Set environment osquery target
const url = 'https://example.com/api/v1/environments/osquery/example';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"expires_at":"example","version":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/environments/osquery/example \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "expires_at": "example", "version": "example" }'Rolls the environment out to a version of the library in stages of 1%, 10%, 50% and 100% of its hosts, two hours apart; the first stage opens now. Any active rollout is replaced. Hosts at or above the version are left alone; osctrld upgrades the others when osqueryd is running. Setting the same version again starts a new rollout and retries hosts that rejected it. The rollout pauses on a rollback and needs Resume. Unknown body fields are refused, and so is expires_at: environment targets do not expire (use a node pin for a temporary override). Environment admins.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Environment name or UUID
Request Bodyrequired
Section titled “Request Bodyrequired”Target version
object
Examplegenerated
{ "expires_at": "example", "version": "example"}Responses
Section titled “Responses”OK
object
Available lists the library version names (no digests), ascending.
object
Rollout is the environment’s latest rollout, null when it never had one.
object
object
object
RolledBackHosts is newest first, at most 50.
object
object
WindowsHosts is the number of Windows hosts in the environment; Windows upgrades cannot be rolled back automatically.
Examplegenerated
{ "available": [ "example" ], "counts": [ { "count": 1, "version": "example" } ], "rollout": { "counts": { "eligible": 1, "rolled_back": 1, "upgraded": 1, "waiting": 1 }, "next_stage_at": "example", "paused": { "at": "example", "host": "example", "reason": "example" }, "request_id": "example", "rolled_back_hosts": [ { "at": "example", "host": "example", "reason": "example" } ], "stage": 1, "stage_opened_at": "example", "stages": [ 1 ], "state": "example", "version": "example" }, "target": { "request_id": "example", "updated_at": "example", "updated_by": "example", "version": "example" }, "windows_hosts": 1}Bad request or version not in the library
object
Examplegenerated
{ "code": "example", "error": "example"}Unauthorized
object
Examplegenerated
{ "code": "example", "error": "example"}Forbidden
object
Examplegenerated
{ "code": "example", "error": "example"}Not found
object
Examplegenerated
{ "code": "example", "error": "example"}Request body too large
object
Examplegenerated
{ "code": "example", "error": "example"}Internal server error
object
Examplegenerated
{ "code": "example", "error": "example"}