def test_get_support_data_retrieval_request_status(self):
       api = DiagnosticsApi()
       diagnostics_api = None
       try:
            diagnostics_api = api.get_support_data_retrieval_request_status(system_id="test", request_id="test")
            # For the DELETE calls, there's no reponse returned and we want to set that as a valid sdk call.
            if diagnostics_api is None:
                diagnostics_api = 1
       except (ApiException, IOError)  as exp:
             # The API call went through but got a HTTP errorcode, which means the SDK works
             diagnostics_api = 1

       self.assertNotEqual(diagnostics_api, None)
def process_alerts_settings(host, username, passwd):
    config = Configuration()
    config.host = "https://" + host
    config.username = username
    config.password = passwd
    config.verify_ssl = False

    #If verify_ssl is true then the certificate file should me made available.
    #This avoids insecure request warnings. Make the certificate available as illustrated below

    #config.ssl_ca_cert = "C:/prox-cert-export.pem"

    #Create a client object to use with the above defined configuration.
    api_client = ApiClient()
    config.api_client = api_client

    diag_api = DiagnosticsApi(api_client)

    try:
        #Get the config info
        dev_alert_cfg = diag_api.get_alert_configuration(
            "1")  # system_id=1 for embedded
    except ApiException as ae:
        print("There was an exception: {}.".format(ae.reason))
        sys.exit()

    print dev_alert_cfg
    print "---------------------"

    #Now Update config info
    #Populate the required fileds as necessary and then call update_asup_configuration()
    #The below example is for illustration only. change/populate updt_req fileds as necessary.

    updt_req = DeviceAlertConfiguration()

    updt_req.alerting_enabled = False
    updt_req.email_sender_address = ""
    updt_req.email_server_address = ""
    updt_req.send_additional_contact_information = False
    updt_req.additional_contact_information = ""
    updt_req.recipient_email_addresses = []

    try:
        #Update config info
        config_resp = diag_api.update_alert_configuration("1", updt_req)

    except ApiException as ae:
        print("There was an exception: {}.".format(ae.reason))
        sys.exit()
示例#3
0
# Create a configuration object and set the appropriate parameters
api_configuration = Configuration()
api_configuration.password = args.password
api_configuration.host = args.proxy
# For demonstration purposes, let's disable SSL verification
api_configuration.verify_ssl = False

# Now create the generic ApiClient object
# The ApiClient will utilize the Configuration object automatically
client = ApiClient()
# remove this prior to release
#print("client:\n{}".format(client.__dict__))
storage_api = StorageSystemsApi()
# remove this prior to release
#print("storage_api: \n{}".format(storage_api.__dict__))
diagnostics_api = DiagnosticsApi()
data_request = SupportDataRequest() # type, filename 
data_request.type = "supportBundle"
data_request.filename = "sampledata"
try:
    initial_response = diagnostics_api.start_support_data_retrieval_request(
        args.systemid, body=data_request)
except ApiException:
    print("An error occurred retrieving the support bundle.")
    sys.exit()
print("Response from DiagnosticsApi.start_support_data_retrieval:\n")
pprint.pprint(initial_response)
# Now we need to wait a bit for the bundle to be generated
# Lets check on the status periodically so we know when it's done
try:
    bundle_ready = False
示例#4
0
#NOTE:Modify the below variable to match your configuration.

config.host = "https://10.113.76.206:8443"
config.username = "******"
config.password = "******"
config.verify_ssl = False

#For embedded, the array ID is 1.

sys_id = "1"

#Create a client object to use with the above defined configuration.
api_client = ApiClient()
config.api_client = api_client

diag_api = DiagnosticsApi(api_client)

#Poupulate values for setting syslog configuration

alert_sys_log_server = AlertSyslogServer()

#Set the syslog server address and port number.
#Below values are for example only

alert_sys_log_server.port_number = "514"
alert_sys_log_server.server_name = "10.113.76.204"

alert_serv_list = []

alert_serv_list.append(alert_sys_log_server)