URL : /check/
Method : POST
{
"components": [
[
{
"name": "PHP",
"constraints": []
}
]
]
}
Condition : Data provided is valid and all requests were understood and supported by the server
Code : 200 OK
Content example : Response will include whether all component requests could be fulfilled based on the criteria (in this simple case there is no additional criteria), a component for each requested component group, and the version that would be used to fulfill this request.:
{
"fulfillable": true,
"components": [
{
"name": "PHP",
"value": "7.2.9"
}
]
}
Condition : If provided data is invalid or unsupported.
Code : 405 Invalid input
Content example :
{}
Change requests are best started with a check request. The returned components array can be fed directly back into the change request exactly as it is returned from the server.
URL : /check/
Method : POST
Check to see if we can get PHP newer than 5.6 and MySQL newer than 5.0 but not 8.0 or higher.
{
"components": [
[
{
"name": "PHP",
"constraints": [
{
">=": "5.6"
}
]
},
{
"name": "MySQL",
"constraints": [
{
">=": "5.0",
"<": "8.0"
}
]
}
]
]
}
Condition : Data provided is valid and all requests were understood and supported by the server
Code : 200 OK
Content example : Response will include whether all component requests could be fulfilled based on the criteria (in this simple case there is no additional criteria), a component for each requested component group, and the version that would be used to fulfill this request.:
{
"fulfillable": true,
"components": [
{
"name": "PHP",
"value": "7.3.2"
},
{
"name": "MySQL",
"value": "5.7.25"
}
]
}
URL : /change/
Method : POST
For our change request we will pass in a callback URI that will be hit when the actual change happens, and the list of components and their respective values that the server returned from our check request.
{
"callback": "https://example.com/callback",
"components": [
{
"name": "PHP",
"value": "7.3.2"
},
{
"name": "MySQL",
"value": "5.7.25"
}
]
}
Condition : Data provided is valid and all requests were understood and supported by the server
Code : 200 OK
Content example : Response will include a message suitable to display and an id that can be used to check the status of the request.:
{
"message": "string",
"id": "e38443a5-e6cb-4297-98cc-28eced0d8e7e"
}
Condition : If provided data is invalid or unsupported.
Code : 405 Invalid input
Content example :
{}