Deploy Update
post
https://api.connect.jfrog.io/v2/
deploy_update
Deploy update
Possible types and values:
devices_filter
object:filters
key:- Possible values for the
type
key:specific_device
- Set this value if you want to filter one specific device. The value of thevalue
key of this type is the ID of the device you want to filter (you can obtain the id on Connect dashboard). The possibleoperand
key values for this type are:is
,is_not
tag
- Set this value if you want to filter devices by a tag. The value of thevalue
key of this type is the name of the tag you want to filter (you can obtain the tag name on Connect dashboard). The possibleoperand
key values for this type are:is
,is_not
app
- Set this value if you want to filter devices by the apps that are set to them. The value of thevalue
key of this type is the app name. The possibleoperand
key values for this type are:is
,is_not
. Additionally, you can set anapp_version
property to filter to a specific app version.device_state
- Set this value if you want to filter devices by their state. The possible values of thevalue
key of this type are:online
,offline
. The possibleoperand
key value of this type is:is
deployment
- Set this value if you want to filter devices by thedeployment_id
and deployment status. The possible values forvalue
arepending
,in_progress
,success
,failed
,aborted
,any
. You must set thedeployment_id
property with the value from the deployments table on the platform.
All values must be of type:
String
.Full payload example:
{
"user_token": "<user token>",
"device_filter": {
"project": { "name": "Demo" },
"groups": [{ "name": "TestGroup1" }, { "name": "TestGroup2" }],
"filters": [
{ "type": "specific_device", "operand": "is", "value": "d-4ec7-1be9" },
{ "type": "deployment", "deployment_id": "dp-9yl3-9ch7", "operand": "is", "value": "failed" }
]
},
"deployment_configuration": {
"flow_id": "f-dd0c-73b9",
"comment": "test webhook 1",
"app": { "name": "default_app", "version": "v1.1" },
"parameters_mapping": {
"username": "ubuntu",
"conf_path": "/etc/app/settings.conf"
}
}
}
Python
import json
import requests
#Upswift tokens
user_token = "<user token>"
json_content = {
"user_token": user_token,
"device_filter": {
"project": { "name": "Demo" },
"groups": [{ "name": "TestGroup1" }, { "name": "TestGroup2" }],
"filters": [
{ "type": "specific_device", "operand": "is", "value": "d-4ec7-1be9" },
{ "type": "deployment", "deployment_id": "dp-9yl3-9ch7", "operand": "is", "value": "failed" }
]
},
"deployment_configuration": {
"flow_id": "f-dd0c-73b9",
"comment": "test webhook 1",
"app": { "name": "default_app", "version": "v1.1" },
"parameters_mapping": {
"username": "ubuntu",
"conf_path": "/etc/app/settings.conf"
}
}
}
call_request = requests.post("https://api.connect.onprem/v2/deploy_update", json=json_content)
call_response = json.loads(call_request.text)
if call_request.status_code != 200:
if call_request.status_code == 429:
error = "API limit reached"
else:
error = call_response["error_message"]
print(error)
else:
response_message = call_response["message"]
Last modified 5mo ago