Quick Start

Set up your environment and create your first MySQL Cloud Service using the REST API by performing the following tasks.

Prerequisites

Prerequisite More Information
Learn about Oracle Cloud.

Getting Started with Oracle Cloud

for information about Oracle Cloud.
Obtain a trial or paid subscription to Oracle Storage Cloud Service.

How to Begin with Object Storage Classic Subscriptionsin Using Oracle Cloud Infrastructure Object Storage Classic.

Create an SSH public/private key pair

Create SSH Keys for Use with Oracle Cloud Services (tutorial).

Generating a Secure Shell (SSH) Public/Private Key Pair. It is also possible to create to create the key pair during the provisioning tasks.

(Optional) Create a container in Oracle Storage Cloud Service to store backups on cloud storage.

(Does not apply to Oracle Cloud Infrastructure)

If using new subscriptions, be sure to set a replication policy for your Oracle Cloud Infrastructure Object Storage Classic before you create the first container.

See Creating Containers in Using Oracle Cloud Infrastructure Object Storage Classic or Creating Containers Using the REST API (tutorial)

(Does not apply to Oracle Cloud Infrastructure)

Create IP networks. This is optional for accounts where regions are supported.

(Does not apply to Oracle Cloud Infrastructure)

Using an IP network gives you more control over the configuration of the network in which your MySQL Cloud Service instance is placed. If you specify an IP network, each underlying VM is auto-assigned a public and private IP address.

See Creating an IP Network in Using Oracle Cloud Infrastructure Compute Classic.

(Applies only to Oracle Cloud Infrastructure)

  • Set up a virtual cloud network and subnets

  • Create an object storage bucket to store your MySQL Cloud Service instance backups

  • Set up IAM policies to allow MySQL Cloud Service to access the network and object storage resources

  • Create an Auth token to use with the object storage service

(Applies only to Oracle Cloud Infrastructure)

See Prerequisites for Oracle Platform Services on Oracle Cloud Infrastructure in Oracle Cloud Infrastructure Services.

Step 1: Obtain Account Information

The account creation e-mail from Oracle contains the identity domain ID, user name, and password for your MySQL Cloud Service instance. If you do not have this information, then contact your service administrator.

If your administrator has changed the identity domain ID to a user-friendly name, you must still specify the identity domain ID when using the REST API. For example, if the original identity domain name was MyIdentityDomain54321 and it was changed to MyIdentityDomain, you must use MyIdentityDomain54321 in the REST endpoints.

On accounts that are integrated with Oracle Identity Cloud Service, the identity domain ID is the Identity Cloud Service tenant name. This tenant name begins with the characters idcs- followed by a string of number and letters (for example, idcs-98888f7964454b658ac6d2f625b29030). See Find Your Oracle Identity Cloud Service Tenant Name in Administering Oracle Identity Cloud Service.

Step 2: Install cURL

The examples use the cURL command-line tool to demonstrate how to access the MySQLCloud Service REST API. To connect securely to the REST server, you must install a version of cURL that supports SSL.

To install cURL on your system:

  1. In your browser, navigate to the cURL home page at http://curl.haxx.se and click Download in the navigation menu.

  2. On the cURL Releases and Downloads page, locate the SSL-enabled version of the cURL software that corresponds to your operating system. Click the link to download the ZIP file, and extract the executable to the desired folder.

When running cURL from a Windows command shell only, you must provide an SSL certificate authority (CA) file or bundle to authenticate against the Verisign CS certificate.

  1. Navigate to the cURL CA Extract page at http://curl.haxx.se/docs/caextract.html and download the cacert.pem SSL CA certificate file in the folder where you installed cURL.

  2. Open a command window, navigate to the directory where you installed cURL, and set the cURL environment variable, CURL_CA_BUNDLE, to the location of the SSL CA certificate file. For example, on a Windows system you would enter:

    C:\curl> set CURL_CA_BUNDLE=cacert.pem

You are now ready to send REST requests to the MySQL Cloud Service instance using cURL. See Authentication, Send Requests, and Use cURL.

Step 3: Understand the Format of Resource URLs

  • See Send Requests for details about defining REST queries.

  • You are now ready to start interacting with the MySQL Cloud Service REST API.

Step 4: Execute your first REST API call using cURL

This assumes everything is set up, and that you already created a MySQL instance. The following is a REST API query that returns all MySQL instances created on this {identityDomainId}:

curl -i -X GET \
-u "username:password" \
-H "X-ID-TENANT-NAME: {identityDomainId}" \
-H "Accept: application/json" \
https://rest_server_url/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances
  • username:password is the user name and password associated with the account, separated by a colon.

  • {identityDomainId} is the identity domain (tenant) associated with the account, which you enter when logging into the cloud.

  • https://rest_server_url is provided by your setup, as described in the Send Requests documentation.

The above will output the response header and response body, and provide information about all MySQL instances associated to the account and domain id. The beginning part of the output will look similar to:

server: Oracle-Application-Server-11g
x-oracle-dms-ecid: 005FeC1q_mm3n355RvFCvd0004t91103mD
x-oracle-dms-ecid: 005FeC1q_mm3n355RvFCvd0004t91103mD
x-frame-options: DENY
content-language: en
content-type: application/json
vary: user-agent
date: Wed, 12 Oct 2016 23:05:02 GMT
content-length: 11274

{"services":{
    "MyTestMySQLInstance":{
      "serviceId":64381,
      "serviceName":"MyTestMySQLInstance",
      "serviceType":"MySQLCS",
      "domainName":"somename",
      "serviceVersion":"5.7",
  	   ...

Note:

The response header text was included because -i was passed into the cURL command. Remove -i to only see the body response (JSON).