import requests
url = "https://platform.ankra.app/org/applications/{application_id}/setup-contract"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/org/applications/{application_id}/setup-contract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/applications/{application_id}/setup-contract \
--header 'Authorization: Bearer <token>'{
"application_id": "<string>",
"name": "<string>",
"analysis_status": "<string>",
"contract": {
"status": "recorded",
"path": "<string>",
"options": [
{
"name": "<string>",
"type": "<string>",
"required": true,
"default": "<string>",
"description": "<string>"
}
],
"reason": "<string>"
},
"database": {
"status": "recorded",
"engine": "<string>",
"operator": "<string>",
"manifest_path": "<string>",
"reason": "<string>"
},
"negotiable_options": [
"<string>"
],
"detected_language": "<string>",
"detected_framework": "<string>",
"pull_request_url": "<string>",
"setup_branch": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Read an application's proposed setup contract
Read the setup Ankra proposed for this application before anything is deployed: the detected stack, whether a database was generated, and the deploy option contract of record. The contract and database each carry a three-valued status - a proposal Ankra could not read answers “unknown”, never an empty option list.
import requests
url = "https://platform.ankra.app/org/applications/{application_id}/setup-contract"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/org/applications/{application_id}/setup-contract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/applications/{application_id}/setup-contract \
--header 'Authorization: Bearer <token>'{
"application_id": "<string>",
"name": "<string>",
"analysis_status": "<string>",
"contract": {
"status": "recorded",
"path": "<string>",
"options": [
{
"name": "<string>",
"type": "<string>",
"required": true,
"default": "<string>",
"description": "<string>"
}
],
"reason": "<string>"
},
"database": {
"status": "recorded",
"engine": "<string>",
"operator": "<string>",
"manifest_path": "<string>",
"reason": "<string>"
},
"negotiable_options": [
"<string>"
],
"detected_language": "<string>",
"detected_framework": "<string>",
"pull_request_url": "<string>",
"setup_branch": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
The generated setup as recorded on the application: what Ankra detected, what it proposed, and what of it is negotiable. negotiable_options lists the option names a revision may change, so a caller never has to guess and a refusal is never the first thing the user learns.
The deploy option contract of record. options is populated only when status is "recorded"; on "absent" and "unknown" it is null and reason says which. An application whose contract Ankra cannot read is not an application without a contract, so the two must not be rendered the same way.
Show child attributes
Show child attributes
The database the proposal carries, read off the recorded manifests rather than off the detection that produced them. engine/operator/manifest_path are set only when status is "recorded".
Show child attributes
Show child attributes