Stop and Start a Service Instance and Individual VMs

post

/paas/api/v1.1/instancemgmt/{identityDomainId}/services/jaas/instances/{serviceId}/hosts/{command}

Controls the lifecycle state of a service instance and its virtual machines (VMs). You can:
  • Stop or start an Oracle Java Cloud Service instance and all its VMs
  • Restart the Administration Server and its associated VM
  • Stop, start, or restart a Managed Server and its associated VM
  • Stop, start, or restart the load balancer and its associated VM

If your Oracle Java Cloud Service instance is based on an HOURLY metering frequency, you will not be charged for the time that the service instance is in a stopped state.

Note the following about stopping and restarting:

  • Automatically assigned public IP addresses, and if applicable reserved public IP addresses on service instances and nodes do not change when the instance or node is restarted or started from a stopped state.
  • On Oracle Cloud Infrastructure: The private IP addresses do not change when you restart the nodes or the instances.
  • On Oracle Cloud Infrastructure Classic: The private IP addresses are released when you stop the nodes and instances. The private IP addresses assigned when you start or restart nodes or instances might be different. But for an instance that is attached to an IP network, you can set a static private IP address (or remove the static private IP configuration) when you restart a node or start a node that was stopped. The static private IP address that you assign in this manner persists in subsequent restarts of the node or service instance.

Scheduled backups do not run when the service instance is stopped. Upon restarting the service instance, backups will resume at the next scheduled time. In other words, missed scheduled backups are not run.

For complete information about what happens when an instance is stopped and started, see About Stopping, Starting, and Restarting an Oracle Java Cloud Service Instance and Individual Nodes in Administering Oracle Java Cloud Service.

On Oracle Cloud Infrastructure and Oracle Cloud Infrastructure Classic: Many of the administration and lifecycle operations that you run for an Oracle Java Cloud Service instance affect the billing for the infrastructure resources that are used by the instance. See Effect of Lifecycle and Administration Operations on Billing.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
The request body defines the hosts to manage.
Root Schema : stopstart-postrequestm
Type: object
Show Source
Nested Schema : components
Type: object
Groups properties for the Oracle WebLogic Server component (WLS) or the Oracle Traffice Director (OTD) component.
Show Source
Nested Schema : OTD
Type: object
Properties for the Oracle Traffic Director (OTD) component.
Show Source
  • hosts
    Host name of the user-managed load balancer node to control.
  • privateStaticIps
    Set a static private IP address or remove the static private IP configuration.

    This attribute is applicable only when:

    • The service instance is attached to an IP network
    • Restarting a single node or starting a single node that was stopped

    Note that the address you specify will not change on subesequent restarts of the node. Keep a note of all the static private IP addresses you assign.

    To remove a static private IP configuration: Specify the value reset.

    To use the original private IP address (automatically assigned when the service instance was first created) as the static private IP: In the Compute Classic Console, locate the node and then find the current private IP address.

    To use a different private IP (other than the original or currently assigned private address), note the following:

    • Do not specify an address that is already assigned to another compute node.
    • Specify an address that is within the range of the IP network to which the service instance is attached.
    • Do not specify the first two addresses and the last address in the range (those are reserved).
    • Dynamically assigned addresses are selected from the start of the address range, so select an address near the end of the range. For example, if the CIDR of the IP network is 192.168.1.0/24, then the usable addresses are 192.168.1.2 through 192.168.1.254. Select a static address from 192.168.1.254 downward. This will minimize the chance of using an address that is already assigned.

Nested Schema : WLS
Type: object
Properties for the Oracle WebLogic Server (WLS) component.
Show Source
  • hosts
    A single host name.
  • privateStaticIps
    Set a static private IP address or remove the static private IP configuration.

    This attribute is applicable only when:

    • The service instance is attached to an IP network
    • Restarting a single node or starting a single node that was stopped

    Note that the address you specify will not change on subesequent restarts of the node. Keep a note of all the static private IP addresses you assign.

    To remove a static private IP configuration: Specify the value reset.

    To use the original private IP address (automatically assigned when the service instance was first created) as the static private IP: In the Compute Classic Console, locate the node and then find the current private IP address.

    To use a different private IP (other than the original or currently assigned private address), note the following:

    • Do not specify an address that is already assigned to another compute node.
    • Specify an address that is within the range of the IP network to which the service instance is attached.
    • Do not specify the first two addresses and the last address in the range (those are reserved).
    • Dynamically assigned addresses are selected from the start of the address range, so select an address near the end of the range. For example, if the CIDR of the IP network is 192.168.1.0/24, then the usable addresses are 192.168.1.2 through 192.168.1.254. Select a static address from 192.168.1.254 downward. This will minimize the chance of using an address that is already assigned.

Nested Schema : hosts
Type: array
Host name of the user-managed load balancer node to control.
Show Source
Nested Schema : privateStaticIps
Type: array
Set a static private IP address or remove the static private IP configuration.

This attribute is applicable only when:

  • The service instance is attached to an IP network
  • Restarting a single node or starting a single node that was stopped

Note that the address you specify will not change on subesequent restarts of the node. Keep a note of all the static private IP addresses you assign.

To remove a static private IP configuration: Specify the value reset.

To use the original private IP address (automatically assigned when the service instance was first created) as the static private IP: In the Compute Classic Console, locate the node and then find the current private IP address.

To use a different private IP (other than the original or currently assigned private address), note the following:

  • Do not specify an address that is already assigned to another compute node.
  • Specify an address that is within the range of the IP network to which the service instance is attached.
  • Do not specify the first two addresses and the last address in the range (those are reserved).
  • Dynamically assigned addresses are selected from the start of the address range, so select an address near the end of the range. For example, if the CIDR of the IP network is 192.168.1.0/24, then the usable addresses are 192.168.1.2 through 192.168.1.254. Select a static address from 192.168.1.254 downward. This will minimize the chance of using an address that is already assigned.

Show Source
Nested Schema : hosts
Type: array
A single host name.
Show Source
Nested Schema : privateStaticIps
Type: array
Set a static private IP address or remove the static private IP configuration.

This attribute is applicable only when:

  • The service instance is attached to an IP network
  • Restarting a single node or starting a single node that was stopped

Note that the address you specify will not change on subesequent restarts of the node. Keep a note of all the static private IP addresses you assign.

To remove a static private IP configuration: Specify the value reset.

To use the original private IP address (automatically assigned when the service instance was first created) as the static private IP: In the Compute Classic Console, locate the node and then find the current private IP address.

To use a different private IP (other than the original or currently assigned private address), note the following:

  • Do not specify an address that is already assigned to another compute node.
  • Specify an address that is within the range of the IP network to which the service instance is attached.
  • Do not specify the first two addresses and the last address in the range (those are reserved).
  • Dynamically assigned addresses are selected from the start of the address range, so select an address near the end of the range. For example, if the CIDR of the IP network is 192.168.1.0/24, then the usable addresses are 192.168.1.2 through 192.168.1.254. Select a static address from 192.168.1.254 downward. This will minimize the chance of using an address that is already assigned.

Show Source
Back to Top

Response

Supported Media Types

202 Response

Accepted. The Location header returns a URI that can be used to view the job status. See View the Status of an Operation by Job Id.
Body ()
Root Schema : accepted-responsem
Type: object
The response body contains information about the operation. It can include an issues array for warning messages.
Show Source
Nested Schema : details
Type: object
Groups details of the operation.
Show Source
Nested Schema : issues
Type: array
Groups strings of warning messages, if any.
Show Source

400 Response

Bad Request. Returned if the request payload contains bad or missing details.

See Status Codes for information about other possible HTTP status codes.

Body ()
Root Schema : badrequest-responsem
Type: object
The response body contains information about the request. It can include an issues array for validation error messages.
Show Source
Nested Schema : details
Type: object
Groups details of the request.
Show Source
Nested Schema : issues
Type: array
Groups strings of validation error messages, if any.
Show Source
Back to Top

Examples

The following example shows how to stop and start an Oracle Java Cloud Service instance by submitting a POST request on the REST resource using cURL.

Note: The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the REST server to contact for your identity domain (or Cloud Account). See Send Requests.

cURL Commands

curl -i -X POST -u username:password -d @stopstartservice.json -H "Content-Type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/hosts/stop
curl -i -X POST -u username:password -d @stopstartservice.json -H "Content-Type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/hosts/start
curl -i -X POST -u username:password -d @restartonehost.json -H "Content-Type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/hosts/restart

Example of Request Body

The following shows the request body to stop or start the entire service instance.

{
   "allServiceHosts" : true
} 

The following is a request body example for stopping, starting, or restarting a single WLS host.

{
   "components": {
      "WLS": {
         "hosts": ["exampleinstance-wls-2"]
      }
   }
} 

The following is a request body example for setting a private static IP when starting a stopped WLS host or restarting a single WLS host.

{
   "components": {
      "WLS": {
        "hosts" : ["exampleinstance-wls-3"],
        "privateStaticIps": [
          "10.20.30.13"
        ]
      }
    }
}

The following is a request body example for removing the static IP configuration from a WLS host.

{
   "components": {
      "WLS": {
        "hosts" : ["exampleinstance-wls-3"],
        "privateStaticIps": [
          "reset"
        ]
      }
    }
}

Example of Response Header

The following shows an example of the response header. The Location header returns the URI that can be used to view the job status. See View the Status of an Operation by Job Id.

HTTP/1.1 202 Accepted
Date: Fri, 23 Jun 2017 17:45:46 GMT
Transfer-Encoding: chunked
Location: https://rest_server_url/paas/api/v1.1/activitylog/ExampleIdentityDomain/job/170576
Content-Type: application/vnd.com.oracle.oracloud.provisioning.Service+json
Service-URI: https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/ExampleInstance
Retry-After: 60

Example of Response Body

The following shows an example of a 202 response returned in JSON format.

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

The following shows an example of a 404 response.

{
    "details": {
        "message": "PSM-LCM-00012 The node [exampleinstance-wls-3] doesn't exist in component [WLS] for service [ExampleInstance].  You can only specify host names that are provisioned using the component parameter hosts."
    }
}

The following shows an example of a 404 response that includes the issues array.

{
    "details": {
        "message": "PSM-LCM-07006 Unable to submit request to stop, start or restart service resources.  Check additional validation errors for details.",
        "issues": [
            "[PSM-LCM-00006 The component [WLS] parameter [servers] in the request payload is not valid.]"
        ]
    }
}
Back to Top