curl --request POST \
--url https://api.opper.ai/management/v1/dynamic-routes/{name}/deploy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_active_version_number": 1,
"expected_draft_revision": 2,
"expected_route_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"note": "<string>"
}
'import requests
url = "https://api.opper.ai/management/v1/dynamic-routes/{name}/deploy"
payload = {
"expected_active_version_number": 1,
"expected_draft_revision": 2,
"expected_route_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"note": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_active_version_number: 1,
expected_draft_revision: 2,
expected_route_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
idempotency_key: '<string>',
note: '<string>'
})
};
fetch('https://api.opper.ai/management/v1/dynamic-routes/{name}/deploy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"draft": {
"graph": {},
"layout": {},
"revision": 123,
"validation": "<array>"
},
"route": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"display_name": "<string>",
"draft_revision": 123,
"invocation_model": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deleted_at": "2023-11-07T05:31:56Z",
"draft_graph": {},
"draft_layout": {},
"draft_validation": "<array>"
},
"version_count": 123,
"active_version": {
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123
},
"latest_version_number": 123
},
"meta": {
"deployed_version": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"draft_revision": 123,
"note": "<string>",
"route_name": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"graph": {},
"layout": {},
"validation": "<array>"
},
"idempotency_replayed": true,
"model_access_locks": {
"locked_projects": 123,
"message": "<string>",
"project_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Deploy the draft
Validates the row-locked current draft and deploys it as a new immutable version, changing live routing. Optional expected_route_uuid, expected_draft_revision and expected_active_version_number bind the operation to the reviewed identity, draft and live pointer; zero active version means unpublished. A mismatch returns 409. Supply a fresh idempotency_key for each new deployment and reuse identical arguments only to retry that operation. A replay returns the original version in meta.deployed_version and current observational data without reactivating the original version or validating a later draft. meta.idempotency_replayed identifies replays. The receipt can also be recovered by the read-only deployments/ endpoint. Requires the dynamic_routes:write scope.
curl --request POST \
--url https://api.opper.ai/management/v1/dynamic-routes/{name}/deploy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_active_version_number": 1,
"expected_draft_revision": 2,
"expected_route_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"note": "<string>"
}
'import requests
url = "https://api.opper.ai/management/v1/dynamic-routes/{name}/deploy"
payload = {
"expected_active_version_number": 1,
"expected_draft_revision": 2,
"expected_route_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"note": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_active_version_number: 1,
expected_draft_revision: 2,
expected_route_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
idempotency_key: '<string>',
note: '<string>'
})
};
fetch('https://api.opper.ai/management/v1/dynamic-routes/{name}/deploy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"draft": {
"graph": {},
"layout": {},
"revision": 123,
"validation": "<array>"
},
"route": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"display_name": "<string>",
"draft_revision": 123,
"invocation_model": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deleted_at": "2023-11-07T05:31:56Z",
"draft_graph": {},
"draft_layout": {},
"draft_validation": "<array>"
},
"version_count": 123,
"active_version": {
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123
},
"latest_version_number": 123
},
"meta": {
"deployed_version": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"draft_revision": 123,
"note": "<string>",
"route_name": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"graph": {},
"layout": {},
"validation": "<array>"
},
"idempotency_replayed": true,
"model_access_locks": {
"locked_projects": 123,
"message": "<string>",
"project_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}