Mutation Examples

Jamf Protect Documentation

Solution
Application
Content Type
Technical Documentation
Utilities & Services
ft:locale
en-US

createUnifiedLoggingFilter

The following createUnifiedLoggingFilter mutation creates a new Unified Logging Filter called Login Events, which will record each user login on computers in Jamf Protect.

mutation createFilter {
  createUnifiedLoggingFilter(
    input: {
      name: "Login Events"
      description: "A description of the filter"
      filter: "processImagePath contains 'loginwindow` and eventMessage contains `com.apple.sessionDidLogin`"
      enabled: true
      tags: "Login"
    }
  ) {
    uuid
    name
    description
    created
    updated
    filter
    tags
    enabled
  }
}

setComputerPlan

To change a computer’s plan, use the setComputerPlan mutation. The following mutation changes a computer (defined by a UUID) to a plan with the ID “1”, and then returns current information about the computer after the computer executes:

Note:

The return information in this example includes the computer's current plan. The computer's plan will not change until it checks in with Jamf Protect.

mutation changePlan {
  setComputerPlan(
    input: { plan: "1" }
    uuid: "ed6553dd-28e7-4ba6-b6e5-2d58b9b37696"
  ) {
    plan {
      id
      name
      created
    }
    configHash
    hostName
    serial
    uuid
    checkin
  }
}

updateComputer

Allows you to update the label or tags associated to a computer.

mutation updateComputerLabelandTags {
  updateComputer(
    input: { label: "label_1", tags: ["tag_1", "tag_2", "tag_3"]}
    uuid: "ed6553dd-28e7-4ba6-b6e5-a12b3c456d78"
  ) {
    hostName
    uuid
    insightsUpdated
    label
    tags
  }
}