Start, Stop, or Restart a Service Instance
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances/{serviceId}/hosts/{function}
Request
- application/vnd.com.oracle.oracloud.provisioning.Service+json
-
function: string
Type of change to the lifecycle state. Valid
{function}
values arestart
,stop
, orrestart
. -
identityDomainId: string
Name of the identity domain for the MySQL Cloud Service account.
-
serviceId: string
The user-defined name of the Oracle MySQL Cloud Service instance.
-
X-ID-TENANT-NAME: string
Name of the identity domain for the MySQL Cloud Service account.
object
Status Change Request Body
-
allServiceHosts(optional):
boolean
When true, this will control all hosts in the service. When provided, the 'hosts' array(s) should be empty.
-
force(optional):
boolean
Flag used to force the request.
-
hosts(optional):
array hosts
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
array
Response
202 Response
object
Response Body
-
jobId(optional):
string
Job ID for the operation.
-
message(optional):
string
System message that describes the operation. For example:
Snapshot a service [{serviceId}] is submitted as an asynchronous job.
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" } }