def get_network_firewalled_service(self,
                                       options=dict()):
        """Does a GET request to /networks/{networkId}/firewalledServices/{service}.

        Return the accessibility settings of the given service ('ICMP', 'web',
        or 'SNMP')

        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: 
                    service -- string -- 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"),
                                 service=options.get("service"))

        # Prepare query URL
        _url_path = '/networks/{networkId}/firewalledServices/{service}'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': options.get('network_id', None),
            'service': options.get('service', None)
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _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_uplink_settings(self,
                                       options=dict()):
        """Does a PUT request to /networks/{networkId}/uplinkSettings.

        Updates the uplink settings for your MX 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: 
                    update_network_uplink_settings --
                        UpdateNetworkUplinkSettingsModel -- 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"))

        # Prepare query URL
        _url_path = '/networks/{networkId}/uplinkSettings'
        _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_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_uplink_settings')))
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body)
Beispiel #3
0
    def clone_organization(self,
                           options=dict()):
        """Does a POST request to /organizations/{organizationId}/clone.

        Create a new organization by cloning the addressed 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: 
                    clone_organization -- CloneOrganizationModel -- 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"),
                                 clone_organization=options.get("clone_organization"))

        # Prepare query URL
        _url_path = '/organizations/{organizationId}/clone'
        _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('clone_organization')))
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body)
Beispiel #4
0
    def get_network_client(self, options=dict()):
        """Does a GET request to /networks/{networkId}/clients/{clientId}.

        Return the client associated with the given identifier. 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: 

        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}'
        _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'}

        # 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)
Beispiel #5
0
    def get_device_camera_analytics_recent(self, options=dict()):
        """Does a GET request to /devices/{serial}/camera/analytics/recent.

        Returns most recent record for analytics zones

        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:
                                            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/recent'
        _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 = {'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_sm_target_groups(self, options=dict()):
        """Does a GET request to /networks/{networkId}/sm/targetGroups.

        List the target groups 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: 
                    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"))

        # Prepare query URL
        _url_path = '/networks/{networkId}/sm/targetGroups'
        _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 = {'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)
Beispiel #7
0
    def add_query_parameter(self, name, value):
        """ Add a query parameter to the HttpRequest.

        Args:
	        name (string): The name of the query parameter.
            value (string): The value of the query parameter.

        """
        self.query_url = APIHelper.append_url_with_query_parameters(self.query_url,
                                                                    {name:value})
        self.query_url = APIHelper.clean_url(self.query_url)
Beispiel #8
0
    def get_device_switch_port(self,
                               options=dict()):
        """Does a GET request to /devices/{serial}/switchPorts/{number}.

        Return a switch port

        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:
                                            number -- string -- 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(serial=options.get("serial"),
                                 number=options.get("number"))

        # Prepare query URL
        _url_path = '/devices/{serial}/switchPorts/{number}'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'serial': options.get('serial', 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'
        }

        # 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 delete_network_pii_request(self,
                                   options=dict()):
        """Does a DELETE request to /networks/{networkId}/pii/requests/{requestId}.

        Delete a restrict processing PII request
        ## ALTERNATE PATH
        ```
        /organizations/{organizationId}/pii/requests/{requestId}
        ```

        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: 
                    request_id -- string -- TODO: type description here.
                        Example: 

        Returns:
            void: 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"),
                                 request_id=options.get("request_id"))

        # Prepare query URL
        _url_path = '/networks/{networkId}/pii/requests/{requestId}'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': options.get('network_id', None),
            'requestId': options.get('request_id', None)
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare and execute request
        _request = self.http_client.delete(_query_url)
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)
    def get_network_pii_requests(self,
                                 network_id):
        """Does a GET request to /networks/{networkId}/pii/requests.

        List the PII requests for this network or organization
        ## ALTERNATE PATH
        ```
        /organizations/{organizationId}/pii/requests
        ```

        Args:
            network_id (string): 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=network_id)

        # Prepare query URL
        _url_path = '/networks/{networkId}/pii/requests'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': network_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _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 delete_organization_admin(self, options=dict()):
        """Does a DELETE request to /organizations/{organizationId}/admins/{id}.

        Revoke all access for a dashboard administrator within this
        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: 
                    id -- string -- TODO: type description here. Example: 

        Returns:
            void: 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}/admins/{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 and execute request
        _request = self.http_client.delete(_query_url)
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)
    def execute_request(self, request, binary=False):
        """Executes an HttpRequest.

        Args:
            request (HttpRequest): The HttpRequest to execute.
            binary (bool): A flag which should be set to True if
                a binary response is expected.

        Returns:
            HttpContext: The HttpContext of the request. It contains,
                both, the request itself and the HttpResponse object.

        """
        # Invoke the on before request HttpCallBack if specified
        if self.http_call_back != None:
            self.http_call_back.on_before_request(request)

        # Add global headers to request
        request.headers = APIHelper.merge_dicts(self.global_headers, request.headers)

        # Invoke the API call to fetch the response.
        func = self.http_client.execute_as_binary if binary else self.http_client.execute_as_string
        response = func(request)
        context = HttpContext(request, response)

        # Invoke the on after response HttpCallBack if specified
        if self.http_call_back != None:
            self.http_call_back.on_after_response(context)

        return context
