After the NAO Cloud configuration has been updated, a publication is required before the changes are taken into account in production.
The publication is an asynchronous process, meaning that it will take time and does not return an immediate response.
When the system receives the request, it will return a HTTP 303 response. The header of the response will contain the location header. The URL in location contains the information about the status of the publication process.
The location header contains the ID of the background job. You can use the proposed URL in the location header to get the status in JSON format and to monitor the processing progress. The format of the URL is API_VERSION_PREFIX/background_jobs/{id} endpoint.
code example:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/vnd.api+json' --header 'Authorization:JhbGciOiJIUzI1NiJ9' 'https://www.nao-cloud.com/api/v2/sites/11090/asset_tracking_config/publish'
HTTP/1.1 303 See Other
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-download-options: noopen
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
permissions-policy: geolocation=(), camera=(), microphone=(), usb=(), payment=()
feature-policy: microphone ‘none’; geolocation ‘none’
location: https://www.nao-cloud.com
/api/v2/background_jobs/62
content-type: text/html; charset=utf-8
cache-control: no-cache
x-request-id: 0e36c596-b4b8-4288-8ebf-eafe677dabe6
x-runtime: 0.024997
vary: Origin,Accept-Encoding
transfer-encoding: chunked
connection: close
The response body after doing HTTP GET on the location header of the response 303:
{
"data": {
"id": "86487",
"type": "job_watcher",
"attributes":
{
"id": 86487,
"name": null,
"description": null,
"status": "success",
"message": "success",
"created_at": "2023-11-13T19:50:57.145Z",
"updated_at": "2023-11-13T19:51:18.361Z",
"has_finished": true
}
} }
We can call the individual GET background_jobs/{id}
endpoint to monitor the processing progress.