Using the REST API for databases
You can use the REST API to create and manage your database patterns, database instances, database images, database workloads, pattern types, and system plug-ins.
Use the accept-language header on your HTTP request to specify which supported system language should be used when generating the response data.
The following tasks can be completed using the REST API:
Database pattern type REST interface
List pattern type information
GET /resources/patternTypes/{dbaas_patterntype}/{version}
Example URL | https://localhost/resources/patternTypes/dbaas/1.1 | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Update database pattern type
PUT /resources/patternTypes/{dbaas_patterntype}/{version_vrmf}
- The value of {dbaas_patterntype} could be dbaas.std.oltp or dbaas.std.datamart
- {version_vrmf} should be the format of “vrmf”, eg: 1.1.0.0
Example URL | https://localhost/resources/patternTypes/ dbaas.std.oltp/1.1.0.0 | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response body |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Show list of plug-ins for a pattern type
GET /resources/patternTypes/{dbaas_patterntype}/{version}/plugins
Example URL | https://localhost/resources/patternTypes/dbaas/1.1/plugins | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response header location | https://localhost/resources/applicationPatterns/a-4e21f6e9-2ca7-4a3a-a5cc-00f04f7b7f08 | |
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Plug-in Configuration REST interface
Retrieve plug-in configuration information
GET /resources/plugins/{dbaas_plugin}/{version_ vrmf }/config
Example URL | https://localhost/resources/plugins/tsm/1.1.0.0/config | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response code | 201 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | The Plug-in is not found. | |
500 | Unexpected error |
Database Pattern REST interface
List all database patterns
GET /resources/applicationPatterns/?app_type=database
Example URL | https://localhost/resources/applicationPatterns/?app_type=database | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Create a database pattern
POST /resources/applicationPatterns
Example URL | https://localhost/resources/applicationPatterns/ | |
---|---|---|
Request Body Content-type | Content-Type - application/json (body is the
application model json file) Content-Type - application/zip (body is a compressed file, including the application model and artifacts files) |
|
Request body example |
|
"app_type:" This must be “database” "patterntype:" This must be “dbaas” purpose: retrieve the value from Get resources/databaseProvisionPurposes "source:" This may be “workloadStandardApproach” “defaultworkloadStandardApproach” or “cloneApproach” |
Response content-type | application/json | |
Response body example |
|
|
Response header location | https://localhost/resources/resources/applicationPatterns/a-2f6df81b-9fd3-48c7-b230-d7ea3cb1e005 | |
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
412 | Invalid parameter supplied, for example, the JSON file is invalid. | |
415 | Invalid content type | |
500 | Unexpected error |
Upload a sql file for database pattern specified by Database Pattern ID
PUT /resources/applicationPatterns/{db_pattern_id}/artifacts/{filename}
Example URL | https://localhost/resources/applicationPatterns/a-8f076605-2201-4461-b80c-635ccc18af1d/artifacts/test.sql | |
---|---|---|
Request content-type | application/octet-stream | |
Request body | sql file | |
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | The application specified by {dbid} is not found. | |
500 | Unexpected error |
Update a database pattern specified by Database Pattern ID
PUT /resources/applicationPatterns/{db_pattern_id}
Example URL | https://localhost/resources/applicationPatterns/a-cdaac959-672c-4df7-a648-b333a3843422 | |
---|---|---|
Request content-type and body | Content-Type - application/json (body is the
application model json file) Content-Type - application/zip (body is compressed file, including the application model and artifacts files) |
|
Request body example |
|
|
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK Note: If an application specified by {dbid}
is not found, the 200 response code returns the following response:
{"success":
"false"}) |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | The application specified by { db_pattern_id } is not found. | |
412 | Invalid parameter supplied, for example, the json file is invalid. | |
500 | Unexpected error |
Update database pattern access rights for specified user name or group name
PUT /resources/applicationPatterns/{db_pattern_id}/accessRights/{name}?{user or group }
Example URL | https://localhost/resources/applicationPatterns/a-cdaac959-672c-4df7-a648-b333a3843422/accessRights/Everyone?group | |
---|---|---|
Response content type | application/json | |
Response example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action | |
403 | Access forbidden | |
404 | The application specified by {dbid} is not found. | |
412 | Invalid parameter supplied, for example, the json file is invalid. | |
500 | Unexpected error |
Delete a database pattern specified by Database Pattern ID
DELETE /resources/applicationPatterns/{db_pattern_id}
Example URL | https://localhost/resources/applicationPatterns/a-cdaac959-672c-4df7-a648-b333a3843422 | |
---|---|---|
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
409 | Conflict | |
500 | Unexpected error |
Database Instance REST interface
List all databases
GET /resources/databases
Response content-type | application/json | |
---|---|---|
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Deploy a database specified by Database Pattern ID
POST /resources/applicationPatterns/{db_pattern_id}/virtualApplications
Request content-type | application/json | |
---|---|---|
Request body | Deploy by cloud group:
Or deploy by environment profile:
|
“deployment_name” is an optional parameter
for virtual application name. By default, it will be the name of application.
“cloud_group” is required for deployment. “ssh_keys” is an optional parameter for deployment. “ip_version” is required for deployment. “environment_profile_id” is required for deployment. “ip_group” is required for deployment. |
Response content-type | application/json | |
Response header location | https://localhost/resources/applicationPatterns/a-bd0b540c-d285-4413-9095-cbbccc180261/virtualApplicationsd-7dadcdcc-d448-45e0-9103-1f3582aca870 | |
Response example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | Application specified by {dbid} is not found. | |
412 | Precondition failed (unable to deploy, such as template) | |
500 | Unexpected error |
Retrieve database information specified by Database ID
GET /resources/databases/{dbid}
Example URL | https://localhost/resources/databases/d-4db8c121-58c4-400b-80da-a2e0f916d83f | |
---|---|---|
Response content-type | application/json | |
Response body example | For admin:
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
404 | Application specified by {dbid} is not found. | |
500 | Unexpected error |
Destroy a database specified by Database ID
PUT: /resources/virtualApplications/{dbid}
stop
and terminate
. Example URL | https://localhost/resources/virtualApplications/d-7956c64e-0fac-49f2-b04e-efbc131a4cc4 | |
---|---|---|
Response content-type | application/json | |
Request body |
|
|
Response code | 202 | Accepted |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | Application specified by {dbid} is not found. | |
409 | Conflict | |
412 | Precondition failed (invalid operation) | |
500 | Unexpected error |
Delete a database specified by Database ID
DELETE: /resources/virtualApplications/{dbid}
Example URL | https://localhost/resources/virtualApplications/d-7956c64e-0fac-49f2-b04e-efbc131a4cc4 | |
---|---|---|
Response content-type | application/json | |
Request body |
|
|
Response code | 200 | OK Note: If the deployment specified by
{dbid } is not found, a 200 response code returns, response body: {"success":
"false"} |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
409 | Conflict (same action is already in process) | |
500 | Unexpected error |
Database Image REST interface
List all database images
GET: /resources/dbimages
Example URL | https://172.16.65.27/resources/dbimages | |
---|---|---|
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
List database images by dbaasversionge
GET: /resources/dbimages?dbaasversionge={version}
Example URL | https://172.16.65.27/resources/dbimages?dbaasversionge=1.0.0.2 | |
---|---|---|
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Create a database image specified by Database ID
Post: /resources/virtualApplications/{dbid}/operations
Request content-type | application/json | |
---|---|---|
Request body | “imageName” is a required parameter for creating a database
image “imageDescription” is an optional parameter. |
|
Response content-type | application/json | |
Response header location | https://localhost/resources/virtualApplications/d-38751eb2-c965-4526-b4f8-3b8d5896b473/operations/o-df8f696a-24a3-41cd-9148-f29c3146ea4d | |
Response body example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | The application specified by {dbid} is not found | |
412 | Precondition failed (unable to deploy, such as template) | |
500 | Unexpected error |
Request content-type | application/json | |
---|---|---|
Request body | “frequency” : required parameter, the value could be
daily, weekly or off |
|
Response content-type | application/json | |
Response header location | https://localhost/resources/virtualApplications/d-38751eb2-c965-4526-b4f8-3b8d5896b473/operations/o-df8f696a-24a3-41cd-9148-f29c3146ea4d | |
Response body example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | The application specified by {dbid} is not found | |
412 | Precondition failed (unable to deploy, such as template) | |
500 | Unexpected error |
Retrieve database image information specified by Database Image ID
Get: /resources/virtualApplications/{db_imageid}
Example URL | https://localhost/resources/dbimages/maunal_172.16.37.180_mydb_20110824034523.json | |
---|---|---|
Request content-type | application/json | |
Request body |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
404 | The application specified by {db_imageid } is not found | |
500 | Unexpected error |
Database Configuration REST interface
Change appuser/appdba password specified by Database ID
Post: /resources/virtualApplications/{dbid}/operations
Request content-type | application/json | |
---|---|---|
Request body |
|
|
Response content-type | application/json | |
Response header location | https://localhost/resources/virtualApplications/d-38751eb2-c965-4526-b4f8-3b8d5896b473/operations/o-d640dcfc-5339-4f37-bfd2-a67c1780e3e0 | |
Response example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | The application specified by {dbid} is not found | |
412 | Precondition failed (unable to deploy, such as template) | |
500 | Unexpected error |
Database Workload REST interface
Get database workload list
Get: /resources/databaseWorkloads
Response content-type | application/json | |
---|---|---|
Request body |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Retrieve database workload detail specified by Database Workload ID
Get: /resources/databaseWorkloads/{db_workloadid}
Response content-type | application/json | |
---|---|---|
Request body |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Database VM Logging REST interface
Get log list from a database VM specified by Database ID and Virtual Machine ID
Get: /log/virtualApplications/{dbid} /virtualMachines/{vmid}
Example URL | https://localhost/log/virtualApplications/d-f8ac5627-a14e-417a-a56e-7084475ab704/virtualMachines/database-db2.11315462912266 | |
---|---|---|
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Get log content from a database VM specified by Database ID and Virtual Machine ID and Log File Path
Get: /log/virtualApplications/{dbid} /virtualMachines/{vmid}/{logFilePath}
Example URL | https://locahost/log/virtualApplications/d-f8ac5627-a14e-417a-a56e-7084475ab704/virtualMachines/database-db2.11315462912266/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/logs/database-db2.11315462912266.DB2/console.log | |
---|---|---|
Request header | Range bytes=4849-484932767 (Range is used to specify the start and end position to get from the log file) |
|
Response content-type | text/plain | |
Request body | [2011-09-08 06:59:57,572] DB2/install.py 47904813321408 pid=14758 INFO Creating and configuring a DB2 instance [2011-09-08 06:59:57,618] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/tune_OS.sh [2011-09-08 07:00:17,967] DB2/install.py 47904813321408 pid=14758 INFO Creating and configuring a DB2 database [2011-09-08 07:00:17,967] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/tune_inst.sh [2011-09-08 07:01:17,343] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/tune_db.sh [2011-09-08 07:01:17,343] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/int_db.sh |
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Download log content from a database VM specified by Database ID and Virtual Machine ID and Log File Path
Get: /log/virtualApplications/{dbid} /virtualMachines/{vmid}/{logFilePath}?action=download
Example URL | https://locahost/log/virtualApplications/d-f8ac5627-a14e-417a-a56e-7084475ab704/virtualMachines/database-db2.11315462912266/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/logs/database-db2.11315462912266.DB2/console.log | |
---|---|---|
Response content-type | text/plain | |
Response header | Content-Disposition attachment; filename="_opt_IBM_WebSphere_AppServer_profiles_AppSrv01_logs_server1_native_stdout.log" | |
Request body example | [2011-09-08 06:59:57,572] DB2/install.py 47904813321408 pid=14758 INFO Creating and configuring a DB2 instance [2011-09-08 06:59:57,618] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/tune_OS.sh [2011-09-08 07:00:17,967] DB2/install.py 47904813321408 pid=14758 INFO Creating and configuring a DB2 database [2011-09-08 07:00:17,967] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/tune_inst.sh [2011-09-08 07:01:17,343] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/tune_db.sh [2011-09-08 07:01:17,343] DB2/install.py 47904813321408 pid=14758 ERROR not find the script:/opt/IBM/maestro/agent/usr/servers/database-db2.11315462912266/scripts/DB2/workloads/departmental_OLTP/int_db.sh |
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Customized Workload Standards REST interface
Create a customized database workload standard
POST /resources/databaseWorkloads
Example URL | https://localhost/resources/databaseWorkloads/ | |
---|---|---|
Response content-type | application/json | |
Request body example |
|
|
Response example |
|
|
Response header location | https://localhost/resources/databaseWorkloads/a82c2322-cd9b-4419-a184-84fec9515f9d | |
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
412 | Invalid parameter supplied, for example, the json file is invalid. | |
415 | Invalid content type | |
500 | Unexpected error |
Upload a compressed file for customized database workload standard specified by Database Workload Standard ID
PUT /resources/workloadFiles/{db_workload_standard_id}?filename={filename}
Example URL | https://localhost/resources/workloadFiles/a82c2322-cd9b-4419-a184-84fec9515f9d?filename=customized_oltp.zip | {filename} must be the same as the value of "workload_file" in the meta json file. |
---|---|---|
Request content-type | application/x-zip-compressed | |
Request body | Compressed file | |
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | Database workload standard specified by {db_workload_standard_id} is not found. | |
500 | Unexpected error |
List all database workload standards
GET /resources/databaseWorkloads/
Example URL | https://localhost/resources/databaseWorkloads/ | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Update a customized database workload standard specified by Database Workload Standard ID
PUT /resources/databaseWorkloads/{db_workload_standard_id}
Example URL | https://localhost/resources/databaseWorkloads/a82c2322-cd9b-4419-a184-84fec9515f9d | |
---|---|---|
Request content type | application/json | |
Request body example |
|
|
Response content type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | Database workload standard specified by {db_workload_standard_id} is not found. | |
412 | Invalid parameter supplied, for example, the json file is invalid. | |
500 | Unexpected error |
Download the compressed file of a customized database workload standard specified by Customized Database Workload Standard ID and compressed file name
GET /resources/dbdownloadzip/{db_workload_standard_id}/artifact/{File Name}
Example URL | https://locahost/resources/dbdownloadzip/a82c2322-cd9b-4419-a184-84fec9515f9d/artifact/customized_oltp.zip | |
---|---|---|
Response content type | application/octet-stream | |
Response body | The compressed file of the customized database workload standard | |
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | The compressed file of the customized database workload standard specified by {db_workload_standard_id} and {File Name} is not found. | |
500 | Unexpected error |
Download the compressed file of a default database workload standard specified by default Database Workload Standard ID and compressed file name
GET /resources/downloadSysZip/{db_workload_standard_id}/artifact/{File Name}
Example URL | https://locahost/resources/downloadSysZip/Departmental_OLTP.zip | |
---|---|---|
Response content type | application/zip | |
Response header | Content-Disposition attachment; filename="Departmental_OLTP.zip" | |
Response body | The compressed file of the pre-defined database workload standard | |
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Delete a customized database workload standard specified by Customized Database Workload Standard ID
DELETE /resources/databaseWorkloads/{db_workload_standard_id}
Example URL | https://localhost/resources/ databaseWorkloads/a82c2322-cd9b-4419-a184-84fec9515f9d | |
---|---|---|
Request content type | application/json | |
Request body example |
|
|
Response code | 200 | OK Note: If a database workload standard
specified by |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
409 | Conflict | |
500 | Unexpected error |
User Management REST interface
Create a user
POST /resources/virtualApplications/{dbid}/operations
Example URL | https://localhost:port /resources/virtualApplications/d-0a70a575-4bac-420e-8c7a-e663d2448e10/operations/ | |
---|---|---|
Response content-type | application/json | |
Request example |
|
|
Response body example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | The application specified by {dbid} is not found | |
500 | Unexpected error |
Change the password of a specified user
POST /resources/virtualApplications/{dbid}/operations
Example URL | https://localhost:port /resources/virtualApplications/d-0a70a575-4bac-420e-8c7a-e663d2448e10/operations/ | |
---|---|---|
Request content-type | application/json | |
Request example |
|
|
Response body example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | The application specified by {dbid} is not found | |
500 | Unexpected error |
List all users for the specified database
GET /resources/dbusers?deploymentID={dbid}
Example URL | https://localhost:port/resources/dbusers?deploymentID= d-0a70a575-4bac-420e-8c7a-e663d2448e10 | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Delete a specified user
POST /resources/virtualApplications/{dbid}/operations
Example URL | https://localhost:port/resources/virtualApplications/d-0a70a575-4bac-420e-8c7a-e663d2448e10/operations | |
---|---|---|
Request content type | application/json | |
Request body example |
|
|
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
DB2 Fix Pack REST interface
Create a DB2 fix pack
POST /resources/virtualApplications/{dbid}/operations
Example URL | https://localhost/resources/db2Fixes/ | |
---|---|---|
Request content-type | application/json | |
Request body example |
|
|
Response content-type | application/json | |
Response body example |
|
|
Response header location | https://localhost/resources/db2Fixes/cc0c684d-8ca4-4aa3-83e4-8436d5623a16 | |
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
412 | Invalid parameter supplied; for example, the json file may be invalid. | |
415 | Invalid content type | |
500 | Unexpected error |
Upload a package file by DB2 fix pack package name
PUT /resources/fixFiles/{packagename}
Example URL | https://localhost/resources/fixFiles/v9.7fp6_linuxx64_server.tgz | |
---|---|---|
Request content-type | application/x-compressed | |
Request body | The package file | |
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Update a package file by DB2 fix pack package name
PUT /resources/db2Fixes/{db_fixpack_id}
Example URL | https://localhost/resources/db2Fixes/cc0c684d-8ca4-4aa3-83e4-8436d5623a16 | |
---|---|---|
Request content-type | application/json | |
Request body example |
|
"id:" must be the same as {db2_fixpack_id} in the URL. |
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | The db2 fixpack specified by {db2_fixpack_id} is not found. | |
412 | Invalid parameter supplied; for example, the json file may be invalid. | |
500 | Unexpected error |
List all DB2 fix packs
GET /resources/db2Fixes /
Example URL | https://localhost/resources/db2Fixes/ | |
---|---|---|
Request content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
List all fix packs valid for DB2 upgrade
GET /resources/db2FixesKS?forMatadata=true
Example URL | https://localhost:port/resources/db2FixesKS?forMetadata=true | |
---|---|---|
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
List all DB2 fix packs valid for creating a database pattern or database instance
GET /resources/db2Fixes/
Example URL | https://localhost/resources/db2Fixes?forUI=true | |
---|---|---|
Response content-type | application/json | |
Response body example |
|
|
Response code | 200 | OK |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
500 | Unexpected error |
Create a database pattern that uses a DB2 fix pack
POST /resources/applicationPatterns
Example URL | https://localhost/resources/applicationPatterns/ | |
---|---|---|
Request body content type | Content-Type - application/json (body is the
application model json file) Content-Type - application/zip (body is a compressed file, including the application model and artifacts files) |
|
Request body example |
|
"app_type:" This must be “database” "patterntype:"
This must be “dbaas” purpose: retrieve the value from Get resources/databaseProvisionPurposes
"source:" This may be “defaultWorkloadStandardApproach" "workloadStandardApproach"
or "cloneApproach” fixpackName: Retrieve this through the "List all DB2 fix packs for creating a database pattern or database instance" operation. |
Request content-type | application/json | |
Response body example |
|
|
Response header location | https://localhost/resources/resources/applicationPatterns/a-bd0b540c-d285-4413-9095-cbbccc180261 | |
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
412 | Invalid parameter supplied; for example, the json file may be invalid. | |
415 | Invalid content type | |
500 | Unexpected error |
Deploy a database with a database pattern that uses a DB2 fix pack
POST /resources/applicationPatterns/{db_pattern_id}/virtualApplications
Request content-type | application/json | |
---|---|---|
Request body example |
|
"deployment_name:" An optional parameter
for database name. By default, it will be the name of database. "cloud_group:" A required parameter for deployment. |
Response content-type | application/json | |
Response header location | https://localhost/resources/applicationPatterns/a-bd0b540c-d285-4413-9095-cbbccc180261/virtualApplicationsd-7dadcdcc-d448-45e0-9103-1f3582aca870 | |
Response example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | The db2 fixpack specified by {db2_fixpack_id} is not found. | |
412 | Invalid parameter supplied; for example, the json file may be invalid. | |
500 | Unexpected error |
Upgrade a deployed database
POST /resources/virtualApplications/{dbid}/operations
Example URL | https://localhost:port /resources/virtualApplications/d-7dadcdcc-d448-45e0-9103-1f3582aca870/operations/ | |
---|---|---|
Response content-type | application/json | |
Request example |
|
fixpackName: Retrieve this through the "List all fix packs valid for DB2 upgrade" operation. |
Response body example |
|
|
Response code | 201 | Created |
401 | The user is not authorized to perform this action. | |
404 | The db2 fixpack specified by {db2_fixpack_id} is not found. | |
412 | Invalid parameter supplied; for example, the json file may be invalid. | |
500 | Unexpected error |
Upgrade database application
PUT /resources/virtualApplications/{dbid}
Example URL | https://localhost /resources/virtualApplications/d-fb6a73e7-f9a2-465f-8357-f26fd7b8a717 | |
---|---|---|
Request body content type | application/json | |
Request body example |
|
|
Response body example | true | |
Response code | 202 | Accepted |
401 | The user is not authorized to perform this action. | |
403 | Access forbidden | |
404 | Application specified by {dbid} is not found | |
409 | Conflict | |
412 | Invalid parameter supplied; for example, the json file may be invalid. | |
500 | Unexpected error |
Delete a specified DB2 fix pack
DELETE /resources/db2Fixes/{db2_fixpack_id}
Example URL | https://localhost/resources/db2Fixes/cc0c684d-8ca4-4aa3-83e4-8436d5623a16 | |
---|---|---|
Response content-type | application/json | |
Response example |
|
|
Response code | 200 | OK Note: If a db2 fixpack specified by {db2_fixpack_id} is not found, the 200 response code returns, response body: {"success": "false"}) |
401 | The user is not authorized to perform this action. | |
404 | Access forbidden | |
409 | Conflict | |
500 | Unexpected error |