Update details on a specific Service

put

/api/v2/services/{service_id}

Updates the properties of a specific service. You identify the service using the service_id path parameter. You provide the updated properties in the body of the request.

Request

Supported Media Types
Path Parameters
Body ()
Body parameters
Root Schema : schema
Type: object
Show Source
Nested Schema : editorTemp
Type: object
Show Source
Nested Schema : struct
Type: object
Show Source
Nested Schema : container_name
Type: object
Show Source
Nested Schema : cpuset
Type: object
Show Source
Nested Schema : dns
Type: object
Show Source
Nested Schema : domainname
Type: object
Show Source
Nested Schema : environment
Type: object
Show Source
Nested Schema : hostname
Type: object
Show Source
Nested Schema : labels
Type: object
Show Source
Nested Schema : log_driver
Type: object
Show Source
Nested Schema : log_opt
Type: object
Show Source
Nested Schema : mac_address
Type: object
Show Source
Nested Schema : mem_limit
Type: object
Show Source
Nested Schema : memswap_limit
Type: object
Show Source
Nested Schema : net
Type: object
Show Source
Nested Schema : pid
Type: object
Show Source
Nested Schema : ports
Type: object
Show Source
Nested Schema : privileged
Type: object
Show Source
Nested Schema : restart
Type: object
Show Source
Nested Schema : tty
Type: object
Show Source
Nested Schema : user
Type: object
Show Source
Nested Schema : volumes
Type: object
Show Source
Nested Schema : dns
Type: array
Show Source
Nested Schema : environment
Type: array
Show Source
Nested Schema : labels
Type: array
Show Source
Nested Schema : log_opt
Type: array
Show Source
Nested Schema : ports
Type: array
Show Source
Nested Schema : volumes
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
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 : service
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 service 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 Syntax

curl -k 
     -X "PUT" 
     -H "Authorization: Bearer 7c8aef29c1f27d50" 
     "https://rest_server_url/api/v2/services/alpine-linux" 
     -d @request_body.json

In this example, alpine-linux is the service_id.

Example of Request Body

The following example shows an example of the request body, which you can pass to the cURL request in a JSON file.

{
    "service_id": "alpine-linux",
    "service_name": "Alpine Linux",
    "subtype": "service",
    "content": "alpine-linux:\n  image: \"alpine:3.4\"\n  environment:\n    - \"occs:description=Runs an example alpine linux container that executes for 10 minutes and prints out a hello world message to the terminal. This example is provided as-is for educational purposes and should not be used in production.\"\n  command: \"/bin/sh -c \\\"i=0; trap 'echo Exiting application; exit' SIGHUP SIGINT SIGTERM; while [ $i -lt 600 ]; do echo Hello world from the alpine docker container!; ((i=i+1)); sleep 1; done\\\"\""
  }

Example Response Body

{
        "service": {
                "service_id": "alpine-linux",
                "service_name": "Alpine Linux",
                "subtype": "service",
                "content": "alpine-linux:\n  image: \"alpine:3.4\"\n  environmen
t:\n    - \"occs:description=Runs an example alpine linux container that execute
s for 10 minutes and prints out a hello world message to the terminal. This exam
ple is provided as-is for educational purposes and should not be used in product
ion.\"\n  command: \"/bin/sh -c \\\"i=0; trap 'echo Exiting application; exit' S
IGHUP SIGINT SIGTERM; while [ $i -lt 600 ]; do echo Hello world from the alpine
docker container!; ((i=i+1)); sleep 1; done\\\"\""
        }
}
Back to Top