- Getting Started with Oracle Cloud at Customer
- Getting Started with IaaS and PaaS Services
- Compute Classic: Using the REST API
- Prepare to Use the REST API
Prepare to Use the REST API
Before you use the REST API, complete the following preparatory steps:
- Install cURL.
Note:
You can access the REST API from any application or programming platform that correctly and completely understands the Hypertext Transfer Protocol (HTTP) and has Internet connectivity.cURL is a command-line tool that you can use to invoke REST API calls by sending HTTP requests. The examples in this document use the cURL command-line tool to demonstrate how to access the Compute Classic REST API.
cURL is available by default on most UNIX-like hosts.
To install cURL on Windows, complete the following steps:
-
In your browser, navigate to http://curl.haxx.se/download.html.
-
Locate the SSL-enabled version of the cURL software that corresponds to your operating system, click the link to download the ZIP file, and install the software.
-
From http://curl.haxx.se/docs/caextract.html, download the
ca-bundle.pem
certificates bundle in the directory where you installed cURL. -
At the command prompt, go to the directory where you installed cURL, and set the cURL environment variable,
CURL_CA_BUNDLE
, to the location of the certificates bundle that you downloaded.For example:
C:\curl> set CURL_CA_BUNDLE=ca-bundle.pem
-
- Find out the REST endpoint URL for your service.
-
Sign in to Oracle Cloud My Services, using the My Services URL from the welcome email.
-
Click near the upper left corner of the page.
-
In the menu that appears, expand Services, and click Compute Classic.
The Instances page of the Compute Classic web console is displayed.
-
Click Site near the top of the page, and select the site for which you want to find out the REST endpoint URL.
-
In the Site Selector dialog box that is displayed, note the URL in the REST Endpoint field.
-
- Identify the two-part user name.
The user name that you must use for REST API calls to Compute Classic is a special two-part name in the format:
/Compute-serviceInstanceID/username
username
is the user name that you use to sign in to My Services.To find out the service instance ID:
-
Sign in to the Oracle Cloud My Services. The Oracle Cloud My Services Dashboard page is displayed. It lists the services available in your account.
-
In the Compute service tile, click Compute. The service details page for Compute Classic is displayed.
-
Under Additional Information, locate the Service Instance ID field and note the value displayed.
For example, if your service instance ID is
575260584
and the user name in your account-creation email isjack.jones@example.com
, then use the following two-part user name for REST API calls:/Compute-575260584/jack.jones@example.com
-