Beispiel #1
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 #2
0
    def update_network_bluetooth_settings(self, options=dict()):
        """Does a PUT request to /networks/{networkId}/bluetoothSettings.

        Update the Bluetooth settings for a network. See the docs page for <a
        href="https://documentation.meraki.com/MR/Bluetooth/Bluetooth_Low_Energ
        y_(BLE)">Bluetooth settings</a>.

        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_bluetooth_settings --
                        UpdateNetworkBluetoothSettingsModel -- 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}/bluetoothSettings'
        _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_bluetooth_settings')))
        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_firewalled_service(self,
                                          options=dict()):
        """Does a PUT request to /networks/{networkId}/firewalledServices/{service}.

        Updates the accessibility settings for 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:
                                            update_network_firewalled_service --
                        UpdateNetworkFirewalledServiceModel -- 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',
            '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_firewalled_service')))
        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 update_device_switch_port(self,
                                  options=dict()):
        """Does a PUT request to /devices/{serial}/switchPorts/{number}.

        Update 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:
                                            update_device_switch_port -- UpdateDeviceSwitchPortModel
                        -- 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',
            '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_device_switch_port')))
        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 claim_network_devices(self, options=dict()):
        """Does a POST request to /networks/{networkId}/devices/claim.

        Claim a device into 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: 
                    claim_network_devices -- ClaimNetworkDevicesModel -- 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"),
            claim_network_devices=options.get("claim_network_devices"))

        # Prepare query URL
        _url_path = '/networks/{networkId}/devices/claim'
        _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 = {'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_network_devices')))
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)
Beispiel #6
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 #7
0
    def update_network_client_policy(self, options=dict()):
        """Does a PUT request to /networks/{networkId}/clients/{clientId}/policy.

        Update the policy assigned to a client on the network. 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_policy --
                        UpdateNetworkClientPolicyModel -- 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}/policy'
        _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_policy')))
        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)