Table of Contents Previous Next


14 EDB Ark API Support : 14.1 Resources

https://<ppcd_host_address>/api/v2.0
/dbengines/engine_id
/options/server-classes/tenant_name/?engineId={id}
/options/vpcids/ tenant_name
/owners/tenant_name/backups
/owners/tenant_name/backups/backup_id
/owners/ tenant_name /clusters
/owners/ tenant_name /clusters/cluster_name
/owners/ tenant_name /clusters/cluster_name/events
/owners/ tenant_name /clusters/cluster_name/statistics?
start=
start_time&end=end_time
/users/user_id
/users/user_id/notifications
Use the /admin/logs resource to download the server log files. You must be an administrator to use this resource. The following is an example of a GET call to /admin/logs:
curl -H "X-Auth-Token: ostoken" https://ppcd_host_address/api/v2.0/admin/logs -o logs.zip
Use the /admin/wall resource to manage the information displayed on the console wall. You must be an administrator to use this resource.
To update the wall message, pass a new value for the wallMessage field with a PUT request.
14.1.3 /clusters
An administrator can use the /clusters resource to retrieve a list of all clusters; the output will include information about the master instance of each cluster. If there is only one cluster, a GET request returns information about the single instance:
See Section 14.1.16 for a complete listing of the information returned by /clusters.
14.1.4 /dbengines
The /dbengines resource allows you to retrieve information about database engines or create a database engine. A GET request returns a list of the currently defined database engines:
{
"dbEngine":[

{

"engineId": "PG_94",
"eol": "false",
"id": "1",
...
},
{
"engineId": "PPAS_95",
"eol": "false",
"id": "2",
...
}
]
}
If the GET request is issued using a token retrieved by an administrative user, the list will include database engines that have been disabled (eol = true). If the list is retrieved by a non-administrative user, disabled engines will be omitted. For a complete list of the information returned by /dbengines, please see Section 14.1.5.
An administrator may use /dbengines to create a new database engine. When using a POST request to create a new database engine, pass the following fields:
{
"engineId": "PPAS_95",
"eol": "false",
"name": "EDB Postgres Advanced Server 9.5 64bit",
"optionalPkgs": "",
"repos": {
"url":
http://user:pwd@yum.enterprisedb.com/9.5/
redhat/rhel-$releasever-$basearch

},
"requiredPkgs": "ppas95-server ppas-pgpool-34
ppas95-pgpool34-extensions",
"serverImage": {
"id": "3"
},
"type": "advanced_server",
"version": "9.5"
}
When passing in information about the server image, pass in only the id number of the server image (returned by the /serverimages resource); the server image must already exist in the Ark console, or the request will fail.
14.1.5 /dbengines/engine_id
The /dbengines/engine_id resource allows you to retrieve information about a specific database engine, modify a database engine definition, or delete an engine. Pass the engine_id with a GET request to retrieve the following information:
{
"engineId": "PG_94",
"eol": "false",
"id": "1",
"name": "PostgreSQL 9.4 64bit",
"optionalPkgs": "",
"repos": {
"id": "30",
"url":
http://yum.postgresql.org/9.4/redhat
/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm

},
"requiredPkgs": "postgresql94-server.x86_64
pgpool-II-94.x86_64 postgresql94-jdbc.x86_64",
"serverImage": {
"id": "2",
"imageId": "a8ed57dd-9a34-40ca-977b-ce3af9ad3745",
"initialUser": "centos",
"serverDescription": "CentOS 6.6",
"serverId": "centos_6.6"
},
"type": "postgres",
"version": "9.4"
}
engine_id is the unique identifier of a database engine, provided in the id field.
Provide the engine_id with a PUT request to update the definition of a specific database engine. Please note that you cannot change the following attributes:
Provide the engine_id with a DELETE request to remove the definition of a database engine.
Use the /options/backup-windows resource to retrieve a list of backup windows; a GET request to the resource returns information in the following format:
14.1.7 /options/ip-pools/tenant_name
14.1.8 /options/server-classes/tenant_name/?engineId=id
tenant_name is the unique identifier of the tenant.
id is an integer value that represents the database engine; use the /dbengines resource to retrieve a list of engine ids. The id parameter is optional. If supplied, the specified engine will be used to filter the list of available server classes meeting the minimum requirements of the backing VM image.
Use the /options/types API to return a list of available database types in the form:
14.1.10 /options/versions/type
Use the /options/version/type API to return a list of database versions available for the specified type:
14.1.11 /options/vpcids/tenant_name
14.1.12 /owners
Use the /owners resource to retrieve a list of tenants that may be accessed by the user that retrieved the security token. A GET request to the resource returns:
The user specified by the service.account.id property (in the ppcd.properties file) has access to all of the tenants that the console understands.
14.1.13 /owners/tenant_name/backups
Use the /owners/tenant_name/backups resource to retrieve a list with information about the current cluster backups.
tenant_name is the name of the tenant in which the cluster resides.
Provide the name of the tenant in which a cluster resides with a GET request to retrieve information about all backups for the specified tenant. If there are no backups, the server returns response code 204.
Use a POST request to create a backup for a cluster. When creating a backup, only the cluster identifier is required; the cluster identifier is passed in as clusterUuid:
The notes field is optional. A successful call to this resource returns response code 202.
14.1.14 /owners/tenant_name/backups/backup_id
The /owners/tenant_name/backups/backup_id resource allows you to retrieve information about a cluster backup or delete a specific backup. A GET request to the resource returns:
{
"backup": {
"backupType": "Manual",
"capacity": "2",
"clusterUuid":
"0e6d9b08-19f1-4d15-8b80-96b186a7dcf0",
"continuousArchiving": "false",
"dbEngine": {
"engineId": "PG_94",
"eol": "false",
"id": "1",
"name": "PostgreSQL 9.4 64bit",
"optionalPkgs": "",
"repos": {
"id": "30",
"url":
http://yum.postgresql.org/9.4/redhat/
rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm

},
"requiredPkgs": "postgresql94-server.x86_64
pgpool-II-94.x86_64 postgresql94-jdbc.x86_64",
"serverImage": {
"id": "2",
"imageId":
"a8ed57dd-9a34-40ca-977b-ce3af9ad3745",
"initialUser": "centos",
"serverDescription": "CentOS 6.6",
"serverId": "centos_6.6"
},
"type": "postgres",
"version": "9.4"
},
"encrypted": "false",
"encryptionKey": "",
"ended": "2016-01-18T23:35:05.497Z ",
"engineVersion": "PostgreSQL 9.4 64bit",
"id": "6f9cc175-2f30-45e9-8a40-50c144117162",
"masterUser": "postgres",
"notes": "",
"owner": "some.user",
"signature": "upgradecluster",
"started": "2016-01-18T18:15:06.497Z ",
"tenant": "Resources",
"yumUpdate": "true"
}
}
tenant_name is the name of the tenant in which the cluster resides.
backup_id is the unique identifier of the backup provided in the id field.
Provide the name of the tenant in which a cluster resides and a backup identifier when calling /owners/tenant_name/backups/backup_id to retrieve information about a specific backup.
14.1.15 /owners/tenant_name/clusters
Use the /owners/tenant_name/clusters resource to retrieve cluster details about all of the clusters that reside within the specified tenant or to create a new cluster.
tenant_name is the name of the tenant.
{
"clusterName": "
new_cluster_name",
"continuousArchiving": "false",
"encrypted": "false",
"fromCluster":
source_cluster_id,
"hardware": "m1.small",
"ipPool": "
IP_pool_name",
"vpcid": "
VM_Network",
"yumUpdate": "true"
}
Note that fromCluster refers to the clusterUuid of the source cluster, and is not a value stored after this call.
To create a cluster from a backup, pass in the same fields, but specify fromBackup instead of fromCluster, and pass in the backup identifier:
14.1.16 /owners/tenant_name/clusters/cluster_name
When calling /owners/tenant_name /clusters/cluster_name, pass in the name of the tenant in which the cluster resides and the name of the cluster; the resource will return the following information about the specified cluster:
{
"instance": {
"autoScale": "true",
"availabilityZone": "ox",
"backupRetention": "1",
"backupWindow": "12:00am - 2:00am",
"caState": "",
"clusterKey": "-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----",
"clusterKeyName": "Resources-onenode",
"clusterName": "onenode",
"clusterState": "2",
"clusterUuid":
"230b3b81-2dd7-4b21-a221-79cfff2b22e7",
"connectionThreshold": "95",
"connections": "1",
"continuousArchiving": "false",
"cpuLoad": "9",
"dataThreshold": "95",
"creationTime": "
2015-10-27T13:06:41.798Z",
"dataThreshold": "65",
"dbEngine": {
"engineId": "PG_94",
"eol": "false",
"id": "1",
"name": "PostgreSQL 9.4 64bit",
"optionalPkgs": "",
"repos": {
"id": "30",
"url": "http://yum.postgresql.org/9.4/
redhat/rhel-6-x86_64/pgdg-redhat94-9.4-
1.noarch.rpm"
},
"requiredPkgs": "postgresql94-server.x86_64
pgpool-II-94.x86_64 postgresql94-jdbc.x86_64",
"serverImage": {
"id": "2",
"imageId":
"a8ed57dd-9a34-40ca-977b-ce3af9ad3745",
"initialUser": "centos",
"serverDescription": "CentOS 6.6",
"serverId": "centos_6.6"
},
"type": "postgres",
"version": "9.4"
},
"dbName": "postgres",
"dbPort": "5432",
"dbState": "2",
"dnsName": "172.16.252.27",
"encrypted": "false",
"engineVersion": "PostgreSQL 9.4 64bit",
"freeDataSpace": "1882272",
"hardware": "m1.small",
"id": "ed68c50c-26ca-45d1-bded-c07334161dce",
"imageId": "a8ed57dd-9a34-40ca-977b-ce3af9ad3745",
"instanceState": "RUNNING",
"iops": "0",
"ipPool": "Sales East",
"lbPort": "9999",
"masterUser": "postgres",
"monitoringLB": "true",
"notificationEmail": "first.last@enterprisedb.com",
"numberOfNodes": "1",
"optimized": "false",
"owner": "first.last",
"pendingModifications": "",
"port": "22",
"primaryFailoverToReplica": "false",
"privateIp": "192.168.1.16",
"profile": "m1.small",
"publicIp": "172.16.252.27",
"readonly": "false",
"region": "uk",
"securityGroup": "jclouds-Resources-onenode",
"storage": "1.0",
"tenant": "Resources",
"usedDataSpace": "40484",
"versionNum": "020000",
"vpcid": "General VM Network",
"yumStatus": "2",
"yumUpdate": "true",
"zone": "ox"
}
}
tenant_name is the name of the tenant in which the cluster resides.
cluster_name is the name of the cluster.
Please note: the values returned for the dbState and clusterState fields correspond with the information displayed in the DB and HA columns in the Ark console.
Perform update on cluster. Value can be true or false; passing in false does nothing and a 204 is returned.
"vpcid": " General VM Network ",
"ipPool": " Sales East "
Please note that yumUpdate is optional, and will default to false.
14.1.17 /owners/tenant_name/clusters/cluster_name/events
Use the /owners/tenant_name/clusters/cluster_name/events resource to retrieve a list of events for a specific cluster. The information returned about each cluster may include:
tenant_name is the name of the tenant.
cluster_name is the name of the cluster.
14.1.18 /owners/tenant_name/clusters/cluster_name/statistics?start=start_time&end=end_time
tenant_name is the name of the tenant.
cluster_name is the name of the cluster.
start_time is the time at which the report will start; specify the time in an ISO_8601 format, or as the number of milliseconds since January 1, 1970.
end_time is thetime at which the report ends; enter the time in an ISO_8601 format, or as the number of milliseconds since January 1, 1970. This parameter is optional.
You can use the /serverimages resource to retrieve information about all currently defined server images, or to create a new server image:
Use a POST request with this resource to create a new server image. When creating a new server image, omit the id field; the server will assign a unique identifier. You must specify a serverId field. The serverID field is displayed to the user in the Server Type field of the Ark console.
14.1.20 /serverimages/image_id
Use the /serverimages/image_id resource to retrieve information about a specific server image, modify a server image, or delete a server image.
image_id is the unique identifier of the server image provided in the id field.
14.1.21 /tokens
You can use the /tokens resource to retrieve a token. The following example uses curl to demonstrate obtaining a token resource:
curl -i -H "Content-Type: application/json" -d \
'{"name":"alice","password":"1safepwd","tenant":"acctg"}' \
https://<host>/api/v2.0/tokens

