Skip Navigation

Create package execution

Create a new
BlackBerry Optics
package execution resource for a specific tenant, which triggers a package to execute on the device or on devices in a specific zone.
Service Endpoint
/packages/v2/executions
Optional query string parameters
Example
https://protectapi.cylance.com/packages/v2/executions
Method
HTTP/1.1 POST
Request headers
  • Accept: application/json
  • Authorization: Bearer
    JWT Token returned by Auth API
    with the opticspkgdeploy:create scope encoded
Notes
  • To create a package execution, either provide a list of devices or a list of zones.
  • For "devices" or "zones", use the SHA256 format. Example: "E378DACB9324453AB8C65A8406952195"
  • For "package" use the UUID4 format. Example: "61d8944e-d900-4724-87eb-d10078b90a41"

Request

Request with device ID and destination local:
{ "execution": { "name": "Package Execution", "target": { "devices": [ "E378DACB9324453AB8C65A8406952195" ] }, "destination": "", "packageExecutions": [ { "arguments": [ "-browser ALL" ], "package": "61d8944e-d900-4724-87eb-d10078b90a41" } ], "keepResultsLocally": true } }
Request with zone ID and destination FTP:
{ "execution": { "name": "Package Execution", "target": { "devices": [ "E378DACB9324453AB8C65A8406952195" ] }, "destination": "", "packageExecutions": [ { "arguments": [ "-browser ALL" ], "package": "61d8944e-d900-4724-87eb-d10078b90a41" } ], "keepResultsLocally": true } }

Response

Please see the Response status codes for more information.

Request JSON schema

Field Name
Description
destination
This is the FTP, SFTP, or SAMBA URL for saving the results. If saving the results to the local disk drive, leave this empty ("").
keepResultsLocally
This is the setting to save the results to the local disk drive. If true, the results are saved to file://[Cylance Data Directory]/Optics.
name
This is the name of the execution.
packageExecutions
This is the list of packages to execute.
  • arguments: This is the list of arguments for the package. See examples from packageDescriptor.
  • package: This is the packageID for the package.
    As an example, you can get the packageID for a package through the “Get Packages” query.
target
These are the devices or zones to execute the packages against.
  • devices: This is the list of device IDs to execute the packages against.
  • zones: This is the list of zone IDs to execute the packages against.
Target devices only or zones only per request, not both.
Device IDs and zone IDs must be uppercase letters and no hyphens.

Response JSON schema

Field Name
Description
createdAt
This is the date and time (in UTC) when the execution was requested.
createdBy
This is the user who requested the execution.
  • id: This is the unique ID for the user.
  • login: This is the email address of the user.
destination
This is the FTP, SFTP, or SAMBA URL for saving the results.
deviceCount
This is the number of online devices at the moment the package execution request was made.
deviceStatuses
These are the statuses of the package executions on the devices.
  • acked (acknowledged): This is the number of devices that receive the package execution command but have not yet responded.
  • failed: This is the number of devices that failed to execute the packages.
  • succeeded: This is the number of devices that have successfully executed the packages.
id
This is the ID of the execution resource.
keepResultsLocally
This is the setting to save the results to the local disk drive. If true, the results are saved to file//[Cylance Data Directory]/Optics.
name
This is the name of the execution.
packageExecutions
This is the list of packages to execute.
  • arguments: This is the list of arguments for the package. See examples from packageDescriptor.
  • package: This is the packageID for the package.
    As an example, you can get the packageID for a package through the “Get Packages” query.
target
These are the devices and/or zones to execute the packages against.
  • devices: This is the list of device IDs to execute the packages against.
  • zones: This is the list of zone IDs to execute the packages against.