Use cURL
cURL is an open source, command-line tool for transferring data with URL syntax, supporting various protocols including HTTP and HTTPS.
The examples throughout the documentation use cURL to demonstrate how to access the MySQL Cloud Service REST API. See Install cURL and Authentication.
Invoke cURL and specify one or more of the command-line options defined in the following table, as required, to direct its execution.
cURL Option | Description |
---|---|
|
Specifies the request body, or data, either directly or by referring to a file on the local machine. Typically we identify the request document, in JSON format, on the local machine. |
|
Specifies the request body as a collection of form parameters. Define each parameter with a name and value, either directly or by referring to a file on the local machine. Typically we identify form data, in JSON format, on the local machine. |
|
Defines a request header. Typically we define one or both of the following:
|
|
Displays response header information. |
|
Specifies the user name and password for HTTP authentication. Typically we specify the user name and password for the MySQL Cloud Service account. |
|
Indicates the type of request (for example, GET, POST, PUT, and so on). |
|
Optionally connect to Oracle Cloud through a proxy server. Alternatively, set the |
The following cURL command examples retrieve the details of the ExampleService
service instance:
curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/ExampleService
Note: The command in the example uses 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.