Solved

Setting Advanced Backup Options for SQL Server Default subclients through REST API

  • 14 June 2022
  • 8 replies
  • 267 views

Badge +1

Can anyone point me towards the documentation on how to set the Advanced Backup Options for SQL Server Default subclients through REST API? I can’t seem to find where to set these in the API docs. I’ve attached an image of the props I’m looking for.

icon

Best answer by Mike Struening RETIRED 14 June 2022, 20:49

View original

8 replies

Userlevel 7
Badge +23

Great question, @dgberrid !

I would start here:

https://documentation.commvault.com/v11/essential/45631_rest_api_post_agent_properties.html

It’s a generic Agent post, though it should work for your needs.

Here’s the API site section for this one:

https://api.commvault.com/#117734a5-9a89-3371-db6c-793eca48e650

If it doesn’t do what you need, let me know the specifics and I’ll investigate for you 🤓

Badge +1

Thanks for the response, I looked through the documentation you linked but there doesn’t appear to be a parameter specifically for ‘Check sum’ or ‘Copy-only’ options which is what I am trying to set for the default subclient advanced backup options. 

I’ve searched through the api doc for those properties, looking for names such as copyOnly, checksum or other variants but am unable to find anything similar. 

I was able to find one place where these are being set but its in the sqlsubclient module for the Python sdk https://github.com/Commvault/cvpysdk/blob/master/cvpysdk/subclients/sqlsubclient.py.

You can see the properties there on line 256...
 

   advanced_options["dataOpt"] = {
"enableIndexCheckPointing": False,
"verifySynthFull": True,
"startLogBackupAfterSuccessfullBackup":
"start_log_backup_after_successfull_backup" in data_options,
"tailLogBackup": "tail_log_backup" in data_options,
"partailSqlBkp": "partial_sql_backup" in data_options,
"useSqlCompression": "use_sql_compression" in data_options,
"useCatalogServer": False,
"enforceTransactionLogUsage": False,
"copyOnly": "copy_only" in data_options,
"skipConsistencyCheck": False,
"skipCatalogPhaseForSnapBackup": True,
"runIntegrityCheck": False,
"checksum": "checksum" in data_options,
"continueaftererror": "continue_after_error" in data_options,
"allowDiffBackupOnReadOnly": "allow_diff_backup_on_read_only" in data_options
}

 I see the some of these properties in the API docs such as the first property listed above ‘enableIndexCheckPointing’ which is documented here…

https://documentation.commvault.com/11.24/essential/48754_rest_api_get_schedule_properties.html

But other properties such as ‘copyOnly’ and ‘checksum’ are not present.

Userlevel 7
Badge +23

Let me see if I can get a dev to reply here and advise on the best path for you!

Userlevel 7
Badge +23

@dgberrid I spoke to some of our devs and they advised to use this:

https://documentation.commvault.com/11.24/essential/45783_rest_api_post_create_task_backup.html

Copy only and Checksums are coming under DataOpt

Badge +1

@Mike Struening thank you for the information. Unfortunately, this is almost what I was aiming for but not exactly. When I create the task through the API using the documentation provided it does set the checksum and copyOnly options on an individual schedule associated with the default subclient but it does not set those options on the actual subclient itself from what I can tell.

The specific options I’m looking to set are found by right clicking the default subclient and selecting the ‘backup’ option and clicking the advanced button and setting those options in the Data tab.

 

I’ve attached two images showing the ways I’m viewing these settings. You can see in the ‘checkSumsSet.png’ I am looking at advanced options on the schedule I’ve posted through the API and the checksum is set as I want. But, in the second image ‘advancedOptions.png’ I right click on the default subclient itself selecting the ‘backup’ option and then hit the advanced button and the checksum is not set. It is the latter option that I am trying to set.

Userlevel 7
Badge +23

@dgberrid , I heard back regarding your reply:

There is no such things as subclient options for things he is looking for. Options he is looking for are backup options. So he can either set it on job or on job within the schedule. Whatever screenshots he is showing to you are from backup screen.

Let me know if that clarifies.

Badge +1

@Mike Struening ok, I think I understand now, the screen shot I was showing was for a one time backup and not a setting for all backups under the subclient. Is that correct?

Userlevel 7
Badge +23

Yup!

Reply