SQL API Guide
1. Entity: SQL Instance
1.1 Create SQL Instance
|
Http Method |
URL |
Description |
|
POST |
/sql/api/v1/sqlinstance |
Creates a new SQL instance |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “create” |
Yes |
|
name |
String |
Unique instance name. |
Yes |
|
description |
String |
Description about instance |
No |
|
engineId |
Integer |
Unique ID of existing engine. Ex. “engine”: {“id”: “1″} |
Yes |
|
nodes |
Integer |
Number of instances to be provisioned |
Yes |
|
targetCloudId |
Integer |
Unique ID of created target cloud.Ex. ”targetCloud”: {“id”: “1″} |
Yes |
|
instanceTypeId |
Integer |
Unique ID of instance type. Ex. “instanceType”: {“id”: “1″}If target cloud is a VM pool, this parameter is not mandatory. |
Yes |
|
availabilityZone |
String |
This parameter holds the value of the availability zone in which the instances is to be launched. If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
multiAZ |
Integer |
Mandatory when setting up Multi AZ redundant nodeValid Values: multiAZ=0 for No ORmulitAZ=1 for yesSupported only for Percona engine wherein(In case this flag is set, the parameters “multiAZAvailabilityZone” and “multiAZAvailabilityZoneName” are mandatory) |
Yes |
|
multiAZAvailabilityZone |
String |
Second availability zone in which the secondary node of the Percona Multi AZ instances is to be launchedThis Is mandatory only if multiAZ value is 1. |
No |
|
multiAZAvailabilityZoneName |
String |
Second Avaiability zone name in which the secondary node of the Percona Multi AZ instances is to be launchedThis Is mandatory only if multiAZ value is 1. |
No |
|
multiAZInstanceType |
Integer |
Unique ID of instance type for secondary avaiability zoneEx. ”instanceType”: {“id”: “1″}If target cloud is a VM pool, then this parameter is not mandatory. |
No |
|
serviceTag |
String |
Environment type TagPreferred values: Testing, Development, Production, Staging. |
Yes |
|
serviceAccessGroup |
Integer |
Unique ID of existing access group.Usage: “serviceAccessGroup“ : {“id”: “123″} |
No |
|
shema |
String |
Database name. |
Yes |
|
masterUserName |
String |
Database user name. |
Yes |
|
masterUserPassword |
String |
Database User Password. |
Yes |
|
characterSet |
String |
Character set format Preferred value: UTF-8 |
No |
|
Port |
Integer |
Database default port 3036 |
Yes |
|
parameterGroup |
Integer |
Unique ID of existing parameter groupUsage: ” parameterGroup” : {“id”: “123″} |
No |
|
storageSize |
Integer |
The size of the volume.Valid values: 10 to 1024GB If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
isBackupPreferenceSet |
Integer |
This flag needs to be set in case automated backup snapshots of the instance being launched need to be triggeredSet value as 0 to disable backupsSet vaue as 1 to enable backups(In case this flag is set, the parameters “backupRetentionPeriod” and “backupStartTime” are mandatory) |
Yes |
|
backupRetentionPeriod |
Integer |
This parameter defines the time period for which the backup snspshots are to be retained. Range: 1 to 50 days |
No |
|
backupStartTime |
String |
This parameter defines the Start time for triggering the automated backup snapshots cycle (Automated Backup snapshot frequency defined under Global Variables)Format: HH:MM |
No |
|
isDefault |
Boolean |
Set value as ‘true’ if you wish to add the defaults else set value as ‘false’ |
Yes |
|
isProvision |
Boolean |
Set value as ‘true’ if you wish to provision the instance else set value as ‘false’ if you wish to ad the instance but in the terminated state |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″ -d’{“create”:{“sqlInstance”:{“name”:”Server1″,”description”:”Server1″,”nodes”:1,”schema”:”demo”,”masterUserName”:”demouser”,”masterUserPassword”:”demouser”,”port”:3306,”serviceTag”:”Testing”,”characterSet”:”UTF-8″,”engine”:{“id”:3},”targetCloud”:{“id”:1},”storageSize”:20,”availabilityZone”:”us-east1″,”instanceType”:{“id”:1},”isBackupPreferenceSet”:1,”backupRetentionPeriod”:”4″,”backupStartTime”:”10:00″,”multiAZ”:1,”multiAZInstanceType”:{“id”:1},”multiAZAvailabilityZoneName”:”US-East1″,”multiAZAvailabilityZone”:”us-east1″},”isDefault”:false,”isProvision”:true}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“instance”:[{"port":3306,"autoMinorEnabled":null,"backupRetentionPeriod":4,"multiAZ":1,"backupStartTime":"10:00","isbackupPreferenceSet":1,"isInProgress":2,"noOfSnapshots":0,"instancetype":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"id":4,"schema":"demo","description":"Server1","masterPassword":"demouser","name":"Server1","availabilityZone":"us-east1","availabilityZoneName":"US-East1","createdDate":"2014-07-08 09:18:38","masterUserName":"demouser","accessGroupName":null,"serviceaccessgroup":{"id":5393,"name":"default_Percona-Server_831"},"targetcloud":{"id":1,"name":"Amazonian","iaasProviderId":1},"characterSet":"UTF-8","status":2,"engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"servicetag":1,"multiAvailabilityZone":"us-east1","isReplica":0,"environment":"Testing","createdBy":2,"nodes":2,"multiAZAvailabilityZoneName":"US-East1","storageSize":20,"multiAzInstanceType":{"id":1,"instanceTypeId":null,"name":null},"noOfReplicas":0}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),entityAlreadyExist(1011), invalidRequest(1000) |
1.2 Update SQL Instance
|
Http Method |
URI |
Description |
|
PUT |
/sql/api/v1/sqlinstance/<id> |
Updates the existing SQL instance (Terminated) |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<id> |
Integer |
Unique database Instance ID |
Yes |
|
name |
String |
Unique instance name. |
Yes |
|
description |
String |
Description about instance |
No |
|
engineId |
Integer |
Unique ID of existing engine. Ex. “engine”: {“id”: “1″} |
Yes |
|
nodes |
Integer |
Number of instances to be provisioned |
Yes |
|
targetCloudId |
Integer |
Unique ID of created target cloud.Ex. ”targetCloud”: {“id”: “1″} |
Yes |
|
instanceTypeId |
Integer |
Unique ID of instance type. Ex. ”instanceType”: {“id”: “1″}If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
availabilityZone |
String |
This parameter holds the value of the avaiability zone in which the instances is to be launched. If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
multiAZ |
Integer |
Mandatory when setting up Multi AZ redundant nodeValid Values: multiAZ=0 for No ORmulitAZ=1 for yes Supported only for Percona engine wherein (In case this flag is set, the parameters “multiAZAvailabilityZone” and “multiAZAvailabilityZoneName” are mandatory) |
Yes |
|
multiAZAvailabilityZone |
String |
Second Avaiability zone in which the secondary node of the Percona Multi AZ instances is to be launchedThis is mandatory only if multi AZ value is 1. |
No |
|
multiAZAvailabilityZoneName |
String |
Second Avaiability zone name in which the secondary node of the Percona Multi AZ instance is to be launchedThis is mandatory only if multiAZ value is 1. |
No |
|
multiAZInstanceType |
Integer |
Unique ID of instance type for secondary availability zone Ex. ”instanceType”: {“id”: “1″}If target cloud is a VM pool, then this parameter is not mandatory. |
No |
|
serviceTag |
String |
Environment type TagPreferred values: Testing, Development, Production, Staging. |
Yes |
|
serviceAccessGroup |
Integer |
Unique ID of existing access group.Usage: “serviceAccessGroup“ : {“id”: “123″} |
No |
|
shema |
String |
Database name. |
Yes |
|
masterUserName |
String |
Database user name. |
Yes |
|
masterUserPassword |
String |
Database User Password. |
Yes |
|
characterSet |
String |
Character set format Preferred value: UTF-8 |
No |
|
Port |
Integer |
Database default port 3036 |
Yes |
|
parameterGroup |
Integer |
Unique ID of existing parameter groupUsage: ” parameterGroup” : {“id”: “123″} |
No |
|
storageSize |
Integer |
The size of the volume.Valid values: 10 to 1024GB If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
isBackupPreferenceSet |
Integer |
This flag needs to be set in case automated backup snapshots of the instance being launched need to be triggeredSet value as 0 to disable backupsSet vaue as 1 to enable backups(In case this flag is set, the parameters “backupRetentionPeriod” and “backupStartTime” are mandatory) |
Yes |
|
backupRetentionPeriod |
Integer |
This parameter defines the time period for which the backup snspshots are to be retained. Range: 1 to 50 days |
No |
|
backupStartTime |
String |
This parameter defines the Start time for triggering the automated backup snapshots cycle (Automated Backup snapshot frequency defined under Global Variables)Format: HH:MM |
No |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance/57” -X PUT -H “CL-AUTH-TOKEN:aac0f4f0-2337-4740-a6c9-184665b3dbf2″ -d’{"name":"Server2","description":"Server2","nodes":1,"schema":"demo","masterUserName":"demouser","masterUserPassword":"demouser","port":3306,"serviceTag":"Testing","characterSet":"UTF-8","engine":{"id":3},"targetCloud":{"id":1},"storageSize":10,"availabilityZone":"us-east1","instanceType":{"id":1},"serviceAccessGroup":{"id":5393},"isBackupPreferenceSet":1,"backupRetentionPeriod":"3","backupStartTime":"10:05","multiAZ":1,"multiAZInstanceType":{"id":1},"multiAZAvailabilityZoneName":"US-East1","multiAZAvailabilityZone":"us-east1"}
Example Response:
{“success”:true,”errors”:{},”response”:{}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), entityDoesNotExist(1012), invalidAction(1001), invalidRequest(1000) |
1.3 Modify SQL Instance
|
Http Method |
URI |
Description |
|
POST |
/sql/api/v1/sqlinstance |
Modifies the existing SQL instance (Provisioned) |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “modify” |
Yes |
|
ID |
Integer |
Unique ID of the existing instance |
Yes |
|
parameterGroup |
Integer |
Unique ID of existing parameter groupUsage: ” parameterGroup” : {“id”: “123″} |
No |
|
isBackupPreferenceSet |
Integer |
This flag needs to be set in case automated backup snapshots of the instance being launched need to be triggered.Set value as 0 to disable backupsSet vaue as 1 to enable backups(In case this flag is set, the parameters “backupRetentionPeriod” and “backupStartTime” are mandatory) |
Yes |
|
backupRetentionPeriod |
Integer |
This parameter defines the time period for which the backup snspshots are to be retained. Range: 1 to 50 days |
No |
|
backupStartTime |
String |
This parameter defines the start time for triggering the automated backup snapshots cycle (Automated Backup snapshot frequency defined under Global Variables)Format: HH:MM |
No |
|
applyNow |
Boolean |
Apply changes to instance.Values: true – If changes are to be applied immediately false – if changes are to be saved but not applied immediatelyand be applied on service restart |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:339b155a-31ba-43fd-887a-e5b47b33df34″ -d’ {"modify":{"sqlInstance":{"id":2,"parameterGroup":{"id":3},"isBackupPreferenceSet":1,"backupRetentionPeriod":"5","backupStartTime":"12:10"},"applyNow":true}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“instance”:[{"port":3306,"autoMinorEnabled":0,"backupRetentionPeriod":5,"multiAZ":1,"backupStartTime":"12:10","isbackupPreferenceSet":1,"isInProgress":2,"noOfSnapshots":null,"instancetype":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"id":2,"schema":"demo","description":"PERCONAMULTIAZ","masterPassword":"demouser","name":"RESTOREDSNAP1","availabilityZone":"us-east1","availabilityZoneName":null,"createdDate":"2014-07-08 07:05:08","parametergroup":{"id":3,"parameterGroupFamilyName":"Percona-Server","name":"Percona_PG","parameterGroupFamilyId":null},"masterUserName":"demouser","accessGroupName":"cumu_7023_default_Percona-Server_1265","serviceaccessgroup":{"id":5392,"name":"default_Percona-Server_1265"},"targetcloud":{"id":1,"name":"Amazonian","iaasProviderId":1},"characterSet":"UTF-8","status":1,"engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"servicetag":1,"multiAvailabilityZone":"us-east1","isReplica":0,"environment":"Testing","createdBy":2,"nodes":2,"multiAZAvailabilityZoneName":null,"storageSize":20,"multiAzInstanceType":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"noOfReplicas":null}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
1.4 Delete SQL Instance
|
Http Method |
URL |
Description |
|
DELETE |
/sql/api/v1/sqlinstance/<id> |
Deletes the existing SQL instance |
Example Request:
curl -i “http://loalhost:8080/sql/api/v1/sqlinstance/56” -X DELETE -H “CL-AUTH-TOKEN:67bcb185-dd7a-4007-b659-004e3da63ae3″
Response Format: JSON
{“success”:true,”errors”:{},”response”:{}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
1.5 Get All SQL Instances
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlinstance/ |
To get all SQL instances |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X GET -H “CL-AUTH-TOKEN:67bcb185-dd7a-4007-b659-004e3da63ae3″
Example Response:
{“success”:true,”errors”:{},”response”:{“instance”:[{"port":3306,"autoMinorEnabled":null,"backupRetentionPeriod":null,"multiAZ":1,"backupStartTime":null,"isbackupPreferenceSet":0,"isInProgress":2,"noOfSnapshots":1,"instancetype":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"id":1,"schema":"demo","description":"PERCONAMULTIAZ","masterPassword":"demouser","name":"PERCONAMULTIAZ","availabilityZone":"us-east1","availabilityZoneName":null,"createdDate":"2014-07-08 06:58:40","masterUserName":"demouser","serviceaccessgroup":{"id":5391,"name":"default_Percona-Server_5385"},"targetcloud":{"id":1,"name":"Amazonian","iaasProviderId":1},"characterSet":"UTF-8","engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"status":1,"servicetag":1,"multiAvailabilityZone":"us-east1","isReplica":0,"environment":"Testing","createdBy":2,"nodes":2,"multiAZAvailabilityZoneName":null,"storageSize":20,"multiAzInstanceType":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"noOfReplicas":0},{"port":3306,"autoMinorEnabled":0,"backupRetentionPeriod":1,"multiAZ":1,"backupStartTime":null,"isbackupPreferenceSet":null,"isInProgress":2,"noOfSnapshots":0,"instancetype":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"id":2,"schema":"demo","description":"PERCONAMULTIAZ","masterPassword":"demouser","name":"RESTOREDSNAP1","availabilityZone":"us-east1","availabilityZoneName":null,"createdDate":"2014-07-08 07:05:08","masterUserName":"demouser","serviceaccessgroup":{"id":5392,"name":"default_Percona-Server_1265"},"targetcloud":{"id":1,"name":"Amazonian","iaasProviderId":1},"characterSet":"UTF-8","engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"status":1,"servicetag":1,"multiAvailabilityZone":"us-east1","isReplica":0,"environment":"Testing","createdBy":2,"nodes":2,"multiAZAvailabilityZoneName":null,"storageSize":20,"multiAzInstanceType":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"noOfReplicas":0}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400),badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013),invalidAction(1001), invalidRequest(1000) |
1.6 Get SQL Instance by ID
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlinstance?id=<id> |
To get SQL instance by ID |
Query Parameters:
|
Filter Name |
Type |
Description |
Required |
|
Id |
Integer |
Unique ID of the instance. |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance?id=57” -X GET -H “CL-AUTH-TOKEN:67bcb185-dd7a-4007-b659-004e3da63ae3″
Example Response:
{“success”:true,”errors”:{},”response”:{“instance”:[{"port":3306,"autoMinorEnabled":null,"backupRetentionPeriod":null,"multiAZ":1,"backupStartTime":null,"isbackupPreferenceSet":0,"isInProgress":2,"noOfSnapshots":1,"instancetype":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"id":1,"schema":"demo","description":"PERCONAMULTIAZ","masterPassword":"demouser","name":"PERCONAMULTIAZ","availabilityZone":"us-east1","availabilityZoneName":"US-East1","createdDate":"2014-07-08 06:58:40","masterUserName":"demouser","serviceaccessgroup":{"id":5391,"name":"default_Percona-Server_5385"},"targetcloud":{"id":1,"name":"Amazonian","iaasProviderId":1},"characterSet":"UTF-8","engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"status":1,"servicetag":1,"multiAvailabilityZone":"us-east1","isReplica":0,"environment":"Testing","createdBy":2,"nodes":2,"multiAZAvailabilityZoneName":"US-East1","storageSize":20,"multiAzInstanceType":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"noOfReplicas":0}]}}00:26:11″,”masterUserName”:”demo”,”serviceaccessgroup”:{“id”:4173,”name”:”default_MySQL_911″},”targetcloud”:{“id”:33,”name”:”falcon_hpcs”},”engine”:{“id”:1,”engineName”:”MySQL”,”version”:”5.5.27″},”status”:2,”charset”:null,”servicetag”:1,”isReplica”:null,”databaseName”:null,”environment”:”Testing”,”createdBy”:43,”nodes”:1,”storageSize”:10,”isInprogress”:2,”noOfReplicas”:0}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
1.7 Get Default SQL Instance
|
Http Method |
URL |
Description |
|
GET |
/sql/api/v1/sqlinstance?userId=1&default=1 |
To get default SQL instance |
Query Parameters:
|
Filter Name |
Type |
Description |
Required |
|
user ID |
Integer |
Unique id of the user. |
Yes |
|
Default |
Integer |
Default value is 1. |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance?userId=2&default=1″ -X GET -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Example Response:
{“success”:true,”errors”:{},”response”:{“instance”:[{"port":3306,"autoMinorEnabled":null,"backupRetentionPeriod":null,"multiAZ":0,"backupStartTime":null,"isbackupPreferenceSet":null,"isInProgress":2,"noOfSnapshots":0,"instancetype":{"id":1,"instanceTypeId":"t1.micro","name":"XSmall"},"id":3,"schema":"demo","description":"description","masterPassword":"demouser","name":"defaultInstance","availabilityZone":"us-east1","availabilityZoneName":"US-East1","createdDate":"2014-07-08 08:40:32","masterUserName":"demouser","targetcloud":{"id":1,"name":"Amazonian","iaasProviderId":1},"characterSet":"UTF-8","engine":{"id":1,"engineName":"MySQL","version":"5.5.27"},"status":2,"servicetag":1,"isReplica":0,"environment":"Testing","createdBy":2,"nodes":1,"storageSize":null,"noOfReplicas":0}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
1.8 Provision SQL Instance
|
Http Method |
URL |
Description |
|
POST |
/sql/api/v1/sqlinstance |
Starts re-provisioning of an terminated SQL instance. |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “provision” |
Yes |
|
Id |
Integer |
Unique Id of the existing instance (Terminated) |
Yes |
Example Request:
curl -i “http://54.196.106.131:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:f01cdd12-4cf6-4348-8c7c-4cda70f48d00″ -d’{“provision”: {“sqlInstance”: {“id”: “5″}}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“instance”:[]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
1.9 Terminate SQL Instance
| Http Method | URI | Description |
| POST | /sql/api/v1/sqlinstance | Terminate the existing SQL instance (provisioned) |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “terminate” |
Yes |
|
Id |
Integer |
Unique Id of the existing instance |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:0185f8cc-aa30-4ef7-a81d-43fd512282d6″ -d’{“terminate”: {“sqlInstance”: {“id”: “6″}}}’
Example Response:
{ “success”: true, “errors”: {}, “response”: {}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400),badMethod (405),overLimit (413),itemNotFound (404),serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013),invalidAction(1001),invalidRequest(1000) |
1.10 Restart SQL Instance
|
Http Method |
URL |
Description |
|
POST |
/sql/api/v1/sqlinstance |
Restarts services on the existing SQL instance. |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “restart” |
Yes |
|
Id |
Integer |
Unique Id of the existing instance |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:0185f8cc-aa30-4ef7-a81d-43fd512282d6″ -d’{“restart”: {“sqlInstance”: {“id”: “20″}}}’
Example Response:
{ “success”: true, “errors”: {}, “response”: {}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
1.11 Cancel SQL Instance
|
Http Method |
URI |
Description |
|
POST |
/sql/api/v1/sqlinstance |
Cancels provisioning of the existing SQL instance. |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “cancel” |
Yes |
|
Id |
Integer |
Unique Id of the existing instance |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:0185f8cc-aa30-4ef7-a81d-43fd512282d6″ -d’{“cancel”: {“sqlInstance”: {“id”: “20″}}}’
Example Response:
{ “success”: true, “errors”: {}, “response”: {}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
1.12 Create Read Replica
|
Http Method |
URI |
Description |
|
POST |
/sql/api/v1/sqlinstance |
Creates and starts provisioning of a read replica. |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “provisionReadReplica” |
Yes |
|
Id |
Integer |
Unique Id of the existing database instance |
Yes |
|
name |
String |
Name of the Read Replica to be created |
Yes |
|
availabilityZone |
String |
Availability Zone in which instance is to be provisioned | |
|
instanceType |
Array |
Instance type id.Ex. “instanceType”: {“id”: “1″} |
Yes |
|
storageSize |
Integer |
Size of Volume. Range: 10 to 1024GB |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:f01cdd12-4cf6-4348-8c7c-4cda70f48d00″ -d’{“provisionReadReplica”:{“sqlInstance”:{“name”:”REPLICA1″,”id”: “49″,”availabilityZone”: “us-east1″,”storageSize”:10,”instanceType”: {“id”: “5″}}}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“instance”:[{"port":3306,"autoMinorEnabled":null,"backupRetentionPeriod":null,"multiAZ":0,"backupStartTime":null,"isBackupPreferenceSet":0,"isInProgress":2,"noOfSnapshots":0,"instancetype":{"id":5,"instanceTypeId":"t1.micro","name":"XSmall"},"id":64,"schema":"demo","description":"VM1","masterPassword":"demouser","name":"REPLICA1","availabilityZone":"us-east1","availabilityZoneName":"US-East1","createdDate":"2014-06-25 15:15:01","masterUserName":"demouser","accessGroupName":"cumu_94_default_MySQL_144","serviceaccessgroup":{"id":4909,"name":"default_MySQL_144"},"targetcloud":{"id":2,"name":"AmazonEC2","iaasProviderId":1},"characterSet":"UTF-8","status":1,"engine":{"id":1,"engineName":"MySQL","version":"5.5.27"},"servicetag":1,"isReplica":1,"environment":"Testing","createdBy":2,"nodes":1,"storageSize":10,"noOfReplicas":0}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
1.13 Promote Read Replica
|
Http Method |
URI |
Description |
|
POST |
/sql/api/v1/sqlinstance |
Promotes the existing read replica as a Main/Master node |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “promote” |
Yes |
|
Id |
Integer |
Unique Id of the existing instance |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:0185f8cc-aa30-4ef7-a81d-43fd512282d6″ -d’{“promoteReadReplica”: {“sqlInstance”: {“id”: “20″}}}
Example Response:
{ “success”: true, “errors”: {},”response”: {}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
1.14 Get Read Replica By User ID
| Http Method | URI | Description |
| GET | /sql/api/v1/sqlinstance?userId=<userid>&isReplica=1 | To get specific replica instance by user ID and is Replica. |
Example Request:
curl -i “http:// localhost:8080/sql/api/v1/sqlinstance?userId=2&isReplica=1″ -X GET -H “CL-AUTH-TOKEN:f2e04895-af0d-4104-aebd-b394b12affcb”
Example Response:
{ “success”: true,”errors”: {},”response”: { “instance”: [ {"accessGroupName": null, port": 3306,"multiaz": null,"autoMinorEnabled": null, "status": 2,"backupRetentionPeriod": null,"backupStartTime": null,"charset": null, "engineName": "MySQL-5.5.27","targetCloudName": "testtargetcloud123", "servicetag": 1,"instanceType": "xsmalll","id": 162,"databaseName": null,"isReplica": 1,"environment": Testing","createdBy": 42,”description": null, "nodes": 1, "name": "abc", "masterPassword": "cumulogic", "storageSize": null, "isInprogress": 2, "createdDate": "2014-04-15 11:41:11", "masterUserName": "cumulogic" },{"accessGroupName": null,"port": 3306,"multiaz": null, "autoMinorEnabled": null, “status": 2,"backupRetentionPeriod": null,"backupStartTime": null,"charset": null, "engineName": "MySQL-5.5.27",targetCloudName":“sttargetcloud123", "servicetag": 1,"instanceType": "xsmalll","id": 163,"databaseName": null, "isReplica": 1,"environment": "Testing","createdBy": 42,"description": null,"nodes": 1, "name": "765sds","masterPassword": "cumulogic", "storageSize": null, "isInprogress": “createdDate": "2014-04-15 11:41:11", "masterUserName": "cumulogic”} ] }}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503),unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
1.15 Clone MySQL Instance
| Http Method | URI | Description |
| POST | /sql/api/v1/sqlinstance | Clonea the existing SQL instance |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “clone” |
Yes |
|
Id |
Integer |
Unique ID of the existing instance |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlinstance” -X POST -H “CL-AUTH-TOKEN:0185f8cc-aa30-4ef7-a81d-43fd512282d6″ -d’{“clone”: {“sqlInstance”: {“id”: “6″}}}’
Example Response
{ “success”: true, “errors”: {}, “response”: {}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400),badMethod (405),overLimit (413),itemNotFound (404),serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013),invalidAction(1001),invalidRequest(1000) |
1.16 Get Events for SQL instance by ID
| Http Method | URI | Description |
| GET | /sql/api/v1/instance/events?id=<id> | Gets events for the database Instance by ID |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/instance/events?id=5″ -X POST -H “CL-AUTH-TOKEN:0185f8cc-aa30-4ef7-a81d-43fd512282d6″
Example Request:
{"success":true,"errors":{},"response":{"events":[{"message":"Create instance job started","id":147,"createdBy":"2014-07-08 15:14:25","timeZone":"UTC","type":"INFO"},{"message":"Create instance task started ","id":148,"createdBy":"2014-07-08 15:14:25","timeZone":"UTC","type":"INFO"},{"message":"Create instance task completed for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":149,"createdBy":"2014-07-08 15:14:57","timeZone":"UTC","type":"INFO"},{"message":"Instance network configuration started for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":150,"createdBy":"2014-07-08 15:14:57","timeZone":"UTC","type":"INFO"},{"message":"Instance network configuration completed for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":151,"createdBy":"2014-07-08 15:14:57","timeZone":"UTC","type":"INFO"},{"message":"Validate instance connection started for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":152,"createdBy":"2014-07-08 15:14:57","timeZone":"UTC","type":"INFO"},{"message":"Validate instance connection completed for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":153,"createdBy":"2014-07-08 15:17:03","timeZone":"UTC","type":"INFO"},{"message":"Storage configuration started for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":154,"createdBy":"2014-07-08 15:17:03","timeZone":"UTC","type":"INFO"},{"message":"Storage configuration completed for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":155,"createdBy":"2014-07-08 15:17:45","timeZone":"UTC","type":"INFO"},{"message":"Engine pre-work started for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":156,"createdBy":"2014-07-08 15:17:45","timeZone":"UTC","type":"INFO"},{"message":"Processing installable for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":157,"createdBy":"2014-07-08 15:17:45","timeZone":"UTC","type":"INFO"},{"message":"Engine pre-work completed for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":158,"createdBy":"2014-07-08 15:19:57","timeZone":"UTC","type":"INFO"},{"message":"Create instance job finished","id":159,"createdBy":"2014-07-08 15:20:05","timeZone":"UTC","type":"INFO"},{"message":"Container engine configuration started ","id":160,"createdBy":"2014-07-08 15:20:10","timeZone":"UTC","type":"INFO"},{"message":"Container engine configuration completed ","id":161,"createdBy":"2014-07-08 15:21:48","timeZone":"UTC","type":"INFO"},{"message":"CL-agent configuration job started ","id":162,"createdBy":"2014-07-08 15:21:50","timeZone":"UTC","type":"INFO"},{"message":"CL-agent configuration task started for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":163,"createdBy":"2014-07-08 15:21:50","timeZone":"UTC","type":"INFO"},{"message":"CL-agent configuration task completed for Host ec2-54-89-86-46.compute-1.amazonaws.com","id":164,"createdBy":"2014-07-08 15:21:50","timeZone":"UTC","type":"INFO"},{"message":"CL-agent configuration job completed ","id":165,"createdBy":"2014-07-08 15:22:00","timeZone":"UTC","type":"INFO"},{"message":"All Tasks for current job completed successfully","id":166,"createdBy":"2014-07-08 15:22:10","timeZone":"UTC","type":"INFO"},{"message":"Create instance snapshot task started ","id":168,"createdBy":"2014-07-08 15:24:05","timeZone":"UTC","type":"INFO"},{"message":"Create instance snapshot task completed ","id":170,"createdBy":"2014-07-08 15:24:05","timeZone":"UTC","type":"INFO"},{"message":"All Tasks for current job completed successfully","id":172,"createdBy":"2014-07-08 15:24:15","timeZone":"UTC","type":"INFO"},{"message":"Create instance binlog task started.","id":173,"createdBy":"2014-07-08 15:25:05","timeZone":"UTC","type":"INFO"},{"message":"Create instance binlog task completed.","id":174,"createdBy":"2014-07-08 15:25:05","timeZone":"UTC","type":"INFO"},{"message":"All Tasks for current job completed successfully","id":175,"createdBy":"2014-07-08 15:25:15","timeZone":"UTC","type":"INFO"},{"message":"Create instance binlog task started.","id":176,"createdBy":"2014-07-08 15:30:05","timeZone":"UTC","type":"INFO"},{"message":"Create instance binlog task completed.","id":177,"createdBy":"2014-07-08 15:30:05","timeZone":"UTC","type":"INFO"},{"message":"All Tasks for current job completed successfully","id":178,"createdBy":"2014-07-08 15:30:15","timeZone":"UTC","type":"INFO"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),invalidRequest(1000) |
2. Entity: SQL Snapshot
2.1 Create Snapshot
|
Http Method |
URI |
Description |
|
POST |
/sql/api/v1/sqlsnapshot |
Creates a new snapshot of the instance |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “snapshot” |
Yes |
|
name |
String |
Unique instance name |
Yes |
|
description |
String |
Description about vm |
No |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlsnapshot” -X POST -H “CL-AUTH-TOKEN:0e3a7b1d-f572-4089-aa76-792d5a20dff1″ -d’{“snapshot”: {“sqlInstance”: {“dbInstance”: {“id”: “2″},”name”: “snapshot1″}}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“snapshot”:[{"sqlinstance":{"port":null,"dbInstanceName":null,"dbInstanceId":2},"port":3306,"id":1,"targetcloud":{"availabilityZone":"us-east1","availabilityZoneName":null,"targetCloudId":2,"targetCloudName":"AmazonEC2Cloud"},"status":2,"name":"snapshot1","retentionPeriod":null,"storageSize":10,"isInProgress":2,"type":1,"createdDate":"2014-06-25 21:30:19","instancetype":{"id":1,"instanceTypeId":"t1.micro","instanceTypeName":"XSmall"}}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),entityAlreadyExist(1011), invalidRequest(1000) |
2.2 Restore From Snapshot
|
Http Method |
URI |
Description |
|
POST |
/sql/api/v1/sqlsnapshot |
Restores the instance from snapshot |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “restoreFromSnapshot” |
Yes |
|
dbInstanceName |
String |
Unique instance name. |
Yes |
|
ID |
Integer |
Unique ID of the snapshot. |
Yes |
|
availabilityZone |
String |
This parameter holds the value of the availability zone in which the instance is to be launched. If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
availabilityZoneName |
String |
This parameter holds the value of the availability zone name in which the instance is to be launched. If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
Port |
Integer |
Port for database access. Default=3306 |
Yes |
|
instanceType |
Array |
Unique Instance type ID.Usage: “instanceType”: {“id”: “1″} |
Yes
|
|
multiAZ |
Integer |
Mandatory when setting up Multi AZ redundant nodeValid Values: multiAZ=0 for No ORmulitAZ=1 for yesSupported only for Percona engine wherein(In case this flag is set, the parameters “multiAZAvailabilityZone” and “multiAZAvailabilityZoneName” are mandatory) |
Yes |
|
multiAZAvailabilityZone |
String |
Second availability zone in which the secondary node of the Percona Multi AZ instance is to be launched.This Is mandatory only if multiAZ value is 1. |
No |
|
multiAZAvailabilityZoneName |
String |
Second availability zone name in which the secondary node of the Percona Multi AZ instances is to be launched.This Is mandatory only if multiAZ value is 1. |
No |
|
multiAZInstanceType |
Integer |
Unique ID of instance type for secondary availability zone.Ex. ”instanceType”: {“id”: “1″}If target cloud is a VM pool, then this parameter is not mandatory. |
No |
|
storageSize |
Integer |
The size of the volume.Valid values: 10 to 1024GB If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
Example Request:
curl -i “http://54.196.106.131:8080/sql/api/v1/sqlsnapshot” -X POST -H “CL-AUTH-TOKEN:0458a745-d90c-4890-86fd-8959dc139470″ -d’{“restoreFromSnapshot”: {“sqlInstance”: {“id”: “17″,”dbInstanceName”: “Restored1″,”availabilityZone”: “us-east1″,”availabilityZoneName”: “US-East1″,”storageSize”: 10,”port”: “3306″,”instanceType”: {“id”: “1″}}}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“snapshot”:[{"sqlinstance":{"port":3306,"dbInstanceName":"test_snap","dbInstanceId":64},"id":4,"targetcloud":{"availabilityZone":"az-2.region-a.geo-1","availabilityZoneName":null,"targetCloudId":33,"targetCloudName":"falcon_hpcs"},"status":2,"name":"snapshot1","retentionPeriod":null,"storageSize":10,"isInprogress":2,"type":1,"createdDate":"2014-04-29 04:37:24","instancetype":{"id":29,"instanceTypeId":"100","instanceTypeName":"xsmall"}}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500),serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013),invalidAction(1001),entityAlreadyExist(1011), invalidRequest(1000) |
2.3 Restore To Snapshot (Point-in-Time Restore)
| Http Method | URI | Description |
| POST | /sql/api/v1/sqlsnapshot | Restores the instance from a snapshot at a particular point-in-time |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name - “restoreToSnapshot” |
Yes |
|
customRestorableTime |
String |
Custom restorable time and date.Format Ex. 2014-06-26 02:30:00 |
Yes |
|
Port |
Integer |
Port of database. |
Yes |
|
instanceType |
Array |
Unique image instance typ ID.Usage: “instanceType”: {“id”: “1″} |
Yes |
|
dbInstance |
Array |
database Instance ID.Usage:”dbInstance”: {“id”: “25″,”name”: “restore”,”port”: “3306″,”isAutoUpdateEnabled”: “0″} |
Yes
|
|
storageSize |
Integer |
Size of additional Volume |
Example Request:
curl -i “http://54.196.106.131:8080/sql/api/v1/sqlsnapshot” -X POST -H “CL-AUTH-TOKEN:0458a745-d90c-4890-86fd-8959dc139470″ -d’{“restoreToSnapshot”: {“sqlInstance”: {“dbInstance”: {“id”: “69″,”name”: “Restored11″,”port”: “3306″,”isAutoUpdateEnabled”: “0″},”customRestorableTime”: “2014-06-26 02:30:00″,”instanceType”: {“id”: “1″}}}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“snapshot”:[{"sqlinstance":{"port":3306,"dbInstanceName":"Restored11","dbInstanceId":101},"port":null,"id":126,"status":null,"name":null,"retentionPeriod":null,"storageSize":null,"isInProgress":null,"type":null,"createdDate":"2014-06-30 11:03:41","instancetype":{"id":1,"instanceTypeId":null,"instanceTypeName":null}}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013),invalidAction(1001),entityAlreadyExist(1011),invalidRequest(1000) |
2.4 Delete MySQL Snapshot
|
Http Method |
URL |
Description |
|
GET |
/sql/api/v1/sqlsnapshot/<id> |
Deletes snapshot by ID |
Example Request:
curl -i “http://localhost:8080/nosql/api/v1/nosqlsnapshot/2″-X DELETE-H “CL-AUTH-TOKEN:3d76564703b3-4334-9a3e-b2d562b5909e”
Example Response:
{“response”: [],”errors”: {},”success”: true}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413), itemNotFound (404) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000), invalidParameterValue(1013) |
2.5 Get SQL Snapshot by Name
|
Http Method |
URL |
Description |
|
GET |
/sql/api/v1/sqlsnapshot?name=<name> |
Gets specific snapshot by name. |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlsnapshot?name=SNAP1″ -X GET -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Example Response:
{“success”:true,”errors”:{},”response”:{“snapshot”:[{"sqlinstance":{"port":3306,"dbInstanceName":"PERCONAMULTIAZ","dbInstanceId":1},"port":3306,"targetcloud":{"availabilityZone":"us-east1","availabilityZoneName":null,"iaasProviderId":1,"targetCloudId":1,"targetCloudName":"Amazonian"},"jobId":2,"status":2,"engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"isInProgress":1,"type":1,"instancetype":{"id":1,"instanceTypeId":"t1.micro","instanceTypeName":"XSmall"},"id":1,"name":"SNAP1","masterPassword":"demouser","retentionPeriod":null,"storageSize":20,"createdDate":"2014-07-08 07:04:30","masterUserName":"demouser"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
2.6 Get SQL Snapshot by ID
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlsnapshot?id=<id> |
Gets specific snapshot by ID. |
Example Request: Query Parameters
curl -i “http://localhost:8080/sql/api/v1/sqlsnapshot?id=1″ -X GET -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Example Response:
{“success”:true,”errors”:{},”response”:{“snapshot”:[{"sqlinstance":{"port":3306,"dbInstanceName":"PERCONAMULTIAZ","dbInstanceId":1},"port":3306,"targetcloud":{"availabilityZone":"us-east1","availabilityZoneName":"US-East1","iaasProviderId":1,"targetCloudId":1,"targetCloudName":"Amazonian"},"jobId":2,"status":2,"engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"isInProgress":1,"type":1,"instancetype":{"id":1,"instanceTypeId":"t1.micro","instanceTypeName":"XSmall"},"id":1,"name":"SNAP1","masterPassword":"demouser","retentionPeriod":null,"storageSize":20,"createdDate":"2014-07-08 07:04:30","masterUserName":"demouser"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
2.7 Get SQL Snapshot By User
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlsnapshot?userId=<userid> |
To get specific snapshot by user ID. |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlsnapshot?userId=2″ -X GET -H “CL-AUTH-TOKEN:9e54e9d8-e58b-4524-8e6c-d34bc5e4a1d1″
Example Response:
{“success”:true,”errors”:{},”response”:{“snapshot”:[{"sqlinstance":{"port":3306,"dbInstanceName":"PERCONAMULTIAZ","dbInstanceId":1},"port":3306,"targetcloud":{"availabilityZone":"us-east1","availabilityZoneName":"US-East1","iaasProviderId":1,"targetCloudId":1,"targetCloudName":"Amazonian"},"jobId":2,"status":2,"engine":{"id":3,"engineName":"Percona-Server","version":"5.5"},"isInProgress":1,"type":1,"instancetype":{"id":1,"instanceTypeId":"t1.micro","instanceTypeName":"XSmall"},"id":1,"name":"SNAP1","masterPassword":"demouser","retentionPeriod":null,"storageSize":20,"createdDate":"2014-07-08 07:04:30","masterUserName":"demouser"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
2.8 Get Events for a Snapshot by ID
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/snapshot/events?id=<id> |
To get events for specific snapshot by user ID |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlsnapshot/events?id=1″ -X GET -H “CL-AUTH-TOKEN:9e54e9d8-e58b-4524-8e6c-d34bc5e4a1d1″
Example Response:
{"success":true,"errors":{},"response":{"events":[{"message":"Create instance snapshot task started ","id":34,"createdBy":"2014-07-08 11:04:35","timeZone":"UTC","type":"INFO"},{"message":"Create instance snapshot task completed ","id":35,"createdBy":"2014-07-08 11:04:35","timeZone":"UTC","type":"INFO"},{"message":"All Tasks for current job completed successfully","id":36,"createdBy":"2014-07-08 11:04:45","timeZone":"UTC","type":"INFO"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
3. Entity: Database Engines
3.1 Get All Database Engines
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlengine |
Gets all SQL engines. |
Example Request:
$ curl -i “http://localhost:8080/sql/api/v1/sqlengine” -X GET -H “CL-AUTH-TOKEN:339b155a-31ba-43fd-887a-e5b47b33df34″
Example Response:
{“success”:true,”errors”:{},”response”:{“engine”:[{"id":1,"hostType":2,"name":"MySQL","type":1,"version":"5.5.27"},{"id":3,"hostType":3,"name":"Percona-Server","type":2,"version":"5.5"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
3.2 Get Database Engine By ID
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlengine?id=<id> |
Gets SQL engine by ID |
Example Request:
$ curl -i “http://localhost:8080/sql/api/v1/sqlengine?id=1” -X GET -H “CL-AUTH-TOKEN:339b155a-31ba-43fd-887a-e5b47b33df34″
Example Response: {“success”:true,”errors”:{},”response”:{“engine”:[{"id":1,"hostType":2,"name":"MySQL","type":1,"version":"5.5.27"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
3.3 Get Database Engine By Name and Version
| Http Method | URI | Description |
| GET | /sql/api/v1/sqlengine?name=<name>&version=<version> | Gets SQL engine by name and version |
Example Request:
$ curl -i “http://localhost:8080/sql/api/v1/sqlengine?name=MySQL&version=5.5.27” -X GET -H “CL-AUTH-TOKEN:339b155a-31ba-43fd-887a-e5b47b33df34″
Example Response:
{“success”:true,”errors”:{},”response”:{“engine”:[{"id":1,"hostType":2,"name":"MySQL","type":1,"version":"5.5.27"}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
4. Entity: SQL Parameter Groups
4.1 Create SQL Parameter Group
|
Http Method |
URL |
Description |
|
Create |
/sql/api/v1/sqlparametergroup |
Creates a new SQL parameter group |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “create” |
Yes |
|
name |
String |
Unique parameter group name. |
Yes |
|
description |
String |
Description about SQL parameter group. |
No |
|
parameterGroupFamilyId |
Integer |
Unique ID of parameter groupfamily ID. |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlparametergroup?” -X POST -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″ -d’{“create”:{“parameterGroupFamilyId”:1,”name”:”SQL_PG”,”description”:”SQL_PG”}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“parameterGroup”:[{"id":2,"description":"SQL_PG","name":"SQL_PG","engineName":"MySQL-5.5.27","parameters":[{"id":15,"scope":"Global","possibleValues":"25 PER of RAM","name":"key_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"","type":"Numeric"},{"id":16,"scope":"Global","possibleValues":"0 to 18446744073709547520","name":"query_cache_size","value":null,"isDynamic":1,"comment":"permitted values are multiple of 1024","defaultValue":"0 (off)","type":"Numeric"},{"id":17,"scope":"Global","possibleValues":"0 or 1 or 2","name":"query_cache_type","value":null,"isDynamic":1,"comment":"","defaultValue":"1 (on)","type":"Numeric"},{"id":18,"scope":"Global","possibleValues":"0 to 16384","name":"thread_cache_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":19,"scope":"Global","possibleValues":"0 to 1000","name":"innodb_thread_concurrency","value":null,"isDynamic":1,"comment":"Setting to 0, takes the limit off","defaultValue":"8","type":"Numeric"},{"id":20,"scope":"Global","possibleValues":"0 to 5000","name":"max_connections","value":null,"isDynamic":1,"comment":"","defaultValue":"100","type":"Numeric"},{"id":21,"scope":"Global","possibleValues":"upto 80 PER of memory","name":"innodb_buffer_pool_size","value":null,"isDynamic":0,"comment":"Setting it very large takes longer to initialize","defaultValue":"8MB","type":"Numeric"},{"id":22,"scope":"Global","possibleValues":"1MB to 8MB","name":"innodb_log_buffer_size","value":null,"isDynamic":0,"comment":"permitted values are multiple of 1024","defaultValue":"1MB","type":"Numeric"},{"id":23,"scope":"Global","possibleValues":"min 10, default 300","name":"innodb_open_files","value":null,"isDynamic":0,"comment":"","defaultValue":"300","type":"Numeric"},{"id":24,"scope":"Global","possibleValues":"upto 4GB max","name":"join_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":25,"scope":"Global","possibleValues":"minimum 4096 bytes, max 1GB","name":"max_binlog_size","value":null,"isDynamic":1,"comment":"","defaultValue":"1GB","type":"Numeric"},{"id":26,"scope":"Global","possibleValues":"upto 2GB max","name":"read_buffer_size","value":null,"isDynamic":1,"comment":"should be in multiple of 4KB","defaultValue":"131072","type":"Numeric"},{"id":27,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"},{"id":28,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"}],”createdDate”:”2014-07-08 06:21:56″}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401), forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| engineName | String |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidParameterValue(1013), invalidRequest(1000) |
4.2 Delete SQL Parameter Group
|
Http Method |
URL |
Description |
|
DELETE |
/sql/api/v1/sqlparametergroup/<id> |
Deletes the existing SQL instance |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlparametergroup/2″ -X DELETE -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Response Format:
{“success”:true,”errors”:{},”response”:{}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401), forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| engineName | String |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidParameterValue(1013), invalidRequest(1000) |
4.3 Update SQL Parameter Group
|
Http Method |
URI |
Description |
|
PUT |
/sql/api/v1/sqlparameter/<id> |
Updates the existing SQL parameter group. |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
name |
String |
Unique SQL parameter Group name |
Yes |
|
dbParameters |
ArrayList |
List of parameters |
Yes |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlparametergroup/1″ -X PUT -H “CL-AUTH-TOKEN:f01cdd12-4cf6-4348-8c7c-4cda70f48d00″ -d’{“dbParameters”:[{"id":14,"scope":"Global","possibleValues":"25 PER of RAM","name":"key_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"","type":"Numeric"},{"id":15,"scope":"Global","possibleValues":"0 to 18446744073709547520","name":"query_cache_size","value":null,"isDynamic":1,"comment":"permitted values are multiple of 1024","defaultValue":"0 (off)","type":"Numeric"},{"id":16,"scope":"Global","possibleValues":"0 or 1 or 2","name":"query_cache_type","value":null,"isDynamic":1,"comment":"","defaultValue":"1 (on)","type":"Numeric"},{"id":17,"scope":"Global","possibleValues":"0 to 16384","name":"thread_cache_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":18,"scope":"Global","possibleValues":"0 to 1000","name":"innodb_thread_concurrency","value":null,"isDynamic":1,"comment":"Setting to 0, takes the limit off","defaultValue":"8","type":"Numeric"},{"id":19,"scope":"Global","possibleValues":"0 to 5000","name":"max_connections","value":"30000","isDynamic":1,"comment":"","defaultValue":"100","type":"Numeric"},{"id":20,"scope":"Global","possibleValues":"upto 80 PER of memory","name":"innodb_buffer_pool_size","value":null,"isDynamic":0,"comment":"Setting it very large takes longer to initialize","defaultValue":"8MB","type":"Numeric"},{"id":21,"scope":"Global","possibleValues":"1MB to 8MB","name":"innodb_log_buffer_size","value":null,"isDynamic":0,"comment":"permitted values are multiple of 1024","defaultValue":"1MB","type":"Numeric"},{"id":22,"scope":"Global","possibleValues":"min 10, default 300","name":"innodb_open_files","value":null,"isDynamic":0,"comment":"","defaultValue":"300","type":"Numeric"},{"id":23,"scope":"Global","possibleValues":"upto 4GB max","name":"join_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":24,"scope":"Global","possibleValues":"minimum 4096 bytes, max 1GB","name":"max_binlog_size","value":null,"isDynamic":1,"comment":"","defaultValue":"1GB","type":"Numeric"},{"id":25,"scope":"Global","possibleValues":"upto 2GB max","name":"read_buffer_size","value":null,"isDynamic":1,"comment":"should be in multiple of 4KB","defaultValue":"131072","type":"Numeric"},{"id":26,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"}]}’
Example Response:
{“success”:true,”errors”:{},”response”:{}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413), itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | QueryFailed(1009), entityDoesNotExist(1012), invalidParameterValue(1013), invalidAction(1001), invalidRequest(1000) |
4.4 Get SQL Parameter Group By Name
|
Http Method |
URL |
Description |
|
GET |
/sql/api/v1/sqlparametergroup?name=<name of Parameter Group> |
Gets specific SQL parameter group by its name |
Example Request: Query Parameters
curl -i “http://localhost:8080/sql/api/v1/sqlparametergroup?name=MySQL_PG” -X GET -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Example Response:
{“success”:true,”errors”:{},”response”:{“parameterGroup”:[{"id":1,"description":"MySQL_Parameter_Group","name":"MySQL_PG","engineName":"MySQL-5.5.27","parameters":[{"id":1,"scope":"Global","possibleValues":"25 PER of RAM","name":"key_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"","type":"Numeric"},{"id":2,"scope":"Global","possibleValues":"0 to 18446744073709547520","name":"query_cache_size","value":null,"isDynamic":1,"comment":"permitted values are multiple of 1024","defaultValue":"0 (off)","type":"Numeric"},{"id":3,"scope":"Global","possibleValues":"0 or 1 or 2","name":"query_cache_type","value":null,"isDynamic":1,"comment":"","defaultValue":"1 (on)","type":"Numeric"},{"id":4,"scope":"Global","possibleValues":"0 to 16384","name":"thread_cache_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":5,"scope":"Global","possibleValues":"0 to 1000","name":"innodb_thread_concurrency","value":null,"isDynamic":1,"comment":"Setting to 0, takes the limit off","defaultValue":"8","type":"Numeric"},{"id":6,"scope":"Global","possibleValues":"0 to 5000","name":"max_connections","value":null,"isDynamic":1,"comment":"","defaultValue":"100","type":"Numeric"},{"id":7,"scope":"Global","possibleValues":"upto 80 PER of memory","name":"innodb_buffer_pool_size","value":null,"isDynamic":0,"comment":"Setting it very large takes longer to initialize","defaultValue":"8MB","type":"Numeric"},{"id":8,"scope":"Global","possibleValues":"1MB to 8MB","name":"innodb_log_buffer_size","value":null,"isDynamic":0,"comment":"permitted values are multiple of 1024","defaultValue":"1MB","type":"Numeric"},{"id":9,"scope":"Global","possibleValues":"min 10, default 300","name":"innodb_open_files","value":null,"isDynamic":0,"comment":"","defaultValue":"300","type":"Numeric"},{"id":10,"scope":"Global","possibleValues":"upto 4GB max","name":"join_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":11,"scope":"Global","possibleValues":"minimum 4096 bytes, max 1GB","name":"max_binlog_size","value":null,"isDynamic":1,"comment":"","defaultValue":"1GB","type":"Numeric"},{"id":12,"scope":"Global","possibleValues":"upto 2GB max","name":"read_buffer_size","value":null,"isDynamic":1,"comment":"should be in multiple of 4KB","defaultValue":"131072","type":"Numeric"},{"id":13,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"},{"id":14,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"}],”createdDate”:”2014-07-08 05:57:10″}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401), forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
4.5 Get SQL Parameter Group By User ID
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlparametergroup?userId=<id> |
Gets SQL parametergroup by user ID. |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlparametergroup?userId=2″ -X GET -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Example Response:
{“success”:true,”errors”:{},”response”:{“parameterGroup”:[{"id":1,"description":"MySQL_Parameter_Group","name":"MySQL_PG","engineName":"MySQL-5.5.27","parameters":[{"id":1,"scope":"Global","possibleValues":"25 PER of RAM","name":"key_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"","type":"Numeric"},{"id":2,"scope":"Global","possibleValues":"0 to 18446744073709547520","name":"query_cache_size","value":null,"isDynamic":1,"comment":"permitted values are multiple of 1024","defaultValue":"0 (off)","type":"Numeric"},{"id":3,"scope":"Global","possibleValues":"0 or 1 or 2","name":"query_cache_type","value":null,"isDynamic":1,"comment":"","defaultValue":"1 (on)","type":"Numeric"},{"id":4,"scope":"Global","possibleValues":"0 to 16384","name":"thread_cache_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":5,"scope":"Global","possibleValues":"0 to 1000","name":"innodb_thread_concurrency","value":null,"isDynamic":1,"comment":"Setting to 0, takes the limit off","defaultValue":"8","type":"Numeric"},{"id":6,"scope":"Global","possibleValues":"0 to 5000","name":"max_connections","value":null,"isDynamic":1,"comment":"","defaultValue":"100","type":"Numeric"},{"id":7,"scope":"Global","possibleValues":"upto 80 PER of memory","name":"innodb_buffer_pool_size","value":null,"isDynamic":0,"comment":"Setting it very large takes longer to initialize","defaultValue":"8MB","type":"Numeric"},{"id":8,"scope":"Global","possibleValues":"1MB to 8MB","name":"innodb_log_buffer_size","value":null,"isDynamic":0,"comment":"permitted values are multiple of 1024","defaultValue":"1MB","type":"Numeric"},{"id":9,"scope":"Global","possibleValues":"min 10, default 300","name":"innodb_open_files","value":null,"isDynamic":0,"comment":"","defaultValue":"300","type":"Numeric"},{"id":10,"scope":"Global","possibleValues":"upto 4GB max","name":"join_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":11,"scope":"Global","possibleValues":"minimum 4096 bytes, max 1GB","name":"max_binlog_size","value":null,"isDynamic":1,"comment":"","defaultValue":"1GB","type":"Numeric"},{"id":12,"scope":"Global","possibleValues":"upto 2GB max","name":"read_buffer_size","value":null,"isDynamic":1,"comment":"should be in multiple of 4KB","defaultValue":"131072","type":"Numeric"},{"id":13,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"},{"id":14,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"}],”createdDate”:”2014-07-08 05:57:10″}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000) |
4.6 Get SQL Parameter Group By ID
|
Http Method |
URI |
Description |
|
GET |
/sql/api/v1/sqlparametergroup?id=<id> |
Gets SQL parametergroup by ID. |
Example Request: Query Parameters
curl -i “http://localhost:8080/sql/api/v1/sqlparametergroup?id=1″ -X GET -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Example Response:
{“success”:true,”errors”:{},”response”:{“parameterGroup”:[{"id":1,"description":"MySQL_Parameter_Group","name":"MySQL_PG","engineName":"MySQL-5.5.27","parameters":[{"id":1,"scope":"Global","possibleValues":"25 PER of RAM","name":"key_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"","type":"Numeric"},{"id":2,"scope":"Global","possibleValues":"0 to 18446744073709547520","name":"query_cache_size","value":null,"isDynamic":1,"comment":"permitted values are multiple of 1024","defaultValue":"0 (off)","type":"Numeric"},{"id":3,"scope":"Global","possibleValues":"0 or 1 or 2","name":"query_cache_type","value":null,"isDynamic":1,"comment":"","defaultValue":"1 (on)","type":"Numeric"},{"id":4,"scope":"Global","possibleValues":"0 to 16384","name":"thread_cache_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":5,"scope":"Global","possibleValues":"0 to 1000","name":"innodb_thread_concurrency","value":null,"isDynamic":1,"comment":"Setting to 0, takes the limit off","defaultValue":"8","type":"Numeric"},{"id":6,"scope":"Global","possibleValues":"0 to 5000","name":"max_connections","value":null,"isDynamic":1,"comment":"","defaultValue":"100","type":"Numeric"},{"id":7,"scope":"Global","possibleValues":"upto 80 PER of memory","name":"innodb_buffer_pool_size","value":null,"isDynamic":0,"comment":"Setting it very large takes longer to initialize","defaultValue":"8MB","type":"Numeric"},{"id":8,"scope":"Global","possibleValues":"1MB to 8MB","name":"innodb_log_buffer_size","value":null,"isDynamic":0,"comment":"permitted values are multiple of 1024","defaultValue":"1MB","type":"Numeric"},{"id":9,"scope":"Global","possibleValues":"min 10, default 300","name":"innodb_open_files","value":null,"isDynamic":0,"comment":"","defaultValue":"300","type":"Numeric"},{"id":10,"scope":"Global","possibleValues":"upto 4GB max","name":"join_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":11,"scope":"Global","possibleValues":"minimum 4096 bytes, max 1GB","name":"max_binlog_size","value":null,"isDynamic":1,"comment":"","defaultValue":"1GB","type":"Numeric"},{"id":12,"scope":"Global","possibleValues":"upto 2GB max","name":"read_buffer_size","value":null,"isDynamic":1,"comment":"should be in multiple of 4KB","defaultValue":"131072","type":"Numeric"},{"id":13,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"},{"id":14,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"}],”createdDate”:”2014-07-08 05:57:10″}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidRequest(1000)invalidParameterValue(1013) |
4.7 Get SQL Parameter Group By User ID and Engine Name
|
Http Method |
URL |
Description |
|
GET |
/sql/api/v1/sqlparametergroup?userId=<id>&engineName=MySQL 5.5.27 |
Gets SQL parameter group by user ID and engine name |
Query Parameters:
| Filter Name | Type | Description |
| user ID | Integer | Unique ID of the user |
| engineName | String | Engine name for SQL service |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/sqlparametergroup?userId=2&engineName=MySQL+5.5.27″ -X GET -H “CL-AUTH-TOKEN:dd660ba2-7ce2-4e46-99c1-a3335f66b712″
Example Response:
{“success”:true,”errors”:{},”response”:{“parameterGroup”:[{"id":1,"description":"MySQL_Parameter_Group","name":"MySQL_PG","engineName":"MySQL-5.5.27","parameters":[{"id":1,"scope":"Global","possibleValues":"25 PER of RAM","name":"key_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"","type":"Numeric"},{"id":2,"scope":"Global","possibleValues":"0 to 18446744073709547520","name":"query_cache_size","value":null,"isDynamic":1,"comment":"permitted values are multiple of 1024","defaultValue":"0 (off)","type":"Numeric"},{"id":3,"scope":"Global","possibleValues":"0 or 1 or 2","name":"query_cache_type","value":null,"isDynamic":1,"comment":"","defaultValue":"1 (on)","type":"Numeric"},{"id":4,"scope":"Global","possibleValues":"0 to 16384","name":"thread_cache_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":5,"scope":"Global","possibleValues":"0 to 1000","name":"innodb_thread_concurrency","value":null,"isDynamic":1,"comment":"Setting to 0, takes the limit off","defaultValue":"8","type":"Numeric"},{"id":6,"scope":"Global","possibleValues":"0 to 5000","name":"max_connections","value":null,"isDynamic":1,"comment":"","defaultValue":"100","type":"Numeric"},{"id":7,"scope":"Global","possibleValues":"upto 80 PER of memory","name":"innodb_buffer_pool_size","value":null,"isDynamic":0,"comment":"Setting it very large takes longer to initialize","defaultValue":"8MB","type":"Numeric"},{"id":8,"scope":"Global","possibleValues":"1MB to 8MB","name":"innodb_log_buffer_size","value":null,"isDynamic":0,"comment":"permitted values are multiple of 1024","defaultValue":"1MB","type":"Numeric"},{"id":9,"scope":"Global","possibleValues":"min 10, default 300","name":"innodb_open_files","value":null,"isDynamic":0,"comment":"","defaultValue":"300","type":"Numeric"},{"id":10,"scope":"Global","possibleValues":"upto 4GB max","name":"join_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"0","type":"Numeric"},{"id":11,"scope":"Global","possibleValues":"minimum 4096 bytes, max 1GB","name":"max_binlog_size","value":null,"isDynamic":1,"comment":"","defaultValue":"1GB","type":"Numeric"},{"id":12,"scope":"Global","possibleValues":"upto 2GB max","name":"read_buffer_size","value":null,"isDynamic":1,"comment":"should be in multiple of 4KB","defaultValue":"131072","type":"Numeric"},{"id":13,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"},{"id":14,"scope":"Global","possibleValues":"Max upto 4GB","name":"sort_buffer_size","value":null,"isDynamic":1,"comment":"","defaultValue":"2097144","type":"Numeric"}],”createdDate”:”2014-07-08 05:57:10″}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| engineName | String |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidParameterValue(1013),invalidRequest(1000) |
5. Entity: SQL Subscriptions
5.1 Add Subscription
|
Http Method |
URL |
Description |
|
POST |
/sql/api/v1/subscription |
Creates a new SQL service subscription. |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
<action> |
String |
Action name “add” |
Yes |
|
name |
String |
Unique subscription name. |
Yes |
|
price |
String |
Subscription pricing in dollars($) |
Yes |
|
priceType |
String |
Subscription Duration Expected values: Monthly=1 OR Yearly=2 |
Yes |
|
features |
String |
Salient Features /Description of the subscription. |
Yes |
|
storageSize |
Integer |
Size of storage. Valid Range:10 to 1024GB |
Yes |
|
multiNode |
Integer |
Number of instances want to provision. |
Yes |
|
iaasProviderId |
Integer |
Unique ID of IaaS Provider |
Yes |
|
imageInstanceTypeId |
Integer |
Unique ID of image instance type. |
Yes |
|
engineId |
Integer |
Unique ID of engine. |
Yes |
|
availabilityZone |
String |
This parameter holds the value of the availability zone in which the instances is to be launchedIf target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
availabilityZoneName |
String |
This parameter holds the value of the availability zone name in which the instances is to be launched.If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
multiAZ |
Integer |
Mandatory when setting up Multi AZ redundant nodeValid Values: multiAZ=0 for No, mulitAZ=1 for yesSupported only for Percona engine wherein(In case this flag is set, the parameters “multiAZAvailabilityZone” and “multiAZAvailabilityZoneName” are mandatory) |
Yes |
| multiAZAvailabilityZone | String | Second Availability zone in which the secondary node of the Percona Multi AZ instances is to be launchedThis Is mandatory only if multiAZ value is 1. |
No |
| multiAZAvailabilityZoneName | String | Second Availability zone name in which the secondary node of the Percona Multi AZ instances is to be launchedThis Is mandatory only if multiAZ value is 1. |
No |
| multiAZInstanceType | Integer | Valid Input: {“id”:1} and so on. Unique ID of image instance type for secondary zone. This Is mandatory only if multiAZ value is 1. |
No |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/subscription” -X POST -H “CL-AUTH-TOKEN:724234d3-0e7b-493d-aa55-6c43a28222f4″ -d’{“add”:{“subscription”: {“name”: “SQLSubscription1″,”price”: “$10″,”priceType”: “1″,”features”: “MySQLServiceonStandaloneVM<br>VMConfiguration:<br>Engine: MySQL5.5.27<br>IaaSProvider: AmazonEC2<br>AvailabilityZone: us-east1<br>InstanceConfiguration:standard.xsmall-1vCPU/1GBRAM/30GBHD-$1<br>NoofNodes: 1<br>Ext.Volume: 100GB<br>”,”storageSize”: “10″,”multiAZ”: “0″,”multiAZInstanceType”:{“id”:1},”multiAZAvailabilityZoneName”:”US-East1″,”multiAZAvailabilityZone”:”us-east1″,”iaasProviderId”: “1″,”availabilityZoneName”: “US-East1″,”availabilityZone”: “us-east1″,”engineId”: “1″,”imageInstanceTypeId”: “1″,”multiNode”: “1″}}}’
Example Response:
{“success”:true,”errors”:{},”response”:{“subscription”:[{"ownerType":1,"priceType":1,"imageInstanceId":1,"multiAZ":0,"id":94,"multiAvailabilityZone":"","price":"$10","createdBy":1,"nodes":1,"name":"SQLSubscription1","availabilityZone":"us-east1","storageSize":10,"multiAZAvailabilityZoneName":"","feature":"MySQLServiceonStandaloneVM<br>VMConfiguration:<br>Engine: MySQL5.5.27<br>IaaSProvider: AmazonEC2<br>AvailabilityZone: us-east1<br>InstanceConfiguration:standard.xsmall-1vCPU/1GBRAM/30GBHD-$1<br>NoofNodes: 1<br>Ext.Volume: 100GB<br>","availabilityZoneName":"US-East1","engineId":1,"targetCloudId":null,"iaasProviderId":1,"createdDate":"2014-07-08 04:53:09","multiAzInstanceTypeId":0}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), invalidAction(1001),entityAlreadyExist(1011), invalidRequest(1000) |
5.2 Update Subscription
|
Http Method |
URL |
Description |
|
PUT |
/sql/api/v1/subscription |
Updates the existing subscription |
Request Parameters:
|
Attribute |
Type |
Description |
Required |
|
ID |
Integer |
Unique ID of existing subscription. |
Yes |
|
name |
String |
Unique subscription name. |
Yes |
|
price |
String |
Subscription pricing in dollars($) |
Yes |
|
priceType |
String |
Subscription Duration Expected values: Monthly=1 OR Yearly=2 |
Yes |
|
features |
String |
Salient Features /Description of the subscription. |
Yes |
|
storageSize |
Integer |
Size of storage. Valid Range:10 to 1024GB |
Yes |
|
multiNode |
Integer |
Number of instances want to provision. |
Yes |
|
iaasProviderId |
Integer |
Unique ID of IaaS Provider |
Yes |
|
imageInstanceTypeId |
Integer |
Unique ID of image instance type. |
Yes |
|
engineId |
Integer |
Unique ID of engine. |
Yes |
|
availabilityZone |
String |
This parameter holds the value of the Availability zone in which the instances is to be launchedIf target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
availabilityZoneName |
String |
This parameter holds the value of the Availability zone name in which the instances is to be launched.If target cloud is a VM pool, then this parameter is not mandatory. |
Yes |
|
multiAZ |
Integer |
Mandatory when setting up Multi AZ redundant nodeValid Values: multiAZ=0 for No, mulitAZ=1 for yesSupported only for Percona engine wherein(In case this flag is set, the parameters “multiAZAvailabilityZone” and “multiAZAvailabilityZoneName” are mandatory) |
Yes |
|
multiAzAvailabilityZone |
String |
Second Availability zone in which the secondary node of the Percona Multi AZ instances is to be launchedThis Is mandatory only if multiAZ value is 1. |
No |
|
multiAzAvailabilityZoneName |
String |
Second Availability zone name in which the secondary node of the Percona Multi AZ instances is to be launchedThis Is mandatory only if multiAZ value is 1. |
No |
|
multiAzInstanceTypeId |
Integer |
Unique ID of image instance type for secondary zone This Is mandatory only if multiAZ value is 1. |
No |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/subscription/94″ -X PUT -H “CL-AUTH-TOKEN:724234d3-0e7b-493d-aa55-6c43a28222f4″ -d’{“name”: “SQLSubscription1″,”price”: “$10″,”priceType”: “1″,”features”: “Percona MultiAZ Instance<br>VMConfiguration:<br>Engine: Percona Server 5.5<br>IaaSProvider: AmazonEC2<br>AvailabilityZone: us-east1<br>InstanceConfiguration:standard.xsmall-1vCPU/1GBRAM/30GBHD-$1<br>No of Nodes: 1<br>Ext.Volume: 10GB<br>”,”storageSize”: “10″,”multiAZ”: “1″,”multiAzInstanceTypeId”: “1″,”multiAzAvailabilityZoneName”:”US-East1″,”multiAzAvailabilityZone”:”us-east1″,”iaasProviderId”: “1″,”availabilityZoneName”: “US-East1″,”availabilityZone”: “us-east1″,”engineId”: “3″,”imageInstanceTypeId”: “1″,”multiNode”: “1″}’
Example Response:
{“success”:true,”errors”:{},”response”:{}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413),itemNotFound (404), serverCapacityUnavailable (503) |
| Custom Error Response Code(s): | queryFailed(1009), invalidParameterValue(1013), entityDoesNotExist(1012),invalidAction(1001), invalidRequest(1000) |
5.3 Delete Subscription by ID
|
Http Method |
URL |
Description |
|
DELETE |
/sql/api/v1/subscription/<id> |
Deletes the subscription by ID
|
Example Request:
curl -i “http://localhost:8080/sql/api/v1/subscription/94” -X DELETE -H “CL-AUTH-TOKEN:724234d3-0e7b-493d-aa55-6c43a28222f4″
Response Format:
{“success”:true,”errors”:{},”response”:{}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| engineName | String |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidParameterValue(1013),invalidRequest(1000) |
5.4 Get Subscription by ID
|
Http Method |
URL |
Description |
|
GET |
/sql/api/v1/subscription?id=<id> |
Gets specific subscription. |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/subscription/294″ -X GET -H “CL-AUTH-TOKEN:e67f8afb-f959-4669-8d14-6e5d6d015e1f”
Example Response:
{“success”:true,”errors”:{},”response”:{“subscription”:[{"ownerType":1,"priceType":1,"imageInstanceId":1,"multiAZ":1,"id":94,"multiAvailabilityZone":"us-east1","price":"$10","createdBy":1,"nodes":1,"name":"SQLSubscription1","availabilityZone":"us-east1","storageSize":10,"multiAZAvailabilityZoneName":"US-East1","feature":"Percona MultiAZ Instance<br>VMConfiguration:<br>Engine: Percona Server 5.5<br>IaaSProvider: AmazonEC2<br>AvailabilityZone: us-east1<br>InstanceConfiguration:standard.xsmall-1vCPU/1GBRAM/30GBHD-$1<br>No of Nodes: 1<br>Ext.Volume: 10GB<br>","availabilityZoneName":"US-East1","engineId":3,"targetCloudId":null,"iaasProviderId":1,"createdDate":"2014-07-08 05:23:10","multiAzInstanceTypeId":1}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| engineName | String |
| Custom Error Response Code(s): | queryFailed(1009), entityDoesNotExist(1012), invalidParameterValue(1013),invalidRequest(1000) |
5.5 Get All Subscriptions
|
Http Method |
URL |
Description |
|
GET |
/sql/api/v1/subscription |
Gets details of all SQL subscriptions |
Example Request:
curl -i “http://localhost:8080/sql/api/v1/subscription” -X GET -H “CL-AUTH-TOKEN:e67f8afb-f959-4669-8d14-6e5d6d015e1f”
Example Response:
{“success”:true,”errors”:{},”response”:{“subscription”:[{"ownerType":1,"priceType":1,"imageInstanceId":1,"multiAZ":1,"id":94,"multiAvailabilityZone":"us-east1","price":"$10","createdBy":1,"nodes":1,"name":"SQLSubscription1","availabilityZone":"us-east1","storageSize":10,"multiAZAvailabilityZoneName":"US-East1","feature":"Percona MultiAZ Instance<br>VMConfiguration:<br>Engine: Percona Server 5.5<br>IaaSProvider: AmazonEC2<br>AvailabilityZone: us-east1<br>InstanceConfiguration:standard.xsmall-1vCPU/1GBRAM/30GBHD-$1<br>No of Nodes: 1<br>Ext.Volume: 10GB<br>","availabilityZoneName":"US-East1","engineId":3,"targetCloudId":null,"iaasProviderId":1,"createdDate":"2014-07-08 05:23:10","multiAzInstanceTypeId":1},{"ownerType":1,"priceType":1,"imageInstanceId":1,"multiAZ":1,"id":96,"multiAvailabilityZone":"us-east1","price":"$2","createdBy":1,"nodes":1,"name":"X","availabilityZone":"us-east1","storageSize":10,"multiAZAvailabilityZoneName":"US-East1","feature":"X","availabilityZoneName":"US-East1","engineId":3,"targetCloudId":null,"iaasProviderId":1,"createdDate":"2014-07-08 05:21:23","multiAzInstanceTypeId":1},{"ownerType":1,"priceType":1,"imageInstanceId":1,"multiAZ":0,"id":97,"multiAvailabilityZone":"","price":"$10","createdBy":1,"nodes":1,"name":"SQLSubscription2","availabilityZone":"us-east1","storageSize":10,"multiAZAvailabilityZoneName":"","feature":"MySQLServiceonStandaloneVM<br>VMConfiguration:<br>Engine: MySQL5.5.27<br>IaaSProvider: AmazonEC2<br>AvailabilityZone: us-east1<br>InstanceConfiguration:standard.xsmall-1vCPU/1GBRAM/30GBHD-$1<br>NoofNodes: 1<br>Ext.Volume: 10GB<br>","availabilityZoneName":"US-East1","engineId":1,"targetCloudId":null,"iaasProviderId":1,"createdDate":"2014-07-08 05:24:32","multiAzInstanceTypeId":1}]}}
Response Code(s):
| Normal Response Code(s): | 200 |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Error Response Code(s): | computeFault (400, 500), serviceUnavailable (503), unauthorized (401),forbidden (403), badRequest (400), badMethod (405), overLimit (413) |
| Custom Error Response Code(s): | queryFailed(1009), invalidRequest(1000) |
