Provisioning MSSQL databases


Use the following procedures to provision a Microsoft SQL Server (MSSQL) database:

The base URL for the API is:

https://<managerHostName>/bda/rest/api

Creating an MSSQL Server Instance

Use the following procedure to create an MSSQL Server Instance.

Syntax

/1.0/mssql/create_instance

Method

POST

Required parameters

  • inst_name—Use the name of the MSSQL Server Instance.
  • node—Use the fully qualified node name.
  • node_name—Use the host name of the Agent.
  • version—Use the MSSQL version you are using currently.
  • template_id—Use the ID provided in the templates of BDA interface.

Optional parameters

None

Response

{
    "status": "success",
    "status_code": 200,
    "data": {
        "job_id": "462",
        "result": "Please check job '462' for info!!"
    }
}

Example

To create an MSSQL Server Instance:

curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node=<node_fqn>&node_name=<hostname>&inst_name=<instance_name>&version=<mssql_version>&template_id=<template_id>" https://my.bda.manager.com/bda/rest/api/1.0/mssql/create_instance

Creating an MSSQL database

Use the following procedure to create an MSSQL database on an MSSQL Server Instance.

Syntax

/1.0/mssql/create_db

Method

POST

Required parameters

  • inst_name—Use the name of the MSSQL Server Instance.
  • node—Use the fully qualified node name.
  • node_name—Use the host name of the Agent.
  • db_name—Use the name of the MSSQL database.
  • template_id—Use the ID provided in the templates of BDA interface.

Optional parameters

None

Response

{
    "status": "success",
    "status_code": 200,
    "data": {
        "job_id": "467",
        "result": "Please check job '467' for info!!"
    }
}

Example

To create an MSSQL database on an MSSQL Server Instance:

curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node=<node_fqn>&node_name=<hostname>&inst_name=<instance_name>&db_name=<db_name>&template_id=<template_id>" https://my.bda.manager.com/bda/rest/api/1.0/mssql/create_db

Removing an MSSQL database

Use the following procedure to remove an MSSQL database.

Syntax

/1.0/mssql/remove_db

Method

POST

Required parameters

  • inst_name—Use the name of the MSSQL Server Instance.
  • node—Use the fully qualified node name.
  • node_name—Use the host name of the Agent.
  • db_name—Use the name of the MSSQL database.
  • template_id—Use the ID provided in the templates of BDA interface.

Optional parameters

None

Response

{
    "status": "success",
    "status_code": 200,
    "data": {
        "job_id": "468",
        "result": "Please check job '468' for info!!"
    }
}

Example

To remove an MSSQL database:

curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node=<node_fqn>&node_name=<hostname>&inst_name=<instance_name>&db_name=<db_name>&template_id=<template_id>" https://my.bda.manager.com/bda/rest/api/1.0/mssql/remove_db

Removing an MSSQL Server Instance

Use the following procedure to remove an MSSQL Server Instance.

Syntax

/1.0/mssql/remove_instance

Method

POST

Required parameters

  • inst_name—Use the name of the MSSQL Server Instance.
  • node—Use the fully qualified node name.
  • node_name—Use the host name of the Agent.
  • template_id—Use the ID provided in the templates of BDA interface.

Optional parameters

None

Response

{
    "status": "success",
    "status_code": 200,
    "data": {
        "job_id": "471",
        "result": "Please check job '471' for info!!"
    }
}

Example

To remove an MSSQL Server Instance:

curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node=<node_fqn>&node_name=<hostname>&inst_name=<instance_name>&template_id=<template_id>" https://my.bda.manager.com/bda/rest/api/1.0/mssql/remove_instance

Starting an MSSQL Server Instance

Use the following procedure to start an MSSQL Server Instance.

Syntax

/1.0/mssql/start

Method

POST

Required parameters

  • inst_name—Use the name of the MSSQL Server Instance.
  • node—Use the fully qualified node name.
  • node_name—Use the host name of the Agent.
  • node_ip—Use the IP address of the Agent.

Optional parameters

None

Response

{
    "status": "success",
    "status_code": 200,
    "data": {
        "job_id": "470",
        "result": "Please look  into job for result"
    }
}

Example

To start an MSSQL Server Instance:

curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node=<node_fqn>&node_name=<hostname>&inst_name=<instance_name>&node_ip=<node_ip>" https://my.bda.manager.com/bda/rest/api/1.0/mssql/start

Stopping an MSSQL Server Instance

Use the following procedure to stop an MSSQL Server Instance.

Syntax

/1.0/mssql/stop

Method

POST

Required parameters

  • inst_name—Use the name of the MSSQL Server Instance.
  • node—Use the fully qualified node name.
  • node_name—Use the host name of the Agent.
  • node_ip—Use the IP address of the Agent.

Optional parameters

None

Response

{
    "status": "success",
    "status_code": 200,
    "data": {
        "job_id": "469",
        "result": "Please look  into job for result"
    }
}

Example

To stop an MSSQL Server Instance:

curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node=<node_fqn>&node_name=<hostname>&inst_name=<instance_name>&node_ip=<node_ip>" https://my.bda.manager.com/bda/rest/api/1.0/mssql/stop


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Database Automation 20.23