def get_organization_uplinks_loss_and_latency(self, options=dict()): """Does a GET request to /organizations/{organizationId}/uplinksLossAndLatency. Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: organization_id -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 365 days from today. t_1 -- string -- The end of the timespan for the data. t1 can be a maximum of 5 minutes after t0. The latest possible time that t1 can be is 2 minutes into the past. timespan -- float -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 5 minutes. The default is 5 minutes. uplink -- UplinkEnum -- Optional filter for a specific WAN uplink. Valid uplinks are wan1, wan2, cellular. Default will return all uplinks. ip -- string -- Optional filter for a specific destination IP. Default will return all destination IPs. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( organization_id=options.get("organization_id")) # Prepare query URL _url_path = '/organizations/{organizationId}/uplinksLossAndLatency' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'organizationId': options.get('organization_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t_0', None), 't1': options.get('t_1', None), 'timespan': options.get('timespan', None), 'uplink': options.get('uplink', None), 'ip': options.get('ip', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_pii_sm_owners_for_key(self, options=dict()): """Does a GET request to /networks/{networkId}/pii/smOwnersForKey. Given a piece of Personally Identifiable Information (PII), return the Systems Manager owner ID(s) associated with that identifier. These owner IDs can be used with the Systems Manager API endpoints to retrieve owner details. Exactly one identifier will be accepted. ## ALTERNATE PATH ``` /organizations/{organizationId}/pii/smOwnersForKey ``` Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: username -- string -- The username of a Systems Manager user email -- string -- The email of a network user account or a Systems Manager device mac -- string -- The MAC of a network client device or a Systems Manager device serial -- string -- The serial of a Systems Manager device imei -- string -- The IMEI of a Systems Manager device bluetooth_mac -- string -- The MAC of a Bluetooth client Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id")) # Prepare query URL _url_path = '/networks/{networkId}/pii/smOwnersForKey' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'networkId': options.get('network_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'username': options.get('username', None), 'email': options.get('email', None), 'mac': options.get('mac', None), 'serial': options.get('serial', None), 'imei': options.get('imei', None), 'bluetoothMac': options.get('bluetooth_mac', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_organization_inventory(self, options=dict()): """Does a GET request to /organizations/{organizationId}/inventory. Return the inventory for an organization Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: organization_id -- string -- TODO: type description here. Example: include_license_info -- bool -- When this parameter is true, each entity in the response will include the license expiration date of the device (if any). Only applies to organizations that support per-device licensing. Defaults to false. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( organization_id=options.get("organization_id")) # Prepare query URL _url_path = '/organizations/{organizationId}/inventory' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'organizationId': options.get('organization_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'includeLicenseInfo': options.get('include_license_info', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_bluetooth_client(self, options=dict()): """Does a GET request to /networks/{networkId}/bluetoothClients/{bluetoothClientId}. Return a Bluetooth client. Bluetooth clients can be identified by their ID or their MAC. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: bluetooth_client_id -- string -- TODO: type description here. Example: include_connectivity_history -- bool -- Include the connectivity history for this client connectivity_history_timespan -- int -- The timespan, in seconds, for the connectivityHistory data. By default 1 day, 86400, will be used. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), bluetooth_client_id=options.get("bluetooth_client_id")) # Prepare query URL _url_path = '/networks/{networkId}/bluetoothClients/{bluetoothClientId}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 'networkId': options.get('network_id', None), 'bluetoothClientId': options.get('bluetooth_client_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'includeConnectivityHistory': options.get('include_connectivity_history', None), 'connectivityHistoryTimespan': options.get('connectivity_history_timespan', None) } _query_builder = APIHelper.append_url_with_query_parameters(_query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json' } # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_organization_api_requests(self, options=dict()): """Does a GET request to /organizations/{organizationId}/apiRequests. List the API requests made by an organization Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: organization_id -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 31 days from today. t_1 -- string -- The end of the timespan for the data. t1 can be a maximum of 31 days after t0. timespan -- int -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 31 days. per_page -- int -- The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. starting_after -- string -- A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. ending_before -- string -- A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. admin_id -- string -- Filter the results by the ID of the admin who made the API requests path -- string -- Filter the results by the path of the API requests method -- string -- Filter the results by the method of the API requests (must be 'GET', 'PUT', 'POST' or 'DELETE') response_code -- int -- Filter the results by the response code of the API requests Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( organization_id=options.get("organization_id")) # Prepare query URL _url_path = '/organizations/{organizationId}/apiRequests' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'organizationId': options.get('organization_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t0', None), 't1': options.get('t1', None), 'timespan': options.get('timespan', None), 'perPage': options.get('per_page', None), 'startingAfter': options.get('starting_after', None), 'endingBefore': options.get('ending_before', None), 'adminId': options.get('admin_id', None), 'path': options.get('path', None), 'method': options.get('method', None), 'responseCode': options.get('response_code', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_camera_video_link(self, options=dict()): """Does a GET request to /networks/{networkId}/cameras/{serial}/videoLink. Returns video link to the specified camera. If a timestamp is supplied, it links to that timestamp. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: serial -- string -- TODO: type description here. Example: timestamp -- string -- [optional] The video link will start at this timestamp. The timestamp is in UNIX Epoch time (milliseconds). If no timestamp is specified, we will assume current time. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), serial=options.get("serial")) # Prepare query URL _url_path = '/networks/{networkId}/cameras/{serial}/videoLink' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'serial': options.get('serial', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = {'timestamp': options.get('timestamp', None)} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def update_organization_saml_role(self, options=dict()): """Does a PUT request to /organizations/{organizationId}/samlRoles/{id}. Update a SAML role Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: organization_id -- string -- TODO: type description here. Example: id -- string -- TODO: type description here. Example: update_organization_saml_role -- UpdateOrganizationSamlRoleModel -- TODO: type description here. Example: Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( organization_id=options.get("organization_id"), id=options.get("id")) # Prepare query URL _url_path = '/organizations/{organizationId}/samlRoles/{id}' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'organizationId': options.get('organization_id', None), 'id': options.get('id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8' } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize( options.get('update_organization_saml_role'))) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_air_marshal(self, options=dict()): """Does a GET request to /networks/{networkId}/airMarshal. List Air Marshal scan results from a network Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 31 days from today. timespan -- float -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id")) # Prepare query URL _url_path = '/networks/{networkId}/airMarshal' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'networkId': options.get('network_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t_0', None), 'timespan': options.get('timespan', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_traffic(self, options=dict()): """Does a GET request to /networks/{networkId}/traffic. The traffic analysis data for this network. <a href="https://documentation.meraki.com/MR/Monitoring_and_Reporting/ Hostname_Visibility">Traffic Analysis with Hostname Visibility</a> must be enabled on the network. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 30 days from today. timespan -- float -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 30 days. device_type -- string -- Filter the data by device type: combined (default), wireless, switch, appliance. When using combined, for each rule the data will come from the device type with the most usage. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id")) # Prepare query URL _url_path = '/networks/{networkId}/traffic' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'networkId': options.get('network_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t_0', None), 'timespan': options.get('timespan', None), 'deviceType': options.get('device_type', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_sm_target_group(self, options=dict()): """Does a GET request to /networks/{networkId}/sm/targetGroups/{targetGroupId}. Return a target group Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: target_group_id -- string -- TODO: type description here. Example: with_details -- bool -- Boolean indicating if the the ids of the devices or users scoped by the target group should be included in the response Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( network_id=options.get("network_id"), target_group_id=options.get("target_group_id")) # Prepare query URL _url_path = '/networks/{networkId}/sm/targetGroups/{targetGroupId}' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'targetGroupId': options.get('target_group_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = {'withDetails': options.get('with_details', None)} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_events(self, options=dict()): """Does a GET request to /networks/{networkId}/events. List the events for the network Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: product_type -- string -- The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, and camera included_event_types -- list of string -- A list of event types. The returned events will be filtered to only include events with these types. excluded_event_types -- list of string -- A list of event types. The returned events will be filtered to exclude events with these types. device_mac -- string -- The MAC address of the Meraki device which the list of events will be filtered with device_serial -- string -- The serial of the Meraki device which the list of events will be filtered with device_name -- string -- The name of the Meraki device which the list of events will be filtered with client_ip -- string -- The IP of the client which the list of events will be filtered with. Only supported for track-by-IP networks. client_mac -- string -- The MAC address of the client which the list of events will be filtered with. Only supported for track-by-MAC networks. client_name -- string -- The name, or partial name, of the client which the list of events will be filtered with sm_device_mac -- string -- The MAC address of the Systems Manager device which the list of events will be filtered with sm_device_name -- string -- The name of the Systems Manager device which the list of events will be filtered with per_page -- int -- The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. starting_after -- string -- A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. ending_before -- string -- A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id")) # Prepare query URL _url_path = '/networks/{networkId}/events' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'networkId': options.get('network_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'productType': options.get('product_type', None), 'includedEventTypes': options.get('included_event_types', None), 'excludedEventTypes': options.get('excluded_event_types', None), 'deviceMac': options.get('device_mac', None), 'deviceSerial': options.get('device_serial', None), 'deviceName': options.get('device_name', None), 'clientIp': options.get('client_ip', None), 'clientMac': options.get('client_mac', None), 'clientName': options.get('client_name', None), 'smDeviceMac': options.get('sm_device_mac', None), 'smDeviceName': options.get('sm_device_name', None), 'perPage': options.get('per_page', None), 'startingAfter': options.get('starting_after', None), 'endingBefore': options.get('ending_before', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_clients_latency_stats(self, options=dict()): """Does a GET request to /networks/{networkId}/clients/latencyStats. Aggregated latency info for this network, grouped by clients Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 180 days from today. t_1 -- string -- The end of the timespan for the data. t1 can be a maximum of 7 days after t0. timespan -- int -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. ssid -- int -- Filter results by SSID vlan -- int -- Filter results by VLAN ap_tag -- string -- Filter results by AP Tag fields -- string -- Partial selection: If present, this call will return only the selected fields of ["rawDistribution", "avg"]. All fields will be returned by default. Selected fields must be entered as a comma separated string. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id")) # Prepare query URL _url_path = '/networks/{networkId}/clients/latencyStats' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 'networkId': options.get('network_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t0', None), 't1': options.get('t1', None), 'timespan': options.get('timespan', None), 'ssid': options.get('ssid', None), 'vlan': options.get('vlan', None), 'apTag': options.get('ap_tag', None), 'fields': options.get('fields', None) } _query_builder = APIHelper.append_url_with_query_parameters(_query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json' } # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_device_loss_and_latency_history(self, options=dict()): """Does a GET request to /networks/{networkId}/devices/{serial}/lossAndLatencyHistory. Get the uplink loss percentage and latency in milliseconds for a wired network device. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: serial -- string -- TODO: type description here. Example: ip -- string -- The destination IP used to obtain the requested stats. This is required. t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 365 days from today. t_1 -- string -- The end of the timespan for the data. t1 can be a maximum of 31 days after t0. timespan -- float -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. resolution -- int -- The time resolution in seconds for returned data. The valid resolutions are: 60, 600, 3600, 86400. The default is 60. uplink -- UplinkEnum -- The WAN uplink used to obtain the requested stats. Valid uplinks are wan1, wan2, cellular. The default is wan1. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), serial=options.get("serial"), ip=options.get("ip")) # Prepare query URL _url_path = '/networks/{networkId}/devices/{serial}/lossAndLatencyHistory' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'serial': options.get('serial', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'ip': options.get('ip', None), 't0': options.get('t_0', None), 't1': options.get('t_1', None), 'timespan': options.get('timespan', None), 'resolution': options.get('resolution', None), 'uplink': options.get('uplink', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_device_lldp_cdp(self, options=dict()): """Does a GET request to /networks/{networkId}/devices/{serial}/lldp_cdp. List LLDP and CDP information for a device Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: serial -- string -- TODO: type description here. Example: timespan -- int -- The timespan for which LLDP and CDP information will be fetched. Must be in seconds and less than or equal to a month (2592000 seconds). LLDP and CDP information is sent to the Meraki dashboard every 10 minutes. In instances where this LLDP and CDP information matches an existing entry in the Meraki dashboard, the data is updated once every two hours. Meraki recommends querying LLDP and CDP information at an interval slightly greater than two hours, to ensure that unchanged CDP / LLDP information can be queried consistently. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), serial=options.get("serial")) # Prepare query URL _url_path = '/networks/{networkId}/devices/{serial}/lldp_cdp' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'serial': options.get('serial', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = {'timespan': options.get('timespan', None)} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_organization_licenses(self, options=dict()): """Does a GET request to /organizations/{organizationId}/licenses. List the licenses for an organization Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: organization_id -- string -- TODO: type description here. Example: per_page -- int -- The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. starting_after -- string -- A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. ending_before -- string -- A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. device_serial -- string -- Filter the licenses to those assigned to a particular device network_id -- string -- Filter the licenses to those assigned in a particular network state -- StateEnum -- Filter the licenses to those in a particular state. Can be one of 'active', 'expired', 'expiring', 'unused', 'unusedActive' or 'recentlyQueued' Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( organization_id=options.get("organization_id")) # Prepare query URL _url_path = '/organizations/{organizationId}/licenses' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'organizationId': options.get('organization_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'perPage': options.get('per_page', None), 'startingAfter': options.get('starting_after', None), 'endingBefore': options.get('ending_before', None), 'deviceSerial': options.get('device_serial', None), 'networkId': options.get('network_id', None), 'state': options.get('state', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_device_clients(self, options=dict()): """Does a GET request to /devices/{serial}/clients. List the clients of a device, up to a maximum of a month ago. The usage of each client is returned in kilobytes. If the device is a switch, the switchport is returned; otherwise the switchport field is null. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: serial -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 31 days from today. timespan -- int -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(serial=options.get("serial")) # Prepare query URL _url_path = '/devices/{serial}/clients' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'serial': options.get('serial', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t0', None), 'timespan': options.get('timespan', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def update_network_ssid_l3_firewall_rules(self, options=dict()): """Does a PUT request to /networks/{networkId}/ssids/{number}/l3FirewallRules. Update the L3 firewall rules of an SSID on an MR network Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: number -- string -- TODO: type description here. Example: update_network_ssid_l_3_firewall_rules -- UpdateNetworkSsidL3FirewallRulesModel -- TODO: type description here. Example: Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), number=options.get("number")) # Prepare query URL _url_path = '/networks/{networkId}/ssids/{number}/l3FirewallRules' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'number': options.get('number', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8' } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize( options.get('update_network_ssid_l3_firewall_rules'))) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_client_latency_history(self, options=dict()): """Does a GET request to /networks/{networkId}/clients/{clientId}/latencyHistory. Return the latency history for a client. Clients can be identified by a client key or either the MAC or IP depending on whether the network uses Track-by-IP. The latency data is from a sample of 2% of packets and is grouped into 4 traffic categories: background, best effort, video, voice. Within these categories the sampled packet counters are bucketed by latency in milliseconds. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: client_id -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 791 days from today. t_1 -- string -- The end of the timespan for the data. t1 can be a maximum of 791 days after t0. timespan -- int -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 791 days. The default is 1 day. resolution -- int -- The time resolution in seconds for returned data. The valid resolutions are: 86400. The default is 86400. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), client_id=options.get("client_id")) # Prepare query URL _url_path = '/networks/{networkId}/clients/{clientId}/latencyHistory' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'clientId': options.get('client_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t0', None), 't1': options.get('t1', None), 'timespan': options.get('timespan', None), 'resolution': options.get('resolution', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_wireless_rf_profiles(self, options=dict()): """Does a GET request to /networks/{networkId}/wireless/rfProfiles. List the non-basic RF profiles for this network Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: include_template_profiles -- bool -- If the network is bound to a template, this parameter controls whether or not the non-basic RF profiles defined on the template should be included in the response alongside the non-basic profiles defined on the bound network. Defaults to false. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id")) # Prepare query URL _url_path = '/networks/{networkId}/wireless/rfProfiles' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'networkId': options.get('network_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'includeTemplateProfiles': options.get('include_template_profiles', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def update_network_client_splash_authorization_status( self, options=dict()): """Does a PUT request to /networks/{networkId}/clients/{clientId}/splashAuthorizationStatus. Update a client's splash authorization. Clients can be identified by a client key or either the MAC or IP depending on whether the network uses Track-by-IP. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: client_id -- string -- TODO: type description here. Example: update_network_client_splash_authorization_status -- UpdateNetworkClientSplashAuthorizationStatusModel -- TODO: type description here. Example: Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), client_id=options.get("client_id")) # Prepare query URL _url_path = '/networks/{networkId}/clients/{clientId}/splashAuthorizationStatus' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'clientId': options.get('client_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8' } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize( options.get( 'update_network_client_splash_authorization_status'))) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_device_camera_analytics_overview(self, options=dict()): """Does a GET request to /devices/{serial}/camera/analytics/overview. Returns an overview of aggregate analytics data for a timespan Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: serial -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 365 days from today. t_1 -- string -- The end of the timespan for the data. t1 can be a maximum of 7 days after t0. timespan -- int -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 1 hour. object_type -- ObjectTypeEnum -- [optional] The object type for which analytics will be retrieved. The default object type is person. The available types are [person, vehicle]. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(serial=options.get("serial")) # Prepare query URL _url_path = '/devices/{serial}/camera/analytics/overview' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'serial': options.get('serial', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t0', None), 't1': options.get('t1', None), 'timespan': options.get('timespan', None), 'objectType': options.get('object_type', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_client_traffic_history(self, options=dict()): """Does a GET request to /networks/{networkId}/clients/{clientId}/trafficHistory. Return the client's network traffic data over time. Usage data is in kilobytes. This endpoint requires detailed traffic analysis to be enabled on the Network-wide > General page. Clients can be identified by a client key or either the MAC or IP depending on whether the network uses Track-by-IP. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: client_id -- string -- TODO: type description here. Example: per_page -- int -- The number of entries per page returned. Acceptable range is 3 - 1000. starting_after -- string -- A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. ending_before -- string -- A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id"), client_id=options.get("client_id")) # Prepare query URL _url_path = '/networks/{networkId}/clients/{clientId}/trafficHistory' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'clientId': options.get('client_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'perPage': options.get('per_page', None), 'startingAfter': options.get('starting_after', None), 'endingBefore': options.get('ending_before', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_bluetooth_clients(self, options=dict()): """Does a GET request to /networks/{networkId}/bluetoothClients. List the Bluetooth clients seen by APs in this network Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: t_0 -- string -- The beginning of the timespan for the data. The maximum lookback period is 7 days from today. timespan -- float -- The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 7 days. The default is 1 day. per_page -- int -- The number of entries per page returned. Acceptable range is 5 - 1000. Default is 10. starting_after -- string -- A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. ending_before -- string -- A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. include_connectivity_history -- bool -- Include the connectivity history for this client Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(network_id=options.get("network_id")) # Prepare query URL _url_path = '/networks/{networkId}/bluetoothClients' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 'networkId': options.get('network_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 't0': options.get('t_0', None), 'timespan': options.get('timespan', None), 'perPage': options.get('per_page', None), 'startingAfter': options.get('starting_after', None), 'endingBefore': options.get('ending_before', None), 'includeConnectivityHistory': options.get('include_connectivity_history', None) } _query_builder = APIHelper.append_url_with_query_parameters(_query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json' } # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def claim_organization(self, options=dict()): """Does a POST request to /organizations/{organizationId}/claim. Claim a list of devices, licenses, and/or orders into an organization. When claiming by order, all devices and licenses in the order will be claimed; licenses will be added to the organization and devices will be placed in the organization's inventory. Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: organization_id -- string -- TODO: type description here. Example: claim_organization -- ClaimOrganizationModel -- TODO: type description here. Example: Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( organization_id=options.get("organization_id")) # Prepare query URL _url_path = '/organizations/{organizationId}/claim' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'organizationId': options.get('organization_id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8' } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize( options.get('claim_organization'))) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def add_network_switch_stack(self, options=dict()): """Does a POST request to /networks/{networkId}/switchStacks/{switchStackId}/add. Add a switch to a stack Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: network_id -- string -- TODO: type description here. Example: switch_stack_id -- string -- TODO: type description here. Example: add_network_switch_stack -- AddNetworkSwitchStackModel -- TODO: type description here. Example: Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters( network_id=options.get("network_id"), switch_stack_id=options.get("switch_stack_id"), add_network_switch_stack=options.get("add_network_switch_stack")) # Prepare query URL _url_path = '/networks/{networkId}/switchStacks/{switchStackId}/add' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'networkId': options.get('network_id', None), 'switchStackId': options.get('switch_stack_id', None) }) _query_builder = Configuration.base_uri _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8' } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize( options.get('add_network_switch_stack'))) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)
def get_network_splash_login_attempts(self, options=dict()): """Does a GET request to /networks/{id}/splashLoginAttempts. List the splash login attempts for a network Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: id -- string -- TODO: type description here. Example: ssid_number -- string -- Only return the login attempts for the specified SSID login_identifier -- string -- The username, email, or phone number used during login timespan -- string -- The timespan, in seconds, for the login attempts. The period will be from [timespan] seconds ago until now. The maximum timespan is 3 months Returns: mixed: Response from the API. Successful operation Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(id=options.get("id")) # Prepare query URL _url_path = '/networks/{id}/splashLoginAttempts' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'id': options.get('id', None)}) _query_builder = Configuration.base_uri _query_builder += _url_path _query_parameters = { 'ssidNumber': options.get('ssid_number', None), 'loginIdentifier': options.get('login_identifier', None), 'timespan': options.get('timespan', None) } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = {'accept': 'application/json'} # Prepare and execute request _request = self.http_client.get(_query_url, headers=_headers) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body)