Beispiel #13
0
    def remove_network_device(self, options=dict()):
        """Does a POST request to /networks/{networkId}/devices/{serial}/remove.

        Remove a single 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:
                        
        Returns:
            void: 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}/remove'
        _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_url = APIHelper.clean_url(_query_builder)

        # Prepare and execute request
        _request = self.http_client.post(_query_url)
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)
Beispiel #14
0
    def get_network_bluetooth_settings(self,
                                       network_id):
        """Does a GET request to /networks/{networkId}/bluetoothSettings.

        Return the Bluetooth settings for a network. <a
        href="https://documentation.meraki.com/MR/Bluetooth/Bluetooth_Low_Energ
        y_(BLE)">Bluetooth settings</a> must be enabled on the network.

        Args:
            network_id (string): 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=network_id)

        # Prepare query URL
        _url_path = '/networks/{networkId}/bluetoothSettings'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': network_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _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)
Beispiel #15
0
    def create_organization(self, create_organization):
        """Does a POST request to /organizations.

        Create a new organization

        Args:
            create_organization (CreateOrganizationModel): 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(create_organization=create_organization)

        # Prepare query URL
        _url_path = '/organizations'
        _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(create_organization))
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body)
Beispiel #16
0
    def split_network(self,
                      network_id):
        """Does a POST request to /networks/{networkId}/split.

        Split a combined network into individual networks for each type of
        device

        Args:
            network_id (string): 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=network_id)

        # Prepare query URL
        _url_path = '/networks/{networkId}/split'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': network_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'accept': 'application/json'
        }

        # Prepare and execute request
        _request = self.http_client.post(_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)
Beispiel #17
0
    def get_network_switch_settings_qos_rules_order(self,
                                                    network_id):
        """Does a GET request to /networks/{networkId}/switch/settings/qosRules/order.

        Return the quality of service rule IDs by order in which they will be
        processed by the switch

        Args:
            network_id (string): 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=network_id)

        # Prepare query URL
        _url_path = '/networks/{networkId}/switch/settings/qosRules/order'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': network_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _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_shaping_dscp_tagging_options(self,
                                                         network_id):
        """Does a GET request to /networks/{networkId}/trafficShaping/dscpTaggingOptions.

        Returns the available DSCP tagging options for your traffic shaping
        rules.

        Args:
            network_id (string): 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=network_id)

        # Prepare query URL
        _url_path = '/networks/{networkId}/trafficShaping/dscpTaggingOptions'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': network_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _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)
Beispiel #19
0
    def get_organization_security_intrusion_settings(self,
                                                     organization_id):
        """Does a GET request to /organizations/{organizationId}/security/intrusionSettings.

        Returns all supported intrusion settings for an organization

        Args:
            organization_id (string): 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=organization_id)

        # Prepare query URL
        _url_path = '/organizations/{organizationId}/security/intrusionSettings'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'organizationId': organization_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _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)
Beispiel #20
0
    def get_device_switch_ports(self,
                                serial):
        """Does a GET request to /devices/{serial}/switchPorts.

        List the switch ports for a switch

        Args:
            serial (string): 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(serial=serial)

        # Prepare query URL
        _url_path = '/devices/{serial}/switchPorts'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'serial': serial
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _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)
Beispiel #21
0
    def unbind_network(self,
                       network_id):
        """Does a POST request to /networks/{networkId}/unbind.

        Unbind a network from a template.

        Args:
            network_id (string): TODO: type description here. Example: 

        Returns:
            void: 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=network_id)

        # Prepare query URL
        _url_path = '/networks/{networkId}/unbind'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': network_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare and execute request
        _request = self.http_client.post(_query_url)
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)
Beispiel #22
0
    def delete_organization(self,
                            organization_id):
        """Does a DELETE request to /organizations/{organizationId}.

        Delete an organization

        Args:
            organization_id (string): TODO: type description here. Example: 

        Returns:
            void: 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=organization_id)

        # Prepare query URL
        _url_path = '/organizations/{organizationId}'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'organizationId': organization_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare and execute request
        _request = self.http_client.delete(_query_url)
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)
    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_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)
Beispiel #25
0
    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/Host
        name_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: 
                    timespan -- string -- The timespan for the data. Must be
                        an integer representing a duration in seconds between
                        two hours and one month. (Mandatory.)
                    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"),
                                 timespan=options.get("timespan"))

        # 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 = {
            '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)
Beispiel #26
0
    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 -- 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 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('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)
Beispiel #27
0
    def get_network_splash_login_attempts(self,
                                          options=dict()):
        """Does a GET request to /networks/{networkId}/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::

                    network_id -- string -- TODO: type description here.
                        Example: 
                    ssid_number -- SsidNumberEnum -- Only return the login
                        attempts for the specified SSID
                    login_identifier -- string -- The username, email, or
                        phone number used during login
                    timespan -- int -- 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(network_id=options.get("network_id"))

        # Prepare query URL
        _url_path = '/networks/{networkId}/splashLoginAttempts'
        _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 = {
            '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)
Beispiel #28
0
    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)
Beispiel #29
0
    def get_network_clients(self, options=dict()):
        """Does a GET request to /networks/{networkId}/clients.

        List the clients that have used this network in the 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::

                    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 -- 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.
                    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}/clients'
        _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),
            'timespan': options.get('timespan', 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)
Beispiel #30
0
    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)