Skip to content

Commit a8c7c77

Browse files
Removed unwanted code
1 parent 2f855d1 commit a8c7c77

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

recipes/python/backup-restore/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ Pre-requisites:
77
- Python 3.5 or higher
88
- Python modules: `requests`
99

10-
1110
Use the following commands to run the scripts.
12-
- Single VM backup and restore
11+
### - Single VM backup and restore
1312

1413
`python single_vm_backup_restore.py --master_server <master_server> --master_username <master_username> --master_password <master_password> --vcenter_name <vcenter_name> --vcenter_username <vcenter_username> --vcenter_password <vcenter_password> --protection_plan_name <protection_plan_name> --clientvm <client_vm_name> --restore_vmname <restore_vm_name>`
1514

@@ -66,7 +65,7 @@ Execution flow of single VM backup and restore script:
6665
- Verify state of instant access recovery VM.
6766
- Perform the cleanup(e.g. remove instant access VM, subscription, protection plan and vcenter)
6867

69-
- Group VM backup and restore
68+
### - Group VM backup and restore
7069

7170
`python group_vm_backup_restore.py --master_server <master_server> --master_username <master_username> --master_password <master_password> --vcenter_name <vcenter_name> --vcenter_username <vcenter_username> --vcenter_password <vcenter_password> --protection_plan_name <protection_plan_name> --querystring <Query_string> --vip_group_name <group_name> --restore_vmname_prefix <restore_vmname_prefix>`
7271

recipes/python/backup-restore/backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
headers = {"Content-Type" : "application/vnd.netbackup+json;version=4.0"}
1010

11-
# Perform single VM backup
11+
# Perform VM backup
1212
def perform_backup(baseurl, token, protection_plan_id, asset_id, is_vm_group = 0):
1313
headers.update({'Authorization': token})
1414
url = baseurl + "servicecatalog/slos/" + protection_plan_id + "/backup-now"

recipes/python/backup-restore/common.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,21 @@ def get_storage_units(baseurl, token):
9292
print(f"Storage unit:[{storage_unit_name}] disable for instant access")
9393
raise Exception(f"Storage unit:[{storage_unit_name}] disabled for instant access")
9494

95-
# Protection plan
95+
# Create protection plan
9696
def create_protection_plan(baseurl, token, protection_plan_name, storage_unit_name):
9797
print(f"Create protection plan:[{protection_plan_name}]")
9898
headers.update({'Authorization': token})
99-
# Create protection plan
10099
payload = {}
101100
url = baseurl + 'servicecatalog/slos?meta=accessControlId'
102101

103102
cur_dir = os.path.dirname(os.path.abspath(__file__))
104-
# path = Path(cur_dir)
105-
# cur_dir = path.parent
106103
file_name = os.path.join(cur_dir, "create_protection_plan_template.json")
107104
f = open(file_name)
108105
data = json.load(f)
109106
data['data']['attributes']['name'] = protection_plan_name
110107
data['data']['attributes']['policyNamePrefix'] = protection_plan_name
111108
data['data']['attributes']['schedules'][0]['backupStorageUnit'] = storage_unit_name
112109
data['data']['attributes']['allowSubscriptionEdit'] = False
113-
print(f"Payload is:[{data}]")
114110

115111
status_code, response_text = rest_request('POST', url, headers, data=data)
116112
validate_response(status_code, 201, response_text)

recipes/python/backup-restore/restore.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ def create_instant_access_vm(baseurl, token, workload_type, backup_id, vcenter_n
114114
}
115115
}
116116
url = baseurl + "recovery/workloads/" + workload_type + "/instant-access-vms"
117-
print(f"Payload:[{payload}]")
118117
status_code, response_text = common.rest_request('POST', url, headers, data=payload)
119118
common.validate_response(status_code, 201, response_text)
120119
mount_id = response_text['data']['id']
@@ -148,7 +147,6 @@ def verify_instant_access_vmstate(baseurl, token, workload_type, backup_id, moun
148147
print(f"Verified instant access restore status:[{inst_access_vmstatus}]")
149148
return mount_id
150149

151-
152150
# Remove instant access VM
153151
def remove_instantaccess_vm(baseurl, token, mount_id):
154152
if mount_id:

0 commit comments

Comments
 (0)