Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated On-Demand-Snapshot Function for MSSQL to support Multiple Objects #196

Closed
wants to merge 16 commits into from

Conversation

Draper1
Copy link
Member

@Draper1 Draper1 commented Feb 10, 2020

Description

Adds functionality to MSSQL on_demand_snapshot to allow multiple objects to be protected with a single call. This will now support:

  • Single/Multiple Specified Databases in format of: object_name = ['DB1','DB2'] or object_name = "DB1"
  • All User Databases within the specified MSSQL Instance
  • All System Databases within the specified MSSQL Instance
  • Support for Availability Groups with the previously mentioned states

NB: This introduces a small breaking change: sql_db variable has been removed from on_demand_snapshot as we now use object_name which is consistent with all other SDK methods.

Related Issue

#183

Motivation and Context

This means we no longer need to loop through a list of Databases, we can simply specify the DBs on the instances and protect them with a single call to the Python SDK.

How Has This Been Tested?

This has be tested locally.

Screenshots (if appropriate):

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTION document.
  • I have updated the CHANGELOG file accordingly for the version that this merge modifies.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Draper1 Draper1 requested a review from a team as a code owner February 10, 2020 11:16
@drew-russell
Copy link
Contributor

@Draper1 Looks like the unit tests are failing. Can you take a look?

@drew-russell
Copy link
Contributor

@Draper1

Looks like we are adding two new variables here: sql_db_type=None, sql_ag=None

We need to update the doc string and user docs with these new variables. Ramzi updated the docs/create_docs.py script so you should be able to just run that and the use docs will be created based off of the doc strings.

Digging into the unit tests more.

These two functions are both returning blank lists in the return tuple:

rubrik.on_demand_snapshot("object_name", "mssql_db", sql_host="sql_host", sql_instance="sql_instance")

rubrik.on_demand_snapshot("object_name", "mssql_db", "Gold", sql_host="sql_host", sql_instance="sql_instance")

E       AssertionError: assert ([], []) == ({'endTime': ...'href_string')
E         At index 0 diff: [] != {'id': 'string', 'status': 'string', 'progress': 0, 'startTime': '2019-05-05T18:57:06.003Z', 'endTime': '2019-05-05T18:57:06.003Z', 'nodeId': 'string', 'error': {'message': 'string'}, 'links': [{'href': 'href_string', 'rel': 'string'}]}
E         Use -v to get the full diff

@drew-russell
Copy link
Contributor

@Draper1 going to close this one out. Let me know if you have cycles to cirlce back on it.

@drew-russell drew-russell deleted the issue-183 branch July 16, 2020 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants