Create a Service Instance
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances
Service instance clones: You can create a clone of an existing MySQL Cloud Service instance, but you must first create a snapshot of the service instance you want to clone. See Snapshots REST Endpoints.
Request
- application/vnd.com.oracle.oracloud.provisioning.Service+json
-
identityDomainId: string
Name of the identity domain for the MySQL Cloud Service account.
-
X-ID-TENANT-NAME: string
Name of the identity domain for the MySQL Cloud Service account.
object
Create Instance Request Body
-
componentParameters:
object MySQL Server Component Root Schema
Title:
MySQL Server Component Root Schema
Contains the nested 'mysql' schema for the request body of the create instance operation. -
serviceParameters:
object MySQL Cloud Service Parameters
Title:
MySQL Cloud Service Parameters
Define service parameters for the create instance operation.
object
MySQL Server Component Root Schema
-
mysql:
object MySQL Server Component Parameters
Title:
MySQL Server Component Parameters
Parameters for the 'mysql' schema defined in componentParameters as part of the create instance operation.
object
MySQL Cloud Service Parameters
-
availabilityDomain(optional):
string
This required attribute is only available on Oracle Cloud Infrastructure.
region
is also required;subnet
is optional.Name of a data center location in the Oracle Cloud Infrastructure region that is specified in
region
. A region is a localized geographic area, composed of one or more availability domains (data centers).The availability domain value format is an account-specific prefix followed by
<region>-<ad>
. For example,FQCn:US-ASHBURN-AD1
whereFQCn
is the account-specific prefix.See Regions and Availability Domains in Oracle Cloud Infrastructure Services.
-
backupDestination:
string
Default Value:
NONE
Backup destination. Valid values are:BOTH
- Both Cloud Storage and Local StorageOSS
- Cloud Storage OnlyNONE
- None
NONE
. -
cloudStorageContainer(optional):
string
URI of the object storage container or bucket for storing MySQL Cloud Service instance backups. This attribute is not required if
backupDestination
is set toNONE
.Note:
- Do not use a container or bucket that you use to back up MySQL Cloud Service instances for any other purpose. For example, do not also use the same container or bucket to back up Oracle Database Cloud Service database deployments. Using one container or bucket for multiple purposes can result in billing errors.
- You do not have to specify a container or bucket if you provision the service instance without enabling backups.
On Oracle Cloud Infrastructure Classic, the object storage container does not have to be created ahead of provisioning your MySQL Cloud Service instance.
To specify the container (existing or new), use one of the following formats:
Storage-<identitydomainid>/<containerName>
<storageservicename>-<identitydomainid>/<containerName>
<restEndPointURL>/<containerName>
To identify the REST endpoint URL of your object storage service, see Finding the REST Endpoint URL for Your Service Instance in Using Oracle Cloud Infrastructure Object Storage Classic.
On Oracle Cloud Infrastructure, the object storage bucket must be created before provisioning your MySQL Cloud Service instance. Do not use the same bucket for more than one instance. For the instructions to create a bucket, see Prerequisites for Oracle Platform Services on Oracle Cloud Infrastructure in the Oracle Cloud Infrastructure documentation. Enter the bucket URL in the following format:
https://swiftobjectstorage.<region>.oraclecloud.com/v1/<namespace>/<bucket>
.To find out your namespace, sign in to the Oracle Cloud Infrastructure web console, click the tenancy name, and look for the Object Storage Namespace field.
Example:
https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/acme/mybucket
-
cloudStorageContainerAutoGenerate(optional):
boolean
This attribute is not applicable when provisioning a MySQL Cloud Service instance in Oracle Cloud Infrastructure.
Flag that specifies whether to create (
true
) or not create (false
) the object storage container if the name specified incloudStorageContainer
does not exist. The default isfalse
. -
cloudStoragePassword(optional):
string
Password for the object storage user. The password must be specified if
cloudStorageContainer
is set.On Oracle Cloud Infrastructure Classic, this is the password for the Oracle Cloud Infrastructure Object Storage Classic user who has read and write access to the container that is specified in
cloudStorageContainer
. -
cloudStorageUser(optional):
string
User name for the object storage user. The user name must be specified if
cloudStorageContainer
is set.On Oracle Cloud Infrastructure Classic, this is the user name for the Oracle Cloud Infrastructure Object Storage Classic user who has read and write access to the container that is specified in
cloudStorageContainer
. -
enableNotification(optional):
boolean
Flag that specifies whether to enable (
true
) or disable (false
) notifications by email. If this property is set totrue
, you must specify a value innotificationEmail
.Currently, notifications are sent only when service instance provisioning is successful or not successful.
-
ipNetwork(optional):
string
This attribute is applicable only to accounts where regions are supported.
This attribute is not applicable when provisioning MySQL Cloud Service instances in Oracle Cloud Infrastructure.
The three-part name of a custom IP network to attach this service instance to. For example:
/Compute-identity_domain/user/object
A
region
name must be specified in order to useipNetwork
. Only those IP networks already created in the specified Oracle Cloud Infrastructure Compute Classic region can be used.A consequence of using an IP network is that the auto-assigned IP address could change each time the service instance is started. To assign fixed public IP addresses to a service instance that is attached to an IP network, you can first create reserved IP addresses, then provision the service instance to use those persistent IP addresses in
ipReservations
. Note that to useipReservations
,assignPublicIP
must betrue
.See IP Reservations REST Endpoints for information about how to find unused IP reservations and, if needed, create new IP reservations.
-
meteringFrequency(optional):
string
Default Value:
HOURLY
The billing frequency of the service instance; eitherMONTHLY
orHOURLY
. -
noRetry(optional):
boolean
This parameter, when set to
true
disables the provisioning retry in case of failures. -
notificationEmail(optional):
string
The email that will be used to send notifications to.
To receive notifications,
enableNotification
must be set totrue
. -
region(optional):
string
This attribute is only applicable to accounts where regions are supported, including accounts on Oracle Cloud Infrastructure.
Name of the region where the MySQL Cloud Service instance is to be provisioned.
(Not applicable on Oracle Cloud Infrastructure) A region name must be specified if you intend to use
ipReservations
oripNetwork
.An Oracle Cloud Infrastructure region must be specified to provision your service instance on Oracle Cloud Infrastructure host resources. Be sure to specify a region that is within the default data region of your account on Oracle Cloud Infrastructure. If the default data region is North America, specify the region such as
us-phoenix-1
orus-ashburn-1
. If the default data region is EMEA, specify the region aseu-frankfurt-1
oruk-london-1
.Note the following when provisioning on Oracle Cloud Infrastructure:
- An availability domain must also be specified using
availabilityDomain
. See Regions and Availability Domains in Oracle Cloud Infrastructure Services. - A subnet can be specified using
subnet
. See VCNs and Subnets in Oracle Cloud Infrastructure Services. Ifsubnet
is not specified, a subnet is automatically assigned to this MySQL Cloud Service instance from a virtual cloud network (VCN) namedsvc-vcn
in the ManagedCompartmentForPaaS compartment. - Access rules and IP reservations REST endpoints are not supported.
- An availability domain must also be specified using
-
serviceDescription(optional):
string
Free-form text that provides additional information about the service instance.
-
serviceName:
string
Name of MySQL Cloud Service instance. The service name:
- Must not exceed 50 characters.
- Must start with a letter.
- Must contain only letters, numbers, or hyphens.
- Must not end with a hyphen.
- Must not contain any other special characters.
- Must be unique within the identity domain.
-
vmPublicKeyText:
string
Public key for the secure shell (SSH). This key will be used for authentication when connecting to the MySQL Cloud Service instance using an SSH client. You generate an SSH public-private key pair using a standard SSH key generation tool.
-
vmUser(optional):
string
VM operating system user that is valid for variations of compute based services. It will default to the username
opc
when not specified.
object
MySQL Server Component Parameters
-
dbName(optional):
string
Default Value:
mydatabase
Initial database schema name of your choice, up to 64 characters; can contain letters, numbers and special characters (_,$). The default name ismydatabase
. -
dbStorage(optional):
integer
Default Value:
25
Storage volume size for MySQL data. The number must be between 25 and 1024 GB. Default value is 25. -
enterpriseMonitor(optional):
string
Default Value:
No
Allowed Values:[ "Yes", "No" ]
Indicate whether to configure MySQL Enterprise Monitor during provisioning. The value can only be one of the valid choices, eitherYes
orNo
and the default isNo
. -
enterpriseMonitorAgentPassword(optional):
string
Password for MySQL Enterprise Monitor agent. The password must be at least 8 characters long with at least one lower case letter, one upper case letter, one number and one special character.
-
enterpriseMonitorAgentUser(optional):
string
Name for the Enterprise Monitor agent user. Agent User name should start with a letter, consist of letters and numbers, and be between 2 to 32 characters.
-
enterpriseMonitorManagerPassword(optional):
string
Password for MySQL Enterprise Monitor manager. The password must be at least 8 characters long with at least one lower case letter, one upper case letter, one number and one special character.
-
enterpriseMonitorManagerUser(optional):
string
Name for the Enterprise Monitor manager user. Manager User name should start with a letter, consist of letters and numbers, and be between 2 to 32 characters.
-
mysqlCharset(optional):
string
Default Value:
utf8mb4
MySQL server character set. See Supported Character Sets and Collations for the character sets MySQL supports. Although the MySQL Server 5.7 default is 'latin1', MySQL Cloud Service sets this to 'utf8mb4' by default. -
mysqlCollation(optional):
string
Default Value:MySQL server collation. See Supported Character Sets and Collations for the permissible collations of each character set.
-
mysqlEMPort(optional):
string
Default Value:
18443
Port for the MySQL Enterprise Monitor. The default is18443
. -
mysqlOptions(optional):
string
MySQL server options and variables. Only comma separated key value pairs with no spaces are permitted (e.g.,
option1=value,option2=value
). MySQL server options that are available as MySQL Server Component Parameters, such asmysqlPort
, are not permitted in amysqlOptions
string. See Server System Variables for information about MySQL server options. -
mysqlPort(optional):
string
Default Value:
3306
Port for the MySQL server. Port must be in the range of 3200-3399. The default is3306
. -
mysqlTimezone(optional):
string
Default Value:
SYSTEM
MySQL server time zone. The default value isSYSTEM
, which indicates that the server time zone is the same as the system time zone. The value can be given as a named time zone, such as 'Europe/Paris', 'US/Eastern', or 'Asia/Shanghai'. See MySQL Server Time Zone Support for related information. -
mysqlUserName(optional):
string
Default Value:
root
Administration user for connecting to the service via the MySQL protocol. User name should start with a letter, consist of letters and numbers, and be between 2 to 32 characters. The default isroot
. -
mysqlUserPassword:
string
Password for MySQL administration user. The password must meet the following requirements:
- Starts with a letter
- Is between 8 and 30 characters long
- Contains letters, at least one number, and optionally, any number of these special characters: dollar sign ($), pound sign (#), and underscore (_).
-
shape(optional):
string
Default Value:
oc3
Desired compute shape. A shape defines the number of Oracle Compute Units (OCPUs) and amount of memory (RAM). Valid shapes include:- oc3: 1 OCPU, 7.5 GB memory
- oc4: 2 OCPUs, 15 GB memory
- oc5: 4 OCPUs, 30 GB memory
- oc6: 8 OCPUs, 60 GB memory
- oc7: 16 OCPUs, 120 GB memory
- oc1m: 1 OCPU, 15 GB memory
- oc2m: 2 OCPUs, 30 GB memory
- oc3m: 4 OCPUs, 60 GB memory
- oc4m: 8 OCPUs, 120 GB memory
- oc5m: 16 OCPUs, 240 GB memory
See About Shapes in Using Oracle Compute Cloud Service for more information about shapes.
-
snapshotName(optional):
string
The name of the snapshot of the service instance specified by
sourceServiceName
that is to be used to create a "snapshot clone". This parameter is valid only ifsourceServiceName
is specified. -
sourceServiceName(optional):
string
When present, indicates that the service instance should be created as a "snapshot clone" of another service instance. Provide the name of the existing service instance whose snapshot is to be used.
dbName
,mysqlCharset
,mysqlCollation
,mysqlEMPort
,enterpriseMonitor
, and associated MySQL server component parameters do not apply when cloning a service from a snapshot. For those parameters, the clone operation uses the values defined in the snapshot of the source service instance. -
subnet(optional):
string
This optional attribute is only applicable when provisioning MySQL Cloud Service instances on Oracle Cloud Infrastructure.
region
andavailabilityDomain
, however, are required.The Oracle Cloud Identifier (OCID) of a subnet from a virtual cloud network (VCN) created on Oracle Cloud Infrastructure.
You can specify a subnet that you have created yourself, or you can let MySQL Cloud Service automatically assign a subnet for you.
To specify a subnet you have created: Use
subnet
to specify the OCID of the subnet from a VCN that you have created on Oracle Cloud Infrastructure. For the instructions to create a VCN and subnet, see Prerequisites for Oracle Platform Services on Oracle Cloud Infrastructure in the Oracle Cloud Infrastructure documentation. The OCID is a unique autogenerated ID. To find out the OCID of the subnet, go to the Oracle Cloud Infrastructure web console, select the Networking tab, click the VCN that your subnet is in, and look for the OCID field under the subnet that you want to use.To let MySQL Cloud Service assign a subnet for you: Do not include
subnet
in your provisioning request payload. When excluded, MySQL Cloud Service automatically assigns a subnet from the VCN namedsvc-vcn
in the ManagedCompartmentForPaaS compartment.
Response
- application/json
202 Response
object
Response Body
-
jobId(optional):
string
Job ID for the operation.
-
message(optional):
string
System message that describes the operation. For example:
Snapshot a service [{serviceId}] is submitted as an asynchronous job.
Examples
The following example shows how to create a MySQL Cloud Service instance by submitting a POST request on the REST endpoint using cURL.
Note: The command in this example uses the URL structure https://rest_server_url/resource-path
, where rest_server_url
is the Oracle Public Cloud or Oracle Cloud Machine REST server to contact for your identity domain or tenant name. See Send Requests for the appropriate URL structure to use on Oracle Public Cloud or Oracle Cloud Machine.
For configuring backups, the cloudStorageContainer
definition depends on your setup. For additional information, see Finding the REST Endpoint URL for Your Cloud Account.
cURL Command
curl -i -X POST \ -u "username:password" \ -H "X-ID-TENANT-NAME: ExampleIdentityDomain" \ -d @createMysqlInstance.json \ -H "Accept: application/json" \ -H "Content-Type: application/vnd.com.oracle.oracloud.provisioning.Service+json" \ https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances
Example of Request Body
The following shows an example of the request body in JSON format. It represents the contents of createMysqlInstance.json
in the cURL example above.
{ "serviceParameters": { "serviceName": "ExampleInstance", "serviceDescription": "My example instance.", "meteringFrequency": "HOURLY", "backupDestination": "NONE", "cloudStorageContainer": "Storage-StorageIdentityDomain/MySQLCS", "cloudStorageUser": "yourcloudStorageUserName", "cloudStoragePassword": "password", "cloudStorageContainerAutoGenerate": true, "region": "uscom-east-1", "vmPublicKeyText": "yourSSHPublicKeyString" }, "componentParameters": { "mysql": { "shape": "oc3", "mysqlUserName": "yourMySQLUserName", "mysqlUserPassword": "password", "mysqlPort": "3306", "mysqlEMPort": "18443", "dbStorage": 25, "dbName": "mydatabase", "mysqlCharset": "utf8mb4", "mysqlTimezone": "SYSTEM", "mysqlCollation": "utf8mb4_general_ci", "enterpriseMonitor": "Yes", "enterpriseMonitorManagerUser": "yourEnterpriseManagerMonitorUserName", "enterpriseMonitorManagerPassword": "password", "enterpriseMonitorAgentUser": "yourEnterpriseAgentUserName", "enterpriseMonitorAgentPassword": "password" } } }
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 202 Accepted
Date: Wed, 30 Nov 2016 22:54:28 GMT
Transfer-Encoding: chunked
Location: https://rest_server_url/paas/api/v1.1/activitylog/ExampleIdentityDomain/job/3465
Content-Type: application/json
Access-Control-Allow-Headers: Content-Type, api_key, Authorization
Service-URI: https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/MyTestInstance
Retry-After: 60
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
X-ORACLE-DMS-ECID: 3ae14bc-78-3-2382197d3-2-18960cea7e06338c6410
Access-Control-Allow-Origin: *
X-Frame-Options: DENY
Example of Response Body
The following shows an example of the response body in JSON format.
{ "details": { "message": "Submitted job to create service [MyTestInstance] in domain [ExampleIdentityDomain].", "jobId": "3465" } }