Starting an ad hoc log backup job for SQL Servers

You can start an ad hoc job for SQL Server’s log backup:

Method and URI

To start an ad hoc log backup job for SQL Server objects, use a POST method and a URI for one of the following types of targets:

  • All databases on an SQL Server instance that does not use the Always On availability groups (AG) feature:

POST    https://{hostname|IPv4}/api/application/sql/
↪/instance/{applicationInstanceId}
  • A specific database on a standalone instance or a failover cluster instance (FCI):

POST    https://{hostname|IPv4}/api/application/sql/
↪/instance/{applicationInstanceId}
↪/database/{applicationDatabaseId}
  • All databases in an AG:

POST    https://{hostname|IPv4}/api/application/sql/
↪/databasegroup/{applicationDatabasegroupId}
  • A specific database in an AG:

POST    https://{hostname|IPv4}/api/application/sql/
↪/databasegroup/{applicationDatabasegroupId}
↪/database/{applicationDatabaseId}

Parameters

Parameter 1: action

Start an ad hoc log backup job.

  • Value: backuplogs

  • Type: System string. Required.

Data

None.

Example: Start an ad hoc log backup job for SQL Servers

Assume that you registered SQL Servers with IBM Spectrum Protect Plus and you want to start an ad hoc job for log backup.

A Python snippet that is similar to the following example can be used to start an ad hoc job for log backup:

_params = {"action": "backuplogs"}

requests.post('https://' + spp_ipv4 + '/api/application/sql/logbackupstatus',
    headers={...}, verify=...)

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK).

{
  "issuccess": true,
  "partial": false,
  "message": null,
  "instances": [
    {
      "name": "SQL-DALLAS1",
      "primaryKey": "3901715654",
      "databases": [
        {
          "name": "Sales_Americas",
          "primaryKey": "bdf61739552dc12302a4a15bb49a7bf0",
          "issuccess": true,
          "message": null,
          "recoveryTimestamp": null,
          "recoveryTransactionId": null,
          "appMetadata": null,
          "logMetadata": null,
          "transferDuration": 0,
          "transferSize": 0,
          "backupPaths": null
        },
        {
          "name": "Support_Americas",
          "primaryKey": "95e6eff67da3d3813c86675ba978b538",
          "issuccess": true,
          "message": null,
          "recoveryTimestamp": null,
          "recoveryTransactionId": null,
          "appMetadata": null,
          "logMetadata": null,
          "transferDuration": 0,
          "transferSize": 0,
          "backupPaths": null
        }
      ]
    },
    {
      "name": "SQL-DALLAS1",
      "primaryKey": "3901715654",
      "databases": [
        {
          "name": "Sales_Americas",
          "primaryKey": "bdf61739552dc12302a4a15bb49a7bf0",
          "issuccess": true,
          "message": null,
          "recoveryTimestamp": null,
          "recoveryTransactionId": null,
          "appMetadata": null,
          "logMetadata": null,
          "transferDuration": 0,
          "transferSize": 0,
          "backupPaths": null
        },
        {
          "name": "Support_Americas",
          "primaryKey": "95e6eff67da3d3813c86675ba978b538",
          "issuccess": true,
          "message": null,
          "recoveryTimestamp": null,
          "recoveryTransactionId": null,
          "appMetadata": null,
          "logMetadata": null,
          "transferDuration": 0,
          "transferSize": 0,
          "backupPaths": null
        }
      ]
    }
  ]
}