Create Your First Instance (old path)

After you have created a request document that defines the details of your service instance, you are ready to create your first Oracle Java Cloud Service instance.

Note: This topic is not relevant to Oracle Cloud Infrastructure or Oracle Cloud Infrastructure Classic. Instead, see Create Your First Service Instance (new path).

To create your first instance, you pass the following information on the cURL command line.

  • To define the request:
    • Use the --data option to pass the create.json file that you created in the previous task, Create the Request Document.

    • Use the -H cURL option to pass the Content-Type header to define the content type of the request document as application/vnd.com.oracle.oracloud.provisioning.Service+json.

  • For authentication, you must specify the account credentials obtained previously, as described in Obtain Account Information, on the cURL command line, as follows:
    • Use the -u cURL option to pass the user name and password for your Oracle Java Cloud Service account

    • Use the -H cURL option to pass the X-ID-TENANT-NAME custom request header to specify the identity domain ID for your Oracle Java Cloud Service account.

Sample cURL Command and Response

curl -i -X POST -u yourUserName:yourPassword --data @create.json -H Content-Type:application/vnd.com.oracle.oracloud.provisioning.Service+json -H X-ID-TENANT-NAME:yourIdentityDomain https://rest_server_url/paas/service/jcs/api/v1.1/instances/yourIdentityDomain

The command in the examples use 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.

The following shows an example of the response header returned.

HTTP/1.1 100 Continue

HTTP/1.1 202 Accepted
Date: Thu, 14 Jul 2016 23:16:53 GMT
Location: https://rest_server_url/paas/service/jcs/api/v1.1/instances/yourIdentityDomain/status/create/job/8466
Content-Length: 0
Content-Type: application/vnd.com.oracle.oracloud.provisioning.Service+json
Service-URI: https://rest_server_url/paas/service/jcs/api/v1.1/instances/yourIdentityDomain/MyFirstInstance

The create instance process takes several minutes to complete. You can check the status of the create operation using the endpoint returned in the Location header above. For example:

curl -i -X GET -u yourUserName:yourPassword -H X-ID-TENANT-NAME:yourIdentityDomain https://rest_server_url/paas/service/jcs/api/v1.1/instances/yourIdentityDomain/status/create/job/8466

The following is an example of the response output. The service instance status shown is In Progress. When the service instance is successfully created and configured, the status is Running.

{
    "service_name": "MyFirstInstance",
    "version": "12cR3",
    "wlsVersion": "12.1.3.0.xxxxxx",
    "status": "In Progress",
    "error_status_desc": "",
    "compliance_status": "",
    "compliance_status_desc": "",
    "auto_update": "true",
    "description": "My first instance using the REST API.",
    "identity_domain": "yourIdentityDomain",
    "creation_time": "Thu Jul 14 23:16:58 UTC 2016",
    "last_modified_time": "Thu Jul 14 23:16:56 UTC 2016",
    "created_by": "yourUserName",
    "service_uri": "https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/yourIdentityDomain\/MyFirstInstance",
    "message": [
        "Created Compute resources for WebLogic Server...",
        "Created security resources for the service...",
        "Starting Compute resources..."
    ]
}