HTTP/1.1 201 Created
Server: Admin
X-Subject-Token: 014khlia0abddk4xboyhy4bsygr9dt27ycyp1sdv
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 21 Sep 2015 17:25:42 GMT

{"expiresAt":"2015-09-21T18:55:42.582+01:00",
"issuedAt":"2015-09-21T18:25:42.582+01:00"}
Use a POST request with a /token resource to retrieve a token used for token-based authentication.
When deleting a token, pass the token to be deleted in the X-Subject-Token header along with the normal X-Auth-Token header. A successful call returns response code 204.
14.1.22 /users
Use a GET request with the /users resource to retrieve information about all currently registered users:
{
"user":[
{
"id": "first.last",
"region": "uk",
"serviceprovider": "openstack-nova",
"firstname": "First",
"lastname": "Last",
"email": "first.last@enterprisedb.com",
"companyName": "EDB",
"serviceProviderEndpoint": "",
"creationTime":
"2015-10-27T13:06:41.798Z",
"lastLogin": "2016-02-23T19:38:25.369Z",
"numLogins": "100",
"enabled": "true",
"numNodes": "65",
"activationTime": "2015-10-27T13:06:41.798Z",
"walArchiveContainer": "EDBArk"
},
{
"id": "first.last",
"region": "uk",
...
}
]
}
Please note: the numNodes field specifies the cumulative number of nodes created by the user; the nodes may or may not be currently running.
14.1.23 /users/user_id
Use the /users/user_id resource to retrieve or modifyinformation about a specific user:
user_id is the identity of a registered EDB Ark user; the user_id takes the form of first_name.last_name.
Pass the user_id with a GET request to retrieve information about a specific user. The email field will be returned only if the user has set a notification email value.
14.1.24 /users/user_id/notifications
Use the /users/user_id/notifications resource to retrieve a notification for a specific user. A call to /users/id/notifications returns a message in the format:
user_id is the identity of a registered EDB Ark user; the user_id takes the form of first_name.last_name.
Provide the user_id of a registered EDB Ark user with a GET request to retrieve a notification message for the user (if available). If there is no notification for the specified user, the server returns response code 204.

14 EDB Ark API Support : 14.1 Resources

Table of Contents Previous Next