API to upgrade an agent to specific version
This end point triggers the agent given its “UUID” upgrade to specific “sensor_version”, the latest version will be applied if “sensor_version” is not provided. This API won’t proceed downgrade requests.
POST /openapi/v1/sensors/{UUID}/upgrade?sensor_version=<sensor_version>
where <sensor_version> can be any one of the results retrieved from the API to get supported software version .
Parameters: The request URL contains the following parameters
Name |
Type |
Description |
---|---|---|
sensor_version |
string |
(optional) Specify the desired version, the latest version will be applied by default |
Returns the status for this upgrade request.
Sample python code
resp = restclient.post('/openapi/v1/sensors/{UUID}/upgrade?sensor_version=3.4.1.1.devel')
if resp.status_code == 200:
print 'agent upgrade was triggered successfully and in progress'
elif resp.status_code == 304:
print 'provided version is not newer than current version'
elif resp.status_code == 400:
print 'provided version is invalid'
elif resp.status_code == 403:
print 'user does not have required capability'
elif resp.status_code == 404:
print 'agent with {UUID} does not exist'