Create a deployment based on a specific Service
/api/v2/services/{service_id}/deploy
To create a new deployment, based on a specific service, you specify the source service (the server upon which you are basing the new service) using the service_id parameter in the request. All additional details about the new deployment are passed via the properties within the body of the request.
Note: This endpoint is deprecated and will no longer be available in the future release.
Request
- application/json
-
service_id: string
service_id
-
Authorization: apiKey
Type:
apiKey
Response
- application/json
200 Response
object
-
created_by:
string
-
created_on:
string
-
creation_info_generation:
integer
-
current_state:
integer
-
deployment_id:
string
-
deployment_name:
string
-
desired_state:
integer
-
desired_state_changed_at:
string
-
generation:
integer
-
pending_state:
integer
-
placement:
object placement
-
quantities:
object quantities
-
stack:
object stack
Default Response
Examples
The following example shows how to create a new deployment, based on an existing service. You perform this task by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.
Note: The command in this example uses the URL structure https://rest_server_url/resource-path
, where rest_server_url
is the manager node for the Oracle Cloud Container instance. See Send Requests for the appropriate URL structure to use for Oracle Public Cloud.
cURL Command
curl -sk
-X "POST"
-H "Authorization: Bearer b39f09c71c297f1d"
"https://rest_server_url/api/v2/services/redis/deploy"
-d '{"deployment_id": "redis-20161026-151632",
"deployment_name": "redis",
"desired_state": 1,
"placement": {"pool_id": "default"},
"quantities": {"redis": 1},
"service_id": "redis"}'
Example of Response Body
{
"deployment": {
"deployment_id": "redis-20161026-151632",
"placement": {
"pool_id": "default"
},
"created_by": "admin",
"created_on": "2016-10-27T04:27:55Z",
"stack": {
"service_id": "redis",
"service_name": "Redis",
"subtype": "service",
"content": "redis:\n image: \"redis:3.2.1-alpine\"\n environment:\n - \"occs:description=The official Redis image. This example is provided as-is for educational purposes and should not be used in production.\"\n"
},
"creation_info_generation": 3,
"deployment_name": "redis",
"quantities": {
"redis": 1
},
"desired_state": 1,
"desired_state_changed_at": "2016-10-27T00:27:53.764362804-04:00",
"generation": 6,
"current_state": 0,
"pending_state": 1
}
}