Skip to content
Prev Previous commit
config changes
  • Loading branch information
suruchimalewar committed Nov 14, 2019
commit 5acf0aa99e342581dc8bf1368dace62dfd832739
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<#
.SYNOPSIS
This sample script demonstrates the use of NetBackup Trust Management APIs.

.DESCRIPTION
The script can be run using NetBackup 8.2 or higher.
It updates the exclude list configuration on the specified client. The exclude list is specified within the script below.

.EXAMPLE
./Config_trust_management_crud_operation.ps1 -MasterServer <masterServer> -UserName <username> -Password <password> -TrustedMasterServerName <Trusted master Server Name> [-DomainName <domainName> -DomainType <domainType>]
#>
Expand Down
2 changes: 1 addition & 1 deletion recipes/powershell/config/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### NetBackup API Code Samples for PowerShell
#### NetBackup API Code Samples for PowerShell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why reduce the header level? The first header should be level 1, not 3 or 4.


This directory contains code samples to invoke NetBackup config APIs using PowerShell.

Expand Down
3 changes: 2 additions & 1 deletion recipes/python/config/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### NetBackup Hosts Configuration Management API Code Samples
#### NetBackup Hosts Configuration Management API Code Samples

This directory contains Python scripts demonstrating the use of NetBackup Hosts Configuration Management APIs to update exclude list on a NetBackup host.

Expand All @@ -18,4 +18,5 @@ Use the following command to run the script. The command should be run from the

`python -W ignore -m config.hosts_exclude_list -hostName <hostName> -nbmaster <masterServer> -username <username> -password <password> [-domainName <domainName>] [-domainType <domainType>]`

`python -W ignore configure_storage_unit_end_to_end.py -nbmaster <master_server> -username <username> -password <password> -trust_payload <input JSON for trusted masters> -trusted_master_server_name <Trusted Master Server Name> [-domainname <domain_name>] [-domaintype <domain_type>]`
`Note: hostName is the name of the NetBackup host to set the exclude configuration. The exclude list is specified in the config/exclude_list file.`
2 changes: 1 addition & 1 deletion recipes/python/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_trusted_master_server_by_name(jwt, base_url, trustedmasterservername):
resp = requests.get(url, headers=headers, params=query_params, verify=False)

if resp.status_code != 200:
raise Exception('GET trusted master server with specific name failed with status code {} and {}'.format(resp.status_code, resp.json()))
raise Exception('GET Trusted master server with specific name failed with status code {} and {}'.format(resp.status_code, resp.json()))

return resp.json()

Expand Down
1 change: 1 addition & 0 deletions recipes/python/config/trust_management_crud_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def read_command_line_arguments():
elif trusted_master_server_name == "":
print("Please provide the value for 'trusted_master_server_name'")
exit()


print_usage()

Expand Down
1 change: 0 additions & 1 deletion snippets/powershell/config/Delete-NB-delete-trust.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down
1 change: 0 additions & 1 deletion snippets/powershell/config/Get-NB-get-media-server.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function InitialSetup()
}

InitialSetup

#####################################################################
# Global Variables
#####################################################################
Expand Down Expand Up @@ -117,7 +116,6 @@ $json = '{
}
}
'

$response_create_trust = Invoke-WebRequest `
-Uri $base_uri `
-Method POST `
Expand Down
2 changes: 1 addition & 1 deletion snippets/powershell/config/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### NetBackup API Code Samples for PowerShell
#### NetBackup API Code Samples for PowerShell

This directory contains code samples to invoke NetBackup REST APIs using PowerShell.

Expand Down
2 changes: 1 addition & 1 deletion snippets/python/config/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### NetBackup API Code Samples for Python
#### NetBackup API Code Samples for Python

This directory contains code samples to invoke NetBackup REST APIs using Python.

Expand Down
2 changes: 1 addition & 1 deletion snippets/python/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ def patch_trusted_master_server(jwt, base_url, file_name, trustedmasterservernam

if resp.status_code != 200:
raise Exception('Update trust between masters API failed with status code {} and {}'.format(resp.status_code, resp.json()))
print("\nThe trust is Upadated with status code: {}\n".format(resp.status_code))
print("\nThe Trust is Upadated with status code: {}\n".format(resp.status_code))
return resp.json()
1 change: 1 addition & 0 deletions snippets/python/config/create_trusted_master_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def read_command_line_arguments():
print("Please provide the value for 'payload'")
exit()


print_usage()

read_command_line_arguments()
Expand Down
1 change: 1 addition & 0 deletions snippets/python/config/delete_trust.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def read_command_line_arguments():
print("Please provide the value for 'trustedmasterservername'")
exit()


print_usage()

read_command_line_arguments()
Expand Down
1 change: 1 addition & 0 deletions snippets/python/config/get_media_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def read_command_line_arguments():
print("Please provide the value for 'password'")
exit()


print_usage()

read_command_line_arguments()
Expand Down
1 change: 1 addition & 0 deletions snippets/python/config/get_media_server_by_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def read_command_line_arguments():
print("Please provide the value for 'medianame'")
exit()


print_usage()

read_command_line_arguments()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def read_command_line_arguments():
print("Please provide the value for 'remotemasterserver'")
exit()


print_usage()

read_command_line_arguments()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def read_command_line_arguments():
print("Please provide the value for 'trustedmasterservername'")
exit()


print_usage()

read_command_line_arguments()
Expand Down
1 change: 1 addition & 0 deletions snippets/python/config/get_trusted_master_server_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def read_command_line_arguments():
print("Please provide the value for 'password'")
exit()


print_usage()

read_command_line_arguments()
Expand Down
1 change: 1 addition & 0 deletions snippets/python/config/patch_trusted_master_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def read_command_line_arguments():
print("Please provide the value for 'trustedmasterservername'")
exit()


print_usage()

read_command_line_arguments()
Expand Down