Provisioning DB2 databases
Use the following procedures to provision a DB2 database:
The base URL for the API is:
https://<managerHostName>/bda/rest/api
Creating a DB2 instance
Use the following procedure to create a DB2 instance.
Syntax
/1.0/db2/create_instance
Method
POST
Required parameters
The required parameters are as follows:
inst_name
—Use the display name of the instance.node
—Use the fully qualified nodeId.version
—Use the DB2 version for which you want to create the instance.template_id
—Use the ID provided in the templates of BDA interface.
Optional parameters
Use the parameter override_values
to override the custom field values in the supplied DB2 template. You must provide values in this field when the following conditions exist:
- The custom fields are not defined in the supplied template.
- You have not provided the default values in the supplied template.
Note
Use a comma to separate multiple override_values
, as shown in the following example:
override_values="cleanup_agent_logs=true,fenced_user_name=db2fenc1"
Example API response
A sample response is as follows:
{
"status": "success",
"status_code": 200,
"data": {
"job_id": "479",
"result": "Please check job '479' for info!!"
}
}
Example API command
A sample example is as follows:
Creating a DB2 database
Use the following procedure to create a DB2 database.
Syntax
/1.0/db2/create_db
Method
POST
Required parameters
The required parameters are as follows:
db_name
—Use the display name of the database.inst_name
—Use the display name of the instance.node
—Use the fully qualified nodeId.version
—Use the DB2 version for which you want to create the database.template_id
—Use the ID provided in the templates of BDA interface.
Optional parameters
Use the parameter override_values
to override the custom field values in the supplied DB2 template. You must provide values in this field when the following conditions exist:
- The custom fields are not defined in the supplied template.
- You have not provided the default values in the supplied template.
Note
Use a comma to separate multiple override_values
, as shown in the following example:
override_values="cleanup_agent_logs=true,fenced_user_name=db2fenc1"
Example API response
A sample response is as follows:
{
"status": "success",
"status_code": 200,
"data": {
"job_id": "479",
"result": "Please check job '479' for info!!"
}
}
Example API command
A sample example is as follows:
Starting a DB2 instance
Use the following procedure to start a DB2 instance.
Syntax
/1.0/db2/start
Method
POST
Required parameters
The required parameters are as follows:
inst_name
—Use the display name of the instance.node
—Use the fully qualified nodeId.node_ip
—Use the IP address of the Agent.hostname
—Use the host name of the Agent node.
Example API response
A sample response is as follows:
{
"status": "success",
"status_code": 200,
"data": {
"job_id": "479",
"result": "Please check job '479' for info!!"
}
}
Example API command
A sample example is as follows:
Stopping a DB2 instance
Use the following procedure to stop a DB2 instance.
Syntax
/1.0/db2/stop
Method
POST
Required parameters
The required parameters are as follows:
inst_name
—Use the display name of the instance.node
—Use the fully qualified nodeId.node_ip
—Use the IP address of the Agent.hostname
—Use the host name of the Agent node.
Example API response
A sample response is as follows:
{
"status": "success",
"status_code": 200,
"data": {
"job_id": "479",
"result": "Please check job '479' for info!!"
}
}
Example API command
A sample example is as follows:
curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" –data "inst_name=<inst_name>&node=<node_fqn>&node_ip=<node_ip>&hostname=<hostname>" https://my.bda.manager.com/bda/rest/api/1.0/db2/stop
Removing a DB2 database
Use the following procedure to remove a DB2 database.
Syntax
/1.0/db2/remove_db
Method
POST
Required parameters
The required parameters are as follows:
db_name
—Use the display name of the database.inst_name
—Use the display name of the instance.node
—Use the fully qualified nodeId.template_id
—Use the ID provided in the templates of BDA interface.
Example API response
A sample response is as follows:
{
"status": "success",
"status_code": 200,
"data": {
"job_id": "479",
"result": "Please check job '479' for info!!"
}
}
Example API command
A sample example is as follows:
Removing a DB2 instance
Use the following procedure to remove a DB2 instance.
Syntax
/1.0/db2/remove_instance
Method
POST
Required parameters
The required parameters are as follows:
inst_name
—Use the display name of the instance.node
—Use the fully qualified nodeId.template_id
—Use the ID provided in the templates of BDA interface.
Example API response
A sample response is as follows:
{
"status": "success",
"status_code": 200,
"data": {
"job_id": "479",
"result": "Please check job '479' for info!!"
}
}
Example API command
A sample example is as follows:
Comments
Log in or register to comment.