Reference: Gateway examples for Deploy
Use Tanium Gateway to access the Tanium API. Use Tanium Gateway queries and mutations to extend Deploy functionality as shown in the examples below. For additional Gateway example syntax, see Reference: Filter syntax and Reference: Gateway examples.
Deploy examples
The following queries and mutation require Deploy, retrieve information about software packages deployed in your environment, and allow you to deploy a software package to endpoints.
Deploy a package to all endpoints (mutation.manageSoftware)
Deploy package to endpoints
The following mutation deploys a package to All Computers.
mutation exampleDeployPackage($group:String) {
manageSoftware(
operation: INSTALL
softwarePackageID: 2
start: "2021-10-27T00:00:00Z"
end: "2021-11-03T00:00:00Z"
target: {targetGroup: $group}
) {
ID
name
}
}
Include the computer group variable in the Variables panel or in your variables dictionary:
{
"group": "All Computers"
}
Example response:
{
"data": {
"manageSoftware": {
"ID": "2",
"name": "Install Tanium Standard Utilities (Linux)"
}
}
}
Get Deploy packages
query.softwarePackages
Get all deploy packages
The following query retrieves all Deploy packages.
query exampleGetDeployPackages {
softwarePackages {
edges {
node {
id
productName
productVendor
productVersion
}
}
}
}
Example response:
{
"data": {
"softwarePackages": {
"edges": [
{
"node": {
"id": "19",
"productName": "Firefox (x64 en-US)",
"productVendor": "Mozilla",
"productVersion": "98.0"
}
},
{
"node": {
"id": "30",
"productName": "Power BI Desktop (x64)",
"productVendor": "Microsoft",
"productVersion": "2.102.845.0"
}
},
{
"node": {
"id": "43",
"productName": "VLC media player (64-bit)",
"productVendor": "VideoLAN",
"productVersion": "3.0.16.0"
}
},
{
"node": {
"id": "46",
"productName": "Visual Studio Code (x64 en-us)",
"productVendor": "Microsoft",
"productVersion": "1.65.2"
}
}
]
}
}
}
Get software deployment status
query.softwareDeployment
Get status of software deployment
The following query retrieves the deployment status of all Deploy packages.
query exampleGetSoftwareDeploymentStatus {
softwareDeployment {
ID
name
status {
completeCount
downloadCompleteWaitingCount
downloadingCount
failedCount
notApplicableCount
runningCount
waitingCount
}
errors {
error
count
}
}
}
Example response:
{
"data": {
"softwareDeployment": [
{
"ID": "5",
"name": "Install Tanium Standard Utilities",
"status": {
"completeCount": 1,
"downloadCompleteWaitingCount": 0,
"downloadingCount": 0,
"failedCount": 0,
"notApplicableCount": 0,
"runningCount": 0,
"waitingCount": 0
},
"errors": null
},
{
"ID": "6",
"name": "Install Tanium Standard Utilities (Linux)",
"status": {
"completeCount": 0,
"downloadCompleteWaitingCount": 0,
"downloadingCount": 1,
"failedCount": 0,
"notApplicableCount": 0,
"runningCount": 0,
"waitingCount": 0
},
"errors": null
}
]
}
}
LEGACY - Get package details
query.packages
Get details of all packages
The following query retrieves multiple fields for all packages.
query examplePackagesQuery {
packages {
items {
id
name
displayName
command
commandTimeout
expireSeconds
contentSet {
id
name
}
processGroupFlag
skipLockFlag
metadata {
adminFlag
name
value
}
sourceHash
sourceHashChangedFlag
sourceID
sourceName
parameters {
key
value
}
rawParameterDefinition
parameterDefinition {
parameterType
model
parameters {
model
parameterType
key
label
helpString
defaultValue
validationExpressions {
model
parameterType
expression
helpString
}
promptText
heightInLines
maxChars
values
restrict
allowEmptyList
minimum
maximum
stepSize
snapInterval
dropdownOptions {
model
parameterType
name
value
}
componentType
startDateRestriction {
model
parameterType
type
interval
intervalCount
unixTimeStamp
}
endDateRestriction {
model
parameterType
type
interval
intervalCount
unixTimeStamp
}
startTimeRestriction {
model
parameterType
type
interval
intervalCount
unixTimeStamp
}
endTimeRestriction {
model
parameterType
type
interval
intervalCount
unixTimeStamp
}
allowDisableEnd
defaultRangeStart {
model
parameterType
type
interval
intervalCount
unixTimeStamp
}
defaultRangeEnd {
model
parameterType
type
interval
intervalCount
unixTimeStamp
}
separatorText
}
}
verifyExpireSeconds
}
}
}
Example response:
{
"data": {
"packages": {
"items": [
{
"id": "1",
"name": "Distribute Tanium Standard Utilities",
"displayName": "Distribute Tanium Standard Utilities",
"command": "cmd.exe /c cscript.exe //E:VBScript install-standard-utils.vbs \"Tools\\StdUtils\"",
"commandTimeout": 2700,
"expireSeconds": 3300,
"contentSet": {
"id": "5",
"name": "Client Management"
},
"processGroupFlag": true,
"skipLockFlag": false,
"metadata": [],
"sourceHash": "60b3e906f92929da67341792db9675d5cd91686546f01b57857686c8c6d84fa8",
"sourceHashChangedFlag": false,
"sourceID": 0,
"sourceName": "",
"parameters": [],
"rawParameterDefinition": null,
"parameterDefinition": null,
"verifyExpireSeconds": 600
},
{
"id": "2",
"name": "Distribute Tanium Standard Utilities (Linux)",
"displayName": "Distribute Tanium Standard Utilities (Linux)",
"command": "/bin/bash distribute-tools.sh STRICT",
"commandTimeout": 120,
"expireSeconds": 720,
"contentSet": {
"id": "5",
"name": "Client Management"
},
"processGroupFlag": true,
"skipLockFlag": false,
"metadata": [],
"sourceHash": "4ed7a30a1ca6c81be5a71b892dfadcdb489122cc641fa4b644f53255134215c9",
"sourceHashChangedFlag": false,
"sourceID": 0,
"sourceName": "",
"parameters": [],
"rawParameterDefinition": null,
"parameterDefinition": null,
"verifyExpireSeconds": 600
}
]
}
}
}