psm jcs clone-service

This command allows you to clone a new service from an existing snapshot.

A snapshot is an image of a complete service instance that you can create by using the psm jcs create-snapshot command. You can see details of a snapshot by using the psm jcs snapshot command or view a list of all snapshots by using the psm jcs snapshots command.

Syntax

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

psm jcs clone-service -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
-c|—config-payload pathToJson Specifies the path to a JSON file containing the instance-cloning information necessary to clone 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 cloning a Java Cloud Service instance by using the REST API. For information about this format, see the Request/Body (create-postrequestm) section of Create 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

This payload clones a new instance from a snapshot taken with psm jcs create-snapshot or by using the Java Cloud Service console. When cloning an instance, sourceServiceName and snapshotName are required. You must also use a clone of the associated Database Cloud Service database deployment.

Note:

You can find parameter descriptions for this sample payload the Request/Body (create-postrequestm) section of Create a Service Instance in the REST API for Oracle Java Cloud Service.
{
  "backupDestination" : "BOTH",
  "cloudStorageContainer" : "yourObjectStorageContainer",
  "cloudStorageUser" : "yourObjectStorageUser",
  "cloudStoragePassword" : "yourObjectStoragePassword",
  "serviceDescription" : "This is a clone of the service instance MyJCSsource",
  "sourceServiceName":"MyJCSsource",
  "snapshotName":"myJCSSnapshot-1",
  "serviceName" : "CloneMyJCSsource",
  "enableAdminConsole" : true,
  "vmPublicKeyText" : "yourSSHPublicKeyString",
  "components" : {
    "WLS" : {
      "shape" : "oc4",
      "adminUserName" : "yourWLSAdminUserName",
      "adminPassword" : "yourWLSAdminPassword",
      "dbaName" : "yourDBUserName",
      "dbaPassword" : "yourDBCSPassword",
      "dbServiceName" : "yourCloneDBCSName"},
    "OTD" : {
      "shape" : "oc4"}}}

Example

$ psm jcs clone-service -c c://home/templates/my-cloned-payload.json

Note that this command returned a job ID. To see the status of your clone-service 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":"CREATE_SERVICE",
 "serviceId":364,
 "serviceName":"Example1Instance",
 "serviceType":"jaas",
 "startDate":"2016-04-28T17:04:41.931+0000",
 "status":"SUCCEED",
 "summaryMessage":"CREATE_SERVICE"

the service was successfully created (cloned).