Update a Deployment
/api/v2/deployments/{deployment_id}
Request
- application/json
-
deployment_id: string
deployment_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 update an existing Oracle Container Cloud Service deployment by submitting a PUT request on 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 -ski
-X "PUT"
-H "Authorization: Bearer 53e024fb32c05723" "https://rest_server_url/api/v2/deployments/deployment_id"
--data "@update_deployment.json"
Contents of the update_deployment.json file
The following example shows how to update a deployment, using a JSON file. You can then pass this JSON file to the endpoint, using a cURL command.
In this example, we are changing the quantities field from 1 to 42. This scales the deployment to 42 containers.
Note when providing the YAML code within the content parameter, you must use escape characters (\) to identify line breaks (/n
), quotation marks, and backslash (\) characters.
{
"deployment_id":"NGINX1-20160919-123512",
"deployment_name":"NGINX1",
"desired_state":1,
"placement":{"pool_id":"default"},
"quantities":{"nginx":42},
"stack":
{
"content":"version: 2\nservices:\n nginx:\n image: \"nginx:1.10.1-alpine\"\n environment:\n - \"NGINX_CONF=server {\\\\n listen 80;\\\\n server_name localhost;\\\\n location / {\\\\n add_header Content-Type text/plain;\\\\n return 200 'Hello from your Docker container';\\\\n }\\\\n}\"\n - \"occs:availability=per-pool\"\n - \"occs:scheduler=random\"\n - \"occs:description=This is the official NGINX image. This example is provided as-is for educational purposes and should not be used in production.\"\n ports:\n - \"8001:80/tcp\"\n command: \"sh -c \\\"echo -e \\\\$NGINX_CONF > /etc/nginx/conf.d/default.conf; nginx -g 'daemon off;'\\\"\"\n",
"service_id":"nginx",
"service_name":"NGINX1",
"subtype":"service"
}
}