Ejemplo n.º 1
0
    elif login_password == "":
        print("Please provide the value for 'login_password'")
        exit()
    elif expiryindays == "":
        print("Please provide the value for 'expiryindays'")
        exit()
    elif description == "":
        print("Please provide the value for 'description'")
        exit()


read_command_line_arguments()

base_url = protocol + "://" + nbmaster + ":" + str(port) + "/netbackup"

jwt = api_requests.perform_login(login_username, login_password, base_url,
                                 login_domainname, login_domaintype)

response = api_requests.apikey_create(jwt, base_url, expiryindays, description,
                                      apikey_username, apikey_domainname,
                                      apikey_domaintype)

apikey = response['data']['attributes']['apiKey']
apikey_tag = response['data']['id']
apikey_expiryDateTime = response['data']['attributes']['expiryDateTime']

print "Successfully created API Key"
print("API Key:" + apikey)
print("API Key Tag:" + apikey_tag)
print("API Key Expiration Date time:" + apikey_expiryDateTime)
        else:
            print_usage()
            exit()

    if nbmaster == "":
        print("Please provide the value for 'nbmaster'")
        exit()
    elif username == "":
        print("Please provide the value for 'username'")
        exit()
    elif password == "":
        print("Please provide the value for 'password'")
        exit()


print_disclaimer()

read_command_line_arguments()

base_url = protocol + "://" + nbmaster + ":" + str(port) + "/netbackup"

jwt = api_requests.perform_login(username, password, base_url, domainname,
                                 domaintype)

images = api_requests.get_netbackup_images(jwt, base_url)

data = images['data']

if len(data) > 0:
    print_image_details(data)
Ejemplo n.º 3
0
            password = sys.argv[i + 1]
        else:
            print_usage()
            exit()

    if nbmaster == "":
        print("Please provide the value for 'nbmaster'")
        exit()
    elif username == "":
        print("Please provide the value for 'username'")
        exit()
    elif password == "":
        print("Please provide the value for 'password'")
        exit()


print_disclaimer()

read_command_line_arguments()

base_url = protocol + "://" + nbmaster + ":" + str(port) + "/netbackup"

jwt = api_requests.perform_login(username, password, base_url)

alerts = api_requests.get_netbackup_alerts(jwt, base_url)

data = alerts['data']

if len(data) > 0:
    print_alert_details(data)