The Deployment/Provisioning API
The deployment API allows you to integrate Tideways into your automated deployment and provisioning process.
Provision Project Endpoint
If you provision a server for a new or existing project, you can request access to the profiling API-Key for the project, by using the provisioning endpoint. It will do the following:
-
Create the given project, if it does not exist in your organization
-
Return the API Key for the project, so you can put it into the php.ini
You can call this endpoint as often as you want to get access to the API key. So when you provision the project on new servers or multiple servers at the same time it will only get created once.
Project Information
To get a list of all the available projects in your organization, you can call the projects endpoint, as in the following example:
curl -H 'Authorization: Bearer <token>' \ -X GET \ https://app.tideways.io/apps/api/{organization}/applications
Response for our demo organization would look like:
[
{
"organization": "demo",
"name": "shopware"
},
{
"organization": "demo",
"name": "symfony_sylius"
},
{
"organization": "demo",
"name": "wordpress"
}
]
Decommissioning Servers
When your project uses dynamic scaling to add and remove servers during high and low traffic periods, then you should use the Deployment Server API to remove old, decommissioned servers. With the following API call, you get an overview over all your servers.
curl -H 'Authorization: Bearer <token>' \
-X GET \
https://app.tideways.io/apps/api/{organization}/{application}/servers
Response:
[
{
"organization": "acme",
"application": "app1",
"server": "app1.foo.bar.local",
"continuous_tracing": true,
"last_sync": "2015-07-31 10:10:10",
"profiler_version": "2.0.10",
"daemon_version": "1.2.6"
},
{
"organization": "acme",
"application": "app1",
"server": "app2.foo.bar.local",
"continuous_tracing": true,
"last_sync": "2015-05-22 12:17:20",
"profiler_version": "2.0.10",
"daemon_version": "1.2.6"
}
]
You can then delete servers by sending a DELETE
request to the same endpoint, with a payload of servers
arguments:
curl -H 'Authorization: Bearer <token>' \
-X DELETE \
-d "servers[]=app2.foo.bar.local" \
https://app.tideways.io/apps/api/{organization}/{application}/servers
Response:
{
"ok": true,
"removed_servers": 1
}
If active servers are accidentally deleted, they will automatically register themselves again on the next synchronization. |