1 Getting Started with Oracle Compute Cloud Service REST API

Oracle Public Cloud Machine supports an optimized version of the Oracle Compute Cloud Service REST API , which enables you to manage the various Oracle Compute Cloud Service objects. This section gives an overview of the Oracle Compute Cloud Service REST API.

Roles of API Users

The following user roles are supported:
  • Tenant administrator (/tenant_name/username)—Administrator for a given tenant. Can perform all the administrative functions for a tenant. Can create users with the /tenant_name/users role for their tenant. Default tenant admin user—/tenant_name/administrator.

  • Tenant user (/tenant_name/username)—User of a tenant group. Can create and use virtual machines (VMs) and resources within the tenant.

For more information on user roles, see Getting Started with Using Oracle Compute Cloud Services in Using Oracle Compute Cloud Service.

Oracle Compute Resource URIs

To perform operations on Oracle Compute Cloud Service resources by using REST API calls, you must specify the fully qualified, unique URI of the resource. The fully qualified URI of a resource is in the following format:

https://api_endpoint/resource_base_path/resource_name

  • api_endpoint is the REST endpoint URL that you receive from the Oracle Cloud Administrator. Examples in this guide use https://api.oc.example.com as the REST endpoint URL.

  • resource_base_path is the base URI of the resource. For example, for SSH public keys, the base URI is /sshkey.

  • resource_name is a unique identifier of the specific resource based on the following convention:

    /domain/user/object_id

For example, the following is the fully qualified URI of the sshkey object named key1 for tenant /mytenant:

https://api.oc.example.com/sshkey/mytenant/public/key1

Authenticating API Calls

API calls to Oracle Compute Cloud Service require basic authentication by user name and password. You can request an authentication token, as described in Authenticate User. When the authentication request succeeds, the server returns a cookie that contains an authentication token that is valid for 5 minutes. The client must include this authentication token in the Cookie: request header, in all subsequent API calls.

For more information, see Authentication.