Start, Stop, or Restart a Service Instance

post

/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances/{serviceId}/hosts/{function}

Controls the lifecycle state of a MySQL Cloud Service instance.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
The request body defines the details that alter the MySQL Cloud Service instance's lifecycle status.
Root Schema : Status Change Request Body
Type: object
Title: Status Change Request Body
Defines details for the stop, start or restart operations.
Show Source
Nested Schema : hosts
Type: array
A list of hosts to control. Note that the service is controlled if ALL hosts are listed, making this the same behavior as including 'allServiceHosts': true
Show Source

Response

202 Response

Accepted. See Status Codes for information about other possible HTTP status codes.
Body ()
Root Schema : Response Body
Type: object
Title: Response Body
The response body contains information about the operation.
Show Source

Examples

The following example shows how to alter the state of a MySQL Cloud Service instance by submitting a POST request on the REST endpoint using cURL.

Note: The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the Oracle Public Cloud or Oracle Cloud Machine REST server to contact for your identity domain or tenant name. See Send Requests for the appropriate URL structure to use on Oracle Public Cloud or Oracle Cloud Machine.

cURL Command

curl -i -X POST \
  -u "username:password" \
  -H "X-ID-TENANT-NAME: ExampleIdentityDomain" \
  -H "Accept: application/json" \
  -H "Content-Type: application/vnd.com.oracle.oracloud.provisioning.Service+json" \
  -d '{"allServiceHosts":true,"force":true}' \
  https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/MyTestInstance/hosts/stop

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 202 Accepted
Server: Oracle-Application-Server-11g
Location: https://rest_server_url:443/paas/api/v1.1/activitylog/ExampleIdentityDomain/job/1790730
Content-Language: en
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type, api_key, Authorization
Retry-After: 60
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
X-ORACLE-DMS-ECID: 0F54EJGa0RdGJ00H900Ri0065pC8uI050^
X-ORACLE-DMS-ECID: 0F54EJGa0RdGJ00H900Ri0065pC8uI050^
Service-URI: https://rest_server_url:443/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/MyTestInstance
X-Frame-Options: DENY
Content-Type: application/json
Vary: user-agent
Date: Tue, 29 Nov 2016 01:50:31 GMT
Connection: close

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "details": {
        "message": "Submitted job to [stop] VMs in service [MyTestInstance] in domain [ExampleIdentityDomain].",
        "jobId": "1790730"
    }
}