Update a Deployment

put

/api/v2/deployments/{deployment_id}

Updates a specific deployment. You identify the deployment using the deployment_id parameter. You define the updated deployment properties using YAML code, which you include in the content parameter in the body of the request.

Request

Supported Media Types
Path Parameters
Body ()
Body parameters
Root Schema : schema
Type: object
Show Source
Nested Schema : placement
Type: object
Show Source
Nested Schema : quantities
Type: object
Show Source
Nested Schema : stack
Type: object
Show Source
Security
Back to Top

Response

Supported Media Types

200 Response

200 Response
Body ()
Root Schema : schema
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : deployment
Type: object
Show Source
Nested Schema : placement
Type: object
Show Source
Nested Schema : quantities
Type: object
Show Source
Nested Schema : stack
Type: object
Show Source

Default Response

Error Payload
Body ()
Root Schema : schema
Type: array
Show Source
Back to Top

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"
         }
}
Back to Top