psm jcs scale

This command scales the compute shape of an instance used by service hosts up or down by adding or removing a managed server.

You can scale only hosts that contain the Administration Server node and Managed Server nodes in a WLS application cluster. Oracle Java Cloud Service does not support scaling for other nodes in a service instance, such as the load balancer node or nodes in the caching (data grid) cluster.

For service instances that were created with the payload parameter isBYOL set to true, you are responsible for ensuring that you have the required licenses for the new shape you are specifying.

Scaling is not supported by Oracle Java Cloud Service - Virtual Image instances (BASIC service level).

Syntax

In the following syntax, line breaks have been added for clarity. Do not include them when entering the command.

psm jcs scale -s|--service-name serviceName 
    -c|--config-payload pathToJson
      [-of|-–output-format json|html|short]
      [-wc|--wait-until-complete true|false] 

Parameters

All parameters are required unless otherwise noted.

Command Option Description
-s|--service-name serviceName Name of the Oracle Java Cloud Service instance.
-c|--config-payload pathToJson Specifies the path to the JSON file containing the scale—up/down information necessary to scale a Java Cloud Service instance. The format of this file, as shown in Sample Payload, is the same as the request body you provide when scaling a Java Cloud Service instance by using the REST API. For information about this format, see the Request/Body (scaleupdown-postrequestm) section of Scale Up or Scale Down a Service Instance in the REST API for Oracle Java Cloud Service.
-of|-–output-format json|html|short (Optional) Output format of the command’s response:

Accepted values: json, html, short

The default output format is the one you specified when using the psm setup command to configure the psm CLI.

-wc|--wait-until-complete true|false

(Optional) A boolean value that, when set to true, makes the command behave synchronously; that is, it does not return until the submitted job is complete. The following message is displayed until the job is complete:
Waiting for the job to complete... (it cannot be cancelled)
Default: false

Sample Payload

Note:

For a description of the payload parameters, see the Request/Body (scaleupdown-postrequestm) section of Scale Up or Scale Down a Service Instance in the REST API for Oracle Java Cloud Service

This sample payload scales up a host.

{
   "components": {
      "WLS": {
         "hosts": ["exampleinstance-wls-2"],
         "shape": "oc5",
         "ignoreManagedServerHeapError": true}
   }
} 

Example

$ psm jcs scale -s example1Instance -c c://home/templates/my-scale-payload.json

Note that this command returned a job ID. To see the status of your scale-up operation, use this ID with the psm jcs operation-status command:

$ psm jcs operation-status -j 34211 -of json

When you see the message:

  "operationId":364,
  "operationType":"SCALE_UP",
  "serviceId":364,
  "serviceName":"Example1Instance",
  "serviceType":"jaas",
  "startDate":"2016-04-28T18:37:35.928+0000",
  "status":"SUCCEED",
  "summaryMessage":"SCALE_UP"

the service was successfully scaled-up.