Create Your First Instance

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.

This topic assumes you have created your request document as shown in Create the Request Document.

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/json.

  • To authenticate the user making the request, you specify the Oracle Cloud account user that has authorization to perform the operation:
    • Use the -H cURL option to pass the X-ID-TENANT-NAME custom request header to specify the identity domain ID for your Oracle Cloud account. See Obtain Account Information.

    • Use the -u cURL option to pass the user name and password for your account in the specified identity domain ID.

Sample cURL Command

curl -i -X POST -u username:password --data @create.json -H Content-Type:application/json -H X-ID-TENANT-NAME:identitydomain https://rest_server_url/paas/api/v1.1/instancemgmt/identitydomain/services/jaas/instances

The command in the example uses Basic authentication and 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 in JSON format.

HTTP/1.0 200 Connection established

HTTP/1.1 100 Continue

HTTP/1.1 202 Accepted
Server: Oracle-Application-Server-11g
Strict-Transport-Security: max-age=31536000;includeSubDomains
Location: https://rest_server/paas/api/v1.1/activitylog/yourIdentityDomain/job/5656430
Content-Language: en
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type, api_key, Authorization, X-ID-TENANT-NAME, X-USER-IDENTITY-DOMAIN-NAME
Retry-After: 60
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
X-ORACLE-DMS-ECID: 005K3L700vQ3n315RvWByd0001b40002^C
X-ORACLE-DMS-ECID: 005K3L700vQ3n315RvWByd0001b40002^C
Service-URI: https://rest_server/paas/api/v1.1/instancemgmt/yourIdentityDomain/services/jaas/instances/ExampleInstance
X-Frame-Options: DENY
Content-Type: application/vnd.com.oracle.oracloud.provisioning.Service+json
Vary: user-agent
Date: Tue, 23 May 2017 18:37:36 GMT
Connection: close

{
    "details":
    {
        "message":"Submitted job to create service [ExampleInstance] in domain [yourIdentityDomain].",
        "jobId":"5656430"
    }
}

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 username:password -H X-ID-TENANT-NAME:yourIdentityDomain https://rest_server_url/paas/api/v1.1/activitylog/identitydomainid/job/5656430

The following is an example of the response output. The creation instance status shown is RUNNING. When the service instance is successfully created and configured, the status is SUCCEED.

{
    "activityLogId":2110073,
    "serviceName":"ExampleInstance",
    "serviceType":"jaas",
    "identityDomain":"yourIdentityDomain",
    "serviceId":174488,
    "jobId":5656430,
    "startDate":"2017-05-23T18:37:36.224+0000",
    "status":"RUNNING",
    "operationId":174488,
    "operationType":"CREATE_SERVICE",
    "summaryMessage":"CREATE_SERVICE",
    "authDomain":"yourIdentityDomain",
    "authUser":"yourUserName",
    "initiatedBy":"USER",
    "messages":[
    {
        "activityDate":"2017-05-23T18:37:36.224+0000","message":"Activity Submitted"
    },
    {
        "activityDate":"2017-05-23T18:37:41.009+0000","message":"Activity Started"
    },
    {
        "activityDate":"2017-05-23T18:37:48.406+0000","message":"Created Compute resources for WebLogic Server..."},
    {
        "activityDate":"2017-05-23T18:37:50.534+0000","message":"Created security resources for the service..."
    }]
}