Send Requests

Use these guidelines when sending requests using the Oracle Java Cloud Service REST API.

URL Structure

Use the following URL structure to access the Oracle Java Cloud Service REST endpoints:

https://rest_server/endpoint-path
Where:
  • endpoint-path is the relative path that defines the REST resource. For a complete list of REST endpoints, see All REST Endpoints.

  • rest_server is the REST server to contact for your cloud account. The value depends on the default data region of your cloud account, as shown in the following table. If necessary, get the REST server URL from your Oracle Cloud Account administrator.

    REST Server Data Region

    psm.us.oraclecloud.com

    • US East (Ashburn)
    • US West (Phoenix)
    • Canada Southeast (Montreal)
    • Canada Southeast (Toronto)

    psm.europe.oraclecloud.com

    • Germany Central (Frankfurt)
    • Netherlands Northwest (Amsterdam)
    • Saudi Arabia West (Jeddah)
    • Switzerland North (Zurich)
    • UK South (London)

    psm.aucom.oraclecloud.com

    • Australia East (Sydney)
    • Australia West (Melbourne)
    • India West (Mumbai)
    • India South (Hyderabad)
    • Japan Central (Osaka)
    • Japan East (Tokyo)
    • South Korea Central (Seoul)
    • South Korea North (Chuncheon)

    psm.brcom-central-1.oraclecloud.com

    • Brazil East (Sao Paulo)

    psm-cloudaccountname.console.oraclecloud.com

    All regions

    cloudaccountname is your tenant name or cloud account name.

    psm-cacct-accountid.console.oraclecloud.com

    All regions

    accountid is the alphanumeric ID of your tenant name or cloud account.

    Note:

    You can find cloudaccountname or accountid in the Welcome email sent to your cloud account administrator, and also in the browser URL address bar when you access the Java Cloud Service console.

Request Methods

You can perform basic CRUD operations (create, read, update, and delete) on a resource by using standard HTTP methods, as summarized in the following table.

HTTP Method Description
POST Create, stop, start, scale out, backup, or restore an Oracle Java Cloud Service instance.
GET Retrieve information about an Oracle Java Cloud Service instance or a service instance component.
PUT Delete an Oracle Java Cloud Service instance or update a service instance, for example, scale in or apply a patch.
DELETE Delete an Oracle Java Cloud Service instance component, for example, delete a backup.

Request Media Types

Unless specified otherwise, the Oracle Java Cloud Service REST API supports application/json.

Headers

The Oracle Java Cloud Service REST API supports headers that may be passed in the header section of an HTTP request or response.

Header Description and Example

Accept

Media type for the response body. Note that unless an operation specifies otherwise, the type is application/json.

Example:

Accept:application/json

Content-Type

Media type of the request body. Required for POST and PUT requests.

Examples:

Content-Type:application/json

Content-Type:application/vnd.com.oracle.oracloud.provisioning.Service+json

X-ID-TENANT-NAME

Identity domain ID of the Oracle Java Cloud Service instance. Must be supplied for authentication.

Example:

X-ID-TENANT-NAME:ExampleIdentityDomain

Authorization

How to validate the Oracle Cloud account user, using HTTP Basic or OAuth 2.0 authentication.

  • Authenticate with HTTP Basic

    If you are not using Oracle Identity Cloud Service to authenticate users, specify the user name and password of the Oracle Cloud user in the form:

    Basic base64-encoded-username-colon-password

    Where base64-encoded-username-colon-password is the Base64 encoding of the user name and password separated by a colon.

    Many client applications provide a method that creates this header for you. In cURL, for example, the -u (--user) option adds the Basic Authorization header to a request.

    Suppose the user name and password string to encode is:

    username:password

    The resulting Authorization header would look similar to this:

    Authorization: Basic abcvZTphYmMxMjM=

  • Authenticate with OAuth 2.0

    If you are using Oracle Identity Cloud Service to authenticate users, specify the access token in the form:

    Bearer token-string-of-letters-and-numbers

    Access tokens are very long strings. The following example has been truncated:

    Bearer eyJ4NXQjUzI1Ni......VkdVAZrb_fw

    You obtain the access token by using the Identity Cloud Service Access Token URL with a client ID, a client secret, an appropriate scope and the password grant type (user name and password for the Oracle Cloud user).

    See Obtain and Use an OAuth Token.