Source code for ciscoisesdk.api.v3_1_patch_1.misc

# -*- coding: utf-8 -*-
"""Cisco Identity Services Engine Misc API wrapper.

Copyright (c) 2021 Cisco and/or its affiliates.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""


from __future__ import absolute_import, division, print_function, unicode_literals

from builtins import *

from past.builtins import basestring

from ...pagination import get_next_page
from ...restsession import RestSession
from ...utils import (
    apply_path_params,
    check_type,
    dict_from_items_with_values,
    dict_of_str,
)


[docs]class Misc(object): """Identity Services Engine Misc API (version: 3.1_Patch_1). Wraps the Identity Services Engine Misc API and exposes the API as native Python methods that return native Python objects. # Cisco ISE 3.0 MNT REST APIs ## License [Cisco Sample Code License](https://developer.cisco.com/site/license/cisco-sample-code-license/) ## Status These are the status icons for the requests so far. - ⌗ : must create resources to test - 🚧 : incomplete | untested - 🛑 : unsupported | bug ## Environment Variables This collection uses environment variables in scripts in the **Tests** tab to store data (`id`, `name`, `portalId`, etc.) between requests. This allows you to `GET` or `POST` then immediately `GET {id}` on a resource. Using **No Environment** will cause this convenience functionality to fail so be sure to choose one. ## Collection Variables This collection includes some default variables that you will want to update or override with environment variables for your ISE deployment. Specfically, you will want to set: - `ise_mnt`: the ISE PAN node name or IP address. Default: `ise.securitydemo.net` - `rest_username`: the username for ERS API access. Must be a member of **SuperAdmin**, **ERSAdmin** or **ERSOperator** groups. Default: `admin` which is the ISE SuperAdmin - `rest_password`: Default: `C1sco12345` """ def __init__(self, session, object_factory, request_validator): """Initialize a new Misc object with the provided RestSession. Args: session(RestSession): The RESTful session object to be used for API calls to the Identity Services Engine service. Raises: TypeError: If the parameter types are incorrect. """ check_type(session, RestSession) super(Misc, self).__init__() self._session = session self._object_factory = object_factory self._request_validator = request_validator
[docs] def get_active_count(self, headers=None, **query_parameters): """ActiveCount. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/Session/ActiveCount') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_e629f554fa652d980ff08988c788c57_v3_1_patch_1', _api_response)
[docs] def get_active_list(self, headers=None, **query_parameters): """ActiveList. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/Session/ActiveList') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_a6c71a1e4d2597ea1b5533e9f1b438f_v3_1_patch_1', _api_response)
[docs] def get_session_auth_list(self, headers=None, **query_parameters): """Session/AuthList. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/Session/AuthList/null/null') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_d91e71e5b84583fb8ea91fcd9fb6751_v3_1_patch_1', _api_response)
[docs] def get_posture_count(self, headers=None, **query_parameters): """PostureCount. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/Session/PostureCount') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_d51ebdbbc75c0f8ed6161ae070a276_v3_1_patch_1', _api_response)
[docs] def get_profiler_count(self, headers=None, **query_parameters): """ProfilerCount. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/Session/ProfilerCount') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_bdb77066ba75002bd343de0e9120b86_v3_1_patch_1', _api_response)
[docs] def get_sessions_by_mac(self, mac, headers=None, **query_parameters): """Sessions by MAC. Args: mac(basestring): mac path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(mac, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'mac': mac, } e_url = ('/admin/API/mnt/Session/MACAddress/{mac}') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_b93e1accc1f35864b9a5b7bc478c7a7c_v3_1_patch_1', _api_response)
[docs] def get_sessions_by_username(self, username, headers=None, **query_parameters): """Sessions by Username. Args: username(basestring): username path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(username, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'username': username, } e_url = ('/admin/API/mnt/Session/UserName/{username}') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_e037613954b58692d89d64eba681_v3_1_patch_1', _api_response)
[docs] def get_sessions_by_nas_ip(self, nas_ipv4, headers=None, **query_parameters): """Sessions by NAS IP. Args: nas_ipv4(basestring): nas_ipv4 path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(nas_ipv4, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'nas_ipv4': nas_ipv4, } e_url = ('/admin/API/mnt/Session/IPAddress/{nas_ipv4}') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_fb7171efd5df8a0fe319983882265_v3_1_patch_1', _api_response)
[docs] def get_sessions_by_endpoint_ip(self, endpoint_ipv4, headers=None, **query_parameters): """Sessions by Endpoint IP. Args: endpoint_ipv4(basestring): endpoint_ipv4 path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(endpoint_ipv4, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'endpoint_ipv4': endpoint_ipv4, } e_url = ('/admin/API/mnt/Session/EndPointIPAddress/{endpoint_ipv4}') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_c7f72c6db5ecbb380133c106d0566_v3_1_patch_1', _api_response)
[docs] def get_sessions_by_session_id(self, session_id, headers=None, **query_parameters): """Sessions by SessionID. Args: session_id(basestring): session_id path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(session_id, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'session_id': session_id, } e_url = ('/admin/API/mnt/Session/Active/SessionID/{session_id}/0') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_eb415db854f5b12aa326bde54285c59_v3_1_patch_1', _api_response)
[docs] def delete_all_sessions(self, headers=None, **query_parameters): """Delete All Sessions. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/Session/Delete/All') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.delete(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.delete(endpoint_full_url, params=_params) return self._object_factory('bpm_bd2a2c3735c6ca7b59c86d428e222_v3_1_patch_1', _api_response)
[docs] def get_mnt_version(self, headers=None, **query_parameters): """MNT Version. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/Version') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_fc354ec4d361514a8e949f628f8e5f89_v3_1_patch_1', _api_response)
[docs] def get_failure_reasons(self, headers=None, **query_parameters): """FailureReasons. Args: headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { } e_url = ('/admin/API/mnt/FailureReasons') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_e346dbd9f9df554da3a3bcc06f4e77d5_v3_1_patch_1', _api_response)
[docs] def get_authentication_status_by_mac(self, mac, records, seconds, headers=None, **query_parameters): """AuthenticationStatus by MAC. Args: mac(basestring): MAC path parameter. seconds(basestring): SECONDS path parameter. records(basestring): RECORDS path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(mac, basestring, may_be_none=False) check_type(seconds, basestring, may_be_none=False) check_type(records, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'MAC': mac, 'SECONDS': seconds, 'RECORDS': records, } e_url = ('/admin/API/mnt/AuthStatus/MACAddress/{MAC}/{SECONDS}/{RE' + 'CORDS}/All') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_b26746235997bc32ace7d67d6987_v3_1_patch_1', _api_response)
[docs] def session_reauthentication_by_mac(self, endpoint_mac, psn_name, reauth_type, headers=None, **query_parameters): """Session Reauthentication by MAC. Args: psn_name(basestring): PSN_NAME path parameter. endpoint_mac(basestring): ENDPOINT_MAC path parameter. reauth_type(basestring): REAUTH_TYPE path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(psn_name, basestring, may_be_none=False) check_type(endpoint_mac, basestring, may_be_none=False) check_type(reauth_type, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'PSN_NAME': psn_name, 'ENDPOINT_MAC': endpoint_mac, 'REAUTH_TYPE': reauth_type, } e_url = ('/admin/API/mnt/CoA/Reauth/{PSN_NAME}/{ENDPOINT_MAC}/{REA' + 'UTH_TYPE}') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_f73477346fb5e7097d915c7f0a99659_v3_1_patch_1', _api_response)
[docs] def session_disconnect(self, disconnect_type , endpoint_ip, mac, nas_ipv4, psn_name, headers=None, **query_parameters): """Session Disconnect. Args: endpoint_ip(basestring): ENDPOINT_IP path parameter. psn_name(basestring): PSN_NAME path parameter. mac(basestring): MAC path parameter. disconnect_type (basestring): DISCONNECT_TYPE path parameter. nas_ipv4(basestring): NAS_IPV4 path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(endpoint_ip, basestring, may_be_none=False) check_type(psn_name, basestring, may_be_none=False) check_type(mac, basestring, may_be_none=False) check_type(disconnect_type , basestring, may_be_none=False) check_type(nas_ipv4, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'ENDPOINT_IP': endpoint_ip, 'PSN_NAME': psn_name, 'MAC': mac, 'DISCONNECT_TYPE': disconnect_type , 'NAS_IPV4': nas_ipv4, } e_url = ('/admin/API/mnt/CoA/Disconnect/{PSN_NAME}/{MAC}/{DISCONN' + 'ECT_TYPE}/{NAS_IPV4}/{ENDPOINT_IP}') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_a097870d5734861255a347911a24_v3_1_patch_1', _api_response)
[docs] def get_account_status_by_mac(self, duration, mac, headers=None, **query_parameters): """AccountStatus by MAC. Args: mac(basestring): mac path parameter. duration(basestring): duration path parameter. headers(dict): Dictionary of HTTP Headers to send with the Request . **query_parameters: Additional query parameters (provides support for parameters that may be added in the future). Returns: RestResponse: REST response with following properties: - headers(MyDict): response headers. - response(MyDict): response body as a MyDict object. Access the object's properties by using the dot notation or the bracket notation. - content(bytes): representation of the request's response - text(str): representation of the request's response Raises: TypeError: If the parameter types are incorrect. MalformedRequest: If the request body created is invalid. ApiError: If the Identity Services Engine cloud returns an error. """ check_type(headers, dict) if headers is not None: if 'Accept' in headers: check_type(headers.get('Accept'), basestring, may_be_none=False) with_custom_headers = False _headers = self._session.headers or {} if headers: _headers.update(dict_of_str(headers)) with_custom_headers = True check_type(mac, basestring, may_be_none=False) check_type(duration, basestring, may_be_none=False) _params = { } _params.update(query_parameters) _params = dict_from_items_with_values(_params) path_params = { 'mac': mac, 'duration': duration, } e_url = ('/admin/API/mnt/AcctStatus/MACAddress/{mac}/{duration}') endpoint_full_url = apply_path_params(e_url, path_params) if with_custom_headers: _api_response = self._session.get(endpoint_full_url, params=_params, headers=_headers) else: _api_response = self._session.get(endpoint_full_url, params=_params) return self._object_factory('bpm_ab0a3ec0359faa72142f074145f6a_v3_1_patch_1', _api_response)