diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0e80852 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,174 @@ +# Contribution Guidelines + +If you're reading this, you're probably thinking about contributing to this +repository. We really appreciate that--thank you! + +This document provides guidelines on contributing to this repository. Please +follow these guidelines when creating issues, making commits, and submitting +pull requests. The repository maintainers review all pull requests and verify +that they conform to these guidelines before approving and merging. + +## Table Of Contents + +- [Contribution Guidelines](#contribution-guidelines) + - [Table Of Contents](#table-of-contents) + - [How Can I Contribute?](#how-can-i-contribute) + - [Contribution Ideas](#contribution-ideas) + - [What should I know before I get started?](#what-should-i-know-before-i-get-started) + - [Guidelines](#guidelines) + - [Licensing](#licensing) + - [Developer’s Certificate of Origin](#developers-certificate-of-origin) + - [Sign Your Work](#sign-your-work) + - [Coding Conventions](#coding-conventions) + - [Additional Notes](#additional-notes) + - [Resources](#resources) + +## How Can I Contribute? + +### Contribution Ideas + +1. Raise issues for bugs, features, and enhancements. +1. Submit updates and improvements to the documentation. +1. Submit articles and guides, which are also part of the documentation. +1. Help out repo maintainers by answering questions in + [Airheads Developer Community][airheads-link]. +1. Share feedback and let us know about interesting use cases in + [Airheads Developer Community][airheads-link]. + +### What should I know before I get started? + +The best way to directly collaborate with the project contributors is through +GitHub. + +- If you want to raise an issue such as a defect, an enhancement request, + feature request, or a general issue, please open a GitHub issue. +- If you want to contribute to our code by either fixing a problem, enhancing + some code, or creating a new feature, please open a GitHub pull request + against the development branch. + +> **Note:** All pull requests require an associated issue number, must be made +> against the **development** branch, and require acknowledgement of the DCO. +> See the [Licensing](#licensing) section below. + +Before you start to code, we recommend discussing your plans through a GitHub +issue, especially for more ambitious contributions. This gives other +contributors a chance to point you in the right direction, give you feedback +on your design, and help you find out if someone else is working on the same +thing. + +It is your responsibility to test and verify, prior to submitting a pull +request, that your updated code doesn't introduce any bugs. Please write a +clear commit message for each commit. Brief messages are fine for small +changes, but bigger changes warrant a little more detail (at least a few +sentences). + +Note that all patches from all contributors get reviewed. After a pull request +is made, other contributors will offer feedback. If the patch passes review, a +maintainer will accept it with a comment. When a pull request fails review, the +author is expected to update the pull request to address the issue until it +passes review and the pull request merges successfully. + +At least one review from a maintainer is required for all patches. + +### Guidelines + +This repo is maintained on a best-effort basis. The burden is on the submitter +and not the repo maintainers to ensure the following criteria are met when code +is submitted. + +- All code submissions must adhere to the structure of the repo: + - Lower-level functions and API calls must be saved in the /pyclearpass folder. + - High-level process-focused functions must be saved in the /workflows folder. + - Do not create new separate folders for submitted projects. + - Do not make copies of existing files to be saved in different folders. + - The objective is that all submissions build on the repo as a whole, rather + than creating multiple sub-projects housed in the repo. +- All Python code should conform to PEP-8 standards. The maintainers use + Pycharm IDE to perform this check. That does not require submitters to use + Pycharm, but regardless of the code editor used, the PEP-8 check must be + successful. +- All functions should have explanatory docstrings using the reStructuredText + format. +- All workflows should have a comment at the top explaining the configuration + steps the workflow performs, and any preconditions that need to be met + before running the script. +- Git commits should have clear, concise messages which explain the + changes made in the commit. +- Pull Requests (PRs) should contain a title and comments that explain the + impact of the PR. +- All code submitted for merge consideration must be tested by the submitter. + +## Licensing + +All contributions must include acceptance of the DCO: + +### Developer’s Certificate of Origin + +> Developer Certificate of Origin Version 1.1 +> +> Copyright © 2004, 2006 The Linux Foundation and its contributors. 660 +> York Street, Suite 102, San Francisco, CA 94110 USA +> +> Everyone is permitted to copy and distribute verbatim copies of this +> license document, but changing it is not allowed. +> +> Developer's Certificate of Origin 1.1 +> +> By making a contribution to this project, I certify that: +> +> (a) The contribution was created in whole or in part by me and I have +> the right to submit it under the open source license indicated in the +> file; or +> +> (b) The contribution is based upon previous work that, to the best of my +> knowledge, is covered under an appropriate open source license and I +> have the right under that license to submit that work with +> modifications, whether created in whole or in part by me, under the same +> open source license (unless I am permitted to submit under a different +> license), as indicated in the file; or +> +> (c) The contribution was provided directly to me by some other person +> who certified (a), (b) or (c) and I have not modified it. +> +> (d) I understand and agree that this project and the contribution are +> public and that a record of the contribution (including all personal +> information I submit with it, including my sign-off) is maintained +> indefinitely and may be redistributed consistent with this project or +> the open source license(s) involved. + +### Sign Your Work + +To accept the DCO, simply add this line to each commit message with your +name and email address (`git commit -s` will do this for you): + +```text +Signed-off-by: Jane Example +``` + +For legal reasons, no anonymous or pseudonymous contributions are +accepted. + +## Coding Conventions + +1. Python code should conform to PEP-8. PyCharm editor has a built-in PEP-8 + checker. +1. Since this is a collaborative project, document your code with comments that + will help other contributors understand the code you write. +1. When in doubt, follow conventions you see used in the source already. + +## Additional Notes + +> **Note:** Please don't file an issue to ask a question. Please reach out to +> us via email or disucssion forums. + +### Resources + +| Resource | Description | +| --- | --- | +| [Airheads Developer Community][airheads-link] | Aruba Airheads forum to discuss all things network automation. | +| [Aruba DevHub ClearPass Guides][devhub-link]| Aruba DevHub guides for ClearPass | +| [aruba-automation@hpe.com][email-link] | Distribution list email to contact the Aruba Automation technical marketing engineering team. | + +[airheads-link]: https://community.arubanetworks.com/t5/Developer-Community/bd-p/DeveloperCommunity +[devhub-link]: https://developer.arubanetworks.com/aruba-cppm/docs +[email-link]: mailto:aruba-automation@hpe.com diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/PKG-INFO b/PKG-INFO new file mode 100644 index 0000000..1450939 --- /dev/null +++ b/PKG-INFO @@ -0,0 +1,238 @@ +Metadata-Version: 2.1 +Name: pyclearpass +Version: 1.0.1 +Summary: This package contains all of the API functions to work with the ClearPass API. This package been built based on Aruba ClearPass v6.11 +Project-URL: Homepage, https://github.com/aruba/pyclearpass +Author-email: Aruba Automation +License-File: LICENSE +Classifier: Development Status :: 4 - Beta +Classifier: Intended Audience :: System Administrators +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Topic :: System :: Networking +Requires-Python: >=3.9 +Requires-Dist: requests>=2.24 +Requires-Dist: urllib3>=1.25.10 +Description-Content-Type: text/markdown + +# pyclearpass +## Aruba ClearPass V6.11 SDK +Aruba ClearPass SDK has been developed in Python v3.9 to utilise the full functionality of the Aruba ClearPass REST API environment. Each available REST API command is available for use in this module. All responses from the ClearPass API are in JSON format and any interactions with the API are logged within the Audit Viewer. + +This package has been uploaded to https://pypi.org/ (outstanding) and is also available to install via https://github.com/jazzyj123/pyclearpass. Installation instructions are provided below. +## Available API Categories +The following describes the available top level functionality of the ClearPass API available within this Python Package. +- Operations +- Certificate Authority +- Endpoint Visibility +- Enforcement Profile +- Global Server Configuration +- Guest Actions +- Guest Configuration +- Identities +- Insights +- Integrations +- Local Server Configuration +- Logs +- Platform Certificates +- Policy Elements +- Session Controls +- Tools and Utilities + +_This package comes without any warranties and should be used at your own risk._ + +## ClearPass Server Readiness +These steps list what is required on the ClearPass server: +1. Make sure you have the API Service enabled within Services. You may use the template to help you do this. +2. Create a new API Client within the ClearPass Guest Portal +a. client id = demo, +b. enabled, Operating Mode =Rest API, +c. Operator Profile = Pick one with apporpiate permission level or make a new one, +d. Grant Type = client credentials) +e. Acess Token Lifetime: 8 Hours +3. Optional but preferred, a valid SSL cerfificate + +If you need information, refer to the ClearPass configuration documentation for the API account - +https://developer.arubanetworks.com/aruba-cppm/docs/clearpass-configuration + +# Python Requirements +Ensure Python v3.9 or greater is installed on your operating system +# Package Installation +#### Method 1 - Installing Package from PyPi (not yet published!) +Run the following in a command line terminal to install the pip package - ```pip3 install pyclearpass``` or ```pip install pyclearpass```. This may vary between Operating Systems. + +#### Method 2 - Installing Package from Github (not using Git.exe) +1. Click into the Aruba Github Repository where the latest version of pyclearpass is located +2. Click Code (in green) and Download to Zip +3. Extract the zip file into a directory +4. Go into a command line terminal and change directory (cd) into the folder where you extracted the zipped file and then down one child folder. The folder contents should pyclearpass (FOLDER), LICENCE, pyproject.toml and README.md +5. In your command line terminal type ```python3 -m build``` or ```python -m build```. This will create a folder called dist with a file containing a .gz extension. +6. Run the following in a command line terminal to install the pip package - ```pip3 install pathtozip.gz``` or ```pip install pathtozip.gz```. This may vary between Operating Systems. + +#### Method 3 - Installing Package from Github (using Git.exe) +1. Install Git for your Operating System from https://git-scm.com/download +2. Run the following in a command line terminal to install the pip package - ```pip3 install git+https://github.com/aruba/pyclearpass``` or ```pip install git+https://github.com/aruba/pyclearpass```. This may vary between Operating Systems. +Note - whilst the repository is located on jazzyj123, you will need to install using ```pip3 install git+https://github.com/jazzyj123/pyclearpass``` or ```pip install git+https://github.com/jazzyj123/pyclearpass```. + +## Inital Usage Instructions +Within your Python favourite IDE enivronment, create an import reference +``` +from pyclearpass import * +``` +Create a object to login into ClearPass. The login object needs to be passed to use any function within the ClearPass API. +An example below shows how to create the login object. +>Note - The login object will contain the APIToken once any function has been used. +It grabs it once for the session and uses the same token through the execution of the rest of the script. + +``` +login = ClearPassAPILogin(server="https://yourserver.network.local:443/api",granttype="client_credentials", +clientsecret="myclientsecretexample", clientid="myclientidexample", verify_ssl=False) +``` +Find an API you want to use, by prefixing ```api``` in your IDE and intellisense will show the available APIs available. Each of the top level API category names are available as a module. Once you have chosen a specifc API to use, for example apiPolicyElements, it will show you the available methods if you suffix a . to the command - ```apiPolicyElements.``` + +The example below prints the roles available within the clearpass server. +``` +print(ApiPolicyElements.get_role(login)) +``` +By default, the example above to return the roles available within the clearpass server will only show the first 25 roles. If you want to view more, you have to adjust the limit. Placing your cursor over the .getRole will usually show you help about the method. +``` +print(ApiPolicyElements.get_role(login, limit=100)) +``` +## Help +Once you have written a specific API ```ApiName.FunctionName(```, placing your cursor over the command will show you help for the function and what the required parameters are (example is Visual Studio Code). The first parameter is always login. +You may also read the help for the function by calling ```help(ApiName.FunctionName)```. Each function contains a help section on how to use it. +## Python Package Upgrade Instructions +Once an update is available on the Python PyPi repository, you may upgrade your release by completing the following in a command line terminal - ```pip3 install pyclearpass --upgrade``` +## Uninstall Package Package +To remove the Python pyclearpass package, type the following command into a command line terminal - ```pip3 uninstall pyclearpass ``` or ```pip uninstall pyclearpass ``` + +## Further Usage Examples +#### Get Local Server Configuration +``` +LSCGCS = ApiLocalServerConfiguration.get_cluster_server(login) +print(json.dumps(LSCGCS['_embedded']['items'],indent=1)) +``` +#### Get Total End Point Count +``` +IGEP = ApiIdentities.get_endpoint(login, calculate_count='true') +print("Total MACs in Table: "+str(IGEP['count'])) +``` +#### Get Insight Device Details +``` +print(ApiLogs.get_insight_endpoint_ip_by_ip(login,ip="192.168.0.99")) +``` + +#### Get list of Admin Users +``` +AU = ApiGlobalServerConfiguration.get_admin_user(login) +for users in AU['_embedded']['items']: + print(users) +``` + +#### Add New Endpoint +``` +newEndPoint = { + "mac_address": "11:22:33:44:55:66", + "description": "Demo EndPoint 1", + "status": "Known" +} +print(ApiIdentities.new_endpoint(login,body=newEndPoint)) +``` +#### Add New Role +``` +role={"name": "Test1","description": "Test role made using the API Package in Python"} +print(ApiPolicyElements.new_role(login,body=role)) +``` + +#### Delete Role +``` +print(ApiPolicyElements.delete_role_name_by_name(login,name='Demo')) +``` + +#### Delete an Enforcement Policy +``` +print(ApiPolicyElements.delete_enforcement_policy_by_enforcement_policy_id(login,enforcement_policy_id='3058')) + +``` + +#### Create a new Enforcement Policy with staged initial rules and then a loop to create additional rules. +``` +newEnforcementPolicy= { + "name": "MPSK Demo", + "description": "MPSK Enforcement", + "enforcement_type": "RADIUS", + "default_enforcement_profile": "Deny Device", + "rule_eval_algo": "first-applicable", + "rules": ''} + +newEnforcementPolicyRules =({"rules":[]}) + +initialrule = { + "enforcement_profile_names": [ + "Sample Enforcement Policy" + ], + "condition": [ + { + "type": "Connection", + "name": "AP-Name", + "oper": "BEGINS_WITH", + "value": "APDemo" + } + ] + } +newEnforcementPolicyRules["rules"].append(initialrule) + +for id in range(9,11): + randompsk = random.randint(8000000,9000000) + epf ={ + "enforcement_profile_names": [ + "Sample Enforcement Policy" + + ], + "condition": [ + { + "type": "Connection", + "name": "AP-Name", + "oper": "BEGINS_WITH", + "value": "APNo"+str(id) + } + ] + } + + newEnforcementPolicyRules["rules"].append(epf) + +newEnforcementPolicy["rules"] = newEnforcementPolicyRules["rules"] +print(ApiPolicyElements.new_enforcement_policy(login,body=newEnforcementPolicy)) + +``` +>Note - you may find it easier to initially pull a working Enforcement Policy with minimal rules before trying to create a new one from scratch. For example, the rule evaluation in the GUI shows as 'First applicable', however in the backend it is shown as 'first-applicable'. This example is a working policy. It is demonstrated with a loop which could read an entry in a CSV file if adapted. + +#### Update an existing Enforcement Policy, retaining the original items and using a loop to add additional items +``` +epol = ApiPolicyElements.get_enforcement_policy_name_by_name(login, name="MPSK Enforcement") +OriginalRules = epol["rules"] +CombinedRules =({"rules":[]}) +for item in range(len(OriginalRules)): + CombinedRules["rules"].append(OriginalRules[item]) + +for no in range(9,11): + rule ={ + "enforcement_profile_names": [ + "Sample Enforcement Policy" + + ], + "condition": [ + { + "type": "Connection", + "name": "AP-Name", + "oper": "BEGINS_WITH", + "value": "APNo"+str(no) + } + ] + } + + CombinedRules["rules"].append(rule) + +ApiPolicyElements.update_enforcement_policy_name_by_name(login,name="MPSK Enforcement",body=CombinedRules) +``` \ No newline at end of file diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md new file mode 100644 index 0000000..28cbb21 --- /dev/null +++ b/RELEASE-NOTES.md @@ -0,0 +1,5 @@ +# 1.0.1 + +## Notable Changes +* This is the initial release for the ClearPass Python libraries. +* This package has been built based on Aruba ClearPass v6.11 \ No newline at end of file diff --git a/pyclearpass/__init__.py b/pyclearpass/__init__.py new file mode 100644 index 0000000..039fb59 --- /dev/null +++ b/pyclearpass/__init__.py @@ -0,0 +1,17 @@ +from pyclearpass.api_explorer_apioperations_v1 import * +from pyclearpass.api_explorer_certificateauthority_v1 import * +from pyclearpass.api_explorer_endpointvisibility_v1 import * +from pyclearpass.api_explorer_enforcementprofile_v1 import * +from pyclearpass.api_explorer_guestactions_v1 import * +from pyclearpass.api_explorer_globalserverconfiguration_v1 import * +from pyclearpass.api_explorer_guestconfiguration_v1 import * +from pyclearpass.api_explorer_identities_v1 import * +from pyclearpass.api_explorer_insight_v1 import * +from pyclearpass.api_explorer_integrations_v1 import * +from pyclearpass.api_explorer_localserverconfiguration_v1 import * +from pyclearpass.api_explorer_logs_v1 import * +from pyclearpass.api_explorer_platformcertificates_v1 import * +from pyclearpass.api_explorer_policyelements_v1 import * +from pyclearpass.api_explorer_sessioncontrol_v1 import * +from pyclearpass.api_explorer_toolsandutilities_v1 import * +from pyclearpass.common import * diff --git a/pyclearpass/api_explorer_apioperations_v1.py b/pyclearpass/api_explorer_apioperations_v1.py new file mode 100644 index 0000000..798052e --- /dev/null +++ b/pyclearpass/api_explorer_apioperations_v1.py @@ -0,0 +1,94 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_apioperations_v1.py + + +class ApiOperations(ClearPassAPILogin): + # Function Section Name:TokenEndpoint + # Function Section Description: Obtain an OAuth2 access token for making API calls + + def new_oauth(self, body=({})): + """ + Operation: Obtain an OAuth2 access token for making API calls + HTTP Status Response Codes: 200 OK, 400 Bad Request, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 400 Bad Request, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- TokenEndpoint {grant_type (string) = ['client_credentials' or 'password' or 'refresh_token']: OAuth2 authentication method,client_id (string): Client ID defined in API Clients,client_secret (string, optional): Client secret, required if the API client is not a public client,username (string, optional): Username for authentication, required for grant_type "password",password (string, optional): Password for authentication, required for grant_type "password",scope (string, optional): Scope of the access request,refresh_token (string, optional): Refresh token issued to the client, required for grant_type "refresh_token"} + Required Body Parameters (type(dict) body example)- { + "grant_type": "", + "client_id": "", + "client_secret": "", + "username": "", + "password": "", + "scope": "", + "refresh_token": "" + } + """ + url_path = "/oauth" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:TokenInfo + # Function Section Description: Returns OAuth2 authenticated client or user information + + def get_oauth_me(self, body=({})): + """ + Operation: Returns OAuth2 authenticated client or user information + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- TokenEndpoint {grant_type (string) = ['client_credentials' or 'password' or 'refresh_token']: OAuth2 authentication method,client_id (string): Client ID defined in API Clients,client_secret (string, optional): Client secret, required if the API client is not a public client,username (string, optional): Username for authentication, required for grant_type "password",password (string, optional): Password for authentication, required for grant_type "password",scope (string, optional): Scope of the access request,refresh_token (string, optional): Refresh token issued to the client, required for grant_type "refresh_token"} + Required Body Parameters (type(dict) body example)- { + "grant_type": "", + "client_id": "", + "client_secret": "", + "username": "", + "password": "", + "scope": "", + "refresh_token": "" + } + """ + url_path = "/oauth/me" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_oauth_me(self, body=({})): + """ + Operation: Returns OAuth2 authenticated client or user information + HTTP Status Response Codes: 200 OK, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- TokenInfo {info (string): Defaults to the operator profile name,name (string): Defaults to the authenticated username,... (string, optional): Additional properties may be returned for grant_type "password" if corresponding properties are defined in the OAuth API enforcement profile} + Required Body Parameters (type(dict) body example)- { + "info": "", + "name": "", + "...": "" + } + """ + url_path = "/oauth/me" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:TokenPrivileges + # Function Section Description: Determine the privileges available to the user + + def get_oauth_privileges(self, body=({})): + """ + Operation: Returns a list of privileges available to the user + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- TokenInfo {info (string): Defaults to the operator profile name,name (string): Defaults to the authenticated username,... (string, optional): Additional properties may be returned for grant_type "password" if corresponding properties are defined in the OAuth API enforcement profile} + Required Body Parameters (type(dict) body example)- { + "info": "", + "name": "", + "...": "" + } + """ + url_path = "/oauth/privileges" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) diff --git a/pyclearpass/api_explorer_certificateauthority_v1.py b/pyclearpass/api_explorer_certificateauthority_v1.py new file mode 100644 index 0000000..964b655 --- /dev/null +++ b/pyclearpass/api_explorer_certificateauthority_v1.py @@ -0,0 +1,372 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_certificateauthority_v1.py + + +class ApiCertificateAuthority(ClearPassAPILogin): + # Function Section Name:Certificate + # Function Section Description: Manage Onboard certificates + + def get_certificate( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of certificates + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/certificate" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_certificate_by_certificate_id(self, certificate_id=""): + """ + Operation: Get a certificate or certificate signing request + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: certificate_id, Description: Numeric ID of the certificate + """ + url_path = "/certificate/{certificate_id}" + dict_path = {"certificate_id": certificate_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def delete_certificate_by_certificate_id(self, certificate_id=""): + """ + Operation: Delete a certificate or certificate signing request + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: certificate_id, Description: Numeric ID of the certificate + """ + url_path = "/certificate/{certificate_id}" + dict_path = {"certificate_id": certificate_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:CertificateChain + # Function Section Description: Get a certificate and its trust chain + + def get_certificate_by_cert_id_chain(self, cert_id=""): + """ + Operation: Get a certificate and its trust chain + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: cert_id, Description: Numeric ID of the certificate + """ + url_path = "/certificate/{cert_id}/chain" + dict_path = {"cert_id": cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:CertificateExport + # Function Section Description: Export a certificate or certificate signing request + + def new_certificate_by_cert_id_export(self, cert_id="", body=({})): + """ + Operation: Export a certificate or certificate signing request + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: cert_id, Description: Numeric ID of the certificate + Required Body Parameters (body description)- CertificateExport {export_format (string) = ['p7b' or 'pem' or 'crt' or 'txt' or 'p12']: Select the file format for the exported item,include_chain (boolean, optional): Select this option to include the certificates for the CA and any intermediate certificate authorities,include_ca (string, optional) = ['all' or 'intermediate']: Select which certificate authorities to include.,export_password (string, optional): Passphrase to protect the PKCS#12 file,export_password2 (string, optional): Re-enter the passphrase} + Required Body Parameters (type(dict) body example)- { + "export_format": "", + "include_chain": false, + "include_ca": "", + "export_password": "", + "export_password2": "" + } + """ + url_path = "/certificate/{cert_id}/export" + dict_path = {"cert_id": cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:CertificateImport + # Function Section Description: Import a code-signing, trusted, or CA certificate + + def new_certificate_import(self, body=({})): + """ + Operation: Import a code-signing, trusted, or CA certificate + HTTP Status Response Codes: 200 OK, 400 Client Error, 401 Unprocessable Entity, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Client Error, 401 Unprocessable Entity, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- CertificateImport {ca_id (integer, optional) = ['1']: Numeric ID of the certificate authority,type (string) = ['trusted' or 'ca' or 'code-signing']: Type of certificate to import,certificate_file (string): Contents of certificate to import,certificate_file_encoding (string) = ['base64' or 'text']: Encoding used for 'certificate_file' parameter,key_file (string, optional): Contents of private key to import,key_file_encoding (string, optional) = ['base64' or 'text']: Encoding used for 'key_file' parameter,key_passphrase (string, optional): Enter the passphrase that was used to encrypt the private key. If the private key is not encrypted, leave this field blank} + Required Body Parameters (type(dict) body example)- { + "ca_id": 0, + "type": "", + "certificate_file": "", + "certificate_file_encoding": "", + "key_file": "", + "key_file_encoding": "", + "key_passphrase": "" + } + """ + url_path = "/certificate/import" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:CertificateNew + # Function Section Description: Create a new certificate signing request and private key + + def new_certificate_new(self, body=({})): + """ + Operation: Create a new certificate signing request and private key + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- CertificateNew {ca_id (integer) = ['1']: Select the certificate authority that will be used to sign this request,cert_type (string) = ['tls-client' or 'trusted' or 'ca' or 'code-signing' or 'https']: Select the type of certificate to create from this signing request,country (string): Enter the 2-letter ISO country code of your country,state (string): Enter the full name of your state or province,locality (string): Enter the name of your locality (town or city),organization (string): Enter the name of your organization or company,organizational_unit (string, optional): Enter the name of your organizational unit (e.g. section or division of the company),common_name (string): Enter a name for the certificate. This is the ‘common name’ of the digital certificate,email_address (string): Enter an email address,key_type (string) = ['rsa_1024' or 'rsa_2048' or 'rsa_4096' or 'ec_prime256v1' or 'ec_secp384r1']: Select the type of private key to create for the certificate,device_type (string, optional): Device type to store in certificate subject alternative name,device_udid (string, optional): Device UDID to store in certificate subject alternative name,device_imei (string, optional): Device IMEI to store in certificate subject alternative name,device_iccid (string, optional): Device ICCID to store in certificate subject alternative name,device_serial (string, optional): Device serial to store in certificate subject alternative name,mac_address (string, optional): List of MAC addresses to store in certificate subject alternative name,product_name (string, optional): Product name to store in certificate subject alternative name,product_version (string, optional): Product version to store in certificate subject alternative name,user_name (string, optional): Username to store in certificate subject alternative name,dns_name (string, optional): Host names to include in the Subject Alt Name extension. + Multiple values can be included, one per line,issue_cert (boolean, optional): Issue this certificate immediately,days (string, optional): The number of days before the certificate will expire,device_name (string, optional): Device name to store in certificate subject alternative name,custom_field (string, optional): Custom fields to store in certificate subject alternative name,user_email_address (string, optional): User’s email address to store in certificate subject alternative name} + Required Body Parameters (type(dict) body example)- { + "ca_id": 0, + "cert_type": "", + "country": "", + "state": "", + "locality": "", + "organization": "", + "organizational_unit": "", + "common_name": "", + "email_address": "", + "key_type": "", + "device_type": "", + "device_udid": "", + "device_imei": "", + "device_iccid": "", + "device_serial": "", + "mac_address": "", + "product_name": "", + "product_version": "", + "user_name": "", + "dns_name": "", + "issue_cert": false, + "days": "", + "device_name": "", + "custom_field": "", + "user_email_address": "" + } + """ + url_path = "/certificate/new" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:CertificateReject + # Function Section Description: Reject a certificate signing request + + def new_certificate_by_cert_id_reject(self, cert_id="", body=({})): + """ + Operation: Reject a certificate signing request + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: cert_id, Description: Numeric ID of the certificate signing request + Required Body Parameters (body description)- CertificateReject {confirm_reject (boolean, optional): Select this checkbox to confirm the rejection of this request} + Required Body Parameters (type(dict) body example)- { + "confirm_reject": false + } + """ + url_path = "/certificate/{cert_id}/reject" + dict_path = {"cert_id": cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:CertificateRequest + # Function Section Description: Import a certificate signing request + + def new_certificate_request(self, body=({})): + """ + Operation: Import a certificate signing request + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- CertificateRequest {ca_id (integer) = ['1']: Select the certificate authority that will be used to sign this request,file_csr_encoding (string, optional) = ['base64' or 'text']: Encoding used for 'file_csr' parameter,file_csr (string): Choose a digital certificate signing request to upload. This should be a PEM encoded PKCS#10 certificate request file,cert_type (string) = ['tls-client' or 'trusted' or 'ca' or 'code-signing' or 'https']: Select the type of certificate to create from this signing request,issue_cert (boolean, optional): To modify the subject of the certificate before signing, do not select this checkbox,days (string, optional): The number of days before the certificate will expire} + Required Body Parameters (type(dict) body example)- { + "ca_id": 0, + "file_csr_encoding": "", + "file_csr": "", + "cert_type": "", + "issue_cert": false, + "days": "" + } + """ + url_path = "/certificate/request" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:CertificateRevoke + # Function Section Description: Revoke a certificate + + def new_certificate_by_cert_id_revoke(self, cert_id="", body=({})): + """ + Operation: Revoke a certificate + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: cert_id, Description: Numeric ID of the certificate + Required Body Parameters (body description)- CertificateRevoke {ca_id (integer) = ['1']: Numeric ID of the certificate authority,confirm_revoke (boolean): Select this checkbox to confirm the certificate revocation} + Required Body Parameters (type(dict) body example)- { + "ca_id": 0, + "confirm_revoke": false + } + """ + url_path = "/certificate/{cert_id}/revoke" + dict_path = {"cert_id": cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:CertificateSignRequest + # Function Section Description: Sign a certificate signing request + + def new_certificate_by_cert_id_sign(self, cert_id="", body=({})): + """ + Operation: Sign a certificate signing request + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: cert_id, Description: Numeric ID of the certificate signing request + Required Body Parameters (body description)- CertificateSignRequest {ca_id (integer) = ['1']: Numeric ID of the certificate authority,days (integer): The number of days before the certificate will expire,confirm_sign (boolean): Select this checkbox to sign the request and issue a certificate,custom_subject (array[SubjectField], optional): If specified, a list of field/value pairs for the subject of the issued certificate,custom_subject_alt_name (array[SubjectAltNameField], optional): If specified, a list of field/value pairs for the subjectAltName of the issued certificate}SubjectField {field (string) = ['C' or 'ST' or 'L' or 'O' or 'OU' or 'CN' or 'emailAddress' or 'mdpsDeviceName' or 'mdpsDeviceType' or 'mdpsMacAddress' or 'mdpsDeviceSerial' or 'mdpsDeviceImei' or 'mdpsDeviceIccid' or 'mdpsDeviceUdid' or 'mdpsProductName' or 'mdpsProductVersion' or 'mdpsUserName' or 'mdpsEmailAddress' or 'mdpsCustomField']: Field within the subject,value (string): Value of the field}SubjectAltNameField {field (string) = ['DNS' or 'email' or 'IP' or 'URI' or 'userPrincipalName']: Field within the subject alt name,value (string): Value of the field} + Required Body Parameters (type(dict) body example)- { + "ca_id": 0, + "days": 0, + "confirm_sign": false, + "custom_subject": [ + { + "field": "", + "value": "" + } + ], + "custom_subject_alt_name": [ + { + "field": "", + "value": "" + } + ] + } + """ + url_path = "/certificate/{cert_id}/sign" + dict_path = {"cert_id": cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:OnboardDevice + # Function Section Description: Manage Onboard devices + + def get_onboard_device( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of devices + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/onboard/device" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_onboard_device_by_id(self, id=""): + """ + Operation: Get a device + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the device + """ + url_path = "/onboard/device/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_onboard_device_by_id(self, id="", body=({})): + """ + Operation: Update settings for a device + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the device + Required Body Parameters (body description)- OnboardDevice {id (integer, optional): Numeric ID of the device,status (string, optional) = ['allowed' or 'pending' or 'denied']: Determines whether the device is able to enroll and access the network,device_type (string, optional) = ['Other' or 'Android' or 'iOS' or 'OS X' or 'Windows' or 'Ubuntu' or 'Chromebook' or 'Web' or 'External']: Device type,device_name (string, optional): Device name,device_udid (string, optional): Unique device identifier,device_imei (string, optional): International Mobile Station Equipment Identity, if available,device_iccid (string, optional): SIM card unique serial number, if available,device_serial (string, optional): Serial number of the device, if available,product_name (string, optional): Product name of the device, if available,product_version (string, optional): Product version string of the device, if available,mac_address (array[string], optional): List of MAC addresses associated with the device,serial_number (string, optional): Serial number of device certificate, if device type is "External",usernames (string, optional): Usernames that have enrolled this device,enrolled (boolean, optional): Flag indicating device has been provisioned and currently has a valid certificate,expanded_type (string, optional): Marketing name for the product,mdm_managed (string, optional): Mobile device management (MDM) vendor name, if an endpoint context server reports the device as managed,device_identifier (string, optional): Unique identifier string } + Required Body Parameters (type(dict) body example)- { + "id": 0, + "status": "", + "device_type": "", + "device_name": "", + "device_udid": "", + "device_imei": "", + "device_iccid": "", + "device_serial": "", + "product_name": "", + "product_version": "", + "mac_address": [ + "" + ], + "serial_number": "", + "usernames": "", + "enrolled": false, + "expanded_type": "", + "mdm_managed": "", + "device_identifier": "" + } + """ + url_path = "/onboard/device/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def delete_onboard_device_by_id( + self, id="", disconnect_active_sessions="", ignore_disconnect_errors="" + ): + """ + Operation: Delete a device + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the device + Optional Query Parameter Name: disconnect_active_sessions, Description: true: Disconnects the device from the network (default)false: No action is taken + Optional Query Parameter Name: ignore_disconnect_errors, Description: true: Optional Disconnect — failure to disconnect will be ignored and the device will be forcibly deleted + false: Require Disconnect (Recommended) — failure to disconnect will stop the device from being deleted (default) + When false (‘Require Disconnect’), the device will only be deleted if all other sessions can be disconnected, + which ensures that the device does not retain access to the network through a currently active session. + You should only select true (‘Optional Disconnect’) if necessary. + This parameter is ignored if disconnect_active_sessions is false. + """ + url_path = "/onboard/device/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = { + "disconnect_active_sessions": disconnect_active_sessions, + "ignore_disconnect_errors": ignore_disconnect_errors, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_endpointvisibility_v1.py b/pyclearpass/api_explorer_endpointvisibility_v1.py new file mode 100644 index 0000000..b698fa1 --- /dev/null +++ b/pyclearpass/api_explorer_endpointvisibility_v1.py @@ -0,0 +1,2089 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_endpointvisibility_v1.py + + +class ApiEndpointVisibility(ClearPassAPILogin): + # Function Section Name:AgentlessOnGuardSettings + # Function Section Description: Manage Agentless OnGuard settings + + def get_agentless_onguard_settings( + self, id="", disconnect_active_sessions="", ignore_disconnect_errors="" + ): + """ + Operation: Get a list of Agentless OnGuard Settings + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric ID of the device + Optional Query Parameter Name: disconnect_active_sessions, Description: true: Disconnects the device from the network (default)false: No action is taken + Optional Query Parameter Name: ignore_disconnect_errors, Description: true: Optional Disconnect — failure to disconnect will be ignored and the device will be forcibly deleted + false: Require Disconnect (Recommended) — failure to disconnect will stop the device from being deleted (default) + When false (‘Require Disconnect’), the device will only be deleted if all other sessions can be disconnected, + which ensures that the device does not retain access to the network through a currently active session. + You should only select true (‘Optional Disconnect’) if necessary. + This parameter is ignored if disconnect_active_sessions is false. + """ + url_path = "/agentless-onguard/settings" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = { + "disconnect_active_sessions": disconnect_active_sessions, + "ignore_disconnect_errors": ignore_disconnect_errors, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_agentless_onguard_settings(self, body=({})): + """ + Operation: Add an Agentless OnGuard Setting + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AgentlessOnGuardSettingsCreate {name (string): Name of Agentless OnGuard Setting,description (string, optional): Description of Agentless OnGuard Setting,client_os (string): Client OS type. Allowed Values: Windows, macOS and Linux,domain_account (string, optional): Name of domain account used to launch Agentless OnGuard on endpoints,ssh_account (string, optional): Name of ssh account used to launch Agentless OnGuard on endpoints,working_dir (string): Full path of directory on endpoints where all files required to start Agentless OnGuard will be copied (e.g. C:\OnGuard),action (string) = ['START_HEALTH_CHECKS']: Action to be performed on endpoints,servers (array[string]): IP addresses or FQDN of ClearPass servers that Agentless OnGuard should use to read agent settings (e.g. ["hostname.example.com", "1.2.3.4"]),download_url (string): HTTP/HTTPS URL to download Agentless OnGuardWrapper EXE from the Remote File Server (e.g. https://10.20.30.40/agent/AgentlessOnGuard/windows/AgentlessOnGuardWrapper.exe),validate_url_cert (boolean, optional): Should Agentless OnGuard Launcher validate the Server Certificate of the remote server while downloading Agentless OnGuardWrapper EXE? (default=true),override_checksum (boolean, optional): Override checksum fields (default=false),checksums_32 (array[string], optional): SHA256 checksums of 32-bit Agentless OnGuard Wrapper EXEs,checksums_64 (array[string], optional): SHA256 checksums of 64-bit Agentless OnGuard Wrapper EXEs} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "client_os": "", + "domain_account": "", + "ssh_account": "", + "working_dir": "", + "action": "", + "servers": [ + "" + ], + "download_url": "", + "validate_url_cert": false, + "override_checksum": false, + "checksums_32": [ + "" + ], + "checksums_64": [ + "" + ] + } + """ + url_path = "/agentless-onguard/settings" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_agentless_onguard_settings_by_settings_id(self, settings_id=""): + """ + Operation: Get an Agentless OnGuard Setting + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: settings_id, Description: Numeric ID of Agentless OnGuard Setting + """ + url_path = "/agentless-onguard/settings/{settings_id}" + dict_path = {"settings_id": settings_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_agentless_onguard_settings_by_settings_id( + self, settings_id="", body=({}) + ): + """ + Operation: Update some fields of an Agentless OnGuard Setting + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: settings_id, Description: Numeric ID of Agentless OnGuard Setting + Required Body Parameters (body description)- AgentlessOnGuardSettingsUpdate {name (string, optional): Name of Agentless OnGuard Setting,description (string, optional): Description of Agentless OnGuard Setting,client_os (string, optional): Client OS type. Allowed Values: Windows, macOS and Linux,domain_account (string, optional): Name of domain account used to launch Agentless OnGuard on endpoints,ssh_account (string, optional): Name of ssh account used to launch Agentless OnGuard on endpoints,working_dir (string, optional): Full path of directory on endpoints where all files required to start Agentless OnGuard will be copied (e.g. C:\OnGuard),action (string, optional) = ['START_HEALTH_CHECKS']: Action to be performed on endpoints,servers (array[string], optional): IP addresses or FQDN of ClearPass servers that Agentless OnGuard should use to read agent settings (e.g. ["hostname.example.com", "1.2.3.4"]),download_url (string, optional): HTTP/HTTPS URL to download Agentless OnGuardWrapper EXE from the Remote File Server (e.g. https://10.20.30.40/agent/AgentlessOnGuard/windows/AgentlessOnGuardWrapper.exe),validate_url_cert (boolean, optional): Should Agentless OnGuard Launcher validate the Server Certificate of the remote server while downloading Agentless OnGuardWrapper EXE? (default=true),override_checksum (boolean, optional): Override checksum fields (default=false),checksums_32 (array[string], optional): SHA256 checksums of 32-bit Agentless OnGuard Wrapper EXEs,checksums_64 (array[string], optional): SHA256 checksums of 64-bit Agentless OnGuard Wrapper EXEs} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "client_os": "", + "domain_account": "", + "ssh_account": "", + "working_dir": "", + "action": "", + "servers": [ + "" + ], + "download_url": "", + "validate_url_cert": false, + "override_checksum": false, + "checksums_32": [ + "" + ], + "checksums_64": [ + "" + ] + } + """ + url_path = "/agentless-onguard/settings/{settings_id}" + dict_path = {"settings_id": settings_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_agentless_onguard_settings_by_settings_id( + self, settings_id="", body=({}) + ): + """ + Operation: Replace an Agentless OnGuard Setting + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: settings_id, Description: Numeric ID of Agentless OnGuard Setting + Required Body Parameters (body description)- AgentlessOnGuardSettingsReplace {name (string): Name of Agentless OnGuard Setting,description (string, optional): Description of Agentless OnGuard Setting,client_os (string): Client OS type. Allowed Values: Windows, macOS and Linux,domain_account (string, optional): Name of domain account used to launch Agentless OnGuard on endpoints,ssh_account (string, optional): Name of ssh account used to launch Agentless OnGuard on endpoints,working_dir (string): Full path of directory on endpoints where all files required to start Agentless OnGuard will be copied (e.g. C:\OnGuard),action (string) = ['START_HEALTH_CHECKS']: Action to be performed on endpoints,servers (array[string]): IP addresses or FQDN of ClearPass servers that Agentless OnGuard should use to read agent settings (e.g. ["hostname.example.com", "1.2.3.4"]),download_url (string): HTTP/HTTPS URL to download Agentless OnGuardWrapper EXE from the Remote File Server (e.g. https://10.20.30.40/agent/AgentlessOnGuard/windows/AgentlessOnGuardWrapper.exe),validate_url_cert (boolean, optional): Should Agentless OnGuard Launcher validate the Server Certificate of the remote server while downloading Agentless OnGuardWrapper EXE? (default=true),override_checksum (boolean, optional): Override checksum fields (default=false),checksums_32 (array[string], optional): SHA256 checksums of 32-bit Agentless OnGuard Wrapper EXEs,checksums_64 (array[string], optional): SHA256 checksums of 64-bit Agentless OnGuard Wrapper EXEs} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "client_os": "", + "domain_account": "", + "ssh_account": "", + "working_dir": "", + "action": "", + "servers": [ + "" + ], + "download_url": "", + "validate_url_cert": false, + "override_checksum": false, + "checksums_32": [ + "" + ], + "checksums_64": [ + "" + ] + } + """ + url_path = "/agentless-onguard/settings/{settings_id}" + dict_path = {"settings_id": settings_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_agentless_onguard_settings_by_settings_id(self, settings_id=""): + """ + Operation: Delete an Agentless OnGuard Setting + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: settings_id, Description: Numeric ID of Agentless OnGuard Setting + """ + url_path = "/agentless-onguard/settings/{settings_id}" + dict_path = {"settings_id": settings_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_agentless_onguard_settings_name_by_name(self, name=""): + """ + Operation: Get an Agentless OnGuard Setting by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of Agentless OnGuard Setting + """ + url_path = "/agentless-onguard/settings/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_agentless_onguard_settings_name_by_name(self, name="", body=({})): + """ + Operation: Update some fields of an Agentless OnGuard Setting by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of Agentless OnGuard Setting + Required Body Parameters (body description)- AgentlessOnGuardSettingsUpdate {name (string, optional): Name of Agentless OnGuard Setting,description (string, optional): Description of Agentless OnGuard Setting,client_os (string, optional): Client OS type. Allowed Values: Windows, macOS and Linux,domain_account (string, optional): Name of domain account used to launch Agentless OnGuard on endpoints,ssh_account (string, optional): Name of ssh account used to launch Agentless OnGuard on endpoints,working_dir (string, optional): Full path of directory on endpoints where all files required to start Agentless OnGuard will be copied (e.g. C:\OnGuard),action (string, optional) = ['START_HEALTH_CHECKS']: Action to be performed on endpoints,servers (array[string], optional): IP addresses or FQDN of ClearPass servers that Agentless OnGuard should use to read agent settings (e.g. ["hostname.example.com", "1.2.3.4"]),download_url (string, optional): HTTP/HTTPS URL to download Agentless OnGuardWrapper EXE from the Remote File Server (e.g. https://10.20.30.40/agent/AgentlessOnGuard/windows/AgentlessOnGuardWrapper.exe),validate_url_cert (boolean, optional): Should Agentless OnGuard Launcher validate the Server Certificate of the remote server while downloading Agentless OnGuardWrapper EXE? (default=true),override_checksum (boolean, optional): Override checksum fields (default=false),checksums_32 (array[string], optional): SHA256 checksums of 32-bit Agentless OnGuard Wrapper EXEs,checksums_64 (array[string], optional): SHA256 checksums of 64-bit Agentless OnGuard Wrapper EXEs} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "client_os": "", + "domain_account": "", + "ssh_account": "", + "working_dir": "", + "action": "", + "servers": [ + "" + ], + "download_url": "", + "validate_url_cert": false, + "override_checksum": false, + "checksums_32": [ + "" + ], + "checksums_64": [ + "" + ] + } + """ + url_path = "/agentless-onguard/settings/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_agentless_onguard_settings_name_by_name(self, name="", body=({})): + """ + Operation: Replace an Agentless OnGuard Setting by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of Agentless OnGuard Setting + Required Body Parameters (body description)- AgentlessOnGuardSettingsReplace {name (string): Name of Agentless OnGuard Setting,description (string, optional): Description of Agentless OnGuard Setting,client_os (string): Client OS type. Allowed Values: Windows, macOS and Linux,domain_account (string, optional): Name of domain account used to launch Agentless OnGuard on endpoints,ssh_account (string, optional): Name of ssh account used to launch Agentless OnGuard on endpoints,working_dir (string): Full path of directory on endpoints where all files required to start Agentless OnGuard will be copied (e.g. C:\OnGuard),action (string) = ['START_HEALTH_CHECKS']: Action to be performed on endpoints,servers (array[string]): IP addresses or FQDN of ClearPass servers that Agentless OnGuard should use to read agent settings (e.g. ["hostname.example.com", "1.2.3.4"]),download_url (string): HTTP/HTTPS URL to download Agentless OnGuardWrapper EXE from the Remote File Server (e.g. https://10.20.30.40/agent/AgentlessOnGuard/windows/AgentlessOnGuardWrapper.exe),validate_url_cert (boolean, optional): Should Agentless OnGuard Launcher validate the Server Certificate of the remote server while downloading Agentless OnGuardWrapper EXE? (default=true),override_checksum (boolean, optional): Override checksum fields (default=false),checksums_32 (array[string], optional): SHA256 checksums of 32-bit Agentless OnGuard Wrapper EXEs,checksums_64 (array[string], optional): SHA256 checksums of 64-bit Agentless OnGuard Wrapper EXEs} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "client_os": "", + "domain_account": "", + "ssh_account": "", + "working_dir": "", + "action": "", + "servers": [ + "" + ], + "download_url": "", + "validate_url_cert": false, + "override_checksum": false, + "checksums_32": [ + "" + ], + "checksums_64": [ + "" + ] + } + """ + url_path = "/agentless-onguard/settings/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_agentless_onguard_settings_name_by_name(self, name=""): + """ + Operation: Delete an Agentless OnGuard Setting by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of Agentless OnGuard Setting + """ + url_path = "/agentless-onguard/settings/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:AgentlessOnGuardSubnetMapping + # Function Section Description: Manage Agentless OnGuard subnet mappings + + def get_agentless_onguard_subnet_mapping( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of subnet mappings + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/agentless-onguard/subnet-mapping" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_agentless_onguard_subnet_mapping(self, body=({})): + """ + Operation: Add a subnet mapping + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AgentlessOnGuardSubnetMappingCreate {name (string): Name of Agentless OnGuard Subnet Mapping,client_subnets (array[string]): IP subnets used for selecting clients,zone (string): Name of Policy Manager Zone for which the specified client subnet is applicable,agentless_onguard_setting_windows (string, optional): Name of Agentless OnGuard setting for Windows for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_macOS (string, optional): Name of Agentless OnGuard setting for macOS for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_linux (string, optional): Name of Agentless OnGuard setting for Linux for the specified subnet and zone. To unset, use empty string,client_scan_setting (string) = ['AllClients' or 'StaticIPClients']: Clients to be scanned in the subnet,enabled (boolean, optional): Enable Clearpass server to process clients in the subnet and run Agentless OnGuard (default=true)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "client_subnets": [ + "" + ], + "zone": "", + "agentless_onguard_setting_windows": "", + "agentless_onguard_setting_macOS": "", + "agentless_onguard_setting_linux": "", + "client_scan_setting": "", + "enabled": false + } + """ + url_path = "/agentless-onguard/subnet-mapping" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_agentless_onguard_subnet_mapping_by_subnet_mapping_id( + self, subnet_mapping_id="" + ): + """ + Operation: Get a subnet mapping + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: subnet_mapping_id, Description: Numeric ID of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/{subnet_mapping_id}" + dict_path = {"subnet_mapping_id": subnet_mapping_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_agentless_onguard_subnet_mapping_by_subnet_mapping_id( + self, subnet_mapping_id="", body=({}) + ): + """ + Operation: Update some fields of a subnet mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: subnet_mapping_id, Description: Numeric ID of subnet mapping + Required Body Parameters (body description)- AgentlessOnGuardSubnetMappingUpdate {name (string, optional): Name of Agentless OnGuard Subnet Mapping,client_subnets (array[string], optional): IP subnets used for selecting clients,zone (string, optional): Name of Policy Manager Zone for which the specified client subnet is applicable,agentless_onguard_setting_windows (string, optional): Name of Agentless OnGuard setting for Windows for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_macOS (string, optional): Name of Agentless OnGuard setting for macOS for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_linux (string, optional): Name of Agentless OnGuard setting for Linux for the specified subnet and zone. To unset, use empty string,client_scan_setting (string, optional) = ['AllClients' or 'StaticIPClients']: Clients to be scanned in the subnet,enabled (boolean, optional): Enable Clearpass server to process clients in the subnet and run Agentless OnGuard (default=true)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "client_subnets": [ + "" + ], + "zone": "", + "agentless_onguard_setting_windows": "", + "agentless_onguard_setting_macOS": "", + "agentless_onguard_setting_linux": "", + "client_scan_setting": "", + "enabled": false + } + """ + url_path = "/agentless-onguard/subnet-mapping/{subnet_mapping_id}" + dict_path = {"subnet_mapping_id": subnet_mapping_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_agentless_onguard_subnet_mapping_by_subnet_mapping_id( + self, subnet_mapping_id="", body=({}) + ): + """ + Operation: Replace a subnet mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: subnet_mapping_id, Description: Numeric ID of subnet mapping + Required Body Parameters (body description)- AgentlessOnGuardSubnetMappingReplace {name (string): Name of Agentless OnGuard Subnet Mapping,client_subnets (array[string]): IP subnets used for selecting clients,zone (string): Name of Policy Manager Zone for which the specified client subnet is applicable,agentless_onguard_setting_windows (string, optional): Name of Agentless OnGuard setting for Windows for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_macOS (string, optional): Name of Agentless OnGuard setting for macOS for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_linux (string, optional): Name of Agentless OnGuard setting for Linux for the specified subnet and zone. To unset, use empty string,client_scan_setting (string) = ['AllClients' or 'StaticIPClients']: Clients to be scanned in the subnet,enabled (boolean, optional): Enable Clearpass server to process clients in the subnet and run Agentless OnGuard (default=true)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "client_subnets": [ + "" + ], + "zone": "", + "agentless_onguard_setting_windows": "", + "agentless_onguard_setting_macOS": "", + "agentless_onguard_setting_linux": "", + "client_scan_setting": "", + "enabled": false + } + """ + url_path = "/agentless-onguard/subnet-mapping/{subnet_mapping_id}" + dict_path = {"subnet_mapping_id": subnet_mapping_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_agentless_onguard_subnet_mapping_by_subnet_mapping_id( + self, subnet_mapping_id="" + ): + """ + Operation: Delete a subnet mapping + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: subnet_mapping_id, Description: Numeric ID of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/{subnet_mapping_id}" + dict_path = {"subnet_mapping_id": subnet_mapping_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_agentless_onguard_subnet_mapping_name_by_name(self, name=""): + """ + Operation: Get a subnet mapping by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_agentless_onguard_subnet_mapping_name_by_name(self, name="", body=({})): + """ + Operation: Update some fields of a subnet mapping by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of subnet mapping + Required Body Parameters (body description)- AgentlessOnGuardSubnetMappingUpdate {name (string, optional): Name of Agentless OnGuard Subnet Mapping,client_subnets (array[string], optional): IP subnets used for selecting clients,zone (string, optional): Name of Policy Manager Zone for which the specified client subnet is applicable,agentless_onguard_setting_windows (string, optional): Name of Agentless OnGuard setting for Windows for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_macOS (string, optional): Name of Agentless OnGuard setting for macOS for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_linux (string, optional): Name of Agentless OnGuard setting for Linux for the specified subnet and zone. To unset, use empty string,client_scan_setting (string, optional) = ['AllClients' or 'StaticIPClients']: Clients to be scanned in the subnet,enabled (boolean, optional): Enable Clearpass server to process clients in the subnet and run Agentless OnGuard (default=true)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "client_subnets": [ + "" + ], + "zone": "", + "agentless_onguard_setting_windows": "", + "agentless_onguard_setting_macOS": "", + "agentless_onguard_setting_linux": "", + "client_scan_setting": "", + "enabled": false + } + """ + url_path = "/agentless-onguard/subnet-mapping/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_agentless_onguard_subnet_mapping_name_by_name(self, name="", body=({})): + """ + Operation: Replace a subnet mapping by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of subnet mapping + Required Body Parameters (body description)- AgentlessOnGuardSubnetMappingReplace {name (string): Name of Agentless OnGuard Subnet Mapping,client_subnets (array[string]): IP subnets used for selecting clients,zone (string): Name of Policy Manager Zone for which the specified client subnet is applicable,agentless_onguard_setting_windows (string, optional): Name of Agentless OnGuard setting for Windows for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_macOS (string, optional): Name of Agentless OnGuard setting for macOS for the specified subnet and zone. To unset, use empty string,agentless_onguard_setting_linux (string, optional): Name of Agentless OnGuard setting for Linux for the specified subnet and zone. To unset, use empty string,client_scan_setting (string) = ['AllClients' or 'StaticIPClients']: Clients to be scanned in the subnet,enabled (boolean, optional): Enable Clearpass server to process clients in the subnet and run Agentless OnGuard (default=true)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "client_subnets": [ + "" + ], + "zone": "", + "agentless_onguard_setting_windows": "", + "agentless_onguard_setting_macOS": "", + "agentless_onguard_setting_linux": "", + "client_scan_setting": "", + "enabled": false + } + """ + url_path = "/agentless-onguard/subnet-mapping/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_agentless_onguard_subnet_mapping_name_by_name(self, name=""): + """ + Operation: Delete a subnet mapping by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def update_agentless_onguard_subnet_mapping_by_subnet_mapping_id_enable( + self, subnet_mapping_id="" + ): + """ + Operation: Enable Agentless OnGuard Settings on client subnets + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: subnet_mapping_id, Description: Numeric ID of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/{subnet_mapping_id}/enable" + dict_path = {"subnet_mapping_id": subnet_mapping_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_agentless_onguard_subnet_mapping_by_subnet_mapping_id_disable( + self, subnet_mapping_id="" + ): + """ + Operation: Disable Agentless OnGuard Settings on client subnets + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: subnet_mapping_id, Description: Numeric ID of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/{subnet_mapping_id}/disable" + dict_path = {"subnet_mapping_id": subnet_mapping_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_agentless_onguard_subnet_mapping_name_by_name_enable(self, name=""): + """ + Operation: Enable Agentless OnGuard Settings on client subnets by subnet mapping name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/name/{name}/enable" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_agentless_onguard_subnet_mapping_name_by_name_disable(self, name=""): + """ + Operation: Disable Agentless OnGuard Settings on client subnets by subnet mapping name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of subnet mapping + """ + url_path = "/agentless-onguard/subnet-mapping/name/{name}/disable" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + # Function Section Name:DeviceFingerprint + # Function Section Description: Manage Device Fingerprint Profiling + + def new_device_profiler_device_fingerprint(self, body=({})): + """ + Operation: Post device fingerprint attributes for profiling + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- DeviceFingerprintCreate {mac (string, optional): MAC address of device,ip (string, optional): IP address of device,hostname (string, optional): Hostname of device,dhcp (DHCPAttributes, optional): DHCP attributes as JSON,active_sync (ActiveSyncAttributes, optional): Active Sync attributes as JSON,host (HostAttributes, optional): Host attributes as JSON,snmp (SNMPAttributes, optional): SNMP attributes as JSON,device (DeviceAttributes, optional): Device attributes as JSON,tcp (TCPAttributes, optional): TCP attributes as JSON,nmap (NMAPAttributes, optional): NMAP attributes as JSON,ssh (SSHAttributes, optional): SSH attributes as JSON,wmi (WMIAttributes, optional): WMI attributes as JSON,ports (PortsAttributes, optional): Port attributes as JSON}DHCPAttributes {device_type (array[string], optional): DHCP Options,option12 (array[string], optional): DHCP Option12,option54 (array[string], optional): DHCP Option54,option55 (array[string], optional): DHCP Option55,option60 (array[string], optional): DHCP Option60}ActiveSyncAttributes {device_type (array[string], optional): ActiveSync Device Type,user_agent (array[string], optional): ActiveSync User Agent,device_model (array[string], optional): ActiveSync Device Model,ip (array[string], optional): ActiveSync IP Address}HostAttributes {os_type (array[string], optional): Host OS Type,user_agent (array[string], optional): Host User Agent,ports (array[string], optional): Host Open Ports,services (array[string], optional): Host Services,device_type (array[string], optional): Host Device Type,dst_conns (array[string], optional): Destination Connections,app_group (array[string], optional): Application Group,mac_oui (array[string], optional): MAC OUI,access_type (array[string], optional): Access Type}SNMPAttributes {name (array[string], optional): SNMP Device Name,sys_name (array[string], optional): SNMP System Name,sys_descr (array[string], optional): SNMP System Description,hr_device_descr (array[string], optional): SNMP Device Description,device_type (array[string], optional): SNMP Device Type,cdp_cache_platform (array[string], optional): CDP Device Description,lldp_sys_descr (array[string], optional): null}DeviceAttributes {category (array[string], optional): Device Category,family (array[string], optional): Device Family,name (array[string], optional): Device Name}TCPAttributes {device (array[string], optional): TCP Device Category,fp (array[string], optional): TCP Fingerprint}NMAPAttributes {device (array[string], optional): Nmap Device Name}SSHAttributes {device_name (array[string], optional): SSH device name}WMIAttributes {os_name (array[string], optional): WMI OS Name}PortsAttributes {open (array[string], optional): Open Ports} + Required Body Parameters (type(dict) body example)- { + "mac": "", + "ip": "", + "hostname": "", + "dhcp": { + "device_type": [ + "" + ], + "option12": [ + "" + ], + "option54": [ + "" + ], + "option55": [ + "" + ], + "option60": [ + "" + ] + }, + "active_sync": { + "device_type": [ + "" + ], + "user_agent": [ + "" + ], + "device_model": [ + "" + ], + "ip": [ + "" + ] + }, + "host": { + "os_type": [ + "" + ], + "user_agent": [ + "" + ], + "ports": [ + "" + ], + "services": [ + "" + ], + "device_type": [ + "" + ], + "dst_conns": [ + "" + ], + "app_group": [ + "" + ], + "mac_oui": [ + "" + ], + "access_type": [ + "" + ] + }, + "snmp": { + "name": [ + "" + ], + "sys_name": [ + "" + ], + "sys_descr": [ + "" + ], + "hr_device_descr": [ + "" + ], + "device_type": [ + "" + ], + "cdp_cache_platform": [ + "" + ], + "lldp_sys_descr": [ + "" + ] + }, + "device": { + "category": [ + "" + ], + "family": [ + "" + ], + "name": [ + "" + ] + }, + "tcp": { + "device": [ + "" + ], + "fp": [ + "" + ] + }, + "nmap": { + "device": [ + "" + ] + }, + "ssh": { + "device_name": [ + "" + ] + }, + "wmi": { + "os_name": [ + "" + ] + }, + "ports": { + "open": [ + "" + ] + } + } + """ + url_path = "/device-profiler/device-fingerprint" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_device_profiler_device_fingerprint_by_mac_or_ip(self, mac_or_ip=""): + """ + Operation: Get profiled device + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: mac_or_ip, Description: MAC or IP address of device + """ + url_path = "/device-profiler/device-fingerprint/{mac_or_ip}" + dict_path = {"mac_or_ip": mac_or_ip} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def delete_device_profiler_device_fingerprint_by_mac_or_ip(self, mac_or_ip=""): + """ + Operation: Delete fingerprint of profiled device + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: mac_or_ip, Description: URL parameter mac_or_ip + """ + url_path = "/device-profiler/device-fingerprint/{mac_or_ip}" + dict_path = {"mac_or_ip": mac_or_ip} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:FingerprintDictionary + # Function Section Description: Manage Fingerprints + + def get_fingerprint( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of Fingerprints + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/fingerprint" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_fingerprint(self, body=({})): + """ + Operation: Create a new Fingerprint + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- FingerprintDictionaryCreate {category (string): Category name of the fingerprint,family (string): Family name of the fingerprint,name (string): Unique name of the fingerprint} + Required Body Parameters (type(dict) body example)- { + "category": "", + "family": "", + "name": "" + } + """ + url_path = "/fingerprint" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_fingerprint_by_fingerprint_id(self, fingerprint_id=""): + """ + Operation: Get a Fingerprint + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: fingerprint_id, Description: Numeric ID of the fingerprint + """ + url_path = "/fingerprint/{fingerprint_id}" + dict_path = {"fingerprint_id": fingerprint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_fingerprint_by_fingerprint_id(self, fingerprint_id="", body=({})): + """ + Operation: Update some fields of a Fingerprint + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: fingerprint_id, Description: Numeric ID of the fingerprint + Required Body Parameters (body description)- FingerprintDictionaryUpdate {category (string, optional): Category name of the fingerprint,family (string, optional): Family name of the fingerprint,name (string, optional): Unique name of the fingerprint} + Required Body Parameters (type(dict) body example)- { + "category": "", + "family": "", + "name": "" + } + """ + url_path = "/fingerprint/{fingerprint_id}" + dict_path = {"fingerprint_id": fingerprint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_fingerprint_by_fingerprint_id(self, fingerprint_id="", body=({})): + """ + Operation: Replace a Fingerprint + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: fingerprint_id, Description: Numeric ID of the fingerprint + Required Body Parameters (body description)- FingerprintDictionaryReplace {category (string): Category name of the fingerprint,family (string): Family name of the fingerprint,name (string): Unique name of the fingerprint} + Required Body Parameters (type(dict) body example)- { + "category": "", + "family": "", + "name": "" + } + """ + url_path = "/fingerprint/{fingerprint_id}" + dict_path = {"fingerprint_id": fingerprint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_fingerprint_by_fingerprint_id(self, fingerprint_id=""): + """ + Operation: Delete a Fingerprint + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: fingerprint_id, Description: Numeric ID of the fingerprint + """ + url_path = "/fingerprint/{fingerprint_id}" + dict_path = {"fingerprint_id": fingerprint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_fingerprint_name_by_category_family_name( + self, category="", family="", name="" + ): + """ + Operation: Get a Fingerprint by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: category, Description: Category name of the fingerprint + Required Path Parameter Name: family, Description: family name of the fingerprint + Required Path Parameter Name: name, Description: Unique name of the fingerprint + """ + url_path = "/fingerprint/name/{category}/{family}/{name}" + dict_path = {"category": category, "family": family, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_fingerprint_name_by_category_family_name( + self, category="", family="", name="", body=({}) + ): + """ + Operation: Update some fields of a Fingerprint by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: category, Description: Category name of the fingerprint + Required Path Parameter Name: family, Description: family name of the fingerprint + Required Path Parameter Name: name, Description: Unique name of the fingerprint + Required Body Parameters (body description)- FingerprintDictionaryUpdate {category (string, optional): Category name of the fingerprint,family (string, optional): Family name of the fingerprint,name (string, optional): Unique name of the fingerprint} + Required Body Parameters (type(dict) body example)- { + "category": "", + "family": "", + "name": "" + } + """ + url_path = "/fingerprint/name/{category}/{family}/{name}" + dict_path = {"category": category, "family": family, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_fingerprint_name_by_category_family_name( + self, category="", family="", name="", body=({}) + ): + """ + Operation: Replace a Fingerprint by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: category, Description: Category name of the fingerprint + Required Path Parameter Name: family, Description: family name of the fingerprint + Required Path Parameter Name: name, Description: Unique name of the fingerprint + Required Body Parameters (body description)- FingerprintDictionaryReplace {category (string): Category name of the fingerprint,family (string): Family name of the fingerprint,name (string): Unique name of the fingerprint} + Required Body Parameters (type(dict) body example)- { + "category": "", + "family": "", + "name": "" + } + """ + url_path = "/fingerprint/name/{category}/{family}/{name}" + dict_path = {"category": category, "family": family, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_fingerprint_name_by_category_family_name( + self, category="", family="", name="" + ): + """ + Operation: Delete a Fingerprint by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: category, Description: Category name of the fingerprint + Required Path Parameter Name: family, Description: family name of the fingerprint + Required Path Parameter Name: name, Description: Unique name of the fingerprint + """ + url_path = "/fingerprint/name/{category}/{family}/{name}" + dict_path = {"category": category, "family": family, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:NetworkScan + # Function Section Description: Manage NetworkScan Services + + def get_config_network_scan( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of NetworkScan + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/config/network-scan" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_config_network_scan(self, body=({})): + """ + Operation: Add a NetworkScan + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- NetworkScanCreate {zone (string): Zone for the Network Scan,type (string) = ['DISCOVERY' or 'SUBNET']: Type of the Network Scan,seed_device_or_ip_subnet (string): Network IP for DISCOVERY (e.g. ["hostname.example.com", "1.2.3.4"]) or IP Subnets for SUBNET (e.g. ["10.1.0.0/16"]) Network Scan,scan_frequency (string) = ['ONDEMAND' or 'HOURLY' or 'DAILY' or 'WEEKLY']: Frequency of Network Scan,start_time (string, optional): Start time (HH:MM) of Network Scan (e.g. ["10:40", "23:20"]),interval (integer, optional): Interval in hours (3 - 350) for HOURLY Network Scan,day_of_week (string, optional) = ['MONDAY' or 'TUESDAY' or 'WEDNESDAY' or 'THURSDAY' or 'FRIDAY' or 'SATURDAY' or 'SUNDAY']: Day of Week for WEEKLY Network Scan,depth (integer, optional) = ['1' or '2' or '3' or '4' or '5']: Depth level for DISCOVERY Network Scan,probe_arp (boolean, optional): Probe all ARP entries found (default=false for type="DISCOVERY", not applicable for type="SUBNET"),enabled (boolean, optional): Is Network Scan enabled? (default=true)} + Required Body Parameters (type(dict) body example)- { + "zone": "", + "type": "", + "seed_device_or_ip_subnet": "", + "scan_frequency": "", + "start_time": "", + "interval": 0, + "day_of_week": "", + "depth": 0, + "probe_arp": false, + "enabled": false + } + """ + url_path = "/config/network-scan" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_config_network_scan_by_scan_id(self, scan_id=""): + """ + Operation: Get a NetworkScan + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: scan_id, Description: Numeric ID of the NetworkScan + """ + url_path = "/config/network-scan/{scan_id}" + dict_path = {"scan_id": scan_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_config_network_scan_by_scan_id(self, scan_id="", body=({})): + """ + Operation: Update some fields of a NetworkScan + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_id, Description: Numeric ID of the NetworkScan + Required Body Parameters (body description)- NetworkScanUpdate {zone (string, optional): Zone for the Network Scan,type (string, optional) = ['DISCOVERY' or 'SUBNET']: Type of the Network Scan,seed_device_or_ip_subnet (string, optional): Network IP for DISCOVERY (e.g. ["hostname.example.com", "1.2.3.4"]) or IP Subnets for SUBNET (e.g. ["10.1.0.0/16"]) Network Scan,scan_frequency (string, optional) = ['ONDEMAND' or 'HOURLY' or 'DAILY' or 'WEEKLY']: Frequency of Network Scan,start_time (string, optional): Start time (HH:MM) of Network Scan (e.g. ["10:40", "23:20"]),interval (integer, optional): Interval in hours (3 - 350) for HOURLY Network Scan,day_of_week (string, optional) = ['MONDAY' or 'TUESDAY' or 'WEDNESDAY' or 'THURSDAY' or 'FRIDAY' or 'SATURDAY' or 'SUNDAY']: Day of Week for WEEKLY Network Scan,depth (integer, optional) = ['1' or '2' or '3' or '4' or '5']: Depth level for DISCOVERY Network Scan,probe_arp (boolean, optional): Probe all ARP entries found (default=false for type="DISCOVERY", not applicable for type="SUBNET"),enabled (boolean, optional): Is Network Scan enabled? (default=true)} + Required Body Parameters (type(dict) body example)- { + "zone": "", + "type": "", + "seed_device_or_ip_subnet": "", + "scan_frequency": "", + "start_time": "", + "interval": 0, + "day_of_week": "", + "depth": 0, + "probe_arp": false, + "enabled": false + } + """ + url_path = "/config/network-scan/{scan_id}" + dict_path = {"scan_id": scan_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_config_network_scan_by_scan_id(self, scan_id="", body=({})): + """ + Operation: Update all fields of a NetworkScan + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_id, Description: Numeric ID of the NetworkScan + Required Body Parameters (body description)- NetworkScanReplace {zone (string): Zone for the Network Scan,type (string) = ['DISCOVERY' or 'SUBNET']: Type of the Network Scan,seed_device_or_ip_subnet (string): Network IP for DISCOVERY (e.g. ["hostname.example.com", "1.2.3.4"]) or IP Subnets for SUBNET (e.g. ["10.1.0.0/16"]) Network Scan,scan_frequency (string) = ['ONDEMAND' or 'HOURLY' or 'DAILY' or 'WEEKLY']: Frequency of Network Scan,start_time (string, optional): Start time (HH:MM) of Network Scan (e.g. ["10:40", "23:20"]),interval (integer, optional): Interval in hours (3 - 350) for HOURLY Network Scan,day_of_week (string, optional) = ['MONDAY' or 'TUESDAY' or 'WEDNESDAY' or 'THURSDAY' or 'FRIDAY' or 'SATURDAY' or 'SUNDAY']: Day of Week for WEEKLY Network Scan,depth (integer, optional) = ['1' or '2' or '3' or '4' or '5']: Depth level for DISCOVERY Network Scan,probe_arp (boolean, optional): Probe all ARP entries found (default=false for type="DISCOVERY", not applicable for type="SUBNET"),enabled (boolean, optional): Is Network Scan enabled? (default=true)} + Required Body Parameters (type(dict) body example)- { + "zone": "", + "type": "", + "seed_device_or_ip_subnet": "", + "scan_frequency": "", + "start_time": "", + "interval": 0, + "day_of_week": "", + "depth": 0, + "probe_arp": false, + "enabled": false + } + """ + url_path = "/config/network-scan/{scan_id}" + dict_path = {"scan_id": scan_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_config_network_scan_by_scan_id(self, scan_id=""): + """ + Operation: Delete a NetworkScan + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: scan_id, Description: Numeric ID of the NetworkScan + """ + url_path = "/config/network-scan/{scan_id}" + dict_path = {"scan_id": scan_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def update_config_network_scan_by_scan_id_enable(self, scan_id=""): + """ + Operation: Update some fields of a NetworkScan + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_id, Description: Numeric ID of the NetworkScan + """ + url_path = "/config/network-scan/{scan_id}/enable" + dict_path = {"scan_id": scan_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_config_network_scan_by_scan_id_disable(self, scan_id=""): + """ + Operation: Update some fields of a NetworkScan + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_id, Description: Numeric ID of the NetworkScan + """ + url_path = "/config/network-scan/{scan_id}/disable" + dict_path = {"scan_id": scan_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + # Function Section Name:OnGuardActivity + # Function Section Description: Manage OnGuard Activity + + def get_onguard_activity( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of Clearpass OnGuard Endpoints + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/onguard-activity" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_onguard_activity_by_onguard_activity_id(self, onguard_activity_id=""): + """ + Operation: Get a Clearpass OnGuard Endpoint Details + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: onguard_activity_id, Description: Numeric ID of the OnGuard Activity + """ + url_path = "/onguard-activity/{onguard_activity_id}" + dict_path = {"onguard_activity_id": onguard_activity_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_onguard_activity_host_mac_by_host_mac(self, host_mac=""): + """ + Operation: Get a Clearpass OnGuard Endpoint Details by host_mac + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: host_mac, Description: MAC Address of the agent + """ + url_path = "/onguard-activity/host_mac/{host_mac}" + dict_path = {"host_mac": host_mac} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_onguard_activity_message(self, body=({})): + """ + Operation: Send/Broadcast Message + HTTP Status Response Codes: 201 Created, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- OnGuardActivityMessage {host_mac_list (object): List of host MAC Address,message (string): Message,info_url (string, optional): URL,is_broadcast (boolean): Is a broadcast} + Required Body Parameters (type(dict) body example)- { + "host_mac_list": "object", + "message": "", + "info_url": "", + "is_broadcast": false + } + """ + url_path = "/onguard-activity/message" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_onguard_activity_notification(self, body=({})): + """ + Operation: Send/Broadcast Notification + HTTP Status Response Codes: 201 Created, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- OnGuardActivityNotification {host_mac_list (object): List of host MAC Address,message (string): Message,info_url (string, optional): URL,is_broadcast (boolean): Is a broadcast,action (string) = ['RestartSession' or 'Bounce']: Action,endpoint_status (string, optional) = ['NO_CHANGE' or 'BLOCK_ACCESS' or 'ALLOW_ACCESS']: Status of the endpoint} + Required Body Parameters (type(dict) body example)- { + "host_mac_list": "object", + "message": "", + "info_url": "", + "is_broadcast": false, + "action": "", + "endpoint_status": "" + } + """ + url_path = "/onguard-activity/notification" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:OnGuardCustomScript + # Function Section Description: Manage OnGuard Custom Scripts + + def get_onguard_custom_script( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of OnGuard Custom Scripts + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/onguard-custom-script" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_onguard_custom_script(self, body=({})): + """ + Operation: Create a new OnGuard Custom Script + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- OnGuardCustomScriptCreate {name (string): Name of Custom Script,description (string, optional): Description of Custom Script,os_type (string) = ['linux' or 'macos' or 'windows']: OS Type of Custom Script,script_type (string) = ['agentScriptEnforcementProfile' or 'autoRemediation' or 'healthCollection']: Type of Custom Script,attributes (object): Attributes of Custom Script, allowed attributes - Path,Command,SHA256,ExecutionLevel,WaitTime,PassResults,SuccessMsg,FailureMsg,ProgressMsg,Description,DownloadURL,ValidateURLCert,ScriptExecutionTimeOut,SignerName (e.g. {"Path": "/home/aruba/scripts","SHA256": "cfd6...f7ca","ExecutionLevel": "User","Command": "runscript.sh","SignerName": "signer"}),output_format (string, optional) = ['json' or 'keyValuePair']: Output Format of Custom Script, applicable only for health collection scripts,output_details (object, optional): Output Details of Custom Script, applicable only for health collection scripts (e.g. {"ExitCode":"Integer", "OutVar1":"Boolean", "OutVar2":"String"}),rule_eval_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm for rules of Custom Script, applicable only for health collection scripts,rules (object, optional): List of Rules for Custom Script, applicable only for health collection scripts (e.g. [{"match_type":"OR","health_status":"Healthy","condition":[{"type":"Script","name":"ExitCode","oper":"EQUALS","value":"0"}]}])} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "os_type": "", + "script_type": "", + "attributes": "object", + "output_format": "", + "output_details": "object", + "rule_eval_algo": "", + "rules": "object" + } + """ + url_path = "/onguard-custom-script" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_onguard_custom_script_by_onguard_custom_script_id( + self, onguard_custom_script_id="" + ): + """ + Operation: Get an OnGuard Custom Script + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: onguard_custom_script_id, Description: Numeric ID of OnGuard Custom Script + """ + url_path = "/onguard-custom-script/{onguard_custom_script_id}" + dict_path = {"onguard_custom_script_id": onguard_custom_script_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_onguard_custom_script_by_onguard_custom_script_id( + self, onguard_custom_script_id="", body=({}) + ): + """ + Operation: Update some fields of an OnGuard Custom Script + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: onguard_custom_script_id, Description: Numeric ID of OnGuard Custom Script + Required Body Parameters (body description)- OnGuardCustomScriptUpdate {name (string, optional): Name of Custom Script,description (string, optional): Description of Custom Script,attributes (object, optional): Attributes of Custom Script, allowed attributes - Path,Command,SHA256,ExecutionLevel,WaitTime,PassResults,SuccessMsg,FailureMsg,ProgressMsg,Description,DownloadURL,ValidateURLCert,ScriptExecutionTimeOut,SignerName (e.g. {"Path": "/home/aruba/scripts","SHA256": "cfd6...f7ca","ExecutionLevel": "User","Command": "runscript.sh","SignerName": "signer"}),output_format (string, optional) = ['json' or 'keyValuePair']: Output Format of Custom Script, applicable only for health collection scripts,output_details (object, optional): Output Details of Custom Script, applicable only for health collection scripts (e.g. {"ExitCode":"Integer", "OutVar1":"Boolean", "OutVar2":"String"}),rule_eval_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm for rules of Custom Script, applicable only for health collection scripts,rules (object, optional): List of Rules for Custom Script, applicable only for health collection scripts (e.g. [{"match_type":"OR","health_status":"Healthy","condition":[{"type":"Script","name":"ExitCode","oper":"EQUALS","value":"0"}]}])} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "attributes": "object", + "output_format": "", + "output_details": "object", + "rule_eval_algo": "", + "rules": "object" + } + """ + url_path = "/onguard-custom-script/{onguard_custom_script_id}" + dict_path = {"onguard_custom_script_id": onguard_custom_script_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_onguard_custom_script_by_onguard_custom_script_id( + self, onguard_custom_script_id="", body=({}) + ): + """ + Operation: Replace an OnGuard Custom Script + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: onguard_custom_script_id, Description: Numeric ID of OnGuard Custom Script + Required Body Parameters (body description)- OnGuardCustomScriptReplace {name (string): Name of Custom Script,description (string, optional): Description of Custom Script,os_type (string) = ['linux' or 'macos' or 'windows']: OS Type of Custom Script,script_type (string) = ['agentScriptEnforcementProfile' or 'autoRemediation' or 'healthCollection']: Type of Custom Script,attributes (object): Attributes of Custom Script, allowed attributes - Path,Command,SHA256,ExecutionLevel,WaitTime,PassResults,SuccessMsg,FailureMsg,ProgressMsg,Description,DownloadURL,ValidateURLCert,ScriptExecutionTimeOut,SignerName (e.g. {"Path": "/home/aruba/scripts","SHA256": "cfd6...f7ca","ExecutionLevel": "User","Command": "runscript.sh","SignerName": "signer"}),output_format (string, optional) = ['json' or 'keyValuePair']: Output Format of Custom Script, applicable only for health collection scripts,output_details (object, optional): Output Details of Custom Script, applicable only for health collection scripts (e.g. {"ExitCode":"Integer", "OutVar1":"Boolean", "OutVar2":"String"}),rule_eval_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm for rules of Custom Script, applicable only for health collection scripts,rules (object, optional): List of Rules for Custom Script, applicable only for health collection scripts (e.g. [{"match_type":"OR","health_status":"Healthy","condition":[{"type":"Script","name":"ExitCode","oper":"EQUALS","value":"0"}]}])} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "os_type": "", + "script_type": "", + "attributes": "object", + "output_format": "", + "output_details": "object", + "rule_eval_algo": "", + "rules": "object" + } + """ + url_path = "/onguard-custom-script/{onguard_custom_script_id}" + dict_path = {"onguard_custom_script_id": onguard_custom_script_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_onguard_custom_script_by_onguard_custom_script_id( + self, onguard_custom_script_id="" + ): + """ + Operation: Delete an OnGuard Custom Script + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: onguard_custom_script_id, Description: Numeric ID of OnGuard Custom Script + """ + url_path = "/onguard-custom-script/{onguard_custom_script_id}" + dict_path = {"onguard_custom_script_id": onguard_custom_script_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_onguard_custom_script_name_by_name(self, name=""): + """ + Operation: Get an OnGuard Custom Script by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of OnGuard Custom Script + """ + url_path = "/onguard-custom-script/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_onguard_custom_script_name_by_name(self, name="", body=({})): + """ + Operation: Update some fields of an OnGuard Custom Script by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of OnGuard Custom Script + Required Body Parameters (body description)- OnGuardCustomScriptUpdate {name (string, optional): Name of Custom Script,description (string, optional): Description of Custom Script,attributes (object, optional): Attributes of Custom Script, allowed attributes - Path,Command,SHA256,ExecutionLevel,WaitTime,PassResults,SuccessMsg,FailureMsg,ProgressMsg,Description,DownloadURL,ValidateURLCert,ScriptExecutionTimeOut,SignerName (e.g. {"Path": "/home/aruba/scripts","SHA256": "cfd6...f7ca","ExecutionLevel": "User","Command": "runscript.sh","SignerName": "signer"}),output_format (string, optional) = ['json' or 'keyValuePair']: Output Format of Custom Script, applicable only for health collection scripts,output_details (object, optional): Output Details of Custom Script, applicable only for health collection scripts (e.g. {"ExitCode":"Integer", "OutVar1":"Boolean", "OutVar2":"String"}),rule_eval_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm for rules of Custom Script, applicable only for health collection scripts,rules (object, optional): List of Rules for Custom Script, applicable only for health collection scripts (e.g. [{"match_type":"OR","health_status":"Healthy","condition":[{"type":"Script","name":"ExitCode","oper":"EQUALS","value":"0"}]}])} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "attributes": "object", + "output_format": "", + "output_details": "object", + "rule_eval_algo": "", + "rules": "object" + } + """ + url_path = "/onguard-custom-script/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_onguard_custom_script_name_by_name(self, name="", body=({})): + """ + Operation: Replace an OnGuard Custom Script by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of OnGuard Custom Script + Required Body Parameters (body description)- OnGuardCustomScriptReplace {name (string): Name of Custom Script,description (string, optional): Description of Custom Script,os_type (string) = ['linux' or 'macos' or 'windows']: OS Type of Custom Script,script_type (string) = ['agentScriptEnforcementProfile' or 'autoRemediation' or 'healthCollection']: Type of Custom Script,attributes (object): Attributes of Custom Script, allowed attributes - Path,Command,SHA256,ExecutionLevel,WaitTime,PassResults,SuccessMsg,FailureMsg,ProgressMsg,Description,DownloadURL,ValidateURLCert,ScriptExecutionTimeOut,SignerName (e.g. {"Path": "/home/aruba/scripts","SHA256": "cfd6...f7ca","ExecutionLevel": "User","Command": "runscript.sh","SignerName": "signer"}),output_format (string, optional) = ['json' or 'keyValuePair']: Output Format of Custom Script, applicable only for health collection scripts,output_details (object, optional): Output Details of Custom Script, applicable only for health collection scripts (e.g. {"ExitCode":"Integer", "OutVar1":"Boolean", "OutVar2":"String"}),rule_eval_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm for rules of Custom Script, applicable only for health collection scripts,rules (object, optional): List of Rules for Custom Script, applicable only for health collection scripts (e.g. [{"match_type":"OR","health_status":"Healthy","condition":[{"type":"Script","name":"ExitCode","oper":"EQUALS","value":"0"}]}])} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "os_type": "", + "script_type": "", + "attributes": "object", + "output_format": "", + "output_details": "object", + "rule_eval_algo": "", + "rules": "object" + } + """ + url_path = "/onguard-custom-script/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_onguard_custom_script_name_by_name(self, name=""): + """ + Operation: Delete an OnGuard Custom Script by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of OnGuard Custom Script + """ + url_path = "/onguard-custom-script/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:OnGuardGlobalSettings + # Function Section Description: Manage OnGuard global settings + + def get_onguard_global_settings(self, name=""): + """ + Operation: Get OnGuard global settings + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of OnGuard Custom Script + """ + url_path = "/onguard/global-settings" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_onguard_global_settings(self, body=({})): + """ + Operation: Update OnGuard global settings + HTTP Status Response Codes: 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- OnGuardGlobalSettingsCreate {AllowRemoteDesktopSession (boolean, optional): Enable access over Remote Desktop Session,CacheCredentialsForDays (integer, optional): Cache Credentials Interval(in days),EnableClientLoadBalance (boolean, optional): Enable OnGuard requests load-balancing,HealthCheckQuietPeriod (integer, optional) = ['>=0']: OnGuard Health Check Interval (in hours),HideLogoutButton (boolean, optional): Enable to hide Logout button,InstallVPNComponent (boolean, optional): Enable to install VPN component,KeepAliveIntervalSeconds (integer, optional) = ['30-600']: Keep-alive Interval (in seconds),LogoutBounceDelay (integer, optional): Delay to bounce after Logout (in minutes),RunOnGuardAs (string, optional) = ['Agent' or 'Service' or 'BothServiceAndAgent']: Run OnGuard As,ServerCertificateValidation (string, optional) = ['Required' or 'WarnAndProceed' or 'Skip']: Server Certificate Validation,ServerCommunicationMode (string, optional) = ['IP' or 'HostName' or 'FQDN']: Server Communication Mode,SupportEmailAddress (string, optional): Support Team Email Address,UseCurrentOSLanguage (boolean, optional): Use Current OS Language (Windows only),UseWindowsCredentials (boolean, optional): Enable to use Windows Single-Sign On,VPNDeviceNames (string, optional): VPN Device Names (Windows),VPNDeviceNamesMacOS (string, optional): VPN Device Names (macOS),VPNDeviceNamesLinux (string, optional): VPN Device Names (Linux),WiredAllowedSubnets (string, optional): [Deprecated] Allowed Subnets for Wired access,WirelessAllowedSubnets (string, optional): [Deprecated] Allowed Subnets for Wireless access} + Required Body Parameters (type(dict) body example)- { + "AllowRemoteDesktopSession": false, + "CacheCredentialsForDays": 0, + "EnableClientLoadBalance": false, + "HealthCheckQuietPeriod": 0, + "HideLogoutButton": false, + "InstallVPNComponent": false, + "KeepAliveIntervalSeconds": 0, + "LogoutBounceDelay": 0, + "RunOnGuardAs": "", + "ServerCertificateValidation": "", + "ServerCommunicationMode": "", + "SupportEmailAddress": "", + "UseCurrentOSLanguage": false, + "UseWindowsCredentials": false, + "VPNDeviceNames": "", + "VPNDeviceNamesMacOS": "", + "VPNDeviceNamesLinux": "", + "WiredAllowedSubnets": "", + "WirelessAllowedSubnets": "" + } + """ + url_path = "/onguard/global-settings" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:OnGuardSettings + # Function Section Description: Manage OnGuard settings + + def get_onguard_settings(self, body=({})): + """ + Operation: Get OnGuard settings + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- OnGuardGlobalSettingsCreate {AllowRemoteDesktopSession (boolean, optional): Enable access over Remote Desktop Session,CacheCredentialsForDays (integer, optional): Cache Credentials Interval(in days),EnableClientLoadBalance (boolean, optional): Enable OnGuard requests load-balancing,HealthCheckQuietPeriod (integer, optional) = ['>=0']: OnGuard Health Check Interval (in hours),HideLogoutButton (boolean, optional): Enable to hide Logout button,InstallVPNComponent (boolean, optional): Enable to install VPN component,KeepAliveIntervalSeconds (integer, optional) = ['30-600']: Keep-alive Interval (in seconds),LogoutBounceDelay (integer, optional): Delay to bounce after Logout (in minutes),RunOnGuardAs (string, optional) = ['Agent' or 'Service' or 'BothServiceAndAgent']: Run OnGuard As,ServerCertificateValidation (string, optional) = ['Required' or 'WarnAndProceed' or 'Skip']: Server Certificate Validation,ServerCommunicationMode (string, optional) = ['IP' or 'HostName' or 'FQDN']: Server Communication Mode,SupportEmailAddress (string, optional): Support Team Email Address,UseCurrentOSLanguage (boolean, optional): Use Current OS Language (Windows only),UseWindowsCredentials (boolean, optional): Enable to use Windows Single-Sign On,VPNDeviceNames (string, optional): VPN Device Names (Windows),VPNDeviceNamesMacOS (string, optional): VPN Device Names (macOS),VPNDeviceNamesLinux (string, optional): VPN Device Names (Linux),WiredAllowedSubnets (string, optional): [Deprecated] Allowed Subnets for Wired access,WirelessAllowedSubnets (string, optional): [Deprecated] Allowed Subnets for Wireless access} + Required Body Parameters (type(dict) body example)- { + "AllowRemoteDesktopSession": false, + "CacheCredentialsForDays": 0, + "EnableClientLoadBalance": false, + "HealthCheckQuietPeriod": 0, + "HideLogoutButton": false, + "InstallVPNComponent": false, + "KeepAliveIntervalSeconds": 0, + "LogoutBounceDelay": 0, + "RunOnGuardAs": "", + "ServerCertificateValidation": "", + "ServerCommunicationMode": "", + "SupportEmailAddress": "", + "UseCurrentOSLanguage": false, + "UseWindowsCredentials": false, + "VPNDeviceNames": "", + "VPNDeviceNamesMacOS": "", + "VPNDeviceNamesLinux": "", + "WiredAllowedSubnets": "", + "WirelessAllowedSubnets": "" + } + """ + url_path = "/onguard/settings" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_onguard_settings(self, body=({})): + """ + Operation: Update OnGuard settings + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- OnGuardSettingsCreate {mode (string, optional) = ['auth' or 'health' or 'both']: Mode of operation,interfaces (string, optional): [wired, wireless, vpn, other]: Network interfaces Agent should monitor,web_agent_interfaces (string, optional): [wired, wireless, vpn, other]: Network interfaces Native Dissolvable Agent should monitor,auth_type (string, optional) = ['cert' or 'password']: Authentication type,field_username_caption (string, optional): Caption for username field,field_password_caption (string, optional): Caption for password field,cert_filter_criteria (string, optional): Filter criteria used by OnGuard client to select certificates for authentication,upgrade_action (string, optional) = ['DoNothing' or 'NotifyOnly' or 'DownloadOnly' or 'AutoUpdate']: Agent action when an update is available,install_vpn_component (boolean, optional): Install VIA component,version (string, optional): Agent version. This is read only field,agentLibraryVersion (string, optional): Version of the OnGuard Agent Library. This is read-only field,installer_modified_time (string, optional): Time when Agent Installers was last updated. This is read only field,installer_modified_time_formatted (string, optional): Formatted Time when Agent Installers was last updated. This is read only field,agent_installers (object, optional): Details about Agent installers. This is read-only field,agent_web_installers (object, optional): Details about Native Dissolvable Agent installers. This is read only field,ip_version_onguard (string, optional) = ['IPv4Only' or 'IPv6Only' or 'dualPreferIPv4' or 'dualPreferIPv6' or 'dualBoth']: IP Version for Server Communication (OnGuard),ip_version_native (string, optional) = ['IPv4Only' or 'IPv6Only' or 'dualPreferIPv4' or 'dualPreferIPv6']: IP Version for Server Communication (Native),custom_remediation (object, optional): Customize webpage details for Agent Remediation UI. Input should be in JSON format.} + Required Body Parameters (type(dict) body example)- { + "mode": "", + "interfaces": "", + "web_agent_interfaces": "", + "auth_type": "", + "field_username_caption": "", + "field_password_caption": "", + "cert_filter_criteria": "", + "upgrade_action": "", + "install_vpn_component": false, + "version": "", + "agentLibraryVersion": "", + "installer_modified_time": "", + "installer_modified_time_formatted": "", + "agent_installers": "object", + "agent_web_installers": "object", + "ip_version_onguard": "", + "ip_version_native": "", + "custom_remediation": "object" + } + """ + url_path = "/onguard/settings" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:OnGuardZoneMapping + # Function Section Description: API's to configure authentication server IP addresses per zone + + def get_onguard_policy_manager_zones(self, body=({})): + """ + Operation: Get Policy Manager Zones with associated authentication server IP addresses(Client Subnets and Server IPs) + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- OnGuardSettingsCreate {mode (string, optional) = ['auth' or 'health' or 'both']: Mode of operation,interfaces (string, optional): [wired, wireless, vpn, other]: Network interfaces Agent should monitor,web_agent_interfaces (string, optional): [wired, wireless, vpn, other]: Network interfaces Native Dissolvable Agent should monitor,auth_type (string, optional) = ['cert' or 'password']: Authentication type,field_username_caption (string, optional): Caption for username field,field_password_caption (string, optional): Caption for password field,cert_filter_criteria (string, optional): Filter criteria used by OnGuard client to select certificates for authentication,upgrade_action (string, optional) = ['DoNothing' or 'NotifyOnly' or 'DownloadOnly' or 'AutoUpdate']: Agent action when an update is available,install_vpn_component (boolean, optional): Install VIA component,version (string, optional): Agent version. This is read only field,agentLibraryVersion (string, optional): Version of the OnGuard Agent Library. This is read-only field,installer_modified_time (string, optional): Time when Agent Installers was last updated. This is read only field,installer_modified_time_formatted (string, optional): Formatted Time when Agent Installers was last updated. This is read only field,agent_installers (object, optional): Details about Agent installers. This is read-only field,agent_web_installers (object, optional): Details about Native Dissolvable Agent installers. This is read only field,ip_version_onguard (string, optional) = ['IPv4Only' or 'IPv6Only' or 'dualPreferIPv4' or 'dualPreferIPv6' or 'dualBoth']: IP Version for Server Communication (OnGuard),ip_version_native (string, optional) = ['IPv4Only' or 'IPv6Only' or 'dualPreferIPv4' or 'dualPreferIPv6']: IP Version for Server Communication (Native),custom_remediation (object, optional): Customize webpage details for Agent Remediation UI. Input should be in JSON format.} + Required Body Parameters (type(dict) body example)- { + "mode": "", + "interfaces": "", + "web_agent_interfaces": "", + "auth_type": "", + "field_username_caption": "", + "field_password_caption": "", + "cert_filter_criteria": "", + "upgrade_action": "", + "install_vpn_component": false, + "version": "", + "agentLibraryVersion": "", + "installer_modified_time": "", + "installer_modified_time_formatted": "", + "agent_installers": "object", + "agent_web_installers": "object", + "ip_version_onguard": "", + "ip_version_native": "", + "custom_remediation": "object" + } + """ + url_path = "/onguard/policy-manager-zones" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_onguard_policy_manager_zones(self, body=({})): + """ + Operation: Post Policy Manager Zones with associated authentication server IP addresses + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- OnGuardZoneMappingCreate {policy_manager_zone_name (string): Name of the Policy Manager Zone,client_subnets (string): client subnet addresses specific to the Policy Manager zone,override_server_ips (string, optional): IP addresses or FQDN to which OnGuard agent will send request. This will override the Default ClearPass Server IPs} + Required Body Parameters (type(dict) body example)- { + "policy_manager_zone_name": "", + "client_subnets": "", + "override_server_ips": "" + } + """ + url_path = "/onguard/policy-manager-zones" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_onguard_policy_manager_zones_by_policy_manager_zones_id( + self, policy_manager_zones_id="" + ): + """ + Operation: Get Client Subnets and Server IPs for Policy Manager Zone + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: policy_manager_zones_id, Description: Numeric ID of the policy manager zone + """ + url_path = "/onguard/policy-manager-zones/{policy_manager_zones_id}" + dict_path = {"policy_manager_zones_id": policy_manager_zones_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_onguard_policy_manager_zones_by_policy_manager_zones_id( + self, policy_manager_zones_id="", body=({}) + ): + """ + Operation: Update authentication server IP addresses for Policy Manager Zone + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: policy_manager_zones_id, Description: Numeric ID of the policy manager zone + Required Body Parameters (body description)- OnGuardZoneMappingUpdate {client_subnets (string, optional): client subnet addresses specific to the Policy Manager zone,override_server_ips (string, optional): IP addresses or FQDN to which OnGuard agent will send request. This will override the Default ClearPass Server IPs} + Required Body Parameters (type(dict) body example)- { + "client_subnets": "", + "override_server_ips": "" + } + """ + url_path = "/onguard/policy-manager-zones/{policy_manager_zones_id}" + dict_path = {"policy_manager_zones_id": policy_manager_zones_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_onguard_policy_manager_zones_by_policy_manager_zones_id( + self, policy_manager_zones_id="", body=({}) + ): + """ + Operation: Post Client Subnets and Server IPs for Policy Manager Zone + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: policy_manager_zones_id, Description: Numeric ID of the policy manager zone + Required Body Parameters (body description)- OnGuardZoneMappingReplace {client_subnets (string): client subnet addresses specific to the Policy Manager zone,override_server_ips (string, optional): IP addresses or FQDN to which OnGuard agent will send request. This will override the Default ClearPass Server IPs} + Required Body Parameters (type(dict) body example)- { + "client_subnets": "", + "override_server_ips": "" + } + """ + url_path = "/onguard/policy-manager-zones/{policy_manager_zones_id}" + dict_path = {"policy_manager_zones_id": policy_manager_zones_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_onguard_policy_manager_zones_by_policy_manager_zones_id( + self, policy_manager_zones_id="" + ): + """ + Operation: Delete authentication server IP addresses for Policy Manager Zone + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: policy_manager_zones_id, Description: Numeric ID of the policy manager zone + """ + url_path = "/onguard/policy-manager-zones/{policy_manager_zones_id}" + dict_path = {"policy_manager_zones_id": policy_manager_zones_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_onguard_policy_manager_zones_name_by_name(self, name=""): + """ + Operation: Get Client Subnets and Server IPs for Policy Manager Zone by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + """ + url_path = "/onguard/policy-manager-zones/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_onguard_policy_manager_zones_name_by_name(self, name="", body=({})): + """ + Operation: Update authentication server IP addresses for Policy Manager Zone by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + Required Body Parameters (body description)- OnGuardZoneMappingUpdate {client_subnets (string, optional): client subnet addresses specific to the Policy Manager zone,override_server_ips (string, optional): IP addresses or FQDN to which OnGuard agent will send request. This will override the Default ClearPass Server IPs} + Required Body Parameters (type(dict) body example)- { + "client_subnets": "", + "override_server_ips": "" + } + """ + url_path = "/onguard/policy-manager-zones/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_onguard_policy_manager_zones_name_by_name(self, name="", body=({})): + """ + Operation: Post Client Subnets and Server IPs for Policy Manager Zone by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + Required Body Parameters (body description)- OnGuardZoneMappingReplace {client_subnets (string): client subnet addresses specific to the Policy Manager zone,override_server_ips (string, optional): IP addresses or FQDN to which OnGuard agent will send request. This will override the Default ClearPass Server IPs} + Required Body Parameters (type(dict) body example)- { + "client_subnets": "", + "override_server_ips": "" + } + """ + url_path = "/onguard/policy-manager-zones/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_onguard_policy_manager_zones_name_by_name(self, name=""): + """ + Operation: Delete authentication server IP addresses for Policy Manager Zone by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + """ + url_path = "/onguard/policy-manager-zones/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:ProfilerSubnetMapping + # Function Section Description: Manage profiler subnet mappings + + def get_profiler_subnet_mapping(self, name=""): + """ + Operation: Get a list of profiler subnet mappings + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + """ + url_path = "/profiler-subnet-mapping" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_profiler_subnet_mapping(self, body=({})): + """ + Operation: Add a profiler subnet mapping + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ProfilerSubnetMappingCreate {network (string): IP Subnets/IP Addresses in CSV format (e.g. "10.21.11.0/24,12.12.12.12"),scan_type (string) = ['WMI' or 'SSH' or 'SNMP']: Scan type of Profiler Subnet Mapping,ext_accounts (array[string]): List of external account names according to Scan Type (e.g. ["acc-wmi-1", "acc-wmi-2", "acc-wmi-3"] for Scan Type WMI)} + Required Body Parameters (type(dict) body example)- { + "network": "", + "scan_type": "", + "ext_accounts": [ + "" + ] + } + """ + url_path = "/profiler-subnet-mapping" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_profiler_subnet_mapping_by_scan_type_profiler_subnet_mapping_id( + self, scan_type="", profiler_subnet_mapping_id="" + ): + """ + Operation: Get a profiler subnet mapping + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: profiler_subnet_mapping_id, Description: Numeric ID of Profiler Subnet Mapping + """ + url_path = "/profiler-subnet-mapping/{scan_type}/{profiler_subnet_mapping_id}" + dict_path = { + "scan_type": scan_type, + "profiler_subnet_mapping_id": profiler_subnet_mapping_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_profiler_subnet_mapping_by_scan_type_profiler_subnet_mapping_id( + self, scan_type="", profiler_subnet_mapping_id="", body=({}) + ): + """ + Operation: Update some fields of a profiler subnet mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: profiler_subnet_mapping_id, Description: Numeric ID of Profiler Subnet Mapping + Required Body Parameters (body description)- ProfilerSubnetMappingUpdate {network (string, optional): IP Subnets/IP Addresses in CSV format (e.g. "10.21.11.0/24,12.12.12.12"),scan_type (string, optional) = ['WMI' or 'SSH' or 'SNMP']: Scan type of Profiler Subnet Mapping,ext_accounts (array[string], optional): List of external account names according to Scan Type (e.g. ["acc-wmi-1", "acc-wmi-2", "acc-wmi-3"] for Scan Type WMI)} + Required Body Parameters (type(dict) body example)- { + "network": "", + "scan_type": "", + "ext_accounts": [ + "" + ] + } + """ + url_path = "/profiler-subnet-mapping/{scan_type}/{profiler_subnet_mapping_id}" + dict_path = { + "scan_type": scan_type, + "profiler_subnet_mapping_id": profiler_subnet_mapping_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_profiler_subnet_mapping_by_scan_type_profiler_subnet_mapping_id( + self, scan_type="", profiler_subnet_mapping_id="", body=({}) + ): + """ + Operation: Replace a profiler subnet mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: profiler_subnet_mapping_id, Description: Numeric ID of Profiler Subnet Mapping + Required Body Parameters (body description)- ProfilerSubnetMappingReplace {network (string): IP Subnets/IP Addresses in CSV format (e.g. "10.21.11.0/24,12.12.12.12"),scan_type (string) = ['WMI' or 'SSH' or 'SNMP']: Scan type of Profiler Subnet Mapping,ext_accounts (array[string]): List of external account names according to Scan Type (e.g. ["acc-wmi-1", "acc-wmi-2", "acc-wmi-3"] for Scan Type WMI)} + Required Body Parameters (type(dict) body example)- { + "network": "", + "scan_type": "", + "ext_accounts": [ + "" + ] + } + """ + url_path = "/profiler-subnet-mapping/{scan_type}/{profiler_subnet_mapping_id}" + dict_path = { + "scan_type": scan_type, + "profiler_subnet_mapping_id": profiler_subnet_mapping_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_profiler_subnet_mapping_by_scan_type_profiler_subnet_mapping_id( + self, scan_type="", profiler_subnet_mapping_id="" + ): + """ + Operation: Delete a profiler subnet mapping + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: profiler_subnet_mapping_id, Description: Numeric ID of Profiler Subnet Mapping + """ + url_path = "/profiler-subnet-mapping/{scan_type}/{profiler_subnet_mapping_id}" + dict_path = { + "scan_type": scan_type, + "profiler_subnet_mapping_id": profiler_subnet_mapping_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_profiler_subnet_mapping_by_scan_type_network_network( + self, scan_type="", network="" + ): + """ + Operation: Get a profiler subnet mapping + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: network, Description: Network of Profiler Subnet Mapping + """ + url_path = "/profiler-subnet-mapping/{scan_type}/network/{network}" + dict_path = {"scan_type": scan_type, "network": network} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_profiler_subnet_mapping_by_scan_type_network_network( + self, scan_type="", network="", body=({}) + ): + """ + Operation: Update some fields of a profiler subnet mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: network, Description: Network of Profiler Subnet Mapping + Required Body Parameters (body description)- ProfilerSubnetMappingUpdate {network (string, optional): IP Subnets/IP Addresses in CSV format (e.g. "10.21.11.0/24,12.12.12.12"),scan_type (string, optional) = ['WMI' or 'SSH' or 'SNMP']: Scan type of Profiler Subnet Mapping,ext_accounts (array[string], optional): List of external account names according to Scan Type (e.g. ["acc-wmi-1", "acc-wmi-2", "acc-wmi-3"] for Scan Type WMI)} + Required Body Parameters (type(dict) body example)- { + "network": "", + "scan_type": "", + "ext_accounts": [ + "" + ] + } + """ + url_path = "/profiler-subnet-mapping/{scan_type}/network/{network}" + dict_path = {"scan_type": scan_type, "network": network} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_profiler_subnet_mapping_by_scan_type_network_network( + self, scan_type="", network="", body=({}) + ): + """ + Operation: Replace a profiler subnet mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: network, Description: Network of Profiler Subnet Mapping + Required Body Parameters (body description)- ProfilerSubnetMappingReplace {network (string): IP Subnets/IP Addresses in CSV format (e.g. "10.21.11.0/24,12.12.12.12"),scan_type (string) = ['WMI' or 'SSH' or 'SNMP']: Scan type of Profiler Subnet Mapping,ext_accounts (array[string]): List of external account names according to Scan Type (e.g. ["acc-wmi-1", "acc-wmi-2", "acc-wmi-3"] for Scan Type WMI)} + Required Body Parameters (type(dict) body example)- { + "network": "", + "scan_type": "", + "ext_accounts": [ + "" + ] + } + """ + url_path = "/profiler-subnet-mapping/{scan_type}/network/{network}" + dict_path = {"scan_type": scan_type, "network": network} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_profiler_subnet_mapping_by_scan_type_network_network( + self, scan_type="", network="" + ): + """ + Operation: Delete a profiler subnet mapping + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: scan_type, Description: Scan Type of Profiler Subnet Mapping + Required Path Parameter Name: network, Description: Network of Profiler Subnet Mapping + """ + url_path = "/profiler-subnet-mapping/{scan_type}/network/{network}" + dict_path = {"scan_type": scan_type, "network": network} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:WindowsHotfix + # Function Section Description: Manage Windows Hotfix + + def get_windows_hotfix( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of Windows Hotfixes + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/windows-hotfix" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_windows_hotfix(self, body=({})): + """ + Operation: Add a Windows Hotfix + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- WindowsHotfixCreate {kbid (string): KBID of the windows hotfix,operating_system (string) = ['Windows 10' or 'Windows 11' or 'Windows 7' or 'Windows 8' or 'Windows Server 2008' or 'Windows Server 2012' or 'Windows Server 2016' or 'Windows Server 2019']: OS of the windows hotfix,title (string): Title of the windows hotfix,severity_rating (string) = ['Critical' or 'Important' or 'Low' or 'Moderate' or 'Unspecified']: Severity rating of the windows hotfix,superseded_by (string, optional): Superseded_by of the windows hotfix,superseding (string, optional): Superseding of the windows hotfix,reboot_behavior (string, optional) = ['' or 'AlwaysRequiresReboot' or 'CanRequestReboot' or 'NeverReboots']: Reboot Behavior of the windows hotfix,release_date (string, optional): Release Date of the windows hotfix,url (string, optional): URL of the windows hotfix,description (string, optional): Description of the windows hotfix} + Required Body Parameters (type(dict) body example)- { + "kbid": "", + "operating_system": "", + "title": "", + "severity_rating": "", + "superseded_by": "", + "superseding": "", + "reboot_behavior": "", + "release_date": "", + "url": "", + "description": "" + } + """ + url_path = "/windows-hotfix" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_windows_hotfix_by_windows_hotfix_id(self, windows_hotfix_id=""): + """ + Operation: Get a windows hotfix + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: windows_hotfix_id, Description: Numeric ID of the windows hotfix + """ + url_path = "/windows-hotfix/{windows_hotfix_id}" + dict_path = {"windows_hotfix_id": windows_hotfix_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_windows_hotfix_by_windows_hotfix_id( + self, windows_hotfix_id="", body=({}) + ): + """ + Operation: Update some fields of a windows hotfix + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: windows_hotfix_id, Description: Numeric ID of the windows hotfix + Required Body Parameters (body description)- WindowsHotfixUpdate {kbid (string, optional): KBID of the windows hotfix,operating_system (string, optional) = ['Windows 10' or 'Windows 11' or 'Windows 7' or 'Windows 8' or 'Windows Server 2008' or 'Windows Server 2012' or 'Windows Server 2016' or 'Windows Server 2019']: OS of the windows hotfix,title (string, optional): Title of the windows hotfix,severity_rating (string, optional) = ['Critical' or 'Important' or 'Low' or 'Moderate' or 'Unspecified']: Severity rating of the windows hotfix,superseded_by (string, optional): Superseded_by of the windows hotfix,superseding (string, optional): Superseding of the windows hotfix,reboot_behavior (string, optional) = ['' or 'AlwaysRequiresReboot' or 'CanRequestReboot' or 'NeverReboots']: Reboot Behavior of the windows hotfix,release_date (string, optional): Release Date of the windows hotfix,url (string, optional): URL of the windows hotfix,description (string, optional): Description of the windows hotfix} + Required Body Parameters (type(dict) body example)- { + "kbid": "", + "operating_system": "", + "title": "", + "severity_rating": "", + "superseded_by": "", + "superseding": "", + "reboot_behavior": "", + "release_date": "", + "url": "", + "description": "" + } + """ + url_path = "/windows-hotfix/{windows_hotfix_id}" + dict_path = {"windows_hotfix_id": windows_hotfix_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_windows_hotfix_by_windows_hotfix_id( + self, windows_hotfix_id="", body=({}) + ): + """ + Operation: Replace a windows hotfix + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: windows_hotfix_id, Description: Numeric ID of the windows hotfix + Required Body Parameters (body description)- WindowsHotfixReplace {kbid (string): KBID of the windows hotfix,operating_system (string) = ['Windows 10' or 'Windows 11' or 'Windows 7' or 'Windows 8' or 'Windows Server 2008' or 'Windows Server 2012' or 'Windows Server 2016' or 'Windows Server 2019']: OS of the windows hotfix,title (string): Title of the windows hotfix,severity_rating (string) = ['Critical' or 'Important' or 'Low' or 'Moderate' or 'Unspecified']: Severity rating of the windows hotfix,superseded_by (string, optional): Superseded_by of the windows hotfix,superseding (string, optional): Superseding of the windows hotfix,reboot_behavior (string, optional) = ['' or 'AlwaysRequiresReboot' or 'CanRequestReboot' or 'NeverReboots']: Reboot Behavior of the windows hotfix,release_date (string, optional): Release Date of the windows hotfix,url (string, optional): URL of the windows hotfix,description (string, optional): Description of the windows hotfix} + Required Body Parameters (type(dict) body example)- { + "kbid": "", + "operating_system": "", + "title": "", + "severity_rating": "", + "superseded_by": "", + "superseding": "", + "reboot_behavior": "", + "release_date": "", + "url": "", + "description": "" + } + """ + url_path = "/windows-hotfix/{windows_hotfix_id}" + dict_path = {"windows_hotfix_id": windows_hotfix_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_windows_hotfix_by_windows_hotfix_id(self, windows_hotfix_id=""): + """ + Operation: Delete a windows hotfix + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: windows_hotfix_id, Description: Numeric ID of the windows hotfix + """ + url_path = "/windows-hotfix/{windows_hotfix_id}" + dict_path = {"windows_hotfix_id": windows_hotfix_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_windows_hotfix_kbid_by_kbid_operating_system_operating_system( + self, kbid="", operating_system="" + ): + """ + Operation: Get a windows hotfix by kbid and os + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: kbid, Description: KBID of the hotfix + Required Path Parameter Name: operating_system, Description: Operating system of the hotfix + """ + url_path = "/windows-hotfix/kbid/{kbid}/operating_system/{operating_system}" + dict_path = {"kbid": kbid, "operating_system": operating_system} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_windows_hotfix_kbid_by_kbid_operating_system_operating_system( + self, kbid="", operating_system="", body=({}) + ): + """ + Operation: Update some fields of a windows hotfix by kbid and os + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: kbid, Description: KBID of the hotfix + Required Path Parameter Name: operating_system, Description: Operating system of the hotfix + Required Body Parameters (body description)- WindowsHotfixUpdate {kbid (string, optional): KBID of the windows hotfix,operating_system (string, optional) = ['Windows 10' or 'Windows 11' or 'Windows 7' or 'Windows 8' or 'Windows Server 2008' or 'Windows Server 2012' or 'Windows Server 2016' or 'Windows Server 2019']: OS of the windows hotfix,title (string, optional): Title of the windows hotfix,severity_rating (string, optional) = ['Critical' or 'Important' or 'Low' or 'Moderate' or 'Unspecified']: Severity rating of the windows hotfix,superseded_by (string, optional): Superseded_by of the windows hotfix,superseding (string, optional): Superseding of the windows hotfix,reboot_behavior (string, optional) = ['' or 'AlwaysRequiresReboot' or 'CanRequestReboot' or 'NeverReboots']: Reboot Behavior of the windows hotfix,release_date (string, optional): Release Date of the windows hotfix,url (string, optional): URL of the windows hotfix,description (string, optional): Description of the windows hotfix} + Required Body Parameters (type(dict) body example)- { + "kbid": "", + "operating_system": "", + "title": "", + "severity_rating": "", + "superseded_by": "", + "superseding": "", + "reboot_behavior": "", + "release_date": "", + "url": "", + "description": "" + } + """ + url_path = "/windows-hotfix/kbid/{kbid}/operating_system/{operating_system}" + dict_path = {"kbid": kbid, "operating_system": operating_system} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_windows_hotfix_kbid_by_kbid_operating_system_operating_system( + self, kbid="", operating_system="", body=({}) + ): + """ + Operation: Replace a windows hotfix by kbid and os + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: kbid, Description: KBID of the hotfix + Required Path Parameter Name: operating_system, Description: Operating system of the hotfix + Required Body Parameters (body description)- WindowsHotfixReplace {kbid (string): KBID of the windows hotfix,operating_system (string) = ['Windows 10' or 'Windows 11' or 'Windows 7' or 'Windows 8' or 'Windows Server 2008' or 'Windows Server 2012' or 'Windows Server 2016' or 'Windows Server 2019']: OS of the windows hotfix,title (string): Title of the windows hotfix,severity_rating (string) = ['Critical' or 'Important' or 'Low' or 'Moderate' or 'Unspecified']: Severity rating of the windows hotfix,superseded_by (string, optional): Superseded_by of the windows hotfix,superseding (string, optional): Superseding of the windows hotfix,reboot_behavior (string, optional) = ['' or 'AlwaysRequiresReboot' or 'CanRequestReboot' or 'NeverReboots']: Reboot Behavior of the windows hotfix,release_date (string, optional): Release Date of the windows hotfix,url (string, optional): URL of the windows hotfix,description (string, optional): Description of the windows hotfix} + Required Body Parameters (type(dict) body example)- { + "kbid": "", + "operating_system": "", + "title": "", + "severity_rating": "", + "superseded_by": "", + "superseding": "", + "reboot_behavior": "", + "release_date": "", + "url": "", + "description": "" + } + """ + url_path = "/windows-hotfix/kbid/{kbid}/operating_system/{operating_system}" + dict_path = {"kbid": kbid, "operating_system": operating_system} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_windows_hotfix_kbid_by_kbid_operating_system_operating_system( + self, kbid="", operating_system="" + ): + """ + Operation: Delete a windows hotfix by kbid and os + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: kbid, Description: KBID of the hotfix + Required Path Parameter Name: operating_system, Description: Operating system of the hotfix + """ + url_path = "/windows-hotfix/kbid/{kbid}/operating_system/{operating_system}" + dict_path = {"kbid": kbid, "operating_system": operating_system} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_enforcementprofile_v1.py b/pyclearpass/api_explorer_enforcementprofile_v1.py new file mode 100644 index 0000000..a76bb29 --- /dev/null +++ b/pyclearpass/api_explorer_enforcementprofile_v1.py @@ -0,0 +1,4489 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_enforcementprofile_v1.py + + +class ApiEnforcementProfiles(ClearPassAPILogin): + # Function Section Name:CaptivePortalProfile + # Function Section Description: Manage Captive Portal Profile + + def get_enforcement_profile_dur_captive_portal_profile_by_product_name( + self, product_name="" + ): + """ + Operation: GET a list of Captive Portal Profiles + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/captive-portal-profile/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_captive_portal_profile_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Captive Portal Profile + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- CaptivePortalProfilePost {name (string): Name of the Captive Portal Profile,url (string): URL for ArubaOS-Switch and AOS-CX Captive Portal Profile,url_hashkey (string, optional): URL HashKey for ArubaOS-Switch Captive Portal Profile,aos_attributes (AosAttributes, optional): Attributes for Mobility Access Switch and Mobility Controller Captive Portal Profile}AosAttributes {server_group (string, optional): Server Group,default_role (string, optional): Default Role,default_guest_role (string, optional): Default Guest Role,redirect_pause (integer, optional): Redirect Pause (0-60 sec),user_login (string, optional) = ['Yes' or 'No']: User Login,guest_login (string, optional) = ['Yes' or 'No']: Guest Login,logout_popup_window (string, optional) = ['Yes' or 'No']: Logout Popup Window,use_http_for_auth (string, optional) = ['Yes' or 'No']: Use HTTP for Authentication,logon_wait_min_delay (integer, optional): Logon Wait Minimum Delay (1-10 sec),logon_wait_max_delay (integer, optional): Logon Wait Maximum Delay (1-10 sec),logon_wait_cpu_util_threshold (integer, optional): Logon Wait CPU Utilization Threshold (1-100 %),max_auth_failures (integer, optional): Max Authentication Failures (0-10),show_fqdn (string, optional) = ['Yes' or 'No']: Show FQDN,use_chap (string, optional) = ['Yes' or 'No']: Use CHAP (Non-standard),login_page (string, optional): Login Page,welcome_page (string, optional): Welcome Page,show_welcome_page (string, optional) = ['Yes' or 'No']: Show Welcome Page,add_switch_ip_add_in_redirection_url (string, optional) = ['Yes' or 'No']: Adding Switch IP Address in Redirection URL,allow_one_active_user_session (string, optional) = ['Yes' or 'No']: Allow only one Active User Session,show_acceptable_use_policy_page (string, optional) = ['Yes' or 'No']: Show the Acceptable Use Policy Page,add_ip_interface_in_redirection_url (string, optional): Add an IP Interface in the Redirection URL,add_user_vlan_in_redirection_url (string, optional) = ['Yes' or 'No']: Add User VLAN in Redirection URL,allowed_net_destinations (array[string], optional): Allowlist Net Destinations} + Required Body Parameters (type(dict) body example)- { + "name": "", + "url": "", + "url_hashkey": "", + "aos_attributes": { + "server_group": "", + "default_role": "", + "default_guest_role": "", + "redirect_pause": 0, + "user_login": "", + "guest_login": "", + "logout_popup_window": "", + "use_http_for_auth": "", + "logon_wait_min_delay": 0, + "logon_wait_max_delay": 0, + "logon_wait_cpu_util_threshold": 0, + "max_auth_failures": 0, + "show_fqdn": "", + "use_chap": "", + "login_page": "", + "welcome_page": "", + "show_welcome_page": "", + "add_switch_ip_add_in_redirection_url": "", + "allow_one_active_user_session": "", + "show_acceptable_use_policy_page": "", + "add_ip_interface_in_redirection_url": "", + "add_user_vlan_in_redirection_url": "", + "allowed_net_destinations": [ + "" + ] + } + } + """ + url_path = "/enforcement-profile-dur/captive-portal-profile/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_captive_portal_profile_by_product_name_captive_portal_profile_id( + self, product_name="", captive_portal_profile_id="" + ): + """ + Operation: Get a Captive Portal Profile + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: captive_portal_profile_id, Description: Numeric ID of the Captive Portal Profile + """ + url_path = "/enforcement-profile-dur/captive-portal-profile/{product_name}/{captive_portal_profile_id}" + dict_path = { + "product_name": product_name, + "captive_portal_profile_id": captive_portal_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_captive_portal_profile_by_product_name_captive_portal_profile_id( + self, product_name="", captive_portal_profile_id="", body=({}) + ): + """ + Operation: Update some fields of a Captive Portal Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: captive_portal_profile_id, Description: Numeric ID of the Captive Portal Profile + Required Body Parameters (body description)- CaptivePortalProfileUpdate {name (string, optional): Name of the Captive Portal Profile,url (string, optional): URL for ArubaOS-Switch and AOS-CX Captive Portal Profile,url_hashkey (string, optional): URL HashKey for ArubaOS-Switch Captive Portal Profile,aos_attributes (AosAttributes, optional): Attributes for Mobility Access Switch and Mobility Controller Captive Portal Profile}AosAttributes {server_group (string, optional): Server Group,default_role (string, optional): Default Role,default_guest_role (string, optional): Default Guest Role,redirect_pause (integer, optional): Redirect Pause (0-60 sec),user_login (string, optional) = ['Yes' or 'No']: User Login,guest_login (string, optional) = ['Yes' or 'No']: Guest Login,logout_popup_window (string, optional) = ['Yes' or 'No']: Logout Popup Window,use_http_for_auth (string, optional) = ['Yes' or 'No']: Use HTTP for Authentication,logon_wait_min_delay (integer, optional): Logon Wait Minimum Delay (1-10 sec),logon_wait_max_delay (integer, optional): Logon Wait Maximum Delay (1-10 sec),logon_wait_cpu_util_threshold (integer, optional): Logon Wait CPU Utilization Threshold (1-100 %),max_auth_failures (integer, optional): Max Authentication Failures (0-10),show_fqdn (string, optional) = ['Yes' or 'No']: Show FQDN,use_chap (string, optional) = ['Yes' or 'No']: Use CHAP (Non-standard),login_page (string, optional): Login Page,welcome_page (string, optional): Welcome Page,show_welcome_page (string, optional) = ['Yes' or 'No']: Show Welcome Page,add_switch_ip_add_in_redirection_url (string, optional) = ['Yes' or 'No']: Adding Switch IP Address in Redirection URL,allow_one_active_user_session (string, optional) = ['Yes' or 'No']: Allow only one Active User Session,show_acceptable_use_policy_page (string, optional) = ['Yes' or 'No']: Show the Acceptable Use Policy Page,add_ip_interface_in_redirection_url (string, optional): Add an IP Interface in the Redirection URL,add_user_vlan_in_redirection_url (string, optional) = ['Yes' or 'No']: Add User VLAN in Redirection URL,allowed_net_destinations (array[string], optional): Allowlist Net Destinations} + Required Body Parameters (type(dict) body example)- { + "name": "", + "url": "", + "url_hashkey": "", + "aos_attributes": { + "server_group": "", + "default_role": "", + "default_guest_role": "", + "redirect_pause": 0, + "user_login": "", + "guest_login": "", + "logout_popup_window": "", + "use_http_for_auth": "", + "logon_wait_min_delay": 0, + "logon_wait_max_delay": 0, + "logon_wait_cpu_util_threshold": 0, + "max_auth_failures": 0, + "show_fqdn": "", + "use_chap": "", + "login_page": "", + "welcome_page": "", + "show_welcome_page": "", + "add_switch_ip_add_in_redirection_url": "", + "allow_one_active_user_session": "", + "show_acceptable_use_policy_page": "", + "add_ip_interface_in_redirection_url": "", + "add_user_vlan_in_redirection_url": "", + "allowed_net_destinations": [ + "" + ] + } + } + """ + url_path = "/enforcement-profile-dur/captive-portal-profile/{product_name}/{captive_portal_profile_id}" + dict_path = { + "product_name": product_name, + "captive_portal_profile_id": captive_portal_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_captive_portal_profile_by_product_name_captive_portal_profile_id( + self, product_name="", captive_portal_profile_id="", body=({}) + ): + """ + Operation: Replace a Captive Portal Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: captive_portal_profile_id, Description: Numeric ID of the Captive Portal Profile + Required Body Parameters (body description)- CaptivePortalProfileReplace {name (string, optional): Name of the Captive Portal Profile,url (string, optional): URL for ArubaOS-Switch and AOS-CX Captive Portal Profile,url_hashkey (string, optional): URL HashKey for ArubaOS-Switch Captive Portal Profile,aos_attributes (AosAttributes, optional): Attributes for Mobility Access Switch and Mobility Controller Captive Portal Profile}AosAttributes {server_group (string, optional): Server Group,default_role (string, optional): Default Role,default_guest_role (string, optional): Default Guest Role,redirect_pause (integer, optional): Redirect Pause (0-60 sec),user_login (string, optional) = ['Yes' or 'No']: User Login,guest_login (string, optional) = ['Yes' or 'No']: Guest Login,logout_popup_window (string, optional) = ['Yes' or 'No']: Logout Popup Window,use_http_for_auth (string, optional) = ['Yes' or 'No']: Use HTTP for Authentication,logon_wait_min_delay (integer, optional): Logon Wait Minimum Delay (1-10 sec),logon_wait_max_delay (integer, optional): Logon Wait Maximum Delay (1-10 sec),logon_wait_cpu_util_threshold (integer, optional): Logon Wait CPU Utilization Threshold (1-100 %),max_auth_failures (integer, optional): Max Authentication Failures (0-10),show_fqdn (string, optional) = ['Yes' or 'No']: Show FQDN,use_chap (string, optional) = ['Yes' or 'No']: Use CHAP (Non-standard),login_page (string, optional): Login Page,welcome_page (string, optional): Welcome Page,show_welcome_page (string, optional) = ['Yes' or 'No']: Show Welcome Page,add_switch_ip_add_in_redirection_url (string, optional) = ['Yes' or 'No']: Adding Switch IP Address in Redirection URL,allow_one_active_user_session (string, optional) = ['Yes' or 'No']: Allow only one Active User Session,show_acceptable_use_policy_page (string, optional) = ['Yes' or 'No']: Show the Acceptable Use Policy Page,add_ip_interface_in_redirection_url (string, optional): Add an IP Interface in the Redirection URL,add_user_vlan_in_redirection_url (string, optional) = ['Yes' or 'No']: Add User VLAN in Redirection URL,allowed_net_destinations (array[string], optional): Allowlist Net Destinations} + Required Body Parameters (type(dict) body example)- { + "name": "", + "url": "", + "url_hashkey": "", + "aos_attributes": { + "server_group": "", + "default_role": "", + "default_guest_role": "", + "redirect_pause": 0, + "user_login": "", + "guest_login": "", + "logout_popup_window": "", + "use_http_for_auth": "", + "logon_wait_min_delay": 0, + "logon_wait_max_delay": 0, + "logon_wait_cpu_util_threshold": 0, + "max_auth_failures": 0, + "show_fqdn": "", + "use_chap": "", + "login_page": "", + "welcome_page": "", + "show_welcome_page": "", + "add_switch_ip_add_in_redirection_url": "", + "allow_one_active_user_session": "", + "show_acceptable_use_policy_page": "", + "add_ip_interface_in_redirection_url": "", + "add_user_vlan_in_redirection_url": "", + "allowed_net_destinations": [ + "" + ] + } + } + """ + url_path = "/enforcement-profile-dur/captive-portal-profile/{product_name}/{captive_portal_profile_id}" + dict_path = { + "product_name": product_name, + "captive_portal_profile_id": captive_portal_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_captive_portal_profile_by_product_name_captive_portal_profile_id( + self, product_name="", captive_portal_profile_id="" + ): + """ + Operation: Delete a Captive Portal Profile + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: captive_portal_profile_id, Description: Numeric ID of the Captive Portal Profile + """ + url_path = "/enforcement-profile-dur/captive-portal-profile/{product_name}/{captive_portal_profile_id}" + dict_path = { + "product_name": product_name, + "captive_portal_profile_id": captive_portal_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_captive_portal_profile_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Captive Portal Profile by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Captive Portal Profile + """ + url_path = ( + "/enforcement-profile-dur/captive-portal-profile/{product_name}/name/{name}" + ) + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_captive_portal_profile_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a Captive Portal Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Captive Portal Profile + Required Body Parameters (body description)- CaptivePortalProfileUpdate {name (string, optional): Name of the Captive Portal Profile,url (string, optional): URL for ArubaOS-Switch and AOS-CX Captive Portal Profile,url_hashkey (string, optional): URL HashKey for ArubaOS-Switch Captive Portal Profile,aos_attributes (AosAttributes, optional): Attributes for Mobility Access Switch and Mobility Controller Captive Portal Profile}AosAttributes {server_group (string, optional): Server Group,default_role (string, optional): Default Role,default_guest_role (string, optional): Default Guest Role,redirect_pause (integer, optional): Redirect Pause (0-60 sec),user_login (string, optional) = ['Yes' or 'No']: User Login,guest_login (string, optional) = ['Yes' or 'No']: Guest Login,logout_popup_window (string, optional) = ['Yes' or 'No']: Logout Popup Window,use_http_for_auth (string, optional) = ['Yes' or 'No']: Use HTTP for Authentication,logon_wait_min_delay (integer, optional): Logon Wait Minimum Delay (1-10 sec),logon_wait_max_delay (integer, optional): Logon Wait Maximum Delay (1-10 sec),logon_wait_cpu_util_threshold (integer, optional): Logon Wait CPU Utilization Threshold (1-100 %),max_auth_failures (integer, optional): Max Authentication Failures (0-10),show_fqdn (string, optional) = ['Yes' or 'No']: Show FQDN,use_chap (string, optional) = ['Yes' or 'No']: Use CHAP (Non-standard),login_page (string, optional): Login Page,welcome_page (string, optional): Welcome Page,show_welcome_page (string, optional) = ['Yes' or 'No']: Show Welcome Page,add_switch_ip_add_in_redirection_url (string, optional) = ['Yes' or 'No']: Adding Switch IP Address in Redirection URL,allow_one_active_user_session (string, optional) = ['Yes' or 'No']: Allow only one Active User Session,show_acceptable_use_policy_page (string, optional) = ['Yes' or 'No']: Show the Acceptable Use Policy Page,add_ip_interface_in_redirection_url (string, optional): Add an IP Interface in the Redirection URL,add_user_vlan_in_redirection_url (string, optional) = ['Yes' or 'No']: Add User VLAN in Redirection URL,allowed_net_destinations (array[string], optional): Allowlist Net Destinations} + Required Body Parameters (type(dict) body example)- { + "name": "", + "url": "", + "url_hashkey": "", + "aos_attributes": { + "server_group": "", + "default_role": "", + "default_guest_role": "", + "redirect_pause": 0, + "user_login": "", + "guest_login": "", + "logout_popup_window": "", + "use_http_for_auth": "", + "logon_wait_min_delay": 0, + "logon_wait_max_delay": 0, + "logon_wait_cpu_util_threshold": 0, + "max_auth_failures": 0, + "show_fqdn": "", + "use_chap": "", + "login_page": "", + "welcome_page": "", + "show_welcome_page": "", + "add_switch_ip_add_in_redirection_url": "", + "allow_one_active_user_session": "", + "show_acceptable_use_policy_page": "", + "add_ip_interface_in_redirection_url": "", + "add_user_vlan_in_redirection_url": "", + "allowed_net_destinations": [ + "" + ] + } + } + """ + url_path = ( + "/enforcement-profile-dur/captive-portal-profile/{product_name}/name/{name}" + ) + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_captive_portal_profile_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Captive Portal Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Captive Portal Profile + Required Body Parameters (body description)- CaptivePortalProfileReplace {name (string, optional): Name of the Captive Portal Profile,url (string, optional): URL for ArubaOS-Switch and AOS-CX Captive Portal Profile,url_hashkey (string, optional): URL HashKey for ArubaOS-Switch Captive Portal Profile,aos_attributes (AosAttributes, optional): Attributes for Mobility Access Switch and Mobility Controller Captive Portal Profile}AosAttributes {server_group (string, optional): Server Group,default_role (string, optional): Default Role,default_guest_role (string, optional): Default Guest Role,redirect_pause (integer, optional): Redirect Pause (0-60 sec),user_login (string, optional) = ['Yes' or 'No']: User Login,guest_login (string, optional) = ['Yes' or 'No']: Guest Login,logout_popup_window (string, optional) = ['Yes' or 'No']: Logout Popup Window,use_http_for_auth (string, optional) = ['Yes' or 'No']: Use HTTP for Authentication,logon_wait_min_delay (integer, optional): Logon Wait Minimum Delay (1-10 sec),logon_wait_max_delay (integer, optional): Logon Wait Maximum Delay (1-10 sec),logon_wait_cpu_util_threshold (integer, optional): Logon Wait CPU Utilization Threshold (1-100 %),max_auth_failures (integer, optional): Max Authentication Failures (0-10),show_fqdn (string, optional) = ['Yes' or 'No']: Show FQDN,use_chap (string, optional) = ['Yes' or 'No']: Use CHAP (Non-standard),login_page (string, optional): Login Page,welcome_page (string, optional): Welcome Page,show_welcome_page (string, optional) = ['Yes' or 'No']: Show Welcome Page,add_switch_ip_add_in_redirection_url (string, optional) = ['Yes' or 'No']: Adding Switch IP Address in Redirection URL,allow_one_active_user_session (string, optional) = ['Yes' or 'No']: Allow only one Active User Session,show_acceptable_use_policy_page (string, optional) = ['Yes' or 'No']: Show the Acceptable Use Policy Page,add_ip_interface_in_redirection_url (string, optional): Add an IP Interface in the Redirection URL,add_user_vlan_in_redirection_url (string, optional) = ['Yes' or 'No']: Add User VLAN in Redirection URL,allowed_net_destinations (array[string], optional): Allowlist Net Destinations} + Required Body Parameters (type(dict) body example)- { + "name": "", + "url": "", + "url_hashkey": "", + "aos_attributes": { + "server_group": "", + "default_role": "", + "default_guest_role": "", + "redirect_pause": 0, + "user_login": "", + "guest_login": "", + "logout_popup_window": "", + "use_http_for_auth": "", + "logon_wait_min_delay": 0, + "logon_wait_max_delay": 0, + "logon_wait_cpu_util_threshold": 0, + "max_auth_failures": 0, + "show_fqdn": "", + "use_chap": "", + "login_page": "", + "welcome_page": "", + "show_welcome_page": "", + "add_switch_ip_add_in_redirection_url": "", + "allow_one_active_user_session": "", + "show_acceptable_use_policy_page": "", + "add_ip_interface_in_redirection_url": "", + "add_user_vlan_in_redirection_url": "", + "allowed_net_destinations": [ + "" + ] + } + } + """ + url_path = ( + "/enforcement-profile-dur/captive-portal-profile/{product_name}/name/{name}" + ) + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_captive_portal_profile_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Captive Portal Profile by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Captive Portal Profile + """ + url_path = ( + "/enforcement-profile-dur/captive-portal-profile/{product_name}/name/{name}" + ) + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:DURClass + # Function Section Description: Manage DUR Class + + def get_enforcement_profile_dur_dur_class_by_product_name(self, product_name=""): + """ + Operation: GET a list of Policies + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_dur_class_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a DUR Class + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- DURClassPost {name (string): Name of the DUR Class,traffic (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Traffic of the DUR Class,hpe_rules (array[HPERulesPost]): Rules for ArubaOS-Switch DUR Class,aos_cx_rules (array[AosCxRulesPost]): Rules for AOS-CX DUR Class}HPERulesPost {number (integer): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,traffic_match_type (string, optional) = ['netsource' or 'protocol']: Traffic Match Type,net_source (string, optional) = ['any']: Net Source for netsource traffic_match_type,net_destination (string, optional): Net Destination for netsource traffic_match_type,net_service (string, optional): Net Service for netsource traffic_match_type,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'vrrp' or 'pim' or 'ospf' or 'ipv6_in_ip' or 'ip_in_ip' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'gre' or 'esp' or 'ah' or '255']: Protocol for protocol traffic_match_type,source (string, optional) = ['any']: Source for protocol traffic_match_type,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Source Port for protocol traffic_match_type,source_port_value (string, optional): Source Port Value for protocol traffic_match_type,protocol_number (integer): Protocol Number (0-255) for 255 protocol,destination (string, optional) = ['any' or 'host' or 'ipsubnet']: Destnation for protocol traffic_match_type,destination_value (string, optional): Destination Value for protocol traffic_match_type,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Destination Port for protocol traffic_match_type,destination_port_value (string, optional): Destination Port Value for protocol traffic_match_type,ip_dscp (integer, optional): IP DSCP (0-63) for protocol traffic_match_type,vlan_id (integer, optional): VLAN ID (1-4094) for protocol traffic_match_type,ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence for protocol traffic_match_type,ip_service_type (string, optional) = ['normal' or 'max reliability' or 'max throughput' or 'minimize delay']: IP Type of Service for protocol traffic_match_type,established (boolean, optional): Established for tcp protocol,fin (boolean, optional): Fin for tcp protocol,rst (boolean, optional): Rst for tcp protocol,syn (boolean, optional): Syn for tcp protocol}AosCxRulesPost {number (integer, optional): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'pim' or 'ospf' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'icmpv6' or 'gre' or 'esp' or 'ah' or 'number' or 'any']: Protocol,protocol_number (integer): Protocol Number for number protocol,source (string, optional) = ['any' or 'ip']: Source,source_ip_address (string): Source IP Address for ip source,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Source Port,source_port_value (string): Source Port Value,destination (string, optional) = ['any' or 'ip']: Destination,destination_ip_address (string): Destination IP Address for ip destination,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Destination Port,destination_port_value (string): Destination Port Value,dscp (integer, optional): DSCP (0-63),vlan_id (integer, optional): VLAN ID (1-4094),ecn (integer, optional): ECN (0-3),ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence,service_type (integer, optional): Type of Service (0-31),ttl (integer, optional): Time to Live (0-255),fragment (boolean, optional): Fragment,count_packet (boolean, optional): Count Packet,cwr (boolean, optional): cwr for tcp protocol,ece (boolean, optional): ece for tcp protocol,urg (boolean, optional): urg for tcp protocol,ack (boolean, optional): ack for tcp protocol,psh (boolean, optional): psh for tcp protocol,rst (boolean, optional): rst for tcp protocol,syn (boolean, optional): syn for tcp protocol,fin (boolean, optional): fin for tcp protocol,established (boolean, optional): established for tcp protocol,icmp_type (string, optional) = ['echo' or 'echo-reply' or 'number']: ICMP Type for icmp protocol,icmp_type_value (integer): ICMP Type Value (0-255) for number icmp_type,icmp_code (integer, optional): ICMP Code (0-255) for icmp protocol} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic": "", + "hpe_rules": [ + { + "number": 0, + "packet_match": "", + "traffic_match_type": "", + "net_source": "", + "net_destination": "", + "net_service": "", + "protocol": "", + "source": "", + "source_port": "", + "source_port_value": "", + "protocol_number": 0, + "destination": "", + "destination_value": "", + "destination_port": "", + "destination_port_value": "", + "ip_dscp": 0, + "vlan_id": 0, + "ip_precedence": "", + "ip_service_type": "", + "established": false, + "fin": false, + "rst": false, + "syn": false + } + ], + "aos_cx_rules": [ + { + "number": 0, + "packet_match": "", + "protocol": "", + "protocol_number": 0, + "source": "", + "source_ip_address": "", + "source_port": "", + "source_port_value": "", + "destination": "", + "destination_ip_address": "", + "destination_port": "", + "destination_port_value": "", + "dscp": 0, + "vlan_id": 0, + "ecn": 0, + "ip_precedence": "", + "service_type": 0, + "ttl": 0, + "fragment": false, + "count_packet": false, + "cwr": false, + "ece": false, + "urg": false, + "ack": false, + "psh": false, + "rst": false, + "syn": false, + "fin": false, + "established": false, + "icmp_type": "", + "icmp_type_value": 0, + "icmp_code": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_dur_class_by_product_name_dur_class_id( + self, product_name="", dur_class_id="" + ): + """ + Operation: Get a DUR Class + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: dur_class_id, Description: Numeric ID of the DURClass + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/{dur_class_id}" + dict_path = {"product_name": product_name, "dur_class_id": dur_class_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_dur_class_by_product_name_dur_class_id( + self, product_name="", dur_class_id="", body=({}) + ): + """ + Operation: Update a DUR Class + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: dur_class_id, Description: Numeric ID of the DURClass + Required Body Parameters (body description)- DURClassUpdate {name (string, optional): Name of the DUR Class,traffic (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Traffic of the DUR Class,hpe_rules (array[HPERulesPost], optional): Rules for ArubaOS-Switch DUR Class,aos_cx_rules (array[AosCxRulesPost], optional): Rules for AOS-CX DUR Class}HPERulesPost {number (integer): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,traffic_match_type (string, optional) = ['netsource' or 'protocol']: Traffic Match Type,net_source (string, optional) = ['any']: Net Source for netsource traffic_match_type,net_destination (string, optional): Net Destination for netsource traffic_match_type,net_service (string, optional): Net Service for netsource traffic_match_type,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'vrrp' or 'pim' or 'ospf' or 'ipv6_in_ip' or 'ip_in_ip' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'gre' or 'esp' or 'ah' or '255']: Protocol for protocol traffic_match_type,source (string, optional) = ['any']: Source for protocol traffic_match_type,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Source Port for protocol traffic_match_type,source_port_value (string, optional): Source Port Value for protocol traffic_match_type,protocol_number (integer): Protocol Number (0-255) for 255 protocol,destination (string, optional) = ['any' or 'host' or 'ipsubnet']: Destnation for protocol traffic_match_type,destination_value (string, optional): Destination Value for protocol traffic_match_type,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Destination Port for protocol traffic_match_type,destination_port_value (string, optional): Destination Port Value for protocol traffic_match_type,ip_dscp (integer, optional): IP DSCP (0-63) for protocol traffic_match_type,vlan_id (integer, optional): VLAN ID (1-4094) for protocol traffic_match_type,ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence for protocol traffic_match_type,ip_service_type (string, optional) = ['normal' or 'max reliability' or 'max throughput' or 'minimize delay']: IP Type of Service for protocol traffic_match_type,established (boolean, optional): Established for tcp protocol,fin (boolean, optional): Fin for tcp protocol,rst (boolean, optional): Rst for tcp protocol,syn (boolean, optional): Syn for tcp protocol}AosCxRulesPost {number (integer, optional): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'pim' or 'ospf' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'icmpv6' or 'gre' or 'esp' or 'ah' or 'number' or 'any']: Protocol,protocol_number (integer): Protocol Number for number protocol,source (string, optional) = ['any' or 'ip']: Source,source_ip_address (string): Source IP Address for ip source,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Source Port,source_port_value (string): Source Port Value,destination (string, optional) = ['any' or 'ip']: Destination,destination_ip_address (string): Destination IP Address for ip destination,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Destination Port,destination_port_value (string): Destination Port Value,dscp (integer, optional): DSCP (0-63),vlan_id (integer, optional): VLAN ID (1-4094),ecn (integer, optional): ECN (0-3),ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence,service_type (integer, optional): Type of Service (0-31),ttl (integer, optional): Time to Live (0-255),fragment (boolean, optional): Fragment,count_packet (boolean, optional): Count Packet,cwr (boolean, optional): cwr for tcp protocol,ece (boolean, optional): ece for tcp protocol,urg (boolean, optional): urg for tcp protocol,ack (boolean, optional): ack for tcp protocol,psh (boolean, optional): psh for tcp protocol,rst (boolean, optional): rst for tcp protocol,syn (boolean, optional): syn for tcp protocol,fin (boolean, optional): fin for tcp protocol,established (boolean, optional): established for tcp protocol,icmp_type (string, optional) = ['echo' or 'echo-reply' or 'number']: ICMP Type for icmp protocol,icmp_type_value (integer): ICMP Type Value (0-255) for number icmp_type,icmp_code (integer, optional): ICMP Code (0-255) for icmp protocol} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic": "", + "hpe_rules": [ + { + "number": 0, + "packet_match": "", + "traffic_match_type": "", + "net_source": "", + "net_destination": "", + "net_service": "", + "protocol": "", + "source": "", + "source_port": "", + "source_port_value": "", + "protocol_number": 0, + "destination": "", + "destination_value": "", + "destination_port": "", + "destination_port_value": "", + "ip_dscp": 0, + "vlan_id": 0, + "ip_precedence": "", + "ip_service_type": "", + "established": false, + "fin": false, + "rst": false, + "syn": false + } + ], + "aos_cx_rules": [ + { + "number": 0, + "packet_match": "", + "protocol": "", + "protocol_number": 0, + "source": "", + "source_ip_address": "", + "source_port": "", + "source_port_value": "", + "destination": "", + "destination_ip_address": "", + "destination_port": "", + "destination_port_value": "", + "dscp": 0, + "vlan_id": 0, + "ecn": 0, + "ip_precedence": "", + "service_type": 0, + "ttl": 0, + "fragment": false, + "count_packet": false, + "cwr": false, + "ece": false, + "urg": false, + "ack": false, + "psh": false, + "rst": false, + "syn": false, + "fin": false, + "established": false, + "icmp_type": "", + "icmp_type_value": 0, + "icmp_code": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/{dur_class_id}" + dict_path = {"product_name": product_name, "dur_class_id": dur_class_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_dur_class_by_product_name_dur_class_id( + self, product_name="", dur_class_id="", body=({}) + ): + """ + Operation: Replace a DUR Class + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: dur_class_id, Description: Numeric ID of the DURClass + Required Body Parameters (body description)- DURClassReplace {name (string): Name of the DUR Class,traffic (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Traffic of the DUR Class,hpe_rules (array[HPERulesPost]): Rules for ArubaOS-Switch DUR Class,aos_cx_rules (array[AosCxRulesPost]): Rules for AOS-CX DUR Class}HPERulesPost {number (integer): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,traffic_match_type (string, optional) = ['netsource' or 'protocol']: Traffic Match Type,net_source (string, optional) = ['any']: Net Source for netsource traffic_match_type,net_destination (string, optional): Net Destination for netsource traffic_match_type,net_service (string, optional): Net Service for netsource traffic_match_type,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'vrrp' or 'pim' or 'ospf' or 'ipv6_in_ip' or 'ip_in_ip' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'gre' or 'esp' or 'ah' or '255']: Protocol for protocol traffic_match_type,source (string, optional) = ['any']: Source for protocol traffic_match_type,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Source Port for protocol traffic_match_type,source_port_value (string, optional): Source Port Value for protocol traffic_match_type,protocol_number (integer): Protocol Number (0-255) for 255 protocol,destination (string, optional) = ['any' or 'host' or 'ipsubnet']: Destnation for protocol traffic_match_type,destination_value (string, optional): Destination Value for protocol traffic_match_type,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Destination Port for protocol traffic_match_type,destination_port_value (string, optional): Destination Port Value for protocol traffic_match_type,ip_dscp (integer, optional): IP DSCP (0-63) for protocol traffic_match_type,vlan_id (integer, optional): VLAN ID (1-4094) for protocol traffic_match_type,ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence for protocol traffic_match_type,ip_service_type (string, optional) = ['normal' or 'max reliability' or 'max throughput' or 'minimize delay']: IP Type of Service for protocol traffic_match_type,established (boolean, optional): Established for tcp protocol,fin (boolean, optional): Fin for tcp protocol,rst (boolean, optional): Rst for tcp protocol,syn (boolean, optional): Syn for tcp protocol}AosCxRulesPost {number (integer, optional): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'pim' or 'ospf' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'icmpv6' or 'gre' or 'esp' or 'ah' or 'number' or 'any']: Protocol,protocol_number (integer): Protocol Number for number protocol,source (string, optional) = ['any' or 'ip']: Source,source_ip_address (string): Source IP Address for ip source,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Source Port,source_port_value (string): Source Port Value,destination (string, optional) = ['any' or 'ip']: Destination,destination_ip_address (string): Destination IP Address for ip destination,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Destination Port,destination_port_value (string): Destination Port Value,dscp (integer, optional): DSCP (0-63),vlan_id (integer, optional): VLAN ID (1-4094),ecn (integer, optional): ECN (0-3),ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence,service_type (integer, optional): Type of Service (0-31),ttl (integer, optional): Time to Live (0-255),fragment (boolean, optional): Fragment,count_packet (boolean, optional): Count Packet,cwr (boolean, optional): cwr for tcp protocol,ece (boolean, optional): ece for tcp protocol,urg (boolean, optional): urg for tcp protocol,ack (boolean, optional): ack for tcp protocol,psh (boolean, optional): psh for tcp protocol,rst (boolean, optional): rst for tcp protocol,syn (boolean, optional): syn for tcp protocol,fin (boolean, optional): fin for tcp protocol,established (boolean, optional): established for tcp protocol,icmp_type (string, optional) = ['echo' or 'echo-reply' or 'number']: ICMP Type for icmp protocol,icmp_type_value (integer): ICMP Type Value (0-255) for number icmp_type,icmp_code (integer, optional): ICMP Code (0-255) for icmp protocol} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic": "", + "hpe_rules": [ + { + "number": 0, + "packet_match": "", + "traffic_match_type": "", + "net_source": "", + "net_destination": "", + "net_service": "", + "protocol": "", + "source": "", + "source_port": "", + "source_port_value": "", + "protocol_number": 0, + "destination": "", + "destination_value": "", + "destination_port": "", + "destination_port_value": "", + "ip_dscp": 0, + "vlan_id": 0, + "ip_precedence": "", + "ip_service_type": "", + "established": false, + "fin": false, + "rst": false, + "syn": false + } + ], + "aos_cx_rules": [ + { + "number": 0, + "packet_match": "", + "protocol": "", + "protocol_number": 0, + "source": "", + "source_ip_address": "", + "source_port": "", + "source_port_value": "", + "destination": "", + "destination_ip_address": "", + "destination_port": "", + "destination_port_value": "", + "dscp": 0, + "vlan_id": 0, + "ecn": 0, + "ip_precedence": "", + "service_type": 0, + "ttl": 0, + "fragment": false, + "count_packet": false, + "cwr": false, + "ece": false, + "urg": false, + "ack": false, + "psh": false, + "rst": false, + "syn": false, + "fin": false, + "established": false, + "icmp_type": "", + "icmp_type_value": 0, + "icmp_code": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/{dur_class_id}" + dict_path = {"product_name": product_name, "dur_class_id": dur_class_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_dur_class_by_product_name_dur_class_id( + self, product_name="", dur_class_id="" + ): + """ + Operation: Delete a DUR Class + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: dur_class_id, Description: Numeric ID of the DURClass + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/{dur_class_id}" + dict_path = {"product_name": product_name, "dur_class_id": dur_class_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_dur_class_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a DUR Class by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the DURClass + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_dur_class_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update a DUR Class by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the DURClass + Required Body Parameters (body description)- DURClassUpdate {name (string, optional): Name of the DUR Class,traffic (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Traffic of the DUR Class,hpe_rules (array[HPERulesPost], optional): Rules for ArubaOS-Switch DUR Class,aos_cx_rules (array[AosCxRulesPost], optional): Rules for AOS-CX DUR Class}HPERulesPost {number (integer): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,traffic_match_type (string, optional) = ['netsource' or 'protocol']: Traffic Match Type,net_source (string, optional) = ['any']: Net Source for netsource traffic_match_type,net_destination (string, optional): Net Destination for netsource traffic_match_type,net_service (string, optional): Net Service for netsource traffic_match_type,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'vrrp' or 'pim' or 'ospf' or 'ipv6_in_ip' or 'ip_in_ip' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'gre' or 'esp' or 'ah' or '255']: Protocol for protocol traffic_match_type,source (string, optional) = ['any']: Source for protocol traffic_match_type,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Source Port for protocol traffic_match_type,source_port_value (string, optional): Source Port Value for protocol traffic_match_type,protocol_number (integer): Protocol Number (0-255) for 255 protocol,destination (string, optional) = ['any' or 'host' or 'ipsubnet']: Destnation for protocol traffic_match_type,destination_value (string, optional): Destination Value for protocol traffic_match_type,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Destination Port for protocol traffic_match_type,destination_port_value (string, optional): Destination Port Value for protocol traffic_match_type,ip_dscp (integer, optional): IP DSCP (0-63) for protocol traffic_match_type,vlan_id (integer, optional): VLAN ID (1-4094) for protocol traffic_match_type,ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence for protocol traffic_match_type,ip_service_type (string, optional) = ['normal' or 'max reliability' or 'max throughput' or 'minimize delay']: IP Type of Service for protocol traffic_match_type,established (boolean, optional): Established for tcp protocol,fin (boolean, optional): Fin for tcp protocol,rst (boolean, optional): Rst for tcp protocol,syn (boolean, optional): Syn for tcp protocol}AosCxRulesPost {number (integer, optional): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'pim' or 'ospf' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'icmpv6' or 'gre' or 'esp' or 'ah' or 'number' or 'any']: Protocol,protocol_number (integer): Protocol Number for number protocol,source (string, optional) = ['any' or 'ip']: Source,source_ip_address (string): Source IP Address for ip source,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Source Port,source_port_value (string): Source Port Value,destination (string, optional) = ['any' or 'ip']: Destination,destination_ip_address (string): Destination IP Address for ip destination,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Destination Port,destination_port_value (string): Destination Port Value,dscp (integer, optional): DSCP (0-63),vlan_id (integer, optional): VLAN ID (1-4094),ecn (integer, optional): ECN (0-3),ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence,service_type (integer, optional): Type of Service (0-31),ttl (integer, optional): Time to Live (0-255),fragment (boolean, optional): Fragment,count_packet (boolean, optional): Count Packet,cwr (boolean, optional): cwr for tcp protocol,ece (boolean, optional): ece for tcp protocol,urg (boolean, optional): urg for tcp protocol,ack (boolean, optional): ack for tcp protocol,psh (boolean, optional): psh for tcp protocol,rst (boolean, optional): rst for tcp protocol,syn (boolean, optional): syn for tcp protocol,fin (boolean, optional): fin for tcp protocol,established (boolean, optional): established for tcp protocol,icmp_type (string, optional) = ['echo' or 'echo-reply' or 'number']: ICMP Type for icmp protocol,icmp_type_value (integer): ICMP Type Value (0-255) for number icmp_type,icmp_code (integer, optional): ICMP Code (0-255) for icmp protocol} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic": "", + "hpe_rules": [ + { + "number": 0, + "packet_match": "", + "traffic_match_type": "", + "net_source": "", + "net_destination": "", + "net_service": "", + "protocol": "", + "source": "", + "source_port": "", + "source_port_value": "", + "protocol_number": 0, + "destination": "", + "destination_value": "", + "destination_port": "", + "destination_port_value": "", + "ip_dscp": 0, + "vlan_id": 0, + "ip_precedence": "", + "ip_service_type": "", + "established": false, + "fin": false, + "rst": false, + "syn": false + } + ], + "aos_cx_rules": [ + { + "number": 0, + "packet_match": "", + "protocol": "", + "protocol_number": 0, + "source": "", + "source_ip_address": "", + "source_port": "", + "source_port_value": "", + "destination": "", + "destination_ip_address": "", + "destination_port": "", + "destination_port_value": "", + "dscp": 0, + "vlan_id": 0, + "ecn": 0, + "ip_precedence": "", + "service_type": 0, + "ttl": 0, + "fragment": false, + "count_packet": false, + "cwr": false, + "ece": false, + "urg": false, + "ack": false, + "psh": false, + "rst": false, + "syn": false, + "fin": false, + "established": false, + "icmp_type": "", + "icmp_type_value": 0, + "icmp_code": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_dur_class_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a DUR Class by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the DURClass + Required Body Parameters (body description)- DURClassReplace {name (string): Name of the DUR Class,traffic (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Traffic of the DUR Class,hpe_rules (array[HPERulesPost]): Rules for ArubaOS-Switch DUR Class,aos_cx_rules (array[AosCxRulesPost]): Rules for AOS-CX DUR Class}HPERulesPost {number (integer): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,traffic_match_type (string, optional) = ['netsource' or 'protocol']: Traffic Match Type,net_source (string, optional) = ['any']: Net Source for netsource traffic_match_type,net_destination (string, optional): Net Destination for netsource traffic_match_type,net_service (string, optional): Net Service for netsource traffic_match_type,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'vrrp' or 'pim' or 'ospf' or 'ipv6_in_ip' or 'ip_in_ip' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'gre' or 'esp' or 'ah' or '255']: Protocol for protocol traffic_match_type,source (string, optional) = ['any']: Source for protocol traffic_match_type,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Source Port for protocol traffic_match_type,source_port_value (string, optional): Source Port Value for protocol traffic_match_type,protocol_number (integer): Protocol Number (0-255) for 255 protocol,destination (string, optional) = ['any' or 'host' or 'ipsubnet']: Destnation for protocol traffic_match_type,destination_value (string, optional): Destination Value for protocol traffic_match_type,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'neg' or 'range']: Destination Port for protocol traffic_match_type,destination_port_value (string, optional): Destination Port Value for protocol traffic_match_type,ip_dscp (integer, optional): IP DSCP (0-63) for protocol traffic_match_type,vlan_id (integer, optional): VLAN ID (1-4094) for protocol traffic_match_type,ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence for protocol traffic_match_type,ip_service_type (string, optional) = ['normal' or 'max reliability' or 'max throughput' or 'minimize delay']: IP Type of Service for protocol traffic_match_type,established (boolean, optional): Established for tcp protocol,fin (boolean, optional): Fin for tcp protocol,rst (boolean, optional): Rst for tcp protocol,syn (boolean, optional): Syn for tcp protocol}AosCxRulesPost {number (integer, optional): Number (1-2147483647),packet_match (string, optional) = ['match' or 'ignore']: Packet Match,protocol (string, optional) = ['tcp' or 'udp' or 'sctp' or 'pim' or 'ospf' or 'ip' or 'ipv6' or 'igmp' or 'icmp' or 'icmpv6' or 'gre' or 'esp' or 'ah' or 'number' or 'any']: Protocol,protocol_number (integer): Protocol Number for number protocol,source (string, optional) = ['any' or 'ip']: Source,source_ip_address (string): Source IP Address for ip source,source_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Source Port,source_port_value (string): Source Port Value,destination (string, optional) = ['any' or 'ip']: Destination,destination_ip_address (string): Destination IP Address for ip destination,destination_port (string, optional) = ['eq' or 'gt' or 'lt' or 'range']: Destination Port,destination_port_value (string): Destination Port Value,dscp (integer, optional): DSCP (0-63),vlan_id (integer, optional): VLAN ID (1-4094),ecn (integer, optional): ECN (0-3),ip_precedence (string, optional) = ['routine' or 'priority' or 'immediate' or 'flash' or 'flash override' or 'critical' or 'internet' or 'network']: IP Precedence,service_type (integer, optional): Type of Service (0-31),ttl (integer, optional): Time to Live (0-255),fragment (boolean, optional): Fragment,count_packet (boolean, optional): Count Packet,cwr (boolean, optional): cwr for tcp protocol,ece (boolean, optional): ece for tcp protocol,urg (boolean, optional): urg for tcp protocol,ack (boolean, optional): ack for tcp protocol,psh (boolean, optional): psh for tcp protocol,rst (boolean, optional): rst for tcp protocol,syn (boolean, optional): syn for tcp protocol,fin (boolean, optional): fin for tcp protocol,established (boolean, optional): established for tcp protocol,icmp_type (string, optional) = ['echo' or 'echo-reply' or 'number']: ICMP Type for icmp protocol,icmp_type_value (integer): ICMP Type Value (0-255) for number icmp_type,icmp_code (integer, optional): ICMP Code (0-255) for icmp protocol} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic": "", + "hpe_rules": [ + { + "number": 0, + "packet_match": "", + "traffic_match_type": "", + "net_source": "", + "net_destination": "", + "net_service": "", + "protocol": "", + "source": "", + "source_port": "", + "source_port_value": "", + "protocol_number": 0, + "destination": "", + "destination_value": "", + "destination_port": "", + "destination_port_value": "", + "ip_dscp": 0, + "vlan_id": 0, + "ip_precedence": "", + "ip_service_type": "", + "established": false, + "fin": false, + "rst": false, + "syn": false + } + ], + "aos_cx_rules": [ + { + "number": 0, + "packet_match": "", + "protocol": "", + "protocol_number": 0, + "source": "", + "source_ip_address": "", + "source_port": "", + "source_port_value": "", + "destination": "", + "destination_ip_address": "", + "destination_port": "", + "destination_port_value": "", + "dscp": 0, + "vlan_id": 0, + "ecn": 0, + "ip_precedence": "", + "service_type": 0, + "ttl": 0, + "fragment": false, + "count_packet": false, + "cwr": false, + "ece": false, + "urg": false, + "ack": false, + "psh": false, + "rst": false, + "syn": false, + "fin": false, + "established": false, + "icmp_type": "", + "icmp_type_value": 0, + "icmp_code": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_dur_class_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a DUR Class by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the DURClass + """ + url_path = "/enforcement-profile-dur/dur-class/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:EnforcementProfile + # Function Section Description: Manage Enforcement Profiles + + def get_enforcement_profile( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of Enforcement Profiles + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/enforcement-profile" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile(self, body=({})): + """ + Operation: Create a new Enforcement Profile + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- EnforcementProfileCreate {name (string): Name of the Enforcement Profile,description (string, optional): Description of the Enforcement Profile,type (string) = ['RADIUS' or 'TACACS' or 'SNMP' or 'Application' or 'Agent' or 'CLI' or 'HTTP' or 'RADIUS_DynAuthZ' or 'Post_Authentication' or 'Aruba_DUR']: Enforcement Profile Type,agent_template (string, optional) = ['Agent' or 'AgentScript']: Agent Enforcement Profile Template,post_auth_template (string, optional) = ['EntityUpdate' or 'SessionRestriction' or 'SessionNotify']: Post Authentication Enforcement Profile Template,radius_dyn_authz_template (string, optional): Post Authentication Enforcement Profile Template,action (string, optional) = ['Accept' or 'Reject' or 'Drop']: Enforcement Profile Action,device_group_list (array[string], optional): Device Group List,attributes (array[Attributes], optional): Attributes,tacacs_service_params (TacacsServiceParam, optional): Tacacs+ Service Params,dur_config (DURConfig, optional): Downloadable User Role Configuration}Attributes {type (string, optional): Type of the Attribute,name (string, optional): Name of the Attribute,value (string, optional): Value of the Attribute}TacacsServiceParam {privilege_level (integer, optional): Privilege Level <0-15>,services (array[string], optional): Selected Services,authorize_attribute_status (string, optional) = ['ADD' or 'REPLACE' or 'FAIL']: Authorize Attribute Status,tacacs_command_config (TacacsCommandConfig, optional): Commands}TacacsCommandConfig {service_type (string, optional) = ['Shell' or 'PIX Shell']: Service Type,permit_unmatched_cmds (boolean, optional): Enable to permit unmatched commands,commands (array[TacacsCommand], optional): Specify which commands with arguments are permitted/denied}TacacsCommand {command (string, optional): Shell Command,permit_unmatched_args (boolean, optional): Enable to permit unmatched arguments,command_args (array[TacacsCommandArgs], optional): List of Command Arguments}TacacsCommandArgs {argument (string, optional): Command Argument,permit_action (boolean, optional): Enable to permit unmatched action}DURConfig {config_mode (string, optional) = ['Standard' or 'Advanced']: Role Configuration Mode for Aruba Downloadable Role Enforcement profile,product (string, optional) = ['AOS-CX' or 'Mobility Controller' or 'ArubaOS-Switch' or 'Mobility Access Switch']: Product Name for Aruba Downloadable Role Enforcement profile,aruba_os_switch_config (ArubaOSSwitchConfig, optional): ArubaOS-Switch Downloadable Role Configuration,mobility_access_switch_config (MASConfig, optional): Mobility Access Switch Downloadable Role Configuration,mobility_controller_config (AMCConfig, optional): Mobility Controller Downloadable Role Configuration,aos_cx_config (AOSCXConfig, optional): AOS-CX Downloadable Role Configuration}ArubaOSSwitchConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policy_name (string, optional): Policy name,controller_static_role (string, optional): Controller Static Role,controller_downloadable_role (string, optional): Controller Downloadable Role,vlan_id (string, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,vlan_tagged_id (string, optional): VLAN ID Tagged,vlan_tagged_name (string, optional): VLAN Name Tagged,reauth_period (string, optional): Re-Authentication Period <0-999999999>,logoff_period (string, optional): Logoff Period <0(mac-pin) OR 60-9999999>,cached_reauth_period (string, optional): Cached Re-Authentication Period <60-2147483647>,enable_device_config (boolean, optional): Enable Device Configuration,enable_poe_allocate_by_class (boolean, optional): Enable POE Allocate By Class,poe_priority (string, optional) = ['low' or 'high' or 'critical']: POE Priority,enable_admin_edge_port (boolean, optional): Enable Admin Edge Port,enable_port_mode (boolean, optional): Enable Port Mode}MASConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policer_profile_name (string, optional): Policer Profile name,qos_profile_name (string, optional): QoS Profile name,voip_profile_name (string, optional): VoIP Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,acl_list (array[acl], optional): Access Control List}acl {name (string, optional): Name of the ACL,type (string, optional) = ['Ethertype' or 'MAC' or 'Stateless' or 'Session']: Type of the ACL}AMCConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,parameterized_vlan (string, optional): Parameterized VLAN,acl_list (array[acl], optional): Access Control List}AOSCXConfig {role_name (string, optional): Role name,description (string, optional): Description,captive_portal_name (string, optional): Captive Portal name,authentication_mode (string, optional) = ['' or 'client-mode' or 'device-mode' or 'multi-domain-mode']: Authentication Mode,device_traffic_class (string, optional) = ['None' or 'Voice']: Device Traffic Class,session_timeout_type (string, optional) = ['Static' or 'Parameterized']: Session Timeout Type,session_timeout (string, optional): Session Timeout <1-4294967295>,parameterized_session_timeout (string, optional): Parameterized Session Timeout,cached_reauth_period (string, optional): Cached Re-authentication period <30-4294967295>,reauth_period_type (string, optional) = ['Manual' or 'Random' or 'Parameterized']: Re-Authentication Period Type,reauth_period (string, optional): Re-Authentication Period <1-4294967295>,minimum_reauth_period (string, optional): Minimum re-authentication period <1-4294967295>,parameterized_reauth (string, optional): Parameterized Re-Authentication,client_inactivity_timeout_type (string, optional) = ['Value' or 'None' or 'Parameterized']: Client Inactivity Timeout Type,client_inactivity_timeout (string, optional): Client Inactivity Timeout value <300-4294967295>,parameterized_client_inactivity_timeout (string, optional): Parameterized Client Inactivity Timeout,allowed_vlan_ids_trunk (string, optional): Allowed VLANs on Trunk <1-4094>,allowed_vlan_names_trunk (string, optional): List of Allowed VLAN Names on Trunk,parameterized_allowed_vlan_type (string, optional) = ['Id' or 'Name']: Parameterized Allowed VLAN Type,parameterized_allowed_vlan (string, optional): Parameterized Allowed VLAN,native_trunk_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Native Trunk VLAN Type,native_trunk_vlan_id (string, optional): Native Trunk VLAN <1-4094>,native_trunk_vlan_name (string, optional): Native Trunk VLAN Name,parameterized_native_trunk_vlan (string, optional): Parameterized Native Trunk VLAN,access_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Access VLAN Type,access_vlan_id (string, optional): Access VLAN <1-4094>,access_vlan_name (string, optional): Access VLAN Name,parameterized_access_vlan (string, optional): Parameterized Access VLAN,gateway_zone (string, optional): Gateway Zone,secondary_role_type (string, optional) = ['None' or 'Static' or 'Dynamic']: Secondary Role Type,gateway_static_role (string, optional): Gateway Static Role,gateway_downloadable_role (string, optional): Gateway Downloadable Role,mtu (string, optional): MTU <68-9198>,trust_mode (string, optional) = ['' or 'none' or 'cos' or 'dscp']: Trust Mode,poe_priority (string, optional) = ['' or 'low' or 'high' or 'critical']: PoE Priority,private_vlan_port_type (string, optional) = ['' or 'promiscuous' or 'secondary']: Private VLAN Port Type,policy_name (string, optional): Policy name} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "agent_template": "", + "post_auth_template": "", + "radius_dyn_authz_template": "", + "action": "", + "device_group_list": [ + "" + ], + "attributes": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "tacacs_service_params": { + "privilege_level": 0, + "services": [ + "" + ], + "authorize_attribute_status": "", + "tacacs_command_config": { + "service_type": "", + "permit_unmatched_cmds": false, + "commands": [ + { + "command": "", + "permit_unmatched_args": false, + "command_args": [ + { + "argument": "", + "permit_action": false + } + ] + } + ] + } + }, + "dur_config": { + "config_mode": "", + "product": "", + "aruba_os_switch_config": { + "captive_portal_profile_name": "", + "policy_name": "", + "controller_static_role": "", + "controller_downloadable_role": "", + "vlan_id": "", + "vlan_name": "", + "vlan_tagged_id": "", + "vlan_tagged_name": "", + "reauth_period": "", + "logoff_period": "", + "cached_reauth_period": "", + "enable_device_config": false, + "enable_poe_allocate_by_class": false, + "poe_priority": "", + "enable_admin_edge_port": false, + "enable_port_mode": false + }, + "mobility_access_switch_config": { + "captive_portal_profile_name": "", + "policer_profile_name": "", + "qos_profile_name": "", + "voip_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "mobility_controller_config": { + "captive_portal_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "vlan_name": "", + "parameterized_vlan": "", + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "aos_cx_config": { + "role_name": "", + "description": "", + "captive_portal_name": "", + "authentication_mode": "", + "device_traffic_class": "", + "session_timeout_type": "", + "session_timeout": "", + "parameterized_session_timeout": "", + "cached_reauth_period": "", + "reauth_period_type": "", + "reauth_period": "", + "minimum_reauth_period": "", + "parameterized_reauth": "", + "client_inactivity_timeout_type": "", + "client_inactivity_timeout": "", + "parameterized_client_inactivity_timeout": "", + "allowed_vlan_ids_trunk": "", + "allowed_vlan_names_trunk": "", + "parameterized_allowed_vlan_type": "", + "parameterized_allowed_vlan": "", + "native_trunk_vlan_type": "", + "native_trunk_vlan_id": "", + "native_trunk_vlan_name": "", + "parameterized_native_trunk_vlan": "", + "access_vlan_type": "", + "access_vlan_id": "", + "access_vlan_name": "", + "parameterized_access_vlan": "", + "gateway_zone": "", + "secondary_role_type": "", + "gateway_static_role": "", + "gateway_downloadable_role": "", + "mtu": "", + "trust_mode": "", + "poe_priority": "", + "private_vlan_port_type": "", + "policy_name": "" + } + } + } + """ + url_path = "/enforcement-profile" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_by_enforcement_profile_id( + self, enforcement_profile_id="" + ): + """ + Operation: Get an Enforcement Profile + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: enforcement_profile_id, Description: Numeric ID of the Enforcement Profile + """ + url_path = "/enforcement-profile/{enforcement_profile_id}" + dict_path = {"enforcement_profile_id": enforcement_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_by_enforcement_profile_id( + self, enforcement_profile_id="", body=({}) + ): + """ + Operation: Update an Enforcement Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: enforcement_profile_id, Description: Numeric ID of the Enforcement Profile + Required Body Parameters (body description)- EnforcementProfileUpdate {name (string, optional): Name of the Enforcement Profile,description (string, optional): Description of the Enforcement Profile,type (string, optional) = ['RADIUS' or 'TACACS' or 'SNMP' or 'Application' or 'Agent' or 'CLI' or 'HTTP' or 'RADIUS_DynAuthZ' or 'Post_Authentication' or 'Aruba_DUR']: Enforcement Profile Type,agent_template (string, optional) = ['Agent' or 'AgentScript']: Agent Enforcement Profile Template,post_auth_template (string, optional) = ['EntityUpdate' or 'SessionRestriction' or 'SessionNotify']: Post Authentication Enforcement Profile Template,radius_dyn_authz_template (string, optional): Post Authentication Enforcement Profile Template,action (string, optional) = ['Accept' or 'Reject' or 'Drop']: Enforcement Profile Action,device_group_list (array[string], optional): Device Group List,attributes (array[Attributes], optional): Attributes,tacacs_service_params (TacacsServiceParam, optional): Tacacs+ Service Params,dur_config (DURConfig, optional): Downloadable User Role Configuration}Attributes {type (string, optional): Type of the Attribute,name (string, optional): Name of the Attribute,value (string, optional): Value of the Attribute}TacacsServiceParam {privilege_level (integer, optional): Privilege Level <0-15>,services (array[string], optional): Selected Services,authorize_attribute_status (string, optional) = ['ADD' or 'REPLACE' or 'FAIL']: Authorize Attribute Status,tacacs_command_config (TacacsCommandConfig, optional): Commands}TacacsCommandConfig {service_type (string, optional) = ['Shell' or 'PIX Shell']: Service Type,permit_unmatched_cmds (boolean, optional): Enable to permit unmatched commands,commands (array[TacacsCommand], optional): Specify which commands with arguments are permitted/denied}TacacsCommand {command (string, optional): Shell Command,permit_unmatched_args (boolean, optional): Enable to permit unmatched arguments,command_args (array[TacacsCommandArgs], optional): List of Command Arguments}TacacsCommandArgs {argument (string, optional): Command Argument,permit_action (boolean, optional): Enable to permit unmatched action}DURConfig {config_mode (string, optional) = ['Standard' or 'Advanced']: Role Configuration Mode for Aruba Downloadable Role Enforcement profile,product (string, optional) = ['AOS-CX' or 'Mobility Controller' or 'ArubaOS-Switch' or 'Mobility Access Switch']: Product Name for Aruba Downloadable Role Enforcement profile,aruba_os_switch_config (ArubaOSSwitchConfig, optional): ArubaOS-Switch Downloadable Role Configuration,mobility_access_switch_config (MASConfig, optional): Mobility Access Switch Downloadable Role Configuration,mobility_controller_config (AMCConfig, optional): Mobility Controller Downloadable Role Configuration,aos_cx_config (AOSCXConfig, optional): AOS-CX Downloadable Role Configuration}ArubaOSSwitchConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policy_name (string, optional): Policy name,controller_static_role (string, optional): Controller Static Role,controller_downloadable_role (string, optional): Controller Downloadable Role,vlan_id (string, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,vlan_tagged_id (string, optional): VLAN ID Tagged,vlan_tagged_name (string, optional): VLAN Name Tagged,reauth_period (string, optional): Re-Authentication Period <0-999999999>,logoff_period (string, optional): Logoff Period <0(mac-pin) OR 60-9999999>,cached_reauth_period (string, optional): Cached Re-Authentication Period <60-2147483647>,enable_device_config (boolean, optional): Enable Device Configuration,enable_poe_allocate_by_class (boolean, optional): Enable POE Allocate By Class,poe_priority (string, optional) = ['low' or 'high' or 'critical']: POE Priority,enable_admin_edge_port (boolean, optional): Enable Admin Edge Port,enable_port_mode (boolean, optional): Enable Port Mode}MASConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policer_profile_name (string, optional): Policer Profile name,qos_profile_name (string, optional): QoS Profile name,voip_profile_name (string, optional): VoIP Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,acl_list (array[acl], optional): Access Control List}acl {name (string, optional): Name of the ACL,type (string, optional) = ['Ethertype' or 'MAC' or 'Stateless' or 'Session']: Type of the ACL}AMCConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,parameterized_vlan (string, optional): Parameterized VLAN,acl_list (array[acl], optional): Access Control List}AOSCXConfig {role_name (string, optional): Role name,description (string, optional): Description,captive_portal_name (string, optional): Captive Portal name,authentication_mode (string, optional) = ['' or 'client-mode' or 'device-mode' or 'multi-domain-mode']: Authentication Mode,device_traffic_class (string, optional) = ['None' or 'Voice']: Device Traffic Class,session_timeout_type (string, optional) = ['Static' or 'Parameterized']: Session Timeout Type,session_timeout (string, optional): Session Timeout <1-4294967295>,parameterized_session_timeout (string, optional): Parameterized Session Timeout,cached_reauth_period (string, optional): Cached Re-authentication period <30-4294967295>,reauth_period_type (string, optional) = ['Manual' or 'Random' or 'Parameterized']: Re-Authentication Period Type,reauth_period (string, optional): Re-Authentication Period <1-4294967295>,minimum_reauth_period (string, optional): Minimum re-authentication period <1-4294967295>,parameterized_reauth (string, optional): Parameterized Re-Authentication,client_inactivity_timeout_type (string, optional) = ['Value' or 'None' or 'Parameterized']: Client Inactivity Timeout Type,client_inactivity_timeout (string, optional): Client Inactivity Timeout value <300-4294967295>,parameterized_client_inactivity_timeout (string, optional): Parameterized Client Inactivity Timeout,allowed_vlan_ids_trunk (string, optional): Allowed VLANs on Trunk <1-4094>,allowed_vlan_names_trunk (string, optional): List of Allowed VLAN Names on Trunk,parameterized_allowed_vlan_type (string, optional) = ['Id' or 'Name']: Parameterized Allowed VLAN Type,parameterized_allowed_vlan (string, optional): Parameterized Allowed VLAN,native_trunk_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Native Trunk VLAN Type,native_trunk_vlan_id (string, optional): Native Trunk VLAN <1-4094>,native_trunk_vlan_name (string, optional): Native Trunk VLAN Name,parameterized_native_trunk_vlan (string, optional): Parameterized Native Trunk VLAN,access_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Access VLAN Type,access_vlan_id (string, optional): Access VLAN <1-4094>,access_vlan_name (string, optional): Access VLAN Name,parameterized_access_vlan (string, optional): Parameterized Access VLAN,gateway_zone (string, optional): Gateway Zone,secondary_role_type (string, optional) = ['None' or 'Static' or 'Dynamic']: Secondary Role Type,gateway_static_role (string, optional): Gateway Static Role,gateway_downloadable_role (string, optional): Gateway Downloadable Role,mtu (string, optional): MTU <68-9198>,trust_mode (string, optional) = ['' or 'none' or 'cos' or 'dscp']: Trust Mode,poe_priority (string, optional) = ['' or 'low' or 'high' or 'critical']: PoE Priority,private_vlan_port_type (string, optional) = ['' or 'promiscuous' or 'secondary']: Private VLAN Port Type,policy_name (string, optional): Policy name} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "agent_template": "", + "post_auth_template": "", + "radius_dyn_authz_template": "", + "action": "", + "device_group_list": [ + "" + ], + "attributes": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "tacacs_service_params": { + "privilege_level": 0, + "services": [ + "" + ], + "authorize_attribute_status": "", + "tacacs_command_config": { + "service_type": "", + "permit_unmatched_cmds": false, + "commands": [ + { + "command": "", + "permit_unmatched_args": false, + "command_args": [ + { + "argument": "", + "permit_action": false + } + ] + } + ] + } + }, + "dur_config": { + "config_mode": "", + "product": "", + "aruba_os_switch_config": { + "captive_portal_profile_name": "", + "policy_name": "", + "controller_static_role": "", + "controller_downloadable_role": "", + "vlan_id": "", + "vlan_name": "", + "vlan_tagged_id": "", + "vlan_tagged_name": "", + "reauth_period": "", + "logoff_period": "", + "cached_reauth_period": "", + "enable_device_config": false, + "enable_poe_allocate_by_class": false, + "poe_priority": "", + "enable_admin_edge_port": false, + "enable_port_mode": false + }, + "mobility_access_switch_config": { + "captive_portal_profile_name": "", + "policer_profile_name": "", + "qos_profile_name": "", + "voip_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "mobility_controller_config": { + "captive_portal_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "vlan_name": "", + "parameterized_vlan": "", + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "aos_cx_config": { + "role_name": "", + "description": "", + "captive_portal_name": "", + "authentication_mode": "", + "device_traffic_class": "", + "session_timeout_type": "", + "session_timeout": "", + "parameterized_session_timeout": "", + "cached_reauth_period": "", + "reauth_period_type": "", + "reauth_period": "", + "minimum_reauth_period": "", + "parameterized_reauth": "", + "client_inactivity_timeout_type": "", + "client_inactivity_timeout": "", + "parameterized_client_inactivity_timeout": "", + "allowed_vlan_ids_trunk": "", + "allowed_vlan_names_trunk": "", + "parameterized_allowed_vlan_type": "", + "parameterized_allowed_vlan": "", + "native_trunk_vlan_type": "", + "native_trunk_vlan_id": "", + "native_trunk_vlan_name": "", + "parameterized_native_trunk_vlan": "", + "access_vlan_type": "", + "access_vlan_id": "", + "access_vlan_name": "", + "parameterized_access_vlan": "", + "gateway_zone": "", + "secondary_role_type": "", + "gateway_static_role": "", + "gateway_downloadable_role": "", + "mtu": "", + "trust_mode": "", + "poe_priority": "", + "private_vlan_port_type": "", + "policy_name": "" + } + } + } + """ + url_path = "/enforcement-profile/{enforcement_profile_id}" + dict_path = {"enforcement_profile_id": enforcement_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_by_enforcement_profile_id( + self, enforcement_profile_id="", body=({}) + ): + """ + Operation: Replace an Enforcement Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: enforcement_profile_id, Description: Numeric ID of the Enforcement Profile + Required Body Parameters (body description)- EnforcementProfileReplace {name (string): Name of the Enforcement Profile,description (string, optional): Description of the Enforcement Profile,type (string) = ['RADIUS' or 'TACACS' or 'SNMP' or 'Application' or 'Agent' or 'CLI' or 'HTTP' or 'RADIUS_DynAuthZ' or 'Post_Authentication' or 'Aruba_DUR']: Enforcement Profile Type,agent_template (string, optional) = ['Agent' or 'AgentScript']: Agent Enforcement Profile Template,post_auth_template (string, optional) = ['EntityUpdate' or 'SessionRestriction' or 'SessionNotify']: Post Authentication Enforcement Profile Template,radius_dyn_authz_template (string, optional): Post Authentication Enforcement Profile Template,action (string, optional) = ['Accept' or 'Reject' or 'Drop']: Enforcement Profile Action,device_group_list (array[string], optional): Device Group List,attributes (array[Attributes], optional): Attributes,tacacs_service_params (TacacsServiceParam, optional): Tacacs+ Service Params,dur_config (DURConfig, optional): Downloadable User Role Configuration}Attributes {type (string, optional): Type of the Attribute,name (string, optional): Name of the Attribute,value (string, optional): Value of the Attribute}TacacsServiceParam {privilege_level (integer, optional): Privilege Level <0-15>,services (array[string], optional): Selected Services,authorize_attribute_status (string, optional) = ['ADD' or 'REPLACE' or 'FAIL']: Authorize Attribute Status,tacacs_command_config (TacacsCommandConfig, optional): Commands}TacacsCommandConfig {service_type (string, optional) = ['Shell' or 'PIX Shell']: Service Type,permit_unmatched_cmds (boolean, optional): Enable to permit unmatched commands,commands (array[TacacsCommand], optional): Specify which commands with arguments are permitted/denied}TacacsCommand {command (string, optional): Shell Command,permit_unmatched_args (boolean, optional): Enable to permit unmatched arguments,command_args (array[TacacsCommandArgs], optional): List of Command Arguments}TacacsCommandArgs {argument (string, optional): Command Argument,permit_action (boolean, optional): Enable to permit unmatched action}DURConfig {config_mode (string, optional) = ['Standard' or 'Advanced']: Role Configuration Mode for Aruba Downloadable Role Enforcement profile,product (string, optional) = ['AOS-CX' or 'Mobility Controller' or 'ArubaOS-Switch' or 'Mobility Access Switch']: Product Name for Aruba Downloadable Role Enforcement profile,aruba_os_switch_config (ArubaOSSwitchConfig, optional): ArubaOS-Switch Downloadable Role Configuration,mobility_access_switch_config (MASConfig, optional): Mobility Access Switch Downloadable Role Configuration,mobility_controller_config (AMCConfig, optional): Mobility Controller Downloadable Role Configuration,aos_cx_config (AOSCXConfig, optional): AOS-CX Downloadable Role Configuration}ArubaOSSwitchConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policy_name (string, optional): Policy name,controller_static_role (string, optional): Controller Static Role,controller_downloadable_role (string, optional): Controller Downloadable Role,vlan_id (string, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,vlan_tagged_id (string, optional): VLAN ID Tagged,vlan_tagged_name (string, optional): VLAN Name Tagged,reauth_period (string, optional): Re-Authentication Period <0-999999999>,logoff_period (string, optional): Logoff Period <0(mac-pin) OR 60-9999999>,cached_reauth_period (string, optional): Cached Re-Authentication Period <60-2147483647>,enable_device_config (boolean, optional): Enable Device Configuration,enable_poe_allocate_by_class (boolean, optional): Enable POE Allocate By Class,poe_priority (string, optional) = ['low' or 'high' or 'critical']: POE Priority,enable_admin_edge_port (boolean, optional): Enable Admin Edge Port,enable_port_mode (boolean, optional): Enable Port Mode}MASConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policer_profile_name (string, optional): Policer Profile name,qos_profile_name (string, optional): QoS Profile name,voip_profile_name (string, optional): VoIP Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,acl_list (array[acl], optional): Access Control List}acl {name (string, optional): Name of the ACL,type (string, optional) = ['Ethertype' or 'MAC' or 'Stateless' or 'Session']: Type of the ACL}AMCConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,parameterized_vlan (string, optional): Parameterized VLAN,acl_list (array[acl], optional): Access Control List}AOSCXConfig {role_name (string, optional): Role name,description (string, optional): Description,captive_portal_name (string, optional): Captive Portal name,authentication_mode (string, optional) = ['' or 'client-mode' or 'device-mode' or 'multi-domain-mode']: Authentication Mode,device_traffic_class (string, optional) = ['None' or 'Voice']: Device Traffic Class,session_timeout_type (string, optional) = ['Static' or 'Parameterized']: Session Timeout Type,session_timeout (string, optional): Session Timeout <1-4294967295>,parameterized_session_timeout (string, optional): Parameterized Session Timeout,cached_reauth_period (string, optional): Cached Re-authentication period <30-4294967295>,reauth_period_type (string, optional) = ['Manual' or 'Random' or 'Parameterized']: Re-Authentication Period Type,reauth_period (string, optional): Re-Authentication Period <1-4294967295>,minimum_reauth_period (string, optional): Minimum re-authentication period <1-4294967295>,parameterized_reauth (string, optional): Parameterized Re-Authentication,client_inactivity_timeout_type (string, optional) = ['Value' or 'None' or 'Parameterized']: Client Inactivity Timeout Type,client_inactivity_timeout (string, optional): Client Inactivity Timeout value <300-4294967295>,parameterized_client_inactivity_timeout (string, optional): Parameterized Client Inactivity Timeout,allowed_vlan_ids_trunk (string, optional): Allowed VLANs on Trunk <1-4094>,allowed_vlan_names_trunk (string, optional): List of Allowed VLAN Names on Trunk,parameterized_allowed_vlan_type (string, optional) = ['Id' or 'Name']: Parameterized Allowed VLAN Type,parameterized_allowed_vlan (string, optional): Parameterized Allowed VLAN,native_trunk_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Native Trunk VLAN Type,native_trunk_vlan_id (string, optional): Native Trunk VLAN <1-4094>,native_trunk_vlan_name (string, optional): Native Trunk VLAN Name,parameterized_native_trunk_vlan (string, optional): Parameterized Native Trunk VLAN,access_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Access VLAN Type,access_vlan_id (string, optional): Access VLAN <1-4094>,access_vlan_name (string, optional): Access VLAN Name,parameterized_access_vlan (string, optional): Parameterized Access VLAN,gateway_zone (string, optional): Gateway Zone,secondary_role_type (string, optional) = ['None' or 'Static' or 'Dynamic']: Secondary Role Type,gateway_static_role (string, optional): Gateway Static Role,gateway_downloadable_role (string, optional): Gateway Downloadable Role,mtu (string, optional): MTU <68-9198>,trust_mode (string, optional) = ['' or 'none' or 'cos' or 'dscp']: Trust Mode,poe_priority (string, optional) = ['' or 'low' or 'high' or 'critical']: PoE Priority,private_vlan_port_type (string, optional) = ['' or 'promiscuous' or 'secondary']: Private VLAN Port Type,policy_name (string, optional): Policy name} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "agent_template": "", + "post_auth_template": "", + "radius_dyn_authz_template": "", + "action": "", + "device_group_list": [ + "" + ], + "attributes": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "tacacs_service_params": { + "privilege_level": 0, + "services": [ + "" + ], + "authorize_attribute_status": "", + "tacacs_command_config": { + "service_type": "", + "permit_unmatched_cmds": false, + "commands": [ + { + "command": "", + "permit_unmatched_args": false, + "command_args": [ + { + "argument": "", + "permit_action": false + } + ] + } + ] + } + }, + "dur_config": { + "config_mode": "", + "product": "", + "aruba_os_switch_config": { + "captive_portal_profile_name": "", + "policy_name": "", + "controller_static_role": "", + "controller_downloadable_role": "", + "vlan_id": "", + "vlan_name": "", + "vlan_tagged_id": "", + "vlan_tagged_name": "", + "reauth_period": "", + "logoff_period": "", + "cached_reauth_period": "", + "enable_device_config": false, + "enable_poe_allocate_by_class": false, + "poe_priority": "", + "enable_admin_edge_port": false, + "enable_port_mode": false + }, + "mobility_access_switch_config": { + "captive_portal_profile_name": "", + "policer_profile_name": "", + "qos_profile_name": "", + "voip_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "mobility_controller_config": { + "captive_portal_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "vlan_name": "", + "parameterized_vlan": "", + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "aos_cx_config": { + "role_name": "", + "description": "", + "captive_portal_name": "", + "authentication_mode": "", + "device_traffic_class": "", + "session_timeout_type": "", + "session_timeout": "", + "parameterized_session_timeout": "", + "cached_reauth_period": "", + "reauth_period_type": "", + "reauth_period": "", + "minimum_reauth_period": "", + "parameterized_reauth": "", + "client_inactivity_timeout_type": "", + "client_inactivity_timeout": "", + "parameterized_client_inactivity_timeout": "", + "allowed_vlan_ids_trunk": "", + "allowed_vlan_names_trunk": "", + "parameterized_allowed_vlan_type": "", + "parameterized_allowed_vlan": "", + "native_trunk_vlan_type": "", + "native_trunk_vlan_id": "", + "native_trunk_vlan_name": "", + "parameterized_native_trunk_vlan": "", + "access_vlan_type": "", + "access_vlan_id": "", + "access_vlan_name": "", + "parameterized_access_vlan": "", + "gateway_zone": "", + "secondary_role_type": "", + "gateway_static_role": "", + "gateway_downloadable_role": "", + "mtu": "", + "trust_mode": "", + "poe_priority": "", + "private_vlan_port_type": "", + "policy_name": "" + } + } + } + """ + url_path = "/enforcement-profile/{enforcement_profile_id}" + dict_path = {"enforcement_profile_id": enforcement_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_by_enforcement_profile_id( + self, enforcement_profile_id="" + ): + """ + Operation: Delete an Enforcement Profile + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: enforcement_profile_id, Description: Numeric ID of the Enforcement Profile + """ + url_path = "/enforcement-profile/{enforcement_profile_id}" + dict_path = {"enforcement_profile_id": enforcement_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_name_by_name(self, name=""): + """ + Operation: Get an Enforcement Profile by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: name of the enforcement profile + """ + url_path = "/enforcement-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_name_by_name(self, name="", body=({})): + """ + Operation: Update an Enforcement Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: name of the enforcement profile + Required Body Parameters (body description)- EnforcementProfileUpdate {name (string, optional): Name of the Enforcement Profile,description (string, optional): Description of the Enforcement Profile,type (string, optional) = ['RADIUS' or 'TACACS' or 'SNMP' or 'Application' or 'Agent' or 'CLI' or 'HTTP' or 'RADIUS_DynAuthZ' or 'Post_Authentication' or 'Aruba_DUR']: Enforcement Profile Type,agent_template (string, optional) = ['Agent' or 'AgentScript']: Agent Enforcement Profile Template,post_auth_template (string, optional) = ['EntityUpdate' or 'SessionRestriction' or 'SessionNotify']: Post Authentication Enforcement Profile Template,radius_dyn_authz_template (string, optional): Post Authentication Enforcement Profile Template,action (string, optional) = ['Accept' or 'Reject' or 'Drop']: Enforcement Profile Action,device_group_list (array[string], optional): Device Group List,attributes (array[Attributes], optional): Attributes,tacacs_service_params (TacacsServiceParam, optional): Tacacs+ Service Params,dur_config (DURConfig, optional): Downloadable User Role Configuration}Attributes {type (string, optional): Type of the Attribute,name (string, optional): Name of the Attribute,value (string, optional): Value of the Attribute}TacacsServiceParam {privilege_level (integer, optional): Privilege Level <0-15>,services (array[string], optional): Selected Services,authorize_attribute_status (string, optional) = ['ADD' or 'REPLACE' or 'FAIL']: Authorize Attribute Status,tacacs_command_config (TacacsCommandConfig, optional): Commands}TacacsCommandConfig {service_type (string, optional) = ['Shell' or 'PIX Shell']: Service Type,permit_unmatched_cmds (boolean, optional): Enable to permit unmatched commands,commands (array[TacacsCommand], optional): Specify which commands with arguments are permitted/denied}TacacsCommand {command (string, optional): Shell Command,permit_unmatched_args (boolean, optional): Enable to permit unmatched arguments,command_args (array[TacacsCommandArgs], optional): List of Command Arguments}TacacsCommandArgs {argument (string, optional): Command Argument,permit_action (boolean, optional): Enable to permit unmatched action}DURConfig {config_mode (string, optional) = ['Standard' or 'Advanced']: Role Configuration Mode for Aruba Downloadable Role Enforcement profile,product (string, optional) = ['AOS-CX' or 'Mobility Controller' or 'ArubaOS-Switch' or 'Mobility Access Switch']: Product Name for Aruba Downloadable Role Enforcement profile,aruba_os_switch_config (ArubaOSSwitchConfig, optional): ArubaOS-Switch Downloadable Role Configuration,mobility_access_switch_config (MASConfig, optional): Mobility Access Switch Downloadable Role Configuration,mobility_controller_config (AMCConfig, optional): Mobility Controller Downloadable Role Configuration,aos_cx_config (AOSCXConfig, optional): AOS-CX Downloadable Role Configuration}ArubaOSSwitchConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policy_name (string, optional): Policy name,controller_static_role (string, optional): Controller Static Role,controller_downloadable_role (string, optional): Controller Downloadable Role,vlan_id (string, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,vlan_tagged_id (string, optional): VLAN ID Tagged,vlan_tagged_name (string, optional): VLAN Name Tagged,reauth_period (string, optional): Re-Authentication Period <0-999999999>,logoff_period (string, optional): Logoff Period <0(mac-pin) OR 60-9999999>,cached_reauth_period (string, optional): Cached Re-Authentication Period <60-2147483647>,enable_device_config (boolean, optional): Enable Device Configuration,enable_poe_allocate_by_class (boolean, optional): Enable POE Allocate By Class,poe_priority (string, optional) = ['low' or 'high' or 'critical']: POE Priority,enable_admin_edge_port (boolean, optional): Enable Admin Edge Port,enable_port_mode (boolean, optional): Enable Port Mode}MASConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policer_profile_name (string, optional): Policer Profile name,qos_profile_name (string, optional): QoS Profile name,voip_profile_name (string, optional): VoIP Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,acl_list (array[acl], optional): Access Control List}acl {name (string, optional): Name of the ACL,type (string, optional) = ['Ethertype' or 'MAC' or 'Stateless' or 'Session']: Type of the ACL}AMCConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,parameterized_vlan (string, optional): Parameterized VLAN,acl_list (array[acl], optional): Access Control List}AOSCXConfig {role_name (string, optional): Role name,description (string, optional): Description,captive_portal_name (string, optional): Captive Portal name,authentication_mode (string, optional) = ['' or 'client-mode' or 'device-mode' or 'multi-domain-mode']: Authentication Mode,device_traffic_class (string, optional) = ['None' or 'Voice']: Device Traffic Class,session_timeout_type (string, optional) = ['Static' or 'Parameterized']: Session Timeout Type,session_timeout (string, optional): Session Timeout <1-4294967295>,parameterized_session_timeout (string, optional): Parameterized Session Timeout,cached_reauth_period (string, optional): Cached Re-authentication period <30-4294967295>,reauth_period_type (string, optional) = ['Manual' or 'Random' or 'Parameterized']: Re-Authentication Period Type,reauth_period (string, optional): Re-Authentication Period <1-4294967295>,minimum_reauth_period (string, optional): Minimum re-authentication period <1-4294967295>,parameterized_reauth (string, optional): Parameterized Re-Authentication,client_inactivity_timeout_type (string, optional) = ['Value' or 'None' or 'Parameterized']: Client Inactivity Timeout Type,client_inactivity_timeout (string, optional): Client Inactivity Timeout value <300-4294967295>,parameterized_client_inactivity_timeout (string, optional): Parameterized Client Inactivity Timeout,allowed_vlan_ids_trunk (string, optional): Allowed VLANs on Trunk <1-4094>,allowed_vlan_names_trunk (string, optional): List of Allowed VLAN Names on Trunk,parameterized_allowed_vlan_type (string, optional) = ['Id' or 'Name']: Parameterized Allowed VLAN Type,parameterized_allowed_vlan (string, optional): Parameterized Allowed VLAN,native_trunk_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Native Trunk VLAN Type,native_trunk_vlan_id (string, optional): Native Trunk VLAN <1-4094>,native_trunk_vlan_name (string, optional): Native Trunk VLAN Name,parameterized_native_trunk_vlan (string, optional): Parameterized Native Trunk VLAN,access_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Access VLAN Type,access_vlan_id (string, optional): Access VLAN <1-4094>,access_vlan_name (string, optional): Access VLAN Name,parameterized_access_vlan (string, optional): Parameterized Access VLAN,gateway_zone (string, optional): Gateway Zone,secondary_role_type (string, optional) = ['None' or 'Static' or 'Dynamic']: Secondary Role Type,gateway_static_role (string, optional): Gateway Static Role,gateway_downloadable_role (string, optional): Gateway Downloadable Role,mtu (string, optional): MTU <68-9198>,trust_mode (string, optional) = ['' or 'none' or 'cos' or 'dscp']: Trust Mode,poe_priority (string, optional) = ['' or 'low' or 'high' or 'critical']: PoE Priority,private_vlan_port_type (string, optional) = ['' or 'promiscuous' or 'secondary']: Private VLAN Port Type,policy_name (string, optional): Policy name} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "agent_template": "", + "post_auth_template": "", + "radius_dyn_authz_template": "", + "action": "", + "device_group_list": [ + "" + ], + "attributes": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "tacacs_service_params": { + "privilege_level": 0, + "services": [ + "" + ], + "authorize_attribute_status": "", + "tacacs_command_config": { + "service_type": "", + "permit_unmatched_cmds": false, + "commands": [ + { + "command": "", + "permit_unmatched_args": false, + "command_args": [ + { + "argument": "", + "permit_action": false + } + ] + } + ] + } + }, + "dur_config": { + "config_mode": "", + "product": "", + "aruba_os_switch_config": { + "captive_portal_profile_name": "", + "policy_name": "", + "controller_static_role": "", + "controller_downloadable_role": "", + "vlan_id": "", + "vlan_name": "", + "vlan_tagged_id": "", + "vlan_tagged_name": "", + "reauth_period": "", + "logoff_period": "", + "cached_reauth_period": "", + "enable_device_config": false, + "enable_poe_allocate_by_class": false, + "poe_priority": "", + "enable_admin_edge_port": false, + "enable_port_mode": false + }, + "mobility_access_switch_config": { + "captive_portal_profile_name": "", + "policer_profile_name": "", + "qos_profile_name": "", + "voip_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "mobility_controller_config": { + "captive_portal_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "vlan_name": "", + "parameterized_vlan": "", + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "aos_cx_config": { + "role_name": "", + "description": "", + "captive_portal_name": "", + "authentication_mode": "", + "device_traffic_class": "", + "session_timeout_type": "", + "session_timeout": "", + "parameterized_session_timeout": "", + "cached_reauth_period": "", + "reauth_period_type": "", + "reauth_period": "", + "minimum_reauth_period": "", + "parameterized_reauth": "", + "client_inactivity_timeout_type": "", + "client_inactivity_timeout": "", + "parameterized_client_inactivity_timeout": "", + "allowed_vlan_ids_trunk": "", + "allowed_vlan_names_trunk": "", + "parameterized_allowed_vlan_type": "", + "parameterized_allowed_vlan": "", + "native_trunk_vlan_type": "", + "native_trunk_vlan_id": "", + "native_trunk_vlan_name": "", + "parameterized_native_trunk_vlan": "", + "access_vlan_type": "", + "access_vlan_id": "", + "access_vlan_name": "", + "parameterized_access_vlan": "", + "gateway_zone": "", + "secondary_role_type": "", + "gateway_static_role": "", + "gateway_downloadable_role": "", + "mtu": "", + "trust_mode": "", + "poe_priority": "", + "private_vlan_port_type": "", + "policy_name": "" + } + } + } + """ + url_path = "/enforcement-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_name_by_name(self, name="", body=({})): + """ + Operation: Replace an Enforcement Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: name of the enforcement profile + Required Body Parameters (body description)- EnforcementProfileReplace {name (string): Name of the Enforcement Profile,description (string, optional): Description of the Enforcement Profile,type (string) = ['RADIUS' or 'TACACS' or 'SNMP' or 'Application' or 'Agent' or 'CLI' or 'HTTP' or 'RADIUS_DynAuthZ' or 'Post_Authentication' or 'Aruba_DUR']: Enforcement Profile Type,agent_template (string, optional) = ['Agent' or 'AgentScript']: Agent Enforcement Profile Template,post_auth_template (string, optional) = ['EntityUpdate' or 'SessionRestriction' or 'SessionNotify']: Post Authentication Enforcement Profile Template,radius_dyn_authz_template (string, optional): Post Authentication Enforcement Profile Template,action (string, optional) = ['Accept' or 'Reject' or 'Drop']: Enforcement Profile Action,device_group_list (array[string], optional): Device Group List,attributes (array[Attributes], optional): Attributes,tacacs_service_params (TacacsServiceParam, optional): Tacacs+ Service Params,dur_config (DURConfig, optional): Downloadable User Role Configuration}Attributes {type (string, optional): Type of the Attribute,name (string, optional): Name of the Attribute,value (string, optional): Value of the Attribute}TacacsServiceParam {privilege_level (integer, optional): Privilege Level <0-15>,services (array[string], optional): Selected Services,authorize_attribute_status (string, optional) = ['ADD' or 'REPLACE' or 'FAIL']: Authorize Attribute Status,tacacs_command_config (TacacsCommandConfig, optional): Commands}TacacsCommandConfig {service_type (string, optional) = ['Shell' or 'PIX Shell']: Service Type,permit_unmatched_cmds (boolean, optional): Enable to permit unmatched commands,commands (array[TacacsCommand], optional): Specify which commands with arguments are permitted/denied}TacacsCommand {command (string, optional): Shell Command,permit_unmatched_args (boolean, optional): Enable to permit unmatched arguments,command_args (array[TacacsCommandArgs], optional): List of Command Arguments}TacacsCommandArgs {argument (string, optional): Command Argument,permit_action (boolean, optional): Enable to permit unmatched action}DURConfig {config_mode (string, optional) = ['Standard' or 'Advanced']: Role Configuration Mode for Aruba Downloadable Role Enforcement profile,product (string, optional) = ['AOS-CX' or 'Mobility Controller' or 'ArubaOS-Switch' or 'Mobility Access Switch']: Product Name for Aruba Downloadable Role Enforcement profile,aruba_os_switch_config (ArubaOSSwitchConfig, optional): ArubaOS-Switch Downloadable Role Configuration,mobility_access_switch_config (MASConfig, optional): Mobility Access Switch Downloadable Role Configuration,mobility_controller_config (AMCConfig, optional): Mobility Controller Downloadable Role Configuration,aos_cx_config (AOSCXConfig, optional): AOS-CX Downloadable Role Configuration}ArubaOSSwitchConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policy_name (string, optional): Policy name,controller_static_role (string, optional): Controller Static Role,controller_downloadable_role (string, optional): Controller Downloadable Role,vlan_id (string, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,vlan_tagged_id (string, optional): VLAN ID Tagged,vlan_tagged_name (string, optional): VLAN Name Tagged,reauth_period (string, optional): Re-Authentication Period <0-999999999>,logoff_period (string, optional): Logoff Period <0(mac-pin) OR 60-9999999>,cached_reauth_period (string, optional): Cached Re-Authentication Period <60-2147483647>,enable_device_config (boolean, optional): Enable Device Configuration,enable_poe_allocate_by_class (boolean, optional): Enable POE Allocate By Class,poe_priority (string, optional) = ['low' or 'high' or 'critical']: POE Priority,enable_admin_edge_port (boolean, optional): Enable Admin Edge Port,enable_port_mode (boolean, optional): Enable Port Mode}MASConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,policer_profile_name (string, optional): Policer Profile name,qos_profile_name (string, optional): QoS Profile name,voip_profile_name (string, optional): VoIP Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,acl_list (array[acl], optional): Access Control List}acl {name (string, optional): Name of the ACL,type (string, optional) = ['Ethertype' or 'MAC' or 'Stateless' or 'Session']: Type of the ACL}AMCConfig {captive_portal_profile_name (string, optional): Captive Portal Profile name,reauth_interval (integer, optional): Re-authentication Interval Time (0-4096),vlan_id (integer, optional): VLAN ID <1-4094>,vlan_name (string, optional): VLAN Name,parameterized_vlan (string, optional): Parameterized VLAN,acl_list (array[acl], optional): Access Control List}AOSCXConfig {role_name (string, optional): Role name,description (string, optional): Description,captive_portal_name (string, optional): Captive Portal name,authentication_mode (string, optional) = ['' or 'client-mode' or 'device-mode' or 'multi-domain-mode']: Authentication Mode,device_traffic_class (string, optional) = ['None' or 'Voice']: Device Traffic Class,session_timeout_type (string, optional) = ['Static' or 'Parameterized']: Session Timeout Type,session_timeout (string, optional): Session Timeout <1-4294967295>,parameterized_session_timeout (string, optional): Parameterized Session Timeout,cached_reauth_period (string, optional): Cached Re-authentication period <30-4294967295>,reauth_period_type (string, optional) = ['Manual' or 'Random' or 'Parameterized']: Re-Authentication Period Type,reauth_period (string, optional): Re-Authentication Period <1-4294967295>,minimum_reauth_period (string, optional): Minimum re-authentication period <1-4294967295>,parameterized_reauth (string, optional): Parameterized Re-Authentication,client_inactivity_timeout_type (string, optional) = ['Value' or 'None' or 'Parameterized']: Client Inactivity Timeout Type,client_inactivity_timeout (string, optional): Client Inactivity Timeout value <300-4294967295>,parameterized_client_inactivity_timeout (string, optional): Parameterized Client Inactivity Timeout,allowed_vlan_ids_trunk (string, optional): Allowed VLANs on Trunk <1-4094>,allowed_vlan_names_trunk (string, optional): List of Allowed VLAN Names on Trunk,parameterized_allowed_vlan_type (string, optional) = ['Id' or 'Name']: Parameterized Allowed VLAN Type,parameterized_allowed_vlan (string, optional): Parameterized Allowed VLAN,native_trunk_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Native Trunk VLAN Type,native_trunk_vlan_id (string, optional): Native Trunk VLAN <1-4094>,native_trunk_vlan_name (string, optional): Native Trunk VLAN Name,parameterized_native_trunk_vlan (string, optional): Parameterized Native Trunk VLAN,access_vlan_type (string, optional) = ['Id' or 'Name' or 'Parameterized']: Access VLAN Type,access_vlan_id (string, optional): Access VLAN <1-4094>,access_vlan_name (string, optional): Access VLAN Name,parameterized_access_vlan (string, optional): Parameterized Access VLAN,gateway_zone (string, optional): Gateway Zone,secondary_role_type (string, optional) = ['None' or 'Static' or 'Dynamic']: Secondary Role Type,gateway_static_role (string, optional): Gateway Static Role,gateway_downloadable_role (string, optional): Gateway Downloadable Role,mtu (string, optional): MTU <68-9198>,trust_mode (string, optional) = ['' or 'none' or 'cos' or 'dscp']: Trust Mode,poe_priority (string, optional) = ['' or 'low' or 'high' or 'critical']: PoE Priority,private_vlan_port_type (string, optional) = ['' or 'promiscuous' or 'secondary']: Private VLAN Port Type,policy_name (string, optional): Policy name} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "agent_template": "", + "post_auth_template": "", + "radius_dyn_authz_template": "", + "action": "", + "device_group_list": [ + "" + ], + "attributes": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "tacacs_service_params": { + "privilege_level": 0, + "services": [ + "" + ], + "authorize_attribute_status": "", + "tacacs_command_config": { + "service_type": "", + "permit_unmatched_cmds": false, + "commands": [ + { + "command": "", + "permit_unmatched_args": false, + "command_args": [ + { + "argument": "", + "permit_action": false + } + ] + } + ] + } + }, + "dur_config": { + "config_mode": "", + "product": "", + "aruba_os_switch_config": { + "captive_portal_profile_name": "", + "policy_name": "", + "controller_static_role": "", + "controller_downloadable_role": "", + "vlan_id": "", + "vlan_name": "", + "vlan_tagged_id": "", + "vlan_tagged_name": "", + "reauth_period": "", + "logoff_period": "", + "cached_reauth_period": "", + "enable_device_config": false, + "enable_poe_allocate_by_class": false, + "poe_priority": "", + "enable_admin_edge_port": false, + "enable_port_mode": false + }, + "mobility_access_switch_config": { + "captive_portal_profile_name": "", + "policer_profile_name": "", + "qos_profile_name": "", + "voip_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "mobility_controller_config": { + "captive_portal_profile_name": "", + "reauth_interval": 0, + "vlan_id": 0, + "vlan_name": "", + "parameterized_vlan": "", + "acl_list": [ + { + "name": "", + "type": "" + } + ] + }, + "aos_cx_config": { + "role_name": "", + "description": "", + "captive_portal_name": "", + "authentication_mode": "", + "device_traffic_class": "", + "session_timeout_type": "", + "session_timeout": "", + "parameterized_session_timeout": "", + "cached_reauth_period": "", + "reauth_period_type": "", + "reauth_period": "", + "minimum_reauth_period": "", + "parameterized_reauth": "", + "client_inactivity_timeout_type": "", + "client_inactivity_timeout": "", + "parameterized_client_inactivity_timeout": "", + "allowed_vlan_ids_trunk": "", + "allowed_vlan_names_trunk": "", + "parameterized_allowed_vlan_type": "", + "parameterized_allowed_vlan": "", + "native_trunk_vlan_type": "", + "native_trunk_vlan_id": "", + "native_trunk_vlan_name": "", + "parameterized_native_trunk_vlan": "", + "access_vlan_type": "", + "access_vlan_id": "", + "access_vlan_name": "", + "parameterized_access_vlan": "", + "gateway_zone": "", + "secondary_role_type": "", + "gateway_static_role": "", + "gateway_downloadable_role": "", + "mtu": "", + "trust_mode": "", + "poe_priority": "", + "private_vlan_port_type": "", + "policy_name": "" + } + } + } + """ + url_path = "/enforcement-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_name_by_name(self, name=""): + """ + Operation: Delete an Enforcement Profile by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: name of the enforcement profile + """ + url_path = "/enforcement-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:EthertypeAccessControlList + # Function Section Description: Manage Ethertype Access Control List + + def get_enforcement_profile_dur_ethertype_access_control_list_by_product_name( + self, product_name="" + ): + """ + Operation: GET a list of Ethertype Access Control Lists + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = ( + "/enforcement-profile-dur/ethertype-access-control-list/{product_name}" + ) + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_ethertype_access_control_list_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Ethertype Access Control List + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- EthertypeAccessControlListPost {name (string): Name of the Ethertype Access Control List,rules (array[RulesPost], optional): Rules of the Ethertype Access Control List}RulesPost {action (string, optional) = ['permit' or 'deny']: Action,ethertype_type (string, optional) = ['any' or 'value']: Ethertype Type,ethertype_value (integer, optional): Ethertype Value (0-65535),subnet_bits (integer, optional): Subnet Bits (0-65535)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "ethertype_type": "", + "ethertype_value": 0, + "subnet_bits": 0 + } + ] + } + """ + url_path = ( + "/enforcement-profile-dur/ethertype-access-control-list/{product_name}" + ) + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_ethertype_access_control_list_by_product_name_ethertype_access_control_list_id( + self, product_name="", ethertype_access_control_list_id="" + ): + """ + Operation: Get a Ethertype Access Control List + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: ethertype_access_control_list_id, Description: Numeric ID of the Ethertype Access Control List + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/{ethertype_access_control_list_id}" + dict_path = { + "product_name": product_name, + "ethertype_access_control_list_id": ethertype_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_ethertype_access_control_list_by_product_name_ethertype_access_control_list_id( + self, product_name="", ethertype_access_control_list_id="", body=({}) + ): + """ + Operation: Update a Ethertype Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: ethertype_access_control_list_id, Description: Numeric ID of the Ethertype Access Control List + Required Body Parameters (body description)- EthertypeAccessControlListUpdate {name (string, optional): Name of the Ethertype Access Control List,rules (array[Rules], optional): Rules of the Ethertype Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,ethertype_type (string) = ['any' or 'value']: Ethertype Type,ethertype_value (integer, optional): Ethertype Value (0-65535),subnet_bits (integer, optional): Subnet Bits (0-65535)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "ethertype_type": "", + "ethertype_value": 0, + "subnet_bits": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/{ethertype_access_control_list_id}" + dict_path = { + "product_name": product_name, + "ethertype_access_control_list_id": ethertype_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_ethertype_access_control_list_by_product_name_ethertype_access_control_list_id( + self, product_name="", ethertype_access_control_list_id="", body=({}) + ): + """ + Operation: Replace a Ethertype Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: ethertype_access_control_list_id, Description: Numeric ID of the Ethertype Access Control List + Required Body Parameters (body description)- EthertypeAccessControlListReplace {name (string, optional): Name of the Ethertype Access Control List,rules (array[Rules], optional): Rules of the Ethertype Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,ethertype_type (string) = ['any' or 'value']: Ethertype Type,ethertype_value (integer, optional): Ethertype Value (0-65535),subnet_bits (integer, optional): Subnet Bits (0-65535)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "ethertype_type": "", + "ethertype_value": 0, + "subnet_bits": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/{ethertype_access_control_list_id}" + dict_path = { + "product_name": product_name, + "ethertype_access_control_list_id": ethertype_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_ethertype_access_control_list_by_product_name_ethertype_access_control_list_id( + self, product_name="", ethertype_access_control_list_id="" + ): + """ + Operation: Delete a Ethertype Access Control List + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: ethertype_access_control_list_id, Description: Numeric ID of the Ethertype Access Control List + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/{ethertype_access_control_list_id}" + dict_path = { + "product_name": product_name, + "ethertype_access_control_list_id": ethertype_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_ethertype_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Ethertype Access Control List by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Ethertype Access Control List + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_ethertype_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update a Ethertype Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Ethertype Access Control List + Required Body Parameters (body description)- EthertypeAccessControlListUpdate {name (string, optional): Name of the Ethertype Access Control List,rules (array[Rules], optional): Rules of the Ethertype Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,ethertype_type (string) = ['any' or 'value']: Ethertype Type,ethertype_value (integer, optional): Ethertype Value (0-65535),subnet_bits (integer, optional): Subnet Bits (0-65535)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "ethertype_type": "", + "ethertype_value": 0, + "subnet_bits": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_ethertype_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Ethertype Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Ethertype Access Control List + Required Body Parameters (body description)- EthertypeAccessControlListReplace {name (string, optional): Name of the Ethertype Access Control List,rules (array[Rules], optional): Rules of the Ethertype Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,ethertype_type (string) = ['any' or 'value']: Ethertype Type,ethertype_value (integer, optional): Ethertype Value (0-65535),subnet_bits (integer, optional): Subnet Bits (0-65535)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "ethertype_type": "", + "ethertype_value": 0, + "subnet_bits": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_ethertype_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Ethertype Access Control List by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Ethertype Access Control List + """ + url_path = "/enforcement-profile-dur/ethertype-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:MACAccessControlList + # Function Section Description: Manage MAC Access Control List + + def get_enforcement_profile_dur_mac_access_control_list_by_product_name( + self, product_name="" + ): + """ + Operation: GET a list of MAC Access Control Lists + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_mac_access_control_list_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a MAC Access Control List + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- MACAccessControlListPost {name (string): Name of the MAC Access Control List,rules (array[RulesPost], optional): Rules of the MAC Access Control List}RulesPost {action (string, optional) = ['permit' or 'deny']: Action,mac_address_type (string, optional) = ['any' or 'host' or 'value']: MAC Address Type,mac_address_value (string, optional): MAC Address Value (eg. AA:BB:CC:DD:EE:FF),subnet_bits (string, optional): Subnet Bits (eg. AA:BB:CC:DD:EE:FF)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "mac_address_type": "", + "mac_address_value": "", + "subnet_bits": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_mac_access_control_list_by_product_name_mac_access_control_list_id( + self, product_name="", mac_access_control_list_id="" + ): + """ + Operation: Get a MAC Access Control List + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: mac_access_control_list_id, Description: Numeric ID of the MAC Access Control List + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/{mac_access_control_list_id}" + dict_path = { + "product_name": product_name, + "mac_access_control_list_id": mac_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_mac_access_control_list_by_product_name_mac_access_control_list_id( + self, product_name="", mac_access_control_list_id="", body=({}) + ): + """ + Operation: Update some fields of a MAC Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: mac_access_control_list_id, Description: Numeric ID of the MAC Access Control List + Required Body Parameters (body description)- MACAccessControlListUpdate {name (string, optional): Name of the MAC Access Control List,rules (array[Rules], optional): Rules of the MAC Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,mac_address_type (string) = ['any' or 'host' or 'value']: MAC Address Type,mac_address_value (string, optional): MAC Address Value (eg. AA:BB:CC:DD:EE:FF),subnet_bits (string, optional): Subnet Bits (eg. AA:BB:CC:DD:EE:FF)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "mac_address_type": "", + "mac_address_value": "", + "subnet_bits": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/{mac_access_control_list_id}" + dict_path = { + "product_name": product_name, + "mac_access_control_list_id": mac_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_mac_access_control_list_by_product_name_mac_access_control_list_id( + self, product_name="", mac_access_control_list_id="", body=({}) + ): + """ + Operation: Replace a MAC Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: mac_access_control_list_id, Description: Numeric ID of the MAC Access Control List + Required Body Parameters (body description)- MACAccessControlListReplace {name (string, optional): Name of the MAC Access Control List,rules (array[Rules], optional): Rules of the MAC Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,mac_address_type (string) = ['any' or 'host' or 'value']: MAC Address Type,mac_address_value (string, optional): MAC Address Value (eg. AA:BB:CC:DD:EE:FF),subnet_bits (string, optional): Subnet Bits (eg. AA:BB:CC:DD:EE:FF)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "mac_address_type": "", + "mac_address_value": "", + "subnet_bits": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/{mac_access_control_list_id}" + dict_path = { + "product_name": product_name, + "mac_access_control_list_id": mac_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_mac_access_control_list_by_product_name_mac_access_control_list_id( + self, product_name="", mac_access_control_list_id="" + ): + """ + Operation: Delete a MAC Access Control List + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: mac_access_control_list_id, Description: Numeric ID of the MAC Access Control List + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/{mac_access_control_list_id}" + dict_path = { + "product_name": product_name, + "mac_access_control_list_id": mac_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_mac_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a MAC Access Control List by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the MAC Access Control List + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_mac_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a MAC Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the MAC Access Control List + Required Body Parameters (body description)- MACAccessControlListUpdate {name (string, optional): Name of the MAC Access Control List,rules (array[Rules], optional): Rules of the MAC Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,mac_address_type (string) = ['any' or 'host' or 'value']: MAC Address Type,mac_address_value (string, optional): MAC Address Value (eg. AA:BB:CC:DD:EE:FF),subnet_bits (string, optional): Subnet Bits (eg. AA:BB:CC:DD:EE:FF)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "mac_address_type": "", + "mac_address_value": "", + "subnet_bits": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_mac_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a MAC Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the MAC Access Control List + Required Body Parameters (body description)- MACAccessControlListReplace {name (string, optional): Name of the MAC Access Control List,rules (array[Rules], optional): Rules of the MAC Access Control List}Rules {action (string) = ['permit' or 'deny']: Action,mac_address_type (string) = ['any' or 'host' or 'value']: MAC Address Type,mac_address_value (string, optional): MAC Address Value (eg. AA:BB:CC:DD:EE:FF),subnet_bits (string, optional): Subnet Bits (eg. AA:BB:CC:DD:EE:FF)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "action": "", + "mac_address_type": "", + "mac_address_value": "", + "subnet_bits": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_mac_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a MAC Access Control List by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the MAC Access Control List + """ + url_path = "/enforcement-profile-dur/mac-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:NATPool + # Function Section Description: Manage NAT Pool + + def get_enforcement_profile_dur_nat_pool_by_product_name(self, product_name=""): + """ + Operation: GET a list of NAT Pools + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_nat_pool_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a NAT Pool + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- NATPoolPost {name (string): Name of the NAT Pool,start_src_range (string): Start of source NAT range,end_src_range (string): End of source NAT range,destination_nat_ip_address (string, optional): Destination NAT IP Address} + Required Body Parameters (type(dict) body example)- { + "name": "", + "start_src_range": "", + "end_src_range": "", + "destination_nat_ip_address": "" + } + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_nat_pool_by_product_name_nat_pool_id( + self, product_name="", nat_pool_id="" + ): + """ + Operation: Get a NAT Pool + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: nat_pool_id, Description: Numeric ID of the NAT Pool + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/{nat_pool_id}" + dict_path = {"product_name": product_name, "nat_pool_id": nat_pool_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_nat_pool_by_product_name_nat_pool_id( + self, product_name="", nat_pool_id="", body=({}) + ): + """ + Operation: Update some fields of a NAT Pool + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: nat_pool_id, Description: Numeric ID of the NAT Pool + Required Body Parameters (body description)- NATPoolUpdate {name (string, optional): Name of the NAT Pool,start_src_range (string, optional): Start of source NAT range,end_src_range (string, optional): End of source NAT range,destination_nat_ip_address (string, optional): Destination NAT IP Address} + Required Body Parameters (type(dict) body example)- { + "name": "", + "start_src_range": "", + "end_src_range": "", + "destination_nat_ip_address": "" + } + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/{nat_pool_id}" + dict_path = {"product_name": product_name, "nat_pool_id": nat_pool_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_nat_pool_by_product_name_nat_pool_id( + self, product_name="", nat_pool_id="", body=({}) + ): + """ + Operation: Replace a NAT Pool + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: nat_pool_id, Description: Numeric ID of the NAT Pool + Required Body Parameters (body description)- NATPoolReplace {name (string): Name of the NAT Pool,start_src_range (string): Start of source NAT range,end_src_range (string): End of source NAT range,destination_nat_ip_address (string, optional): Destination NAT IP Address} + Required Body Parameters (type(dict) body example)- { + "name": "", + "start_src_range": "", + "end_src_range": "", + "destination_nat_ip_address": "" + } + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/{nat_pool_id}" + dict_path = {"product_name": product_name, "nat_pool_id": nat_pool_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_nat_pool_by_product_name_nat_pool_id( + self, product_name="", nat_pool_id="" + ): + """ + Operation: Delete a NAT Pool + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: nat_pool_id, Description: Numeric ID of the NAT Pool + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/{nat_pool_id}" + dict_path = {"product_name": product_name, "nat_pool_id": nat_pool_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_nat_pool_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a NAT Pool by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the NAT Pool + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_nat_pool_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a NAT Pool by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the NAT Pool + Required Body Parameters (body description)- NATPoolUpdate {name (string, optional): Name of the NAT Pool,start_src_range (string, optional): Start of source NAT range,end_src_range (string, optional): End of source NAT range,destination_nat_ip_address (string, optional): Destination NAT IP Address} + Required Body Parameters (type(dict) body example)- { + "name": "", + "start_src_range": "", + "end_src_range": "", + "destination_nat_ip_address": "" + } + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_nat_pool_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a NAT Pool by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the NAT Pool + Required Body Parameters (body description)- NATPoolReplace {name (string): Name of the NAT Pool,start_src_range (string): Start of source NAT range,end_src_range (string): End of source NAT range,destination_nat_ip_address (string, optional): Destination NAT IP Address} + Required Body Parameters (type(dict) body example)- { + "name": "", + "start_src_range": "", + "end_src_range": "", + "destination_nat_ip_address": "" + } + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_nat_pool_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a NAT Pool by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the NAT Pool + """ + url_path = "/enforcement-profile-dur/nat-pool/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:NetDestination + # Function Section Description: Manage Net Destination + + def get_enforcement_profile_dur_net_destination_by_product_name( + self, product_name="" + ): + """ + Operation: GET a list of Net Destinations + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_net_destination_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Net Destination + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- NetDestinationPost {name (string): Name of the Net Destination,invert (boolean, optional): Invert for Mobility Access Switch and Mobility Controller Net Destination,rules (array[RulesPost]): Rules for the Net Destination}RulesPost {rule_type (string, optional) = ['host' or 'network' or 'name' or 'range']: Rule Type,ip_address (string): IP Address,netmask (string): Netmask,end_ip_address (string): End IP Address,host_name (string): Host Name or Domain,position (integer): Position (1-220) for ArubaOS-Switch Net Destination rule} + Required Body Parameters (type(dict) body example)- { + "name": "", + "invert": false, + "rules": [ + { + "rule_type": "", + "ip_address": "", + "netmask": "", + "end_ip_address": "", + "host_name": "", + "position": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_net_destination_by_product_name_net_destination_id( + self, product_name="", net_destination_id="" + ): + """ + Operation: Get a Net Destination + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_destination_id, Description: Numeric ID of the Net Destination + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/{net_destination_id}" + dict_path = { + "product_name": product_name, + "net_destination_id": net_destination_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_net_destination_by_product_name_net_destination_id( + self, product_name="", net_destination_id="", body=({}) + ): + """ + Operation: Update some fields of a Net Destination + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_destination_id, Description: Numeric ID of the Net Destination + Required Body Parameters (body description)- NetDestinationUpdate {name (string, optional): Name of the Net Destination,invert (boolean, optional): Invert for Mobility Access Switch and Mobility Controller Net Destination,rules (array[Rules], optional): Rules for the Net Destination}Rules {rule_type (string) = ['host' or 'network' or 'name' or 'range']: Rule Type,ip_address (string): IP Address,netmask (string): Netmask,end_ip_address (string): End IP Address,host_name (string): Host Name or Domain,position (integer): Position (1-220) for ArubaOS-Switch Net Destination rule} + Required Body Parameters (type(dict) body example)- { + "name": "", + "invert": false, + "rules": [ + { + "rule_type": "", + "ip_address": "", + "netmask": "", + "end_ip_address": "", + "host_name": "", + "position": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/{net_destination_id}" + dict_path = { + "product_name": product_name, + "net_destination_id": net_destination_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_net_destination_by_product_name_net_destination_id( + self, product_name="", net_destination_id="", body=({}) + ): + """ + Operation: Replace a Net Destination + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_destination_id, Description: Numeric ID of the Net Destination + Required Body Parameters (body description)- NetDestinationReplace {name (string, optional): Name of the Net Destination,invert (boolean, optional): Invert for Mobility Access Switch and Mobility Controller Net Destination,rules (array[Rules], optional): Rules for the Net Destination}Rules {rule_type (string) = ['host' or 'network' or 'name' or 'range']: Rule Type,ip_address (string): IP Address,netmask (string): Netmask,end_ip_address (string): End IP Address,host_name (string): Host Name or Domain,position (integer): Position (1-220) for ArubaOS-Switch Net Destination rule} + Required Body Parameters (type(dict) body example)- { + "name": "", + "invert": false, + "rules": [ + { + "rule_type": "", + "ip_address": "", + "netmask": "", + "end_ip_address": "", + "host_name": "", + "position": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/{net_destination_id}" + dict_path = { + "product_name": product_name, + "net_destination_id": net_destination_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_net_destination_by_product_name_net_destination_id( + self, product_name="", net_destination_id="" + ): + """ + Operation: Delete a Net Destination + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_destination_id, Description: Numeric ID of the Net Destination + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/{net_destination_id}" + dict_path = { + "product_name": product_name, + "net_destination_id": net_destination_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_net_destination_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Net Destination by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Destination + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_net_destination_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a Net Destination by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Destination + Required Body Parameters (body description)- NetDestinationUpdate {name (string, optional): Name of the Net Destination,invert (boolean, optional): Invert for Mobility Access Switch and Mobility Controller Net Destination,rules (array[Rules], optional): Rules for the Net Destination}Rules {rule_type (string) = ['host' or 'network' or 'name' or 'range']: Rule Type,ip_address (string): IP Address,netmask (string): Netmask,end_ip_address (string): End IP Address,host_name (string): Host Name or Domain,position (integer): Position (1-220) for ArubaOS-Switch Net Destination rule} + Required Body Parameters (type(dict) body example)- { + "name": "", + "invert": false, + "rules": [ + { + "rule_type": "", + "ip_address": "", + "netmask": "", + "end_ip_address": "", + "host_name": "", + "position": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_net_destination_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Net Destination by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Destination + Required Body Parameters (body description)- NetDestinationReplace {name (string, optional): Name of the Net Destination,invert (boolean, optional): Invert for Mobility Access Switch and Mobility Controller Net Destination,rules (array[Rules], optional): Rules for the Net Destination}Rules {rule_type (string) = ['host' or 'network' or 'name' or 'range']: Rule Type,ip_address (string): IP Address,netmask (string): Netmask,end_ip_address (string): End IP Address,host_name (string): Host Name or Domain,position (integer): Position (1-220) for ArubaOS-Switch Net Destination rule} + Required Body Parameters (type(dict) body example)- { + "name": "", + "invert": false, + "rules": [ + { + "rule_type": "", + "ip_address": "", + "netmask": "", + "end_ip_address": "", + "host_name": "", + "position": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_net_destination_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Net Destination by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Destination + """ + url_path = "/enforcement-profile-dur/net-destination/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:NetService + # Function Section Description: Manage Net Services + + def get_enforcement_profile_dur_net_service_by_product_name(self, product_name=""): + """ + Operation: GET a list of Net Services + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/net-service/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_net_service_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Net Service + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- NetServicePost {name (string): Name of the Net Service,description (string, optional): Description of the Net Service,protocol (string, optional) = ['TCP' or 'UDP' or 'IP']: Protocol of the Net Service,port_selection (string, optional) = ['List' or 'Range' or 'Port']: Port Selection of the Net Service. Port is not applicable for MAS and AMC products,port_list (string, optional): Comma separated Port values of the Net Service,port (integer, optional): Port of the Net Service (1-65535),max_port (integer, optional): Max Port of the Net Service (1-65535),ip_protocol_number (integer, optional): IP Protocol Number of the Net Service (0-255),application_level_gateway (string, optional) = ['dhcp' or 'dns' or 'ftp' or 'noe' or 'rtsp' or 'sccp' or 'sip' or 'sips' or 'svp' or 'tftp' or 'vocera']: Application Level Gateway of the Net Service} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "protocol": "", + "port_selection": "", + "port_list": "", + "port": 0, + "max_port": 0, + "ip_protocol_number": 0, + "application_level_gateway": "" + } + """ + url_path = "/enforcement-profile-dur/net-service/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_net_service_by_product_name_net_service_id( + self, product_name="", net_service_id="" + ): + """ + Operation: Get a Net Service + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_service_id, Description: Numeric ID of the Net Service + """ + url_path = ( + "/enforcement-profile-dur/net-service/{product_name}/{net_service_id}" + ) + dict_path = {"product_name": product_name, "net_service_id": net_service_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_net_service_by_product_name_net_service_id( + self, product_name="", net_service_id="", body=({}) + ): + """ + Operation: Update some fields of a Net Service + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_service_id, Description: Numeric ID of the Net Service + Required Body Parameters (body description)- NetServiceUpdate {name (string, optional): Name of the Net Service,description (string, optional): Description of the Net Service,protocol (string, optional) = ['TCP' or 'UDP' or 'IP']: Protocol of the Net Service,port_selection (string, optional) = ['List' or 'Range' or 'Port']: Port Selection of the Net Service. Port is not applicable for MAS and AMC products,port_list (string, optional): Comma separated Port values of the Net Service,port (integer, optional): Port of the Net Service (1-65535),max_port (integer, optional): Max Port of the Net Service (1-65535),ip_protocol_number (integer, optional): IP Protocol Number of the Net Service (0-255),application_level_gateway (string, optional) = ['dhcp' or 'dns' or 'ftp' or 'noe' or 'rtsp' or 'sccp' or 'sip' or 'sips' or 'svp' or 'tftp' or 'vocera']: Application Level Gateway of the Net Service} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "protocol": "", + "port_selection": "", + "port_list": "", + "port": 0, + "max_port": 0, + "ip_protocol_number": 0, + "application_level_gateway": "" + } + """ + url_path = ( + "/enforcement-profile-dur/net-service/{product_name}/{net_service_id}" + ) + dict_path = {"product_name": product_name, "net_service_id": net_service_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_net_service_by_product_name_net_service_id( + self, product_name="", net_service_id="", body=({}) + ): + """ + Operation: Replace a Net Service + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_service_id, Description: Numeric ID of the Net Service + Required Body Parameters (body description)- NetServiceReplace {name (string): Name of the Net Service,description (string): Description of the Net Service,protocol (string) = ['TCP' or 'UDP' or 'IP']: Protocol of the Net Service,port_selection (string, optional) = ['List' or 'Range' or 'Port']: Port Selection of the Net Service. Port is not applicable for MAS and AMC products,port_list (string, optional): Comma separated Port values of the Net Service,port (integer, optional): Port of the Net Service (1-65535),max_port (integer, optional): Max Port of the Net Service (1-65535),ip_protocol_number (integer, optional): IP Protocol Number of the Net Service (0-255),application_level_gateway (string, optional) = ['dhcp' or 'dns' or 'ftp' or 'noe' or 'rtsp' or 'sccp' or 'sip' or 'sips' or 'svp' or 'tftp' or 'vocera']: Application Level Gateway of the Net Service} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "protocol": "", + "port_selection": "", + "port_list": "", + "port": 0, + "max_port": 0, + "ip_protocol_number": 0, + "application_level_gateway": "" + } + """ + url_path = ( + "/enforcement-profile-dur/net-service/{product_name}/{net_service_id}" + ) + dict_path = {"product_name": product_name, "net_service_id": net_service_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_net_service_by_product_name_net_service_id( + self, product_name="", net_service_id="" + ): + """ + Operation: Delete a Net Service + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: net_service_id, Description: Numeric ID of the Net Service + """ + url_path = ( + "/enforcement-profile-dur/net-service/{product_name}/{net_service_id}" + ) + dict_path = {"product_name": product_name, "net_service_id": net_service_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_net_service_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Net Service by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Service + """ + url_path = "/enforcement-profile-dur/net-service/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_net_service_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a Net Service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Service + Required Body Parameters (body description)- NetServiceUpdate {name (string, optional): Name of the Net Service,description (string, optional): Description of the Net Service,protocol (string, optional) = ['TCP' or 'UDP' or 'IP']: Protocol of the Net Service,port_selection (string, optional) = ['List' or 'Range' or 'Port']: Port Selection of the Net Service. Port is not applicable for MAS and AMC products,port_list (string, optional): Comma separated Port values of the Net Service,port (integer, optional): Port of the Net Service (1-65535),max_port (integer, optional): Max Port of the Net Service (1-65535),ip_protocol_number (integer, optional): IP Protocol Number of the Net Service (0-255),application_level_gateway (string, optional) = ['dhcp' or 'dns' or 'ftp' or 'noe' or 'rtsp' or 'sccp' or 'sip' or 'sips' or 'svp' or 'tftp' or 'vocera']: Application Level Gateway of the Net Service} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "protocol": "", + "port_selection": "", + "port_list": "", + "port": 0, + "max_port": 0, + "ip_protocol_number": 0, + "application_level_gateway": "" + } + """ + url_path = "/enforcement-profile-dur/net-service/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_net_service_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Net Service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Service + Required Body Parameters (body description)- NetServiceReplace {name (string): Name of the Net Service,description (string): Description of the Net Service,protocol (string) = ['TCP' or 'UDP' or 'IP']: Protocol of the Net Service,port_selection (string, optional) = ['List' or 'Range' or 'Port']: Port Selection of the Net Service. Port is not applicable for MAS and AMC products,port_list (string, optional): Comma separated Port values of the Net Service,port (integer, optional): Port of the Net Service (1-65535),max_port (integer, optional): Max Port of the Net Service (1-65535),ip_protocol_number (integer, optional): IP Protocol Number of the Net Service (0-255),application_level_gateway (string, optional) = ['dhcp' or 'dns' or 'ftp' or 'noe' or 'rtsp' or 'sccp' or 'sip' or 'sips' or 'svp' or 'tftp' or 'vocera']: Application Level Gateway of the Net Service} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "protocol": "", + "port_selection": "", + "port_list": "", + "port": 0, + "max_port": 0, + "ip_protocol_number": 0, + "application_level_gateway": "" + } + """ + url_path = "/enforcement-profile-dur/net-service/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_net_service_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Net Service by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Net Service + """ + url_path = "/enforcement-profile-dur/net-service/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:PolicerProfile + # Function Section Description: Manage Policer Profile + + def get_enforcement_profile_dur_policer_profile_by_product_name( + self, product_name="" + ): + """ + Operation: GET a list of Policer Profiles + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_policer_profile_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Policer Profile + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- PolicerProfilePost {name (string): Name of the Policer Profile,cbs (integer, optional): CBS (Bytes) of the Policer Profile,cir (integer, optional): CIR (Kbps) of the Policer Profile,ebs (integer, optional): EBS (Bytes) of the Policer Profile,exceed_action (string, optional): Exceed Action of the Policer Profile,exceed_qos_profile (string, optional): Exceed QoS Profile of the Policer Profile,violate_action (string, optional): Violate Action of the Policer Profile,violate_qos_profile (string, optional): Violate QoS Profile of the Policer Profile} + Required Body Parameters (type(dict) body example)- { + "name": "", + "cbs": 0, + "cir": 0, + "ebs": 0, + "exceed_action": "", + "exceed_qos_profile": "", + "violate_action": "", + "violate_qos_profile": "" + } + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_policer_profile_by_product_name_policer_profile_id( + self, product_name="", policer_profile_id="" + ): + """ + Operation: Get a Policer Profile + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policer_profile_id, Description: Numeric ID of the Policer Profile + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/{policer_profile_id}" + dict_path = { + "product_name": product_name, + "policer_profile_id": policer_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_policer_profile_by_product_name_policer_profile_id( + self, product_name="", policer_profile_id="", body=({}) + ): + """ + Operation: Update some fields of a Policer Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policer_profile_id, Description: Numeric ID of the Policer Profile + Required Body Parameters (body description)- PolicerProfileUpdate {name (string, optional): Name of the Policer Profile,cbs (integer, optional): CBS (Bytes) of the Policer Profile,cir (integer, optional): CIR (Kbps) of the Policer Profile,ebs (integer, optional): EBS (Bytes) of the Policer Profile,exceed_action (string, optional): Exceed Action of the Policer Profile,exceed_qos_profile (string, optional): Exceed QoS Profile of the Policer Profile,violate_action (string, optional): Violate Action of the Policer Profile,violate_qos_profile (string, optional): Violate QoS Profile of the Policer Profile} + Required Body Parameters (type(dict) body example)- { + "name": "", + "cbs": 0, + "cir": 0, + "ebs": 0, + "exceed_action": "", + "exceed_qos_profile": "", + "violate_action": "", + "violate_qos_profile": "" + } + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/{policer_profile_id}" + dict_path = { + "product_name": product_name, + "policer_profile_id": policer_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_policer_profile_by_product_name_policer_profile_id( + self, product_name="", policer_profile_id="", body=({}) + ): + """ + Operation: Replace a Policer Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policer_profile_id, Description: Numeric ID of the Policer Profile + Required Body Parameters (body description)- PolicerProfileReplace {name (string): Name of the Policer Profile,cbs (integer, optional): CBS (Bytes) of the Policer Profile,cir (integer, optional): CIR (Kbps) of the Policer Profile,ebs (integer, optional): EBS (Bytes) of the Policer Profile,exceed_action (string, optional): Exceed Action of the Policer Profile,exceed_qos_profile (string, optional): Exceed QoS Profile of the Policer Profile,violate_action (string, optional): Violate Action of the Policer Profile,violate_qos_profile (string, optional): Violate QoS Profile of the Policer Profile} + Required Body Parameters (type(dict) body example)- { + "name": "", + "cbs": 0, + "cir": 0, + "ebs": 0, + "exceed_action": "", + "exceed_qos_profile": "", + "violate_action": "", + "violate_qos_profile": "" + } + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/{policer_profile_id}" + dict_path = { + "product_name": product_name, + "policer_profile_id": policer_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_policer_profile_by_product_name_policer_profile_id( + self, product_name="", policer_profile_id="" + ): + """ + Operation: Delete a Policer Profile + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policer_profile_id, Description: Numeric ID of the Policer Profile + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/{policer_profile_id}" + dict_path = { + "product_name": product_name, + "policer_profile_id": policer_profile_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_policer_profile_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Policer Profile by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policer Profile + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_policer_profile_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a Policer Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policer Profile + Required Body Parameters (body description)- PolicerProfileUpdate {name (string, optional): Name of the Policer Profile,cbs (integer, optional): CBS (Bytes) of the Policer Profile,cir (integer, optional): CIR (Kbps) of the Policer Profile,ebs (integer, optional): EBS (Bytes) of the Policer Profile,exceed_action (string, optional): Exceed Action of the Policer Profile,exceed_qos_profile (string, optional): Exceed QoS Profile of the Policer Profile,violate_action (string, optional): Violate Action of the Policer Profile,violate_qos_profile (string, optional): Violate QoS Profile of the Policer Profile} + Required Body Parameters (type(dict) body example)- { + "name": "", + "cbs": 0, + "cir": 0, + "ebs": 0, + "exceed_action": "", + "exceed_qos_profile": "", + "violate_action": "", + "violate_qos_profile": "" + } + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_policer_profile_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Policer Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policer Profile + Required Body Parameters (body description)- PolicerProfileReplace {name (string): Name of the Policer Profile,cbs (integer, optional): CBS (Bytes) of the Policer Profile,cir (integer, optional): CIR (Kbps) of the Policer Profile,ebs (integer, optional): EBS (Bytes) of the Policer Profile,exceed_action (string, optional): Exceed Action of the Policer Profile,exceed_qos_profile (string, optional): Exceed QoS Profile of the Policer Profile,violate_action (string, optional): Violate Action of the Policer Profile,violate_qos_profile (string, optional): Violate QoS Profile of the Policer Profile} + Required Body Parameters (type(dict) body example)- { + "name": "", + "cbs": 0, + "cir": 0, + "ebs": 0, + "exceed_action": "", + "exceed_qos_profile": "", + "violate_action": "", + "violate_qos_profile": "" + } + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_policer_profile_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Policer Profile by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policer Profile + """ + url_path = "/enforcement-profile-dur/policer-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:Policy + # Function Section Description: Manage Policy + + def get_enforcement_profile_dur_policy_by_product_name(self, product_name=""): + """ + Operation: GET a list of Policies + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/policy/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_policy_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Policy + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- PolicyPost {name (string): Name of the Policy,rules (array[RulesPost]): Rules of the Policy}RulesPost {number (integer): Number,class_type (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Class Type. ipv4 only applies to ArubaOS-Switch policy and ip only applies to AOS-CX policy,class_name (string): Class Name,action (string, optional) = ['permit' or 'drop' or 'deny' or 'redirect']: Action. deny only applies to ArubaOS-Switch policy and drop only applies to AOS-CX policy,dscp (integer, optional): DSCP (0-63),ip_precedence (integer, optional): IP Precedence (0-7),priority (integer, optional): Priority (0-7),rate_limit (integer, optional): Rate Limit in kbps for ArubaOS-Switch policy (0-10000000),committed_information_rate (integer, optional): Committed Information Rate for AOS-CX policy (1-4294967295),committed_burst_size (integer, optional): Committed Burst Size for AOS-CX policy (1-4294967295),exceed_action (string, optional) = ['drop']: Exceed Action for AOS-CX policy,priority_code_point (integer, optional): Priority Code Point for AOS-CX policy (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "number": 0, + "class_type": "", + "class_name": "", + "action": "", + "dscp": 0, + "ip_precedence": 0, + "priority": 0, + "rate_limit": 0, + "committed_information_rate": 0, + "committed_burst_size": 0, + "exceed_action": "", + "priority_code_point": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/policy/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_policy_by_product_name_policy_id( + self, product_name="", policy_id="" + ): + """ + Operation: Get a Policy + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policy_id, Description: Numeric ID of the Policy + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/{policy_id}" + dict_path = {"product_name": product_name, "policy_id": policy_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_policy_by_product_name_policy_id( + self, product_name="", policy_id="", body=({}) + ): + """ + Operation: Update a Policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policy_id, Description: Numeric ID of the Policy + Required Body Parameters (body description)- PolicyUpdate {name (string, optional): Name of the Policy,rules (array[RulesPost], optional): Rules of the Policy}RulesPost {number (integer): Number,class_type (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Class Type. ipv4 only applies to ArubaOS-Switch policy and ip only applies to AOS-CX policy,class_name (string): Class Name,action (string, optional) = ['permit' or 'drop' or 'deny' or 'redirect']: Action. deny only applies to ArubaOS-Switch policy and drop only applies to AOS-CX policy,dscp (integer, optional): DSCP (0-63),ip_precedence (integer, optional): IP Precedence (0-7),priority (integer, optional): Priority (0-7),rate_limit (integer, optional): Rate Limit in kbps for ArubaOS-Switch policy (0-10000000),committed_information_rate (integer, optional): Committed Information Rate for AOS-CX policy (1-4294967295),committed_burst_size (integer, optional): Committed Burst Size for AOS-CX policy (1-4294967295),exceed_action (string, optional) = ['drop']: Exceed Action for AOS-CX policy,priority_code_point (integer, optional): Priority Code Point for AOS-CX policy (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "number": 0, + "class_type": "", + "class_name": "", + "action": "", + "dscp": 0, + "ip_precedence": 0, + "priority": 0, + "rate_limit": 0, + "committed_information_rate": 0, + "committed_burst_size": 0, + "exceed_action": "", + "priority_code_point": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/{policy_id}" + dict_path = {"product_name": product_name, "policy_id": policy_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_policy_by_product_name_policy_id( + self, product_name="", policy_id="", body=({}) + ): + """ + Operation: Replace a Policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policy_id, Description: Numeric ID of the Policy + Required Body Parameters (body description)- PolicyReplace {name (string): Name of the Policy,rules (array[RulesPost]): Rules of the Policy}RulesPost {number (integer): Number,class_type (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Class Type. ipv4 only applies to ArubaOS-Switch policy and ip only applies to AOS-CX policy,class_name (string): Class Name,action (string, optional) = ['permit' or 'drop' or 'deny' or 'redirect']: Action. deny only applies to ArubaOS-Switch policy and drop only applies to AOS-CX policy,dscp (integer, optional): DSCP (0-63),ip_precedence (integer, optional): IP Precedence (0-7),priority (integer, optional): Priority (0-7),rate_limit (integer, optional): Rate Limit in kbps for ArubaOS-Switch policy (0-10000000),committed_information_rate (integer, optional): Committed Information Rate for AOS-CX policy (1-4294967295),committed_burst_size (integer, optional): Committed Burst Size for AOS-CX policy (1-4294967295),exceed_action (string, optional) = ['drop']: Exceed Action for AOS-CX policy,priority_code_point (integer, optional): Priority Code Point for AOS-CX policy (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "number": 0, + "class_type": "", + "class_name": "", + "action": "", + "dscp": 0, + "ip_precedence": 0, + "priority": 0, + "rate_limit": 0, + "committed_information_rate": 0, + "committed_burst_size": 0, + "exceed_action": "", + "priority_code_point": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/{policy_id}" + dict_path = {"product_name": product_name, "policy_id": policy_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_policy_by_product_name_policy_id( + self, product_name="", policy_id="" + ): + """ + Operation: Delete a Policy + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: policy_id, Description: Numeric ID of the Policy + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/{policy_id}" + dict_path = {"product_name": product_name, "policy_id": policy_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_policy_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Policy by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policy + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_policy_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update a Policy by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policy + Required Body Parameters (body description)- PolicyUpdate {name (string, optional): Name of the Policy,rules (array[RulesPost], optional): Rules of the Policy}RulesPost {number (integer): Number,class_type (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Class Type. ipv4 only applies to ArubaOS-Switch policy and ip only applies to AOS-CX policy,class_name (string): Class Name,action (string, optional) = ['permit' or 'drop' or 'deny' or 'redirect']: Action. deny only applies to ArubaOS-Switch policy and drop only applies to AOS-CX policy,dscp (integer, optional): DSCP (0-63),ip_precedence (integer, optional): IP Precedence (0-7),priority (integer, optional): Priority (0-7),rate_limit (integer, optional): Rate Limit in kbps for ArubaOS-Switch policy (0-10000000),committed_information_rate (integer, optional): Committed Information Rate for AOS-CX policy (1-4294967295),committed_burst_size (integer, optional): Committed Burst Size for AOS-CX policy (1-4294967295),exceed_action (string, optional) = ['drop']: Exceed Action for AOS-CX policy,priority_code_point (integer, optional): Priority Code Point for AOS-CX policy (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "number": 0, + "class_type": "", + "class_name": "", + "action": "", + "dscp": 0, + "ip_precedence": 0, + "priority": 0, + "rate_limit": 0, + "committed_information_rate": 0, + "committed_burst_size": 0, + "exceed_action": "", + "priority_code_point": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_policy_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Policy by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policy + Required Body Parameters (body description)- PolicyReplace {name (string): Name of the Policy,rules (array[RulesPost]): Rules of the Policy}RulesPost {number (integer): Number,class_type (string, optional) = ['ipv4' or 'ip' or 'ipv6']: Class Type. ipv4 only applies to ArubaOS-Switch policy and ip only applies to AOS-CX policy,class_name (string): Class Name,action (string, optional) = ['permit' or 'drop' or 'deny' or 'redirect']: Action. deny only applies to ArubaOS-Switch policy and drop only applies to AOS-CX policy,dscp (integer, optional): DSCP (0-63),ip_precedence (integer, optional): IP Precedence (0-7),priority (integer, optional): Priority (0-7),rate_limit (integer, optional): Rate Limit in kbps for ArubaOS-Switch policy (0-10000000),committed_information_rate (integer, optional): Committed Information Rate for AOS-CX policy (1-4294967295),committed_burst_size (integer, optional): Committed Burst Size for AOS-CX policy (1-4294967295),exceed_action (string, optional) = ['drop']: Exceed Action for AOS-CX policy,priority_code_point (integer, optional): Priority Code Point for AOS-CX policy (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "number": 0, + "class_type": "", + "class_name": "", + "action": "", + "dscp": 0, + "ip_precedence": 0, + "priority": 0, + "rate_limit": 0, + "committed_information_rate": 0, + "committed_burst_size": 0, + "exceed_action": "", + "priority_code_point": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_policy_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Policy by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Policy + """ + url_path = "/enforcement-profile-dur/policy/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:QoSProfile + # Function Section Description: Manage QoS Profiles + + def get_enforcement_profile_dur_qos_profile_by_product_name(self, product_name=""): + """ + Operation: GET a list of QoS Profiles + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/qos-profile/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_qos_profile_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a QoS Profile + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- QoSProfilePost {name (string): Name of the QoS Profile,traffic_class (integer, optional): Traffic Class of the QoS Profile (0-7),drop_precedence (string, optional) = ['high' or 'low']: Drop Precedence of the QoS Profile,dscp (integer, optional): DSCP of the QoS Profile (0-63),dot1p (integer, optional): 802.1p of the QoS Profile (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic_class": 0, + "drop_precedence": "", + "dscp": 0, + "dot1p": 0 + } + """ + url_path = "/enforcement-profile-dur/qos-profile/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_qos_profile_by_product_name_qos_profile_id( + self, product_name="", qos_profile_id="" + ): + """ + Operation: Get a QoS Profile + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: qos_profile_id, Description: Numeric ID of the QoS Profile + """ + url_path = ( + "/enforcement-profile-dur/qos-profile/{product_name}/{qos_profile_id}" + ) + dict_path = {"product_name": product_name, "qos_profile_id": qos_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_qos_profile_by_product_name_qos_profile_id( + self, product_name="", qos_profile_id="", body=({}) + ): + """ + Operation: Update some fields of a QoS Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: qos_profile_id, Description: Numeric ID of the QoS Profile + Required Body Parameters (body description)- QoSProfileUpdate {name (string, optional): Name of the QoS Profile,traffic_class (integer, optional): Traffic Class of the QoS Profile (0-7),drop_precedence (string, optional) = ['high' or 'low']: Drop Precedence of the QoS Profile,dscp (integer, optional): DSCP of the QoS Profile (0-63),dot1p (integer, optional): 802.1p of the QoS Profile (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic_class": 0, + "drop_precedence": "", + "dscp": 0, + "dot1p": 0 + } + """ + url_path = ( + "/enforcement-profile-dur/qos-profile/{product_name}/{qos_profile_id}" + ) + dict_path = {"product_name": product_name, "qos_profile_id": qos_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_qos_profile_by_product_name_qos_profile_id( + self, product_name="", qos_profile_id="", body=({}) + ): + """ + Operation: Replace a QoS Profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: qos_profile_id, Description: Numeric ID of the QoS Profile + Required Body Parameters (body description)- QoSProfileReplace {name (string, optional): Name of the QoS Profile,traffic_class (integer, optional): Traffic Class of the QoS Profile (0-7),drop_precedence (string, optional) = ['high' or 'low']: Drop Precedence of the QoS Profile,dscp (integer, optional): DSCP of the QoS Profile (0-63),dot1p (integer, optional): 802.1p of the QoS Profile (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic_class": 0, + "drop_precedence": "", + "dscp": 0, + "dot1p": 0 + } + """ + url_path = ( + "/enforcement-profile-dur/qos-profile/{product_name}/{qos_profile_id}" + ) + dict_path = {"product_name": product_name, "qos_profile_id": qos_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_qos_profile_by_product_name_qos_profile_id( + self, product_name="", qos_profile_id="" + ): + """ + Operation: Delete a QoS Profile + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: qos_profile_id, Description: Numeric ID of the QoS Profile + """ + url_path = ( + "/enforcement-profile-dur/qos-profile/{product_name}/{qos_profile_id}" + ) + dict_path = {"product_name": product_name, "qos_profile_id": qos_profile_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_qos_profile_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a QoS Profile by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the QoS Profile + """ + url_path = "/enforcement-profile-dur/qos-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_qos_profile_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a QoS Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the QoS Profile + Required Body Parameters (body description)- QoSProfileUpdate {name (string, optional): Name of the QoS Profile,traffic_class (integer, optional): Traffic Class of the QoS Profile (0-7),drop_precedence (string, optional) = ['high' or 'low']: Drop Precedence of the QoS Profile,dscp (integer, optional): DSCP of the QoS Profile (0-63),dot1p (integer, optional): 802.1p of the QoS Profile (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic_class": 0, + "drop_precedence": "", + "dscp": 0, + "dot1p": 0 + } + """ + url_path = "/enforcement-profile-dur/qos-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_qos_profile_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a QoS Profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the QoS Profile + Required Body Parameters (body description)- QoSProfileReplace {name (string, optional): Name of the QoS Profile,traffic_class (integer, optional): Traffic Class of the QoS Profile (0-7),drop_precedence (string, optional) = ['high' or 'low']: Drop Precedence of the QoS Profile,dscp (integer, optional): DSCP of the QoS Profile (0-63),dot1p (integer, optional): 802.1p of the QoS Profile (0-7)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "traffic_class": 0, + "drop_precedence": "", + "dscp": 0, + "dot1p": 0 + } + """ + url_path = "/enforcement-profile-dur/qos-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_qos_profile_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a QoS Profile by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the QoS Profile + """ + url_path = "/enforcement-profile-dur/qos-profile/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:SessionAccessControlList + # Function Section Description: Manage Session Access Control List + + def get_enforcement_profile_dur_session_access_control_list_by_product_name( + self, product_name="" + ): + """ + Operation: GET a list of Session Access Control Lists + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_session_access_control_list_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Session Access Control List + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- SessionAccessControlListPost {name (string): Name of the Session Access Control List,rules (array[RulesPost], optional): Rules of the Session Access Control List}RulesPost {src_traffic_match (string, optional) = ['alias' or 'any' or 'host' or 'network' or 'user']: Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string, optional) = ['alias' or 'any' or 'host' or 'network' or 'user']: Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string, optional) = ['any' or 'protocol' or 'service' or 'tcp' or 'udp']: Service Type,protocol_number (integer, optional): Protocol Number (0-255),service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port (0-65535),tcp_max_port (integer, optional): TCP Max Port (0-65535),udp_min_port (integer, optional): UDP Min Port (0-65535),udp_max_port (integer, optional): UDP Max Port (0-65535),action (string, optional) = ['deny' or 'dst-nat' or 'dual-nat' or 'permit' or 'redirect' or 'src-nat']: Action,dst_nat_ip_address (string, optional): Destination NAT IP Address,dst_nat_port (integer, optional): Destination NAT Port (0-65535),network_name (string, optional): Name of Network in FQDN format,dual_nat_pool (string, optional): Dual NAT Pool,tunnel_id (integer, optional): Tunnel ID (1-50),src_nat_pool (string, optional): Source NAT Pool,deny_list_user_if_acl_applied (string, optional) = ['Yes' or 'No']: Deny List User if ACL gets applied,dot1p_priority (integer, optional): 802.1p Priority (0-7),log_if_acl_applied (string, optional) = ['Yes' or 'No']: Log if ACL gets applied,mirror (string, optional) = ['Yes' or 'No']: Mirror,position (integer, optional): Position (1-2000),queue_priority (string, optional) = ['low' or 'high']: Queue Priority,time_range (string, optional): Time Range,tos (integer, optional): TOS (0-63)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "dst_nat_ip_address": "", + "dst_nat_port": 0, + "network_name": "", + "dual_nat_pool": "", + "tunnel_id": 0, + "src_nat_pool": "", + "deny_list_user_if_acl_applied": "", + "dot1p_priority": 0, + "log_if_acl_applied": "", + "mirror": "", + "position": 0, + "queue_priority": "", + "time_range": "", + "tos": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_session_access_control_list_by_product_name_session_access_control_list_id( + self, product_name="", session_access_control_list_id="" + ): + """ + Operation: Get a Session Access Control List + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: session_access_control_list_id, Description: Numeric ID of the Session Access Control List + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/{session_access_control_list_id}" + dict_path = { + "product_name": product_name, + "session_access_control_list_id": session_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_session_access_control_list_by_product_name_session_access_control_list_id( + self, product_name="", session_access_control_list_id="", body=({}) + ): + """ + Operation: Update some fields of a Session Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: session_access_control_list_id, Description: Numeric ID of the Session Access Control List + Required Body Parameters (body description)- SessionAccessControlListUpdate {name (string, optional): Name of the Session Access Control List,rules (array[Rules], optional): Rules of the Session Access Control List}Rules {src_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string) = ['any' or 'protocol' or 'service' or 'tcp' or 'udp']: Service Type,protocol_number (integer, optional): Protocol Number (0-255),service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port (0-65535),tcp_max_port (integer, optional): TCP Max Port (0-65535),udp_min_port (integer, optional): UDP Min Port (0-65535),udp_max_port (integer, optional): UDP Max Port (0-65535),action (string) = ['deny' or 'dst-nat' or 'dual-nat' or 'permit' or 'redirect' or 'src-nat']: Action,dst_nat_ip_address (string, optional): Destination NAT IP Address,dst_nat_port (integer, optional): Destination NAT Port (0-65535),network_name (string, optional): Name of Network in FQDN format,dual_nat_pool (string, optional): Dual NAT Pool,tunnel_id (integer, optional): Tunnel ID (1-50),src_nat_pool (string, optional): Source NAT Pool,deny_list_user_if_acl_applied (string) = ['Yes' or 'No']: Deny List User if ACL gets applied,dot1p_priority (integer, optional): 802.1p Priority (0-7),log_if_acl_applied (string) = ['Yes' or 'No']: Log if ACL gets applied,mirror (string) = ['Yes' or 'No']: Mirror,position (integer, optional): Position (1-2000),queue_priority (string, optional) = ['low' or 'high']: Queue Priority,time_range (string, optional): Time Range,tos (integer, optional): TOS (0-63)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "dst_nat_ip_address": "", + "dst_nat_port": 0, + "network_name": "", + "dual_nat_pool": "", + "tunnel_id": 0, + "src_nat_pool": "", + "deny_list_user_if_acl_applied": "", + "dot1p_priority": 0, + "log_if_acl_applied": "", + "mirror": "", + "position": 0, + "queue_priority": "", + "time_range": "", + "tos": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/{session_access_control_list_id}" + dict_path = { + "product_name": product_name, + "session_access_control_list_id": session_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_session_access_control_list_by_product_name_session_access_control_list_id( + self, product_name="", session_access_control_list_id="", body=({}) + ): + """ + Operation: Replace a Session Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: session_access_control_list_id, Description: Numeric ID of the Session Access Control List + Required Body Parameters (body description)- SessionAccessControlListReplace {name (string, optional): Name of the Session Access Control List,rules (array[Rules], optional): Rules of the Session Access Control List}Rules {src_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string) = ['any' or 'protocol' or 'service' or 'tcp' or 'udp']: Service Type,protocol_number (integer, optional): Protocol Number (0-255),service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port (0-65535),tcp_max_port (integer, optional): TCP Max Port (0-65535),udp_min_port (integer, optional): UDP Min Port (0-65535),udp_max_port (integer, optional): UDP Max Port (0-65535),action (string) = ['deny' or 'dst-nat' or 'dual-nat' or 'permit' or 'redirect' or 'src-nat']: Action,dst_nat_ip_address (string, optional): Destination NAT IP Address,dst_nat_port (integer, optional): Destination NAT Port (0-65535),network_name (string, optional): Name of Network in FQDN format,dual_nat_pool (string, optional): Dual NAT Pool,tunnel_id (integer, optional): Tunnel ID (1-50),src_nat_pool (string, optional): Source NAT Pool,deny_list_user_if_acl_applied (string) = ['Yes' or 'No']: Deny List User if ACL gets applied,dot1p_priority (integer, optional): 802.1p Priority (0-7),log_if_acl_applied (string) = ['Yes' or 'No']: Log if ACL gets applied,mirror (string) = ['Yes' or 'No']: Mirror,position (integer, optional): Position (1-2000),queue_priority (string, optional) = ['low' or 'high']: Queue Priority,time_range (string, optional): Time Range,tos (integer, optional): TOS (0-63)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "dst_nat_ip_address": "", + "dst_nat_port": 0, + "network_name": "", + "dual_nat_pool": "", + "tunnel_id": 0, + "src_nat_pool": "", + "deny_list_user_if_acl_applied": "", + "dot1p_priority": 0, + "log_if_acl_applied": "", + "mirror": "", + "position": 0, + "queue_priority": "", + "time_range": "", + "tos": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/{session_access_control_list_id}" + dict_path = { + "product_name": product_name, + "session_access_control_list_id": session_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_session_access_control_list_by_product_name_session_access_control_list_id( + self, product_name="", session_access_control_list_id="" + ): + """ + Operation: Delete a Session Access Control List + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: session_access_control_list_id, Description: Numeric ID of the Session Access Control List + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/{session_access_control_list_id}" + dict_path = { + "product_name": product_name, + "session_access_control_list_id": session_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_session_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Session Access Control List by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Session Access Control List + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_session_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a Session Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Session Access Control List + Required Body Parameters (body description)- SessionAccessControlListUpdate {name (string, optional): Name of the Session Access Control List,rules (array[Rules], optional): Rules of the Session Access Control List}Rules {src_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string) = ['any' or 'protocol' or 'service' or 'tcp' or 'udp']: Service Type,protocol_number (integer, optional): Protocol Number (0-255),service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port (0-65535),tcp_max_port (integer, optional): TCP Max Port (0-65535),udp_min_port (integer, optional): UDP Min Port (0-65535),udp_max_port (integer, optional): UDP Max Port (0-65535),action (string) = ['deny' or 'dst-nat' or 'dual-nat' or 'permit' or 'redirect' or 'src-nat']: Action,dst_nat_ip_address (string, optional): Destination NAT IP Address,dst_nat_port (integer, optional): Destination NAT Port (0-65535),network_name (string, optional): Name of Network in FQDN format,dual_nat_pool (string, optional): Dual NAT Pool,tunnel_id (integer, optional): Tunnel ID (1-50),src_nat_pool (string, optional): Source NAT Pool,deny_list_user_if_acl_applied (string) = ['Yes' or 'No']: Deny List User if ACL gets applied,dot1p_priority (integer, optional): 802.1p Priority (0-7),log_if_acl_applied (string) = ['Yes' or 'No']: Log if ACL gets applied,mirror (string) = ['Yes' or 'No']: Mirror,position (integer, optional): Position (1-2000),queue_priority (string, optional) = ['low' or 'high']: Queue Priority,time_range (string, optional): Time Range,tos (integer, optional): TOS (0-63)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "dst_nat_ip_address": "", + "dst_nat_port": 0, + "network_name": "", + "dual_nat_pool": "", + "tunnel_id": 0, + "src_nat_pool": "", + "deny_list_user_if_acl_applied": "", + "dot1p_priority": 0, + "log_if_acl_applied": "", + "mirror": "", + "position": 0, + "queue_priority": "", + "time_range": "", + "tos": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_session_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Session Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Session Access Control List + Required Body Parameters (body description)- SessionAccessControlListReplace {name (string, optional): Name of the Session Access Control List,rules (array[Rules], optional): Rules of the Session Access Control List}Rules {src_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string) = ['alias' or 'any' or 'host' or 'network' or 'user']: Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string) = ['any' or 'protocol' or 'service' or 'tcp' or 'udp']: Service Type,protocol_number (integer, optional): Protocol Number (0-255),service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port (0-65535),tcp_max_port (integer, optional): TCP Max Port (0-65535),udp_min_port (integer, optional): UDP Min Port (0-65535),udp_max_port (integer, optional): UDP Max Port (0-65535),action (string) = ['deny' or 'dst-nat' or 'dual-nat' or 'permit' or 'redirect' or 'src-nat']: Action,dst_nat_ip_address (string, optional): Destination NAT IP Address,dst_nat_port (integer, optional): Destination NAT Port (0-65535),network_name (string, optional): Name of Network in FQDN format,dual_nat_pool (string, optional): Dual NAT Pool,tunnel_id (integer, optional): Tunnel ID (1-50),src_nat_pool (string, optional): Source NAT Pool,deny_list_user_if_acl_applied (string) = ['Yes' or 'No']: Deny List User if ACL gets applied,dot1p_priority (integer, optional): 802.1p Priority (0-7),log_if_acl_applied (string) = ['Yes' or 'No']: Log if ACL gets applied,mirror (string) = ['Yes' or 'No']: Mirror,position (integer, optional): Position (1-2000),queue_priority (string, optional) = ['low' or 'high']: Queue Priority,time_range (string, optional): Time Range,tos (integer, optional): TOS (0-63)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "dst_nat_ip_address": "", + "dst_nat_port": 0, + "network_name": "", + "dual_nat_pool": "", + "tunnel_id": 0, + "src_nat_pool": "", + "deny_list_user_if_acl_applied": "", + "dot1p_priority": 0, + "log_if_acl_applied": "", + "mirror": "", + "position": 0, + "queue_priority": "", + "time_range": "", + "tos": 0 + } + ] + } + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_session_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Session Access Control List by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Session Access Control List + """ + url_path = "/enforcement-profile-dur/session-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:StatelessAccessControlList + # Function Section Description: Manage Stateless Access Control List + + def get_enforcement_profile_dur_stateless_access_control_list_by_product_name( + self, product_name="" + ): + """ + Operation: GET a list of Stateless Access Control Lists + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = ( + "/enforcement-profile-dur/stateless-access-control-list/{product_name}" + ) + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_stateless_access_control_list_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Stateless Access Control List + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- StatelessAccessControlListPost {name (string): Name of the Stateless Access Control List,rules (array[RulesPost], optional): Rules of the Stateless Access Control List}RulesPost {src_traffic_match (string, optional): Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string, optional): Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string, optional): Service Type,protocol_number (integer, optional): Protocol Number,service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port,tcp_max_port (integer, optional): TCP Max Port,udp_min_port (integer, optional): UDP Min Port,udp_max_port (integer, optional): UDP Max Port,action (string, optional): Action,redirect_type (string, optional): Redirect Type,ipsec_map_based_redirect (string, optional): Redirect based on IPsec Map,tunnel_id (integer, optional): Tunnel ID,deny_list_user_if_acl_applied (string, optional): Deny List User if ACL gets applied,log_if_acl_applied (string, optional): Log if ACL gets applied,position (integer, optional): Position,policer_profile (string, optional): Policer Profile,qos_profile (string, optional): QoS Profile,time_range (string, optional): Time Range} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "redirect_type": "", + "ipsec_map_based_redirect": "", + "tunnel_id": 0, + "deny_list_user_if_acl_applied": "", + "log_if_acl_applied": "", + "position": 0, + "policer_profile": "", + "qos_profile": "", + "time_range": "" + } + ] + } + """ + url_path = ( + "/enforcement-profile-dur/stateless-access-control-list/{product_name}" + ) + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_stateless_access_control_list_by_product_name_stateless_access_control_list_id( + self, product_name="", stateless_access_control_list_id="" + ): + """ + Operation: Get a Stateless Access Control List + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: stateless_access_control_list_id, Description: Numeric ID of the Stateless Access Control List + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/{stateless_access_control_list_id}" + dict_path = { + "product_name": product_name, + "stateless_access_control_list_id": stateless_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_stateless_access_control_list_by_product_name_stateless_access_control_list_id( + self, product_name="", stateless_access_control_list_id="", body=({}) + ): + """ + Operation: Update some fields of a Stateless Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: stateless_access_control_list_id, Description: Numeric ID of the Stateless Access Control List + Required Body Parameters (body description)- StatelessAccessControlListUpdate {name (string, optional): Name of the Stateless Access Control List,rules (array[Rules], optional): Rules of the Stateless Access Control List}Rules {src_traffic_match (string): Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string): Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string): Service Type,protocol_number (integer, optional): Protocol Number,service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port,tcp_max_port (integer, optional): TCP Max Port,udp_min_port (integer, optional): UDP Min Port,udp_max_port (integer, optional): UDP Max Port,action (string): Action,redirect_type (string, optional): Redirect Type,ipsec_map_based_redirect (string, optional): Redirect based on IPsec Map,tunnel_id (integer, optional): Tunnel ID,deny_list_user_if_acl_applied (string): Deny List User if ACL gets applied,log_if_acl_applied (string): Log if ACL gets applied,position (integer, optional): Position,policer_profile (string, optional): Policer Profile,qos_profile (string, optional): QoS Profile,time_range (string, optional): Time Range} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "redirect_type": "", + "ipsec_map_based_redirect": "", + "tunnel_id": 0, + "deny_list_user_if_acl_applied": "", + "log_if_acl_applied": "", + "position": 0, + "policer_profile": "", + "qos_profile": "", + "time_range": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/{stateless_access_control_list_id}" + dict_path = { + "product_name": product_name, + "stateless_access_control_list_id": stateless_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_stateless_access_control_list_by_product_name_stateless_access_control_list_id( + self, product_name="", stateless_access_control_list_id="", body=({}) + ): + """ + Operation: Replace a Stateless Access Control List + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: stateless_access_control_list_id, Description: Numeric ID of the Stateless Access Control List + Required Body Parameters (body description)- StatelessAccessControlListReplace {name (string, optional): Name of the Stateless Access Control List,rules (array[Rules], optional): Rules of the Stateless Access Control List}Rules {src_traffic_match (string): Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string): Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string): Service Type,protocol_number (integer, optional): Protocol Number,service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port,tcp_max_port (integer, optional): TCP Max Port,udp_min_port (integer, optional): UDP Min Port,udp_max_port (integer, optional): UDP Max Port,action (string): Action,redirect_type (string, optional): Redirect Type,ipsec_map_based_redirect (string, optional): Redirect based on IPsec Map,tunnel_id (integer, optional): Tunnel ID,deny_list_user_if_acl_applied (string): Deny List User if ACL gets applied,log_if_acl_applied (string): Log if ACL gets applied,position (integer, optional): Position,policer_profile (string, optional): Policer Profile,qos_profile (string, optional): QoS Profile,time_range (string, optional): Time Range} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "redirect_type": "", + "ipsec_map_based_redirect": "", + "tunnel_id": 0, + "deny_list_user_if_acl_applied": "", + "log_if_acl_applied": "", + "position": 0, + "policer_profile": "", + "qos_profile": "", + "time_range": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/{stateless_access_control_list_id}" + dict_path = { + "product_name": product_name, + "stateless_access_control_list_id": stateless_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_stateless_access_control_list_by_product_name_stateless_access_control_list_id( + self, product_name="", stateless_access_control_list_id="" + ): + """ + Operation: Delete a Stateless Access Control List + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: stateless_access_control_list_id, Description: Numeric ID of the Stateless Access Control List + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/{stateless_access_control_list_id}" + dict_path = { + "product_name": product_name, + "stateless_access_control_list_id": stateless_access_control_list_id, + } + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_stateless_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Stateless Access Control List by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Stateless Access Control List + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_stateless_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a Stateless Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Stateless Access Control List + Required Body Parameters (body description)- StatelessAccessControlListUpdate {name (string, optional): Name of the Stateless Access Control List,rules (array[Rules], optional): Rules of the Stateless Access Control List}Rules {src_traffic_match (string): Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string): Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string): Service Type,protocol_number (integer, optional): Protocol Number,service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port,tcp_max_port (integer, optional): TCP Max Port,udp_min_port (integer, optional): UDP Min Port,udp_max_port (integer, optional): UDP Max Port,action (string): Action,redirect_type (string, optional): Redirect Type,ipsec_map_based_redirect (string, optional): Redirect based on IPsec Map,tunnel_id (integer, optional): Tunnel ID,deny_list_user_if_acl_applied (string): Deny List User if ACL gets applied,log_if_acl_applied (string): Log if ACL gets applied,position (integer, optional): Position,policer_profile (string, optional): Policer Profile,qos_profile (string, optional): QoS Profile,time_range (string, optional): Time Range} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "redirect_type": "", + "ipsec_map_based_redirect": "", + "tunnel_id": 0, + "deny_list_user_if_acl_applied": "", + "log_if_acl_applied": "", + "position": 0, + "policer_profile": "", + "qos_profile": "", + "time_range": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_stateless_access_control_list_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Stateless Access Control List by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Stateless Access Control List + Required Body Parameters (body description)- StatelessAccessControlListReplace {name (string, optional): Name of the Stateless Access Control List,rules (array[Rules], optional): Rules of the Stateless Access Control List}Rules {src_traffic_match (string): Source Traffic Match,src_alias (string, optional): Source Alias,src_ip_address (string, optional): Source IP Address,src_netmask (string, optional): Source Net Mask,dst_traffic_match (string): Destination Traffic Match,dst_alias (string, optional): Destination Alias,dst_ip_address (string, optional): Destination IP Address,dst_netmask (string, optional): Destination Net Mask,service_type (string): Service Type,protocol_number (integer, optional): Protocol Number,service (string, optional): Service,tcp_min_port (integer, optional): TCP Min Port,tcp_max_port (integer, optional): TCP Max Port,udp_min_port (integer, optional): UDP Min Port,udp_max_port (integer, optional): UDP Max Port,action (string): Action,redirect_type (string, optional): Redirect Type,ipsec_map_based_redirect (string, optional): Redirect based on IPsec Map,tunnel_id (integer, optional): Tunnel ID,deny_list_user_if_acl_applied (string): Deny List User if ACL gets applied,log_if_acl_applied (string): Log if ACL gets applied,position (integer, optional): Position,policer_profile (string, optional): Policer Profile,qos_profile (string, optional): QoS Profile,time_range (string, optional): Time Range} + Required Body Parameters (type(dict) body example)- { + "name": "", + "rules": [ + { + "src_traffic_match": "", + "src_alias": "", + "src_ip_address": "", + "src_netmask": "", + "dst_traffic_match": "", + "dst_alias": "", + "dst_ip_address": "", + "dst_netmask": "", + "service_type": "", + "protocol_number": 0, + "service": "", + "tcp_min_port": 0, + "tcp_max_port": 0, + "udp_min_port": 0, + "udp_max_port": 0, + "action": "", + "redirect_type": "", + "ipsec_map_based_redirect": "", + "tunnel_id": 0, + "deny_list_user_if_acl_applied": "", + "log_if_acl_applied": "", + "position": 0, + "policer_profile": "", + "qos_profile": "", + "time_range": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_stateless_access_control_list_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Stateless Access Control List by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Stateless Access Control List + """ + url_path = "/enforcement-profile-dur/stateless-access-control-list/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:TimeRange + # Function Section Description: Manage Time Range + + def get_enforcement_profile_dur_time_range_by_product_name(self, product_name=""): + """ + Operation: GET a list of Time Ranges + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_enforcement_profile_dur_time_range_by_product_name( + self, product_name="", body=({}) + ): + """ + Operation: Add a Time Range + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Body Parameters (body description)- TimeRangePost {name (string): Name of the Time Range,type (string, optional) = ['Absolute' or 'Periodic']: Type of the Time Range,rules (array[RulesPost]): Rules of the Time Range}RulesPost {start_day_or_date (string) = ['Daily' or 'Weekend' or 'Weekday' or 'Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: Start day for Periodic Time Range or Start date for Absolute Time Range,end_day_or_date (string) = ['Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: End Day for Periodic Time Range or End date for Absolute Time Range,start_time (string): Start time,end_time (string): End Time} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "rules": [ + { + "start_day_or_date": "", + "end_day_or_date": "", + "start_time": "", + "end_time": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}" + dict_path = {"product_name": product_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_enforcement_profile_dur_time_range_by_product_name_time_range_id( + self, product_name="", time_range_id="" + ): + """ + Operation: Get a Time Range + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: time_range_id, Description: Numeric ID of the Time Range + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/{time_range_id}" + dict_path = {"product_name": product_name, "time_range_id": time_range_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_time_range_by_product_name_time_range_id( + self, product_name="", time_range_id="", body=({}) + ): + """ + Operation: Update some fields of a Time Range + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: time_range_id, Description: Numeric ID of the Time Range + Required Body Parameters (body description)- TimeRangeUpdate {name (string, optional): Name of the Time Range,type (string, optional) = ['Absolute' or 'Periodic']: Type of the Time Range,rules (array[Rules], optional): Rules of the Time Range}Rules {start_day_or_date (string) = ['Daily' or 'Weekend' or 'Weekday' or 'Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: Start day for Periodic Time Range or Start date for Absolute Time Range,end_day_or_date (string) = ['Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: End Day for Periodic Time Range or End date for Absolute Time Range,start_time (string): Start time,end_time (string): End Time} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "rules": [ + { + "start_day_or_date": "", + "end_day_or_date": "", + "start_time": "", + "end_time": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/{time_range_id}" + dict_path = {"product_name": product_name, "time_range_id": time_range_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_time_range_by_product_name_time_range_id( + self, product_name="", time_range_id="", body=({}) + ): + """ + Operation: Replace a Time Range + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: time_range_id, Description: Numeric ID of the Time Range + Required Body Parameters (body description)- TimeRangeReplace {name (string, optional): Name of the Time Range,type (string, optional) = ['Absolute' or 'Periodic']: Type of the Time Range,rules (array[Rules], optional): Rules of the Time Range}Rules {start_day_or_date (string) = ['Daily' or 'Weekend' or 'Weekday' or 'Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: Start day for Periodic Time Range or Start date for Absolute Time Range,end_day_or_date (string) = ['Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: End Day for Periodic Time Range or End date for Absolute Time Range,start_time (string): Start time,end_time (string): End Time} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "rules": [ + { + "start_day_or_date": "", + "end_day_or_date": "", + "start_time": "", + "end_time": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/{time_range_id}" + dict_path = {"product_name": product_name, "time_range_id": time_range_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_time_range_by_product_name_time_range_id( + self, product_name="", time_range_id="" + ): + """ + Operation: Delete a Time Range + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: time_range_id, Description: Numeric ID of the Time Range + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/{time_range_id}" + dict_path = {"product_name": product_name, "time_range_id": time_range_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_enforcement_profile_dur_time_range_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Get a Time Range by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Time Range + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_enforcement_profile_dur_time_range_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Update some fields of a Time Range by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Time Range + Required Body Parameters (body description)- TimeRangeUpdate {name (string, optional): Name of the Time Range,type (string, optional) = ['Absolute' or 'Periodic']: Type of the Time Range,rules (array[Rules], optional): Rules of the Time Range}Rules {start_day_or_date (string) = ['Daily' or 'Weekend' or 'Weekday' or 'Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: Start day for Periodic Time Range or Start date for Absolute Time Range,end_day_or_date (string) = ['Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: End Day for Periodic Time Range or End date for Absolute Time Range,start_time (string): Start time,end_time (string): End Time} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "rules": [ + { + "start_day_or_date": "", + "end_day_or_date": "", + "start_time": "", + "end_time": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_enforcement_profile_dur_time_range_by_product_name_name_name( + self, product_name="", name="", body=({}) + ): + """ + Operation: Replace a Time Range by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Time Range + Required Body Parameters (body description)- TimeRangeReplace {name (string, optional): Name of the Time Range,type (string, optional) = ['Absolute' or 'Periodic']: Type of the Time Range,rules (array[Rules], optional): Rules of the Time Range}Rules {start_day_or_date (string) = ['Daily' or 'Weekend' or 'Weekday' or 'Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: Start day for Periodic Time Range or Start date for Absolute Time Range,end_day_or_date (string) = ['Sunday' or 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday' or 'Saturday']: End Day for Periodic Time Range or End date for Absolute Time Range,start_time (string): Start time,end_time (string): End Time} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "rules": [ + { + "start_day_or_date": "", + "end_day_or_date": "", + "start_time": "", + "end_time": "" + } + ] + } + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_enforcement_profile_dur_time_range_by_product_name_name_name( + self, product_name="", name="" + ): + """ + Operation: Delete a Time Range by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: product_name, Description: Product Name + Required Path Parameter Name: name, Description: Name of the Time Range + """ + url_path = "/enforcement-profile-dur/time-range/{product_name}/name/{name}" + dict_path = {"product_name": product_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_globalserverconfiguration_v1.py b/pyclearpass/api_explorer_globalserverconfiguration_v1.py new file mode 100644 index 0000000..c4749eb --- /dev/null +++ b/pyclearpass/api_explorer_globalserverconfiguration_v1.py @@ -0,0 +1,2377 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_globalserverconfiguration_v1.py + + +class ApiGlobalServerConfiguration(ClearPassAPILogin): + # Function Section Name:AdminPrivilege + # Function Section Description: Manage admin privileges + + def get_admin_privilege( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of admin privileges + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/admin-privilege" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_admin_privilege(self, body=({})): + """ + Operation: Create a new admin privilege + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AdminPrivilegeCreate {name (string): Name of the admin privilege,description (string, optional): Description of the admin privilege,access_type (string, optional) = ['UI' or 'API' or 'FULL']: Property to decide the access type of the user.,cppm_privileges (object): Privilege list in JSON object format(e.g., {"con:RWD", "mon":"RW"}).,insight_privileges (object, optional): Privilege list in JSON object format(e.g., {"report": "RWD", "dashboard":"RW"}).,allow_passwords (boolean, optional): If selected, all passwords may be displayed in the response,allow_security_configs (boolean, optional): If selected, Admin user will have access for security configuration} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "access_type": "", + "cppm_privileges": "object", + "insight_privileges": "object", + "allow_passwords": false, + "allow_security_configs": false + } + """ + url_path = "/admin-privilege" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_admin_privilege_by_admin_privilege_id(self, admin_privilege_id=""): + """ + Operation: Get an admin privilege + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: admin_privilege_id, Description: Numeric ID of the admin privilege + """ + url_path = "/admin-privilege/{admin_privilege_id}" + dict_path = {"admin_privilege_id": admin_privilege_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_admin_privilege_by_admin_privilege_id( + self, admin_privilege_id="", body=({}) + ): + """ + Operation: Update some fields of an admin privilege + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: admin_privilege_id, Description: Numeric ID of the admin privilege + Required Body Parameters (body description)- AdminPrivilegeUpdate {name (string, optional): Name of the admin privilege,description (string, optional): Description of the admin privilege,access_type (string, optional) = ['UI' or 'API' or 'FULL']: Property to decide the access type of the user.,cppm_privileges (object, optional): Privilege list in JSON object format(e.g., {"con:RWD", "mon":"RW"}).,insight_privileges (object, optional): Privilege list in JSON object format(e.g., {"report": "RWD", "dashboard":"RW"}).,allow_passwords (boolean, optional): If selected, all passwords may be displayed in the response,allow_security_configs (boolean, optional): If selected, Admin user will have access for security configuration} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "access_type": "", + "cppm_privileges": "object", + "insight_privileges": "object", + "allow_passwords": false, + "allow_security_configs": false + } + """ + url_path = "/admin-privilege/{admin_privilege_id}" + dict_path = {"admin_privilege_id": admin_privilege_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_admin_privilege_by_admin_privilege_id( + self, admin_privilege_id="", body=({}) + ): + """ + Operation: Replace an admin privilege + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: admin_privilege_id, Description: Numeric ID of the admin privilege + Required Body Parameters (body description)- AdminPrivilegeReplace {name (string): Name of the admin privilege,description (string, optional): Description of the admin privilege,access_type (string, optional) = ['UI' or 'API' or 'FULL']: Property to decide the access type of the user.,cppm_privileges (object): Privilege list in JSON object format(e.g., {"con:RWD", "mon":"RW"}).,insight_privileges (object, optional): Privilege list in JSON object format(e.g., {"report": "RWD", "dashboard":"RW"}).,allow_passwords (boolean, optional): If selected, all passwords may be displayed in the response,allow_security_configs (boolean, optional): If selected, Admin user will have access for security configuration} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "access_type": "", + "cppm_privileges": "object", + "insight_privileges": "object", + "allow_passwords": false, + "allow_security_configs": false + } + """ + url_path = "/admin-privilege/{admin_privilege_id}" + dict_path = {"admin_privilege_id": admin_privilege_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_admin_privilege_by_admin_privilege_id(self, admin_privilege_id=""): + """ + Operation: Delete an admin privilege + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: admin_privilege_id, Description: Numeric ID of the admin privilege + """ + url_path = "/admin-privilege/{admin_privilege_id}" + dict_path = {"admin_privilege_id": admin_privilege_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_admin_privilege_name_by_name(self, name=""): + """ + Operation: Get an admin privilege by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the admin privilege + """ + url_path = "/admin-privilege/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_admin_privilege_name_by_name(self, name="", body=({})): + """ + Operation: Update some fields of an admin privilege by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the admin privilege + Required Body Parameters (body description)- AdminPrivilegeUpdate {name (string, optional): Name of the admin privilege,description (string, optional): Description of the admin privilege,access_type (string, optional) = ['UI' or 'API' or 'FULL']: Property to decide the access type of the user.,cppm_privileges (object, optional): Privilege list in JSON object format(e.g., {"con:RWD", "mon":"RW"}).,insight_privileges (object, optional): Privilege list in JSON object format(e.g., {"report": "RWD", "dashboard":"RW"}).,allow_passwords (boolean, optional): If selected, all passwords may be displayed in the response,allow_security_configs (boolean, optional): If selected, Admin user will have access for security configuration} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "access_type": "", + "cppm_privileges": "object", + "insight_privileges": "object", + "allow_passwords": false, + "allow_security_configs": false + } + """ + url_path = "/admin-privilege/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_admin_privilege_name_by_name(self, name="", body=({})): + """ + Operation: Replace an admin privilege by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the admin privilege + Required Body Parameters (body description)- AdminPrivilegeReplace {name (string): Name of the admin privilege,description (string, optional): Description of the admin privilege,access_type (string, optional) = ['UI' or 'API' or 'FULL']: Property to decide the access type of the user.,cppm_privileges (object): Privilege list in JSON object format(e.g., {"con:RWD", "mon":"RW"}).,insight_privileges (object, optional): Privilege list in JSON object format(e.g., {"report": "RWD", "dashboard":"RW"}).,allow_passwords (boolean, optional): If selected, all passwords may be displayed in the response,allow_security_configs (boolean, optional): If selected, Admin user will have access for security configuration} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "access_type": "", + "cppm_privileges": "object", + "insight_privileges": "object", + "allow_passwords": false, + "allow_security_configs": false + } + """ + url_path = "/admin-privilege/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_admin_privilege_name_by_name(self, name=""): + """ + Operation: Delete an admin privilege by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the admin privilege + """ + url_path = "/admin-privilege/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:AdminUser + # Function Section Description: Manage admin users + + def get_admin_user( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of admin users + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/admin-user" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_admin_user(self, body=({})): + """ + Operation: Create a new admin user + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AdminUserCreate {name (string): Name of the admin user,user_id (string): Unique user id of the admin user,enabled (boolean, optional): Flag indicating if the account is enabled,password (string): Password of the admin user,privilege_level (string): Name of the admin privilege} + Required Body Parameters (type(dict) body example)- { + "name": "", + "user_id": "", + "enabled": false, + "password": "", + "privilege_level": "" + } + """ + url_path = "/admin-user" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_admin_user_by_id(self, id=""): + """ + Operation: Get an admin user + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric ID of the admin user + """ + url_path = "/admin-user/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_admin_user_by_id(self, id="", body=({})): + """ + Operation: Update some fields of an admin user + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the admin user + Required Body Parameters (body description)- AdminUserUpdate {name (string, optional): Name of the admin user,user_id (string, optional): Unique user id of the admin user,enabled (boolean, optional): Flag indicating if the account is enabled,password (string, optional): Password of the admin user,privilege_level (string, optional): Name of the admin privilege} + Required Body Parameters (type(dict) body example)- { + "name": "", + "user_id": "", + "enabled": false, + "password": "", + "privilege_level": "" + } + """ + url_path = "/admin-user/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_admin_user_by_id(self, id="", body=({})): + """ + Operation: Replace an admin user + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the admin user + Required Body Parameters (body description)- AdminUserReplace {name (string): Name of the admin user,user_id (string): Unique user id of the admin user,enabled (boolean, optional): Flag indicating if the account is enabled,password (string): Password of the admin user,privilege_level (string): Name of the admin privilege} + Required Body Parameters (type(dict) body example)- { + "name": "", + "user_id": "", + "enabled": false, + "password": "", + "privilege_level": "" + } + """ + url_path = "/admin-user/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_admin_user_by_id(self, id=""): + """ + Operation: Delete an admin user + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric ID of the admin user + """ + url_path = "/admin-user/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_admin_user_user_id_by_user_id(self, user_id=""): + """ + Operation: Get an admin user by user_id + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: user_id, Description: Unique user_id of the admin user + """ + url_path = "/admin-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_admin_user_user_id_by_user_id(self, user_id="", body=({})): + """ + Operation: Update some fields of an admin user by user_id + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: user_id, Description: Unique user_id of the admin user + Required Body Parameters (body description)- AdminUserUpdate {name (string, optional): Name of the admin user,user_id (string, optional): Unique user id of the admin user,enabled (boolean, optional): Flag indicating if the account is enabled,password (string, optional): Password of the admin user,privilege_level (string, optional): Name of the admin privilege} + Required Body Parameters (type(dict) body example)- { + "name": "", + "user_id": "", + "enabled": false, + "password": "", + "privilege_level": "" + } + """ + url_path = "/admin-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_admin_user_user_id_by_user_id(self, user_id="", body=({})): + """ + Operation: Replace an admin user by user_id + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: user_id, Description: Unique user_id of the admin user + Required Body Parameters (body description)- AdminUserReplace {name (string): Name of the admin user,user_id (string): Unique user id of the admin user,enabled (boolean, optional): Flag indicating if the account is enabled,password (string): Password of the admin user,privilege_level (string): Name of the admin privilege} + Required Body Parameters (type(dict) body example)- { + "name": "", + "user_id": "", + "enabled": false, + "password": "", + "privilege_level": "" + } + """ + url_path = "/admin-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_admin_user_user_id_by_user_id(self, user_id=""): + """ + Operation: Delete an admin user by user_id + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: user_id, Description: Unique user_id of the admin user + """ + url_path = "/admin-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:AdminUserPasswordPolicy + # Function Section Description: Manage admin user password policies + + def get_admin_user_password_policy(self, user_id=""): + """ + Operation: Get the admin user password policies + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: user_id, Description: Unique user_id of the admin user + """ + url_path = "/admin-user/password-policy" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_admin_user_password_policy(self, body=({})): + """ + Operation: Put the admin user password policies + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AdminUserPasswordPolicyReplace {password_minimum_length (integer) = ['6-128']: Minimum length of the password,password_complexity (string) = ['NONE' or 'CASE' or 'NUMBER' or 'ALPHANUMERIC' or 'CASENUMERIC' or 'PUNCTUATION' or 'COMPLEX']: Complexity Level of the password,password_disallowed_characters (string, optional): Disallowed characters in the password,password_disallowed_words (string, optional): Disallowed words in the password,password_prohibit_user_id (boolean, optional): May not contain User ID or its characters in reversed order,password_prohibit_repeated_chars (boolean, optional): May not contain repeated character four or more times consecutively,password_expiry_days (integer, optional) = ['0-500']: Password expiry days,disable_after_failed_attempts (integer, optional) = ['1-100']: Failed attempts count,reset_failed_attempts_count (boolean, optional): Reset failed attempts count and enable those users} + Required Body Parameters (type(dict) body example)- { + "password_minimum_length": 0, + "password_complexity": "", + "password_disallowed_characters": "", + "password_disallowed_words": "", + "password_prohibit_user_id": false, + "password_prohibit_repeated_chars": false, + "password_expiry_days": 0, + "disable_after_failed_attempts": 0, + "reset_failed_attempts_count": false + } + """ + url_path = "/admin-user/password-policy" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def update_admin_user_password_policy(self, body=({})): + """ + Operation: Patch the admin user password policies + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AdminUserPasswordPolicyUpdate {password_minimum_length (integer, optional) = ['6-128']: Minimum length of the password,password_complexity (string, optional) = ['NONE' or 'CASE' or 'NUMBER' or 'ALPHANUMERIC' or 'CASENUMERIC' or 'PUNCTUATION' or 'COMPLEX']: Complexity Level of the password,password_disallowed_characters (string, optional): Disallowed characters in the password,password_disallowed_words (string, optional): Disallowed words in the password,password_prohibit_user_id (boolean, optional): May not contain User ID or its characters in reversed order,password_prohibit_repeated_chars (boolean, optional): May not contain repeated character four or more times consecutively,password_expiry_days (integer, optional) = ['0-500']: Password expiry days,disable_after_failed_attempts (integer, optional) = ['1-100']: Failed attempts count,reset_failed_attempts_count (boolean, optional): Reset failed attempts count and enable those users} + Required Body Parameters (type(dict) body example)- { + "password_minimum_length": 0, + "password_complexity": "", + "password_disallowed_characters": "", + "password_disallowed_words": "", + "password_prohibit_user_id": false, + "password_prohibit_repeated_chars": false, + "password_expiry_days": 0, + "disable_after_failed_attempts": 0, + "reset_failed_attempts_count": false + } + """ + url_path = "/admin-user/password-policy" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:ApplicationLicense + # Function Section Description: Manage application license + + def get_application_license(self, body=({})): + """ + Operation: Get a list of application licenses + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- AdminUserPasswordPolicyUpdate {password_minimum_length (integer, optional) = ['6-128']: Minimum length of the password,password_complexity (string, optional) = ['NONE' or 'CASE' or 'NUMBER' or 'ALPHANUMERIC' or 'CASENUMERIC' or 'PUNCTUATION' or 'COMPLEX']: Complexity Level of the password,password_disallowed_characters (string, optional): Disallowed characters in the password,password_disallowed_words (string, optional): Disallowed words in the password,password_prohibit_user_id (boolean, optional): May not contain User ID or its characters in reversed order,password_prohibit_repeated_chars (boolean, optional): May not contain repeated character four or more times consecutively,password_expiry_days (integer, optional) = ['0-500']: Password expiry days,disable_after_failed_attempts (integer, optional) = ['1-100']: Failed attempts count,reset_failed_attempts_count (boolean, optional): Reset failed attempts count and enable those users} + Required Body Parameters (type(dict) body example)- { + "password_minimum_length": 0, + "password_complexity": "", + "password_disallowed_characters": "", + "password_disallowed_words": "", + "password_prohibit_user_id": false, + "password_prohibit_repeated_chars": false, + "password_expiry_days": 0, + "disable_after_failed_attempts": 0, + "reset_failed_attempts_count": false + } + """ + url_path = "/application-license" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_application_license(self, body=({})): + """ + Operation: Create a new application license + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ApplicationLicenseCreate {license_key (string): License key} + Required Body Parameters (type(dict) body example)- { + "license_key": "" + } + """ + url_path = "/application-license" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_application_license_by_license_id(self, license_id=""): + """ + Operation: Get a license by license id + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: license_id, Description: Numeric ID of Application License + """ + url_path = "/application-license/{license_id}" + dict_path = {"license_id": license_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_application_license_by_license_id(self, license_id="", body=({})): + """ + Operation: Update a license by license id + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: license_id, Description: Numeric ID of Application License + Required Body Parameters (body description)- ApplicationLicenseReplace {license_key (string): License key} + Required Body Parameters (type(dict) body example)- { + "license_key": "" + } + """ + url_path = "/application-license/{license_id}" + dict_path = {"license_id": license_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_application_license_by_license_id(self, license_id=""): + """ + Operation: Delete a license by license id + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: license_id, Description: Numeric ID of Application License + """ + url_path = "/application-license/{license_id}" + dict_path = {"license_id": license_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def update_application_license_activate_online_by_license_id(self, license_id=""): + """ + Operation: Activate license online by license id + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: license_id, Description: Numeric ID of Application License + """ + url_path = "/application-license/activate-online/{license_id}" + dict_path = {"license_id": license_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_application_license_activate_offline_by_license_id(self, license_id=""): + """ + Operation: Activate license offline by license id + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: license_id, Description: Numeric ID of Application License + """ + url_path = "/application-license/activate-offline/{license_id}" + dict_path = {"license_id": license_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def get_application_license_summary(self, license_id=""): + """ + Operation: Get application license summary + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: license_id, Description: Numeric ID of Application License + """ + url_path = "/application-license/summary" + dict_path = {"license_id": license_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:Attribute + # Function Section Description: Manage Attributes + + def get_attribute( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of attributes + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/attribute" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_attribute(self, body=({})): + """ + Operation: Create a new attribute + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AttributeCreate {name (string): Name of the attribute,entity_name (string) = ['Device' or 'LocalUser' or 'GuestUser' or 'Endpoint' or 'Onboard']: Entity Name of the attribute,data_type (string) = ['Boolean' or 'Date' or 'Day' or 'IPv4Address' or 'IPv6Address' or 'Integer32' or 'List' or 'MACAddress' or 'String' or 'Text' or 'Time' or 'TimeOfDay']: Data Type of the attribute,mandatory (boolean, optional): Enable this to make this attribute mandatory for the entity,default_value (string, optional): Default Value of the attribute,allow_multiple (boolean, optional): To Allow Multiple values of the attribute for Data Type String,allowed_value (string, optional): Allowed Value for Data Type List (e.g., example1,example2,example3)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "entity_name": "", + "data_type": "", + "mandatory": false, + "default_value": "", + "allow_multiple": false, + "allowed_value": "" + } + """ + url_path = "/attribute" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_attribute_by_attribute_id(self, attribute_id=""): + """ + Operation: Get an attribute + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: attribute_id, Description: Numeric ID of the attribute + """ + url_path = "/attribute/{attribute_id}" + dict_path = {"attribute_id": attribute_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_attribute_by_attribute_id(self, attribute_id="", body=({})): + """ + Operation: Update some fields of an attribute + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: attribute_id, Description: Numeric ID of the attribute + Required Body Parameters (body description)- AttributeUpdate {name (string, optional): Name of the attribute,entity_name (string, optional) = ['Device' or 'LocalUser' or 'GuestUser' or 'Endpoint' or 'Onboard']: Entity Name of the attribute,data_type (string, optional) = ['Boolean' or 'Date' or 'Day' or 'IPv4Address' or 'IPv6Address' or 'Integer32' or 'List' or 'MACAddress' or 'String' or 'Text' or 'Time' or 'TimeOfDay']: Data Type of the attribute,mandatory (boolean, optional): Enable this to make this attribute mandatory for the entity,default_value (string, optional): Default Value of the attribute,allow_multiple (boolean, optional): To Allow Multiple values of the attribute for Data Type String,allowed_value (string, optional): Allowed Value for Data Type List (e.g., example1,example2,example3)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "entity_name": "", + "data_type": "", + "mandatory": false, + "default_value": "", + "allow_multiple": false, + "allowed_value": "" + } + """ + url_path = "/attribute/{attribute_id}" + dict_path = {"attribute_id": attribute_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_attribute_by_attribute_id(self, attribute_id="", body=({})): + """ + Operation: Replace an attribute + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: attribute_id, Description: Numeric ID of the attribute + Required Body Parameters (body description)- AttributeReplace {name (string): Name of the attribute,entity_name (string) = ['Device' or 'LocalUser' or 'GuestUser' or 'Endpoint' or 'Onboard']: Entity Name of the attribute,data_type (string) = ['Boolean' or 'Date' or 'Day' or 'IPv4Address' or 'IPv6Address' or 'Integer32' or 'List' or 'MACAddress' or 'String' or 'Text' or 'Time' or 'TimeOfDay']: Data Type of the attribute,mandatory (boolean, optional): Enable this to make this attribute mandatory for the entity,default_value (string, optional): Default Value of the attribute,allow_multiple (boolean, optional): To Allow Multiple values of the attribute for Data Type String,allowed_value (string, optional): Allowed Value for Data Type List (e.g., example1,example2,example3)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "entity_name": "", + "data_type": "", + "mandatory": false, + "default_value": "", + "allow_multiple": false, + "allowed_value": "" + } + """ + url_path = "/attribute/{attribute_id}" + dict_path = {"attribute_id": attribute_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_attribute_by_attribute_id(self, attribute_id=""): + """ + Operation: Delete an attribute + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: attribute_id, Description: Numeric ID of the attribute + """ + url_path = "/attribute/{attribute_id}" + dict_path = {"attribute_id": attribute_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_attribute_by_entity_name_name_name(self, entity_name="", name=""): + """ + Operation: Get an attribute by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: entity_name, Description: Entity Name of the attribute + Required Path Parameter Name: name, Description: Unique name of the attribute + """ + url_path = "/attribute/{entity_name}/name/{name}" + dict_path = {"entity_name": entity_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_attribute_by_entity_name_name_name( + self, entity_name="", name="", body=({}) + ): + """ + Operation: Update some fields of an attribute by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: entity_name, Description: Entity Name of the attribute + Required Path Parameter Name: name, Description: Unique name of the attribute + Required Body Parameters (body description)- AttributeUpdate {name (string, optional): Name of the attribute,entity_name (string, optional) = ['Device' or 'LocalUser' or 'GuestUser' or 'Endpoint' or 'Onboard']: Entity Name of the attribute,data_type (string, optional) = ['Boolean' or 'Date' or 'Day' or 'IPv4Address' or 'IPv6Address' or 'Integer32' or 'List' or 'MACAddress' or 'String' or 'Text' or 'Time' or 'TimeOfDay']: Data Type of the attribute,mandatory (boolean, optional): Enable this to make this attribute mandatory for the entity,default_value (string, optional): Default Value of the attribute,allow_multiple (boolean, optional): To Allow Multiple values of the attribute for Data Type String,allowed_value (string, optional): Allowed Value for Data Type List (e.g., example1,example2,example3)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "entity_name": "", + "data_type": "", + "mandatory": false, + "default_value": "", + "allow_multiple": false, + "allowed_value": "" + } + """ + url_path = "/attribute/{entity_name}/name/{name}" + dict_path = {"entity_name": entity_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_attribute_by_entity_name_name_name( + self, entity_name="", name="", body=({}) + ): + """ + Operation: Replace an attribute by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: entity_name, Description: Entity Name of the attribute + Required Path Parameter Name: name, Description: Unique name of the attribute + Required Body Parameters (body description)- AttributeReplace {name (string): Name of the attribute,entity_name (string) = ['Device' or 'LocalUser' or 'GuestUser' or 'Endpoint' or 'Onboard']: Entity Name of the attribute,data_type (string) = ['Boolean' or 'Date' or 'Day' or 'IPv4Address' or 'IPv6Address' or 'Integer32' or 'List' or 'MACAddress' or 'String' or 'Text' or 'Time' or 'TimeOfDay']: Data Type of the attribute,mandatory (boolean, optional): Enable this to make this attribute mandatory for the entity,default_value (string, optional): Default Value of the attribute,allow_multiple (boolean, optional): To Allow Multiple values of the attribute for Data Type String,allowed_value (string, optional): Allowed Value for Data Type List (e.g., example1,example2,example3)} + Required Body Parameters (type(dict) body example)- { + "name": "", + "entity_name": "", + "data_type": "", + "mandatory": false, + "default_value": "", + "allow_multiple": false, + "allowed_value": "" + } + """ + url_path = "/attribute/{entity_name}/name/{name}" + dict_path = {"entity_name": entity_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_attribute_by_entity_name_name_name(self, entity_name="", name=""): + """ + Operation: Delete an attribute by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: entity_name, Description: Entity Name of the attribute + Required Path Parameter Name: name, Description: Unique name of the attribute + """ + url_path = "/attribute/{entity_name}/name/{name}" + dict_path = {"entity_name": entity_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:ClearPassPortal + # Function Section Description: Manage ClearPass portal + + def get_clearpass_portal(self, entity_name="", name=""): + """ + Operation: Get ClearPass Portal + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: entity_name, Description: Entity Name of the attribute + Required Path Parameter Name: name, Description: Unique name of the attribute + """ + url_path = "/clearpass-portal" + dict_path = {"entity_name": entity_name, "name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_clearpass_portal(self, body=({})): + """ + Operation: Change ClearPass Portal + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ClearPassPortal {title (string, optional): Default Landing page Title,header (string, optional): Default Landing page Header,footer (string, optional): Default Landing page Footer,copyright (string, optional): Default Landing page Copyright text,app_name (string, optional) = ['ClearPass Guest' or 'ClearPass Insight' or 'ClearPass Policy Manager' or 'ClearPass Onboard']: If specified, User will be redirected to the selected ClearPass application login page,guest_portal (string, optional): If specified, User will be redirected to the selected Guest Web Login/Self-Registration Portal,url (string, optional): Redirect URL constructed based on the Guest Portal name(guest_portal) or Application Login Page(app_name)} + Required Body Parameters (type(dict) body example)- { + "title": "", + "header": "", + "footer": "", + "copyright": "", + "app_name": "", + "guest_portal": "", + "url": "" + } + """ + url_path = "/clearpass-portal" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:ClusterDbSync + # Function Section Description: Ensure a subscriber node is synchronized with the publisher node + + def new_cluster_db_sync(self, body=({})): + """ + Operation: Synchronize subscriber with the publisher + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Unprocessable Entity, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Unprocessable Entity, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ClusterDbSync {timeout (string, optional): Maximum time in seconds to wait for the database sync operation} + Required Body Parameters (type(dict) body example)- { + "timeout": "" + } + """ + url_path = "/cluster/db-sync" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:ClusterWideParameter + # Function Section Description: Manage cluster wide parameters + + def get_cluster_parameters(self, body=({})): + """ + Operation: Get cluster wide parameters + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- ClusterDbSync {timeout (string, optional): Maximum time in seconds to wait for the database sync operation} + Required Body Parameters (type(dict) body example)- { + "timeout": "" + } + """ + url_path = "/cluster/parameters" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def replace_cluster_parameters(self, body=({})): + """ + Operation: Replace cluster wide parameters + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ClusterWideParameter {AdminSessionIdleTimeout (integer, optional): Admin Session Idle Timeout in minutes,AdminUserLoginRemoteTacacsServerIP (string, optional): Remote TACACS+ server for Admin logins,AdminUserLoginRemoteTacacsServerPort (integer, optional): Admin UI Login Remote TACACS+ Server Port,AdminUserLoginRemoteTacacsServerSecret (string, optional): Remote TACACS+ server shared secret,AdminUserLoginSecondaryRemoteTacacsServerIP (string, optional),AdminUserLoginSecondaryRemoteTacacsServerPort (integer, optional),AdminUserLoginSecondaryRemoteTacacsServerSecret (string, optional),AdminUserLoginTacacsClientIpSetByHeaderXFF (string, optional) = ['TRUE' or 'FALSE']: Enable Admin UI TACACS+ Client IP set by X-Forwarded-For (XFF) header,AdminUserLoginTertiaryRemoteTacacsServerIP (string, optional),AdminUserLoginTertiaryRemoteTacacsServerPort (integer, optional),AdminUserLoginTertiaryRemoteTacacsServerSecret (string, optional),AlertNotificationTimeout (string, optional) = ['1' or '2' or '4' or '6' or '8' or '12' or '24' or 'Disabled']: Alert Notification Timeout in hours,AuditRecordsCleanupInterval (integer, optional): Old Audit Records cleanup interval in days,AutoBackupConfigOptions (string, optional) = ['Off' or 'Config' or 'Config|SessionInfo']: Auto backup configuration options,CLISessionIdleTimeout (integer, optional): CLI Session Idle Timeout in minutes,CSRCleanupInterval (integer, optional): Cleanup interval for CSRs and private keys,ClearPassZoneCache (string, optional) = ['OFF' or 'NORMAL' or 'FULL']: ClearPass Zone Cache Durability,ClusterCommunicationMode (string, optional) = ['ipv4' or 'ipv6']: Mode of communication between cluster nodes,CommonCriteriaMode (string, optional) = ['TRUE' or 'FALSE']: Enable Common Criteria mode for the cluster,ConsoleSessionIdleTimeout (integer, optional): Console Session Idle Timeout in minutes,ContentSecurityPolicy (string, optional) = ['Enable' or 'Disable']: Enable Content Security Policy (CSP),ContextServerPollInterval (integer, optional): Endpoint Context Servers polling interval in minutes,ContextServerPollStartTime (string, optional): [00:00:00-23:59:59] Endpoint Context Servers polling start time,DbAppexternalUserPassword (string, optional): Database user "appexternal" password,DesignatedStandbyPublisher (string, optional): Designated Standby Publisher,DisableTLS1.0 (string, optional) = ['None' or 'Admin' or 'Network' or 'All']: Disable TLSv1.0 support,DisableTLS1.1 (string, optional) = ['None' or 'Admin' or 'Network' or 'All']: Disable TLSv1.1 support,DisableTLS1.3 (string, optional) = ['None' or 'Admin'],EnableNTLMV1ForWmi (string, optional) = ['TRUE' or 'FALSE']: Enable NTLMV1 for WMI scans,EnablePublisherFailover (string, optional) = ['TRUE' or 'FALSE']: Enable Publisher Failover,EnableTelemetry (string, optional) = ['TRUE' or 'FALSE']: Enable sharing information about the cluster to Telemetry server,ExpiredGuestAccountsCleanupInterval (integer, optional): Expired guest accounts cleanup interval in days,ExtensionsAutoUpgradesFlag (string, optional) = ['TRUE' or 'FALSE'],FreeDiskSpaceThreshold (integer, optional): Free disk space threshold value in %,FreeMemoryThreshold (integer, optional): Free memory threshold value in %,ICMPv6Filters (string, optional) = ['Enable' or 'Disable']: Enable ICMPv6 Filters,IgnoreConflictNetworkBootAgents (string, optional) = ['TRUE' or 'FALSE']: Enable Ignore Conflict (Network Boot Agents),InformationStoredCleanupInterval (integer, optional): Cleanup interval for information stored on the disk in days,KnownEndpointsCleanupInterval (integer, optional): Known endpoints cleanup interval in days,LoginBannerText (string, optional): Login Banner Text,NetflowReprofileInterval (integer, optional): Netflow reprofile interval in days,NotificationEmailAddress (string, optional): Alert Notification - Email Address,NotificationSmsAddress (string, optional): Alert Notification - SMS Address,OnGuardAutoUpdatesFlag (string, optional) = ['TRUE' or 'FALSE']: Automatically check for available OnGuard Signature Updates,PasswordPrompt (string, optional): TACACS+ Password Prompt Text,PolicyResultCacheTimeout (integer, optional): Policy result cache timeout in minutes,PostAuthUnsubscribeEndpoints (string, optional) = ['Enable' or 'Disable'],PostAuthV2 (string, optional) = ['Enable' or 'Disable']: Enable Post-Auth v2,PostAuthV2HttpEnforcement (string, optional) = ['Enable' or 'Disable']: Enable Post-Auth v2 HTTP enforcement,ProcessWiredFromIfMap (string, optional) = ['TRUE' or 'FALSE']: Process wired device information from IF-MAP interface,ProfiledKnownEndpointsCleanupOption (string, optional) = ['TRUE' or 'FALSE']: Profiled Known endpoints cleanup option in days,ProfiledUnknownEndpointsCleanupInterval (integer, optional): Profiled Unknown endpoints cleanup interval in days,ProfilerConflictStrictMode (string, optional) = ['high' or 'medium' or 'low']: Conflict Detection Strict Mode,ProfilerNmapEnable (string, optional) = ['TRUE' or 'FALSE']: Enable endpoint port scan using Nmap,ProfilerPostureEnable (string, optional) = ['TRUE' or 'FALSE']: Enable Endpoint scan using WMI,ProfilerScanPorts (string, optional): Profiler Scan TCP Ports,ProfilerSubnetScanInterval (integer, optional): Profiler subnet scan interval in hours,ProfilingAutoUpdatesFlag (string, optional) = ['TRUE' or 'FALSE']: Automatically check for available Profiling Updates,SSHCipherMode (string, optional): Allowed SSH Cipher Modes,SessionLogsCleanupInterval (integer, optional): Cleanup interval for Session log details in the database in days,SoftwareAutoUpdatesFlag (string, optional) = ['TRUE' or 'FALSE']: Automatically check for available Software Updates,StaleTLSsessioninDiskclenaup (integer, optional),StandbyFailoverWaitTime (integer, optional): Failover Wait Time in minutes,StaticIPEndpointsCleanupOption (string, optional) = ['TRUE' or 'FALSE']: Static IP endpoints cleanup option,StorePasswordHash (string, optional) = ['TRUE' or 'FALSE']: Store Password Hash for MSCHAP authentication,StoreReversibleLocalUserPasswords (string, optional) = ['TRUE' or 'FALSE']: Store Local User passwords using reversible encryption,SyslogBatchInterval (integer, optional): Syslog Export Interval in seconds,SystemAlertLevel (string, optional) = ['INFO' or 'WARN' or 'ERROR']: System Alert Level,TacacsAllowUnencryptedCommunication (string, optional) = ['Enable' or 'Disable']: Enable TACACS+ clients to communicate with ClearPass server over an unencrypted channel,TacacsDisableChangePassword (string, optional) = ['TRUE' or 'FALSE']: Disable Change Password for TACACS+,TacacsIdleTimeout (integer, optional): TACACS+ Connection Idle Timeout in seconds,TacacsProcessUnauthenticatedRequest (string, optional) = ['Enable' or 'Disable']: Enable unauthenticated TACACS+ user request processing,UnknownEndpointsCleanupInterval (integer, optional): Unknown endpoints cleanup interval in days,UserPrompt (string, optional): TACACS+ User Prompt Text,allowConcurrentLogin (string, optional) = ['TRUE' or 'FALSE']: Enable Concurrent Admin Login,session_cache_type (string, optional) = ['Internal' or 'Internal+Disk']} + Required Body Parameters (type(dict) body example)- { + "AdminSessionIdleTimeout": 0, + "AdminUserLoginRemoteTacacsServerIP": "", + "AdminUserLoginRemoteTacacsServerPort": 0, + "AdminUserLoginRemoteTacacsServerSecret": "", + "AdminUserLoginSecondaryRemoteTacacsServerIP": "", + "AdminUserLoginSecondaryRemoteTacacsServerPort": 0, + "AdminUserLoginSecondaryRemoteTacacsServerSecret": "", + "AdminUserLoginTacacsClientIpSetByHeaderXFF": "", + "AdminUserLoginTertiaryRemoteTacacsServerIP": "", + "AdminUserLoginTertiaryRemoteTacacsServerPort": 0, + "AdminUserLoginTertiaryRemoteTacacsServerSecret": "", + "AlertNotificationTimeout": "", + "AuditRecordsCleanupInterval": 0, + "AutoBackupConfigOptions": "", + "CLISessionIdleTimeout": 0, + "CSRCleanupInterval": 0, + "ClearPassZoneCache": "", + "ClusterCommunicationMode": "", + "CommonCriteriaMode": "", + "ConsoleSessionIdleTimeout": 0, + "ContentSecurityPolicy": "", + "ContextServerPollInterval": 0, + "ContextServerPollStartTime": "", + "DbAppexternalUserPassword": "", + "DesignatedStandbyPublisher": "", + "DisableTLS1.0": "", + "DisableTLS1.1": "", + "DisableTLS1.3": "", + "EnableNTLMV1ForWmi": "", + "EnablePublisherFailover": "", + "EnableTelemetry": "", + "ExpiredGuestAccountsCleanupInterval": 0, + "ExtensionsAutoUpgradesFlag": "", + "FreeDiskSpaceThreshold": 0, + "FreeMemoryThreshold": 0, + "ICMPv6Filters": "", + "IgnoreConflictNetworkBootAgents": "", + "InformationStoredCleanupInterval": 0, + "KnownEndpointsCleanupInterval": 0, + "LoginBannerText": "", + "NetflowReprofileInterval": 0, + "NotificationEmailAddress": "", + "NotificationSmsAddress": "", + "OnGuardAutoUpdatesFlag": "", + "PasswordPrompt": "", + "PolicyResultCacheTimeout": 0, + "PostAuthUnsubscribeEndpoints": "", + "PostAuthV2": "", + "PostAuthV2HttpEnforcement": "", + "ProcessWiredFromIfMap": "", + "ProfiledKnownEndpointsCleanupOption": "", + "ProfiledUnknownEndpointsCleanupInterval": 0, + "ProfilerConflictStrictMode": "", + "ProfilerNmapEnable": "", + "ProfilerPostureEnable": "", + "ProfilerScanPorts": "", + "ProfilerSubnetScanInterval": 0, + "ProfilingAutoUpdatesFlag": "", + "SSHCipherMode": "", + "SessionLogsCleanupInterval": 0, + "SoftwareAutoUpdatesFlag": "", + "StaleTLSsessioninDiskclenaup": 0, + "StandbyFailoverWaitTime": 0, + "StaticIPEndpointsCleanupOption": "", + "StorePasswordHash": "", + "StoreReversibleLocalUserPasswords": "", + "SyslogBatchInterval": 0, + "SystemAlertLevel": "", + "TacacsAllowUnencryptedCommunication": "", + "TacacsDisableChangePassword": "", + "TacacsIdleTimeout": 0, + "TacacsProcessUnauthenticatedRequest": "", + "UnknownEndpointsCleanupInterval": 0, + "UserPrompt": "", + "allowConcurrentLogin": "", + "session_cache_type": "" + } + """ + url_path = "/cluster/parameters" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def update_cluster_parameters(self, body=({})): + """ + Operation: Update some cluster wide parameters + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ClusterWideParameter {AdminSessionIdleTimeout (integer, optional): Admin Session Idle Timeout in minutes,AdminUserLoginRemoteTacacsServerIP (string, optional): Remote TACACS+ server for Admin logins,AdminUserLoginRemoteTacacsServerPort (integer, optional): Admin UI Login Remote TACACS+ Server Port,AdminUserLoginRemoteTacacsServerSecret (string, optional): Remote TACACS+ server shared secret,AdminUserLoginSecondaryRemoteTacacsServerIP (string, optional),AdminUserLoginSecondaryRemoteTacacsServerPort (integer, optional),AdminUserLoginSecondaryRemoteTacacsServerSecret (string, optional),AdminUserLoginTacacsClientIpSetByHeaderXFF (string, optional) = ['TRUE' or 'FALSE']: Enable Admin UI TACACS+ Client IP set by X-Forwarded-For (XFF) header,AdminUserLoginTertiaryRemoteTacacsServerIP (string, optional),AdminUserLoginTertiaryRemoteTacacsServerPort (integer, optional),AdminUserLoginTertiaryRemoteTacacsServerSecret (string, optional),AlertNotificationTimeout (string, optional) = ['1' or '2' or '4' or '6' or '8' or '12' or '24' or 'Disabled']: Alert Notification Timeout in hours,AuditRecordsCleanupInterval (integer, optional): Old Audit Records cleanup interval in days,AutoBackupConfigOptions (string, optional) = ['Off' or 'Config' or 'Config|SessionInfo']: Auto backup configuration options,CLISessionIdleTimeout (integer, optional): CLI Session Idle Timeout in minutes,CSRCleanupInterval (integer, optional): Cleanup interval for CSRs and private keys,ClearPassZoneCache (string, optional) = ['OFF' or 'NORMAL' or 'FULL']: ClearPass Zone Cache Durability,ClusterCommunicationMode (string, optional) = ['ipv4' or 'ipv6']: Mode of communication between cluster nodes,CommonCriteriaMode (string, optional) = ['TRUE' or 'FALSE']: Enable Common Criteria mode for the cluster,ConsoleSessionIdleTimeout (integer, optional): Console Session Idle Timeout in minutes,ContentSecurityPolicy (string, optional) = ['Enable' or 'Disable']: Enable Content Security Policy (CSP),ContextServerPollInterval (integer, optional): Endpoint Context Servers polling interval in minutes,ContextServerPollStartTime (string, optional): [00:00:00-23:59:59] Endpoint Context Servers polling start time,DbAppexternalUserPassword (string, optional): Database user "appexternal" password,DesignatedStandbyPublisher (string, optional): Designated Standby Publisher,DisableTLS1.0 (string, optional) = ['None' or 'Admin' or 'Network' or 'All']: Disable TLSv1.0 support,DisableTLS1.1 (string, optional) = ['None' or 'Admin' or 'Network' or 'All']: Disable TLSv1.1 support,DisableTLS1.3 (string, optional) = ['None' or 'Admin'],EnableNTLMV1ForWmi (string, optional) = ['TRUE' or 'FALSE']: Enable NTLMV1 for WMI scans,EnablePublisherFailover (string, optional) = ['TRUE' or 'FALSE']: Enable Publisher Failover,EnableTelemetry (string, optional) = ['TRUE' or 'FALSE']: Enable sharing information about the cluster to Telemetry server,ExpiredGuestAccountsCleanupInterval (integer, optional): Expired guest accounts cleanup interval in days,ExtensionsAutoUpgradesFlag (string, optional) = ['TRUE' or 'FALSE'],FreeDiskSpaceThreshold (integer, optional): Free disk space threshold value in %,FreeMemoryThreshold (integer, optional): Free memory threshold value in %,ICMPv6Filters (string, optional) = ['Enable' or 'Disable']: Enable ICMPv6 Filters,IgnoreConflictNetworkBootAgents (string, optional) = ['TRUE' or 'FALSE']: Enable Ignore Conflict (Network Boot Agents),InformationStoredCleanupInterval (integer, optional): Cleanup interval for information stored on the disk in days,KnownEndpointsCleanupInterval (integer, optional): Known endpoints cleanup interval in days,LoginBannerText (string, optional): Login Banner Text,NetflowReprofileInterval (integer, optional): Netflow reprofile interval in days,NotificationEmailAddress (string, optional): Alert Notification - Email Address,NotificationSmsAddress (string, optional): Alert Notification - SMS Address,OnGuardAutoUpdatesFlag (string, optional) = ['TRUE' or 'FALSE']: Automatically check for available OnGuard Signature Updates,PasswordPrompt (string, optional): TACACS+ Password Prompt Text,PolicyResultCacheTimeout (integer, optional): Policy result cache timeout in minutes,PostAuthUnsubscribeEndpoints (string, optional) = ['Enable' or 'Disable'],PostAuthV2 (string, optional) = ['Enable' or 'Disable']: Enable Post-Auth v2,PostAuthV2HttpEnforcement (string, optional) = ['Enable' or 'Disable']: Enable Post-Auth v2 HTTP enforcement,ProcessWiredFromIfMap (string, optional) = ['TRUE' or 'FALSE']: Process wired device information from IF-MAP interface,ProfiledKnownEndpointsCleanupOption (string, optional) = ['TRUE' or 'FALSE']: Profiled Known endpoints cleanup option in days,ProfiledUnknownEndpointsCleanupInterval (integer, optional): Profiled Unknown endpoints cleanup interval in days,ProfilerConflictStrictMode (string, optional) = ['high' or 'medium' or 'low']: Conflict Detection Strict Mode,ProfilerNmapEnable (string, optional) = ['TRUE' or 'FALSE']: Enable endpoint port scan using Nmap,ProfilerPostureEnable (string, optional) = ['TRUE' or 'FALSE']: Enable Endpoint scan using WMI,ProfilerScanPorts (string, optional): Profiler Scan TCP Ports,ProfilerSubnetScanInterval (integer, optional): Profiler subnet scan interval in hours,ProfilingAutoUpdatesFlag (string, optional) = ['TRUE' or 'FALSE']: Automatically check for available Profiling Updates,SSHCipherMode (string, optional): Allowed SSH Cipher Modes,SessionLogsCleanupInterval (integer, optional): Cleanup interval for Session log details in the database in days,SoftwareAutoUpdatesFlag (string, optional) = ['TRUE' or 'FALSE']: Automatically check for available Software Updates,StaleTLSsessioninDiskclenaup (integer, optional),StandbyFailoverWaitTime (integer, optional): Failover Wait Time in minutes,StaticIPEndpointsCleanupOption (string, optional) = ['TRUE' or 'FALSE']: Static IP endpoints cleanup option,StorePasswordHash (string, optional) = ['TRUE' or 'FALSE']: Store Password Hash for MSCHAP authentication,StoreReversibleLocalUserPasswords (string, optional) = ['TRUE' or 'FALSE']: Store Local User passwords using reversible encryption,SyslogBatchInterval (integer, optional): Syslog Export Interval in seconds,SystemAlertLevel (string, optional) = ['INFO' or 'WARN' or 'ERROR']: System Alert Level,TacacsAllowUnencryptedCommunication (string, optional) = ['Enable' or 'Disable']: Enable TACACS+ clients to communicate with ClearPass server over an unencrypted channel,TacacsDisableChangePassword (string, optional) = ['TRUE' or 'FALSE']: Disable Change Password for TACACS+,TacacsIdleTimeout (integer, optional): TACACS+ Connection Idle Timeout in seconds,TacacsProcessUnauthenticatedRequest (string, optional) = ['Enable' or 'Disable']: Enable unauthenticated TACACS+ user request processing,UnknownEndpointsCleanupInterval (integer, optional): Unknown endpoints cleanup interval in days,UserPrompt (string, optional): TACACS+ User Prompt Text,allowConcurrentLogin (string, optional) = ['TRUE' or 'FALSE']: Enable Concurrent Admin Login,session_cache_type (string, optional) = ['Internal' or 'Internal+Disk']} + Required Body Parameters (type(dict) body example)- { + "AdminSessionIdleTimeout": 0, + "AdminUserLoginRemoteTacacsServerIP": "", + "AdminUserLoginRemoteTacacsServerPort": 0, + "AdminUserLoginRemoteTacacsServerSecret": "", + "AdminUserLoginSecondaryRemoteTacacsServerIP": "", + "AdminUserLoginSecondaryRemoteTacacsServerPort": 0, + "AdminUserLoginSecondaryRemoteTacacsServerSecret": "", + "AdminUserLoginTacacsClientIpSetByHeaderXFF": "", + "AdminUserLoginTertiaryRemoteTacacsServerIP": "", + "AdminUserLoginTertiaryRemoteTacacsServerPort": 0, + "AdminUserLoginTertiaryRemoteTacacsServerSecret": "", + "AlertNotificationTimeout": "", + "AuditRecordsCleanupInterval": 0, + "AutoBackupConfigOptions": "", + "CLISessionIdleTimeout": 0, + "CSRCleanupInterval": 0, + "ClearPassZoneCache": "", + "ClusterCommunicationMode": "", + "CommonCriteriaMode": "", + "ConsoleSessionIdleTimeout": 0, + "ContentSecurityPolicy": "", + "ContextServerPollInterval": 0, + "ContextServerPollStartTime": "", + "DbAppexternalUserPassword": "", + "DesignatedStandbyPublisher": "", + "DisableTLS1.0": "", + "DisableTLS1.1": "", + "DisableTLS1.3": "", + "EnableNTLMV1ForWmi": "", + "EnablePublisherFailover": "", + "EnableTelemetry": "", + "ExpiredGuestAccountsCleanupInterval": 0, + "ExtensionsAutoUpgradesFlag": "", + "FreeDiskSpaceThreshold": 0, + "FreeMemoryThreshold": 0, + "ICMPv6Filters": "", + "IgnoreConflictNetworkBootAgents": "", + "InformationStoredCleanupInterval": 0, + "KnownEndpointsCleanupInterval": 0, + "LoginBannerText": "", + "NetflowReprofileInterval": 0, + "NotificationEmailAddress": "", + "NotificationSmsAddress": "", + "OnGuardAutoUpdatesFlag": "", + "PasswordPrompt": "", + "PolicyResultCacheTimeout": 0, + "PostAuthUnsubscribeEndpoints": "", + "PostAuthV2": "", + "PostAuthV2HttpEnforcement": "", + "ProcessWiredFromIfMap": "", + "ProfiledKnownEndpointsCleanupOption": "", + "ProfiledUnknownEndpointsCleanupInterval": 0, + "ProfilerConflictStrictMode": "", + "ProfilerNmapEnable": "", + "ProfilerPostureEnable": "", + "ProfilerScanPorts": "", + "ProfilerSubnetScanInterval": 0, + "ProfilingAutoUpdatesFlag": "", + "SSHCipherMode": "", + "SessionLogsCleanupInterval": 0, + "SoftwareAutoUpdatesFlag": "", + "StaleTLSsessioninDiskclenaup": 0, + "StandbyFailoverWaitTime": 0, + "StaticIPEndpointsCleanupOption": "", + "StorePasswordHash": "", + "StoreReversibleLocalUserPasswords": "", + "SyslogBatchInterval": 0, + "SystemAlertLevel": "", + "TacacsAllowUnencryptedCommunication": "", + "TacacsDisableChangePassword": "", + "TacacsIdleTimeout": 0, + "TacacsProcessUnauthenticatedRequest": "", + "UnknownEndpointsCleanupInterval": 0, + "UserPrompt": "", + "allowConcurrentLogin": "", + "session_cache_type": "" + } + """ + url_path = "/cluster/parameters" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:DataFilter + # Function Section Description: Manage data filters + + def get_data_filter( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of data filters + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/data-filter" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_data_filter(self, body=({})): + """ + Operation: Create a new data filter + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- DataFilterCreate {name (string): Name of the Data Filter,description (string, optional): Description of the Data Filter,type (string): Type of the Data Filter. i.e. SESSION or ACCOUNTING or INSIGHT,attr_type (string, optional): Attribute type (RADIUS/TACACS+/Any) of the Data Filter. Required only when type is ACCOUNTING,configuration_type (string) = ['custom_sql' or 'attribute_rules']: Configuration type of the Data Filter,template (string, optional): Template name for Data Filter (applicable when type=INSIGHT),custom_sql (string, optional): Custom SQL of the Data Filter,rule_eval_algo (string, optional) = ['evaluate-all' or 'first-applicable']: Rule Evaluation Algorithm for rules of Data Filter, applicable only for attributes,rules (RulesSettingsCreate, optional): List of Rules for Data Filter, applicable only for attributes}RulesSettingsCreate {match_type (string) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,condition (RulesConditionSettingsCreate): Conditions of data filter attribute rules}RulesConditionSettingsCreate {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "attr_type": "", + "configuration_type": "", + "template": "", + "custom_sql": "", + "rule_eval_algo": "", + "rules": { + "match_type": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } + } + """ + url_path = "/data-filter" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_data_filter_by_data_filter_id(self, data_filter_id=""): + """ + Operation: Get a data filter + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: data_filter_id, Description: Numeric ID of the Data Filter + """ + url_path = "/data-filter/{data_filter_id}" + dict_path = {"data_filter_id": data_filter_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_data_filter_by_data_filter_id(self, data_filter_id="", body=({})): + """ + Operation: Update a data filter + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: data_filter_id, Description: Numeric ID of the Data Filter + Required Body Parameters (body description)- DataFilterUpdate {name (string, optional): Name of the Data Filter,description (string, optional): Description of the Data Filter,type (string, optional): Type of the Data Filter. i.e. SESSION or ACCOUNTING or INSIGHT,attr_type (string, optional): Attribute type (RADIUS/TACACS+/Any) of the Data Filter. Required only when type is ACCOUNTING,configuration_type (string, optional) = ['custom_sql' or 'attribute_rules']: Configuration type of the Data Filter,template (string, optional): Template name for Data Filter (applicable when type=INSIGHT),custom_sql (string, optional): Custom SQL of the Data Filter,rule_eval_algo (string, optional) = ['evaluate-all' or 'first-applicable']: Rule Evaluation Algorithm for rules of Data Filter, applicable only for attributes,rules (RulesSettingsUpdate, optional): List of Rules for Data Filter, applicable only for attributes}RulesSettingsUpdate {match_type (string, optional) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,condition (RulesConditionSettingsUpdate, optional): Conditions of data filter attribute rules}RulesConditionSettingsUpdate {type (string, optional): Condition type,name (string, optional): Condition name,oper (string, optional): Condition operator,value (string, optional): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "attr_type": "", + "configuration_type": "", + "template": "", + "custom_sql": "", + "rule_eval_algo": "", + "rules": { + "match_type": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } + } + """ + url_path = "/data-filter/{data_filter_id}" + dict_path = {"data_filter_id": data_filter_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_data_filter_by_data_filter_id(self, data_filter_id="", body=({})): + """ + Operation: Replace a data filter + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: data_filter_id, Description: Numeric ID of the Data Filter + Required Body Parameters (body description)- DataFilterReplace {name (string): Name of the Data Filter,description (string, optional): Description of the Data Filter,type (string): Type of the Data Filter. i.e. SESSION or ACCOUNTING or INSIGHT,attr_type (string, optional): Attribute type (RADIUS/TACACS+/Any) of the Data Filter. Required only when type is ACCOUNTING,configuration_type (string) = ['custom_sql' or 'attribute_rules']: Configuration type of the Data Filter,template (string, optional): Template name for Data Filter (applicable when type=INSIGHT),custom_sql (string, optional): Custom SQL of the Data Filter,rule_eval_algo (string, optional) = ['evaluate-all' or 'first-applicable']: Rule Evaluation Algorithm for rules of Data Filter, applicable only for attributes,rules (RulesSettingsReplace, optional): List of Rules for Data Filter, applicable only for attributes}RulesSettingsReplace {match_type (string) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,condition (RulesConditionSettingsReplace): Conditions of data filter attribute rules}RulesConditionSettingsReplace {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "attr_type": "", + "configuration_type": "", + "template": "", + "custom_sql": "", + "rule_eval_algo": "", + "rules": { + "match_type": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } + } + """ + url_path = "/data-filter/{data_filter_id}" + dict_path = {"data_filter_id": data_filter_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_data_filter_by_data_filter_id(self, data_filter_id=""): + """ + Operation: Delete a data filter + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: data_filter_id, Description: Numeric ID of the Data Filter + """ + url_path = "/data-filter/{data_filter_id}" + dict_path = {"data_filter_id": data_filter_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_data_filter_name_by_name(self, name=""): + """ + Operation: Get a data filter by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the data filter + """ + url_path = "/data-filter/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_data_filter_name_by_name(self, name="", body=({})): + """ + Operation: Update a data filter by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the data filter + Required Body Parameters (body description)- DataFilterUpdate {name (string, optional): Name of the Data Filter,description (string, optional): Description of the Data Filter,type (string, optional): Type of the Data Filter. i.e. SESSION or ACCOUNTING or INSIGHT,attr_type (string, optional): Attribute type (RADIUS/TACACS+/Any) of the Data Filter. Required only when type is ACCOUNTING,configuration_type (string, optional) = ['custom_sql' or 'attribute_rules']: Configuration type of the Data Filter,template (string, optional): Template name for Data Filter (applicable when type=INSIGHT),custom_sql (string, optional): Custom SQL of the Data Filter,rule_eval_algo (string, optional) = ['evaluate-all' or 'first-applicable']: Rule Evaluation Algorithm for rules of Data Filter, applicable only for attributes,rules (RulesSettingsUpdate, optional): List of Rules for Data Filter, applicable only for attributes}RulesSettingsUpdate {match_type (string, optional) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,condition (RulesConditionSettingsUpdate, optional): Conditions of data filter attribute rules}RulesConditionSettingsUpdate {type (string, optional): Condition type,name (string, optional): Condition name,oper (string, optional): Condition operator,value (string, optional): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "attr_type": "", + "configuration_type": "", + "template": "", + "custom_sql": "", + "rule_eval_algo": "", + "rules": { + "match_type": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } + } + """ + url_path = "/data-filter/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_data_filter_name_by_name(self, name="", body=({})): + """ + Operation: Replace a data filter by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the data filter + Required Body Parameters (body description)- DataFilterReplace {name (string): Name of the Data Filter,description (string, optional): Description of the Data Filter,type (string): Type of the Data Filter. i.e. SESSION or ACCOUNTING or INSIGHT,attr_type (string, optional): Attribute type (RADIUS/TACACS+/Any) of the Data Filter. Required only when type is ACCOUNTING,configuration_type (string) = ['custom_sql' or 'attribute_rules']: Configuration type of the Data Filter,template (string, optional): Template name for Data Filter (applicable when type=INSIGHT),custom_sql (string, optional): Custom SQL of the Data Filter,rule_eval_algo (string, optional) = ['evaluate-all' or 'first-applicable']: Rule Evaluation Algorithm for rules of Data Filter, applicable only for attributes,rules (RulesSettingsReplace, optional): List of Rules for Data Filter, applicable only for attributes}RulesSettingsReplace {match_type (string) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,condition (RulesConditionSettingsReplace): Conditions of data filter attribute rules}RulesConditionSettingsReplace {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "attr_type": "", + "configuration_type": "", + "template": "", + "custom_sql": "", + "rule_eval_algo": "", + "rules": { + "match_type": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } + } + """ + url_path = "/data-filter/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_data_filter_name_by_name(self, name=""): + """ + Operation: Delete a data filter by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the data filter + """ + url_path = "/data-filter/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:FileBackupServer + # Function Section Description: Manage file backup server + + def get_file_backup_server( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of file backup server + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/file-backup-server" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_file_backup_server(self, body=({})): + """ + Operation: Create a new file backup server + HTTP Status Response Codes: 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- FileBackupServerCreate {host_address (string): Server host address of file backup server,description (string, optional): Description of file backup server,protocol (string) = ['SFTP' or 'SCP' or 'NFS 3' or 'NFS 4']: Protocol for file backup server,port (integer): Port for file backup server,username (string): Username of file backup server,password (string): Password for file backup server,time_out (integer): Timeout for file backup server ,remote_dir (string): Remote directory for file backup server,cppm_servers (array[string], optional): ClearPass server UUID List for file backup server} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "protocol": "", + "port": 0, + "username": "", + "password": "", + "time_out": 0, + "remote_dir": "", + "cppm_servers": [ + "" + ] + } + """ + url_path = "/file-backup-server" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_file_backup_server_by_file_backup_server_id(self, file_backup_server_id=""): + """ + Operation: Get a file backup server + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: file_backup_server_id, Description: Numeric ID of the file-backup-server + """ + url_path = "/file-backup-server/{file_backup_server_id}" + dict_path = {"file_backup_server_id": file_backup_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_file_backup_server_by_file_backup_server_id( + self, file_backup_server_id="", body=({}) + ): + """ + Operation: Update some fields of a file backup server + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: file_backup_server_id, Description: Numeric ID of the file-backup-server + Required Body Parameters (body description)- FileBackupServerUpdate {host_address (string, optional): Server host address of file backup server,description (string, optional): Description of file backup server,protocol (string, optional) = ['SFTP' or 'SCP' or 'NFS 3' or 'NFS 4']: Protocol for file backup server,port (integer, optional): Port for file backup server,username (string, optional): Username of file backup server,password (string, optional): Password for file backup server,time_out (integer, optional): Timeout for file backup server ,remote_dir (string, optional): Remote directory for file backup server,cppm_servers (array[string], optional): ClearPass server UUID List for file backup server} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "protocol": "", + "port": 0, + "username": "", + "password": "", + "time_out": 0, + "remote_dir": "", + "cppm_servers": [ + "" + ] + } + """ + url_path = "/file-backup-server/{file_backup_server_id}" + dict_path = {"file_backup_server_id": file_backup_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_file_backup_server_by_file_backup_server_id( + self, file_backup_server_id="", body=({}) + ): + """ + Operation: Replace a file backup server + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: file_backup_server_id, Description: Numeric ID of the file-backup-server + Required Body Parameters (body description)- FileBackupServerReplace {host_address (string): Server host address of file backup server,description (string, optional): Description of file backup server,protocol (string) = ['SFTP' or 'SCP' or 'NFS 3' or 'NFS 4']: Protocol for file backup server,port (integer): Port for file backup server,username (string): Username of file backup server,password (string): Password for file backup server,time_out (integer): Timeout for file backup server ,remote_dir (string): Remote directory for file backup server,cppm_servers (array[string], optional): ClearPass server UUID List for file backup server} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "protocol": "", + "port": 0, + "username": "", + "password": "", + "time_out": 0, + "remote_dir": "", + "cppm_servers": [ + "" + ] + } + """ + url_path = "/file-backup-server/{file_backup_server_id}" + dict_path = {"file_backup_server_id": file_backup_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_file_backup_server_by_file_backup_server_id( + self, file_backup_server_id="" + ): + """ + Operation: Delete a syslog export filter + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: file_backup_server_id, Description: Numeric ID of the file-backup-server + """ + url_path = "/file-backup-server/{file_backup_server_id}" + dict_path = {"file_backup_server_id": file_backup_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_file_backup_server_host_address_by_host_address(self, host_address=""): + """ + Operation: Get a file backup server by host_address + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: host_address, Description: Unique host_address of the file-backup-server + """ + url_path = "/file-backup-server/host-address/{host_address}" + dict_path = {"host_address": host_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_file_backup_server_host_address_by_host_address( + self, host_address="", body=({}) + ): + """ + Operation: Update some fields of a file backup server by host_address + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: host_address, Description: Unique host_address of the file-backup-server + Required Body Parameters (body description)- FileBackupServerUpdate {host_address (string, optional): Server host address of file backup server,description (string, optional): Description of file backup server,protocol (string, optional) = ['SFTP' or 'SCP' or 'NFS 3' or 'NFS 4']: Protocol for file backup server,port (integer, optional): Port for file backup server,username (string, optional): Username of file backup server,password (string, optional): Password for file backup server,time_out (integer, optional): Timeout for file backup server ,remote_dir (string, optional): Remote directory for file backup server,cppm_servers (array[string], optional): ClearPass server UUID List for file backup server} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "protocol": "", + "port": 0, + "username": "", + "password": "", + "time_out": 0, + "remote_dir": "", + "cppm_servers": [ + "" + ] + } + """ + url_path = "/file-backup-server/host-address/{host_address}" + dict_path = {"host_address": host_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_file_backup_server_host_address_by_host_address( + self, host_address="", body=({}) + ): + """ + Operation: Replace a file backup server by host_address + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: host_address, Description: Unique host_address of the file-backup-server + Required Body Parameters (body description)- FileBackupServerReplace {host_address (string): Server host address of file backup server,description (string, optional): Description of file backup server,protocol (string) = ['SFTP' or 'SCP' or 'NFS 3' or 'NFS 4']: Protocol for file backup server,port (integer): Port for file backup server,username (string): Username of file backup server,password (string): Password for file backup server,time_out (integer): Timeout for file backup server ,remote_dir (string): Remote directory for file backup server,cppm_servers (array[string], optional): ClearPass server UUID List for file backup server} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "protocol": "", + "port": 0, + "username": "", + "password": "", + "time_out": 0, + "remote_dir": "", + "cppm_servers": [ + "" + ] + } + """ + url_path = "/file-backup-server/host-address/{host_address}" + dict_path = {"host_address": host_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_file_backup_server_host_address_by_host_address(self, host_address=""): + """ + Operation: Delete a syslog export filter by host_address + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: host_address, Description: Unique host_address of the file-backup-server + """ + url_path = "/file-backup-server/host-address/{host_address}" + dict_path = {"host_address": host_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:ListAllPrivileges + # Function Section Description: Returns the list of system-defined privileges + + def get_oauth_all_privileges(self, format=""): + """ + Operation: Returns the list of system-defined privileges + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: format, Description: list: List of all privileges by nametree: List of all domains, each containing features + """ + url_path = "/oauth/all-privileges" + dict_query = {"format": format} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:LocalUserPasswordPolicy + # Function Section Description: Manage local user password policies + + def get_local_user_password_policy(self, format=""): + """ + Operation: Get the local user password policy + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Optional Query Parameter Name: format, Description: list: List of all privileges by nametree: List of all domains, each containing features + """ + url_path = "/local-user/password-policy" + dict_query = {"format": format} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_local_user_password_policy(self, body=({})): + """ + Operation: Put the local user password policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- LocalUserPasswordPolicyReplace {password_minimum_length (integer) = ['1-128']: Minimum length of the password,password_complexity (string) = ['NONE' or 'CASE' or 'NUMBER' or 'ALPHANUMERIC' or 'CASENUMERIC' or 'PUNCTUATION' or 'COMPLEX']: Complexity Level of the password,password_disallowed_characters (string, optional): Disallowed characters in the password,password_disallowed_words (string, optional): Disallowed words in the password,password_prohibit_user_id (boolean, optional): May not contain User ID or its characters in reversed order,password_prohibit_repeated_chars (boolean, optional): May not contain repeated character four or more times consecutively,password_expiry_days (integer, optional) = ['0-500']: Password expiry days,password_remember_history (integer, optional) = ['1-99']: Must be different from this many previous passwords,reminder_days (integer, optional) = ['1-365']: Display reminder message after this many days,reminder_message (string, optional): Reminder message to be displayed,disable_after_days (integer, optional) = ['1-1000']: Disable after Days Exceed,disable_after_date (string, optional) = ['yyyy-mm-dd']: Disable after Date Exceeds,disable_after_unchanged_days (integer, optional) = ['1-365']: Disable after password not changed after this many days,disable_after_failed_attempts (integer, optional) = ['1-100']: Failed attempts count,reset_failed_attempts_count (boolean, optional): Reset failed attempts count and enable those users} + Required Body Parameters (type(dict) body example)- { + "password_minimum_length": 0, + "password_complexity": "", + "password_disallowed_characters": "", + "password_disallowed_words": "", + "password_prohibit_user_id": false, + "password_prohibit_repeated_chars": false, + "password_expiry_days": 0, + "password_remember_history": 0, + "reminder_days": 0, + "reminder_message": "", + "disable_after_days": 0, + "disable_after_date": "", + "disable_after_unchanged_days": 0, + "disable_after_failed_attempts": 0, + "reset_failed_attempts_count": false + } + """ + url_path = "/local-user/password-policy" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def update_local_user_password_policy(self, body=({})): + """ + Operation: Patch the local user password policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- LocalUserPasswordPolicyUpdate {password_minimum_length (integer, optional) = ['1-128']: Minimum length of the password,password_complexity (string, optional) = ['NONE' or 'CASE' or 'NUMBER' or 'ALPHANUMERIC' or 'CASENUMERIC' or 'PUNCTUATION' or 'COMPLEX']: Complexity Level of the password,password_disallowed_characters (string, optional): Disallowed characters in the password,password_disallowed_words (string, optional): Disallowed words in the password,password_prohibit_user_id (boolean, optional): May not contain User ID or its characters in reversed order,password_prohibit_repeated_chars (boolean, optional): May not contain repeated character four or more times consecutively,password_expiry_days (integer, optional) = ['0-500']: Password expiry days,password_remember_history (integer, optional) = ['1-99']: Must be different from this many previous passwords,reminder_days (integer, optional) = ['1-365']: Display reminder message after this many days,reminder_message (string, optional): Reminder message to be displayed,disable_after_days (integer, optional) = ['1-1000']: Disable after Days Exceed,disable_after_date (string, optional) = ['yyyy-mm-dd']: Disable after Date Exceeds,disable_after_unchanged_days (integer, optional) = ['1-365']: Disable after password not changed after this many days,disable_after_failed_attempts (integer, optional) = ['1-100']: Failed attempts count,reset_failed_attempts_count (boolean, optional): Reset failed attempts count and enable those users} + Required Body Parameters (type(dict) body example)- { + "password_minimum_length": 0, + "password_complexity": "", + "password_disallowed_characters": "", + "password_disallowed_words": "", + "password_prohibit_user_id": false, + "password_prohibit_repeated_chars": false, + "password_expiry_days": 0, + "password_remember_history": 0, + "reminder_days": 0, + "reminder_message": "", + "disable_after_days": 0, + "disable_after_date": "", + "disable_after_unchanged_days": 0, + "disable_after_failed_attempts": 0, + "reset_failed_attempts_count": false + } + """ + url_path = "/local-user/password-policy" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:MessagingSetup + # Function Section Description: Operations for MessagingSetup + + def get_messaging_setup(self, body=({})): + """ + Operation: GET Messaging setup + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- LocalUserPasswordPolicyUpdate {password_minimum_length (integer, optional) = ['1-128']: Minimum length of the password,password_complexity (string, optional) = ['NONE' or 'CASE' or 'NUMBER' or 'ALPHANUMERIC' or 'CASENUMERIC' or 'PUNCTUATION' or 'COMPLEX']: Complexity Level of the password,password_disallowed_characters (string, optional): Disallowed characters in the password,password_disallowed_words (string, optional): Disallowed words in the password,password_prohibit_user_id (boolean, optional): May not contain User ID or its characters in reversed order,password_prohibit_repeated_chars (boolean, optional): May not contain repeated character four or more times consecutively,password_expiry_days (integer, optional) = ['0-500']: Password expiry days,password_remember_history (integer, optional) = ['1-99']: Must be different from this many previous passwords,reminder_days (integer, optional) = ['1-365']: Display reminder message after this many days,reminder_message (string, optional): Reminder message to be displayed,disable_after_days (integer, optional) = ['1-1000']: Disable after Days Exceed,disable_after_date (string, optional) = ['yyyy-mm-dd']: Disable after Date Exceeds,disable_after_unchanged_days (integer, optional) = ['1-365']: Disable after password not changed after this many days,disable_after_failed_attempts (integer, optional) = ['1-100']: Failed attempts count,reset_failed_attempts_count (boolean, optional): Reset failed attempts count and enable those users} + Required Body Parameters (type(dict) body example)- { + "password_minimum_length": 0, + "password_complexity": "", + "password_disallowed_characters": "", + "password_disallowed_words": "", + "password_prohibit_user_id": false, + "password_prohibit_repeated_chars": false, + "password_expiry_days": 0, + "password_remember_history": 0, + "reminder_days": 0, + "reminder_message": "", + "disable_after_days": 0, + "disable_after_date": "", + "disable_after_unchanged_days": 0, + "disable_after_failed_attempts": 0, + "reset_failed_attempts_count": false + } + """ + url_path = "/messaging-setup" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_messaging_setup(self, body=({})): + """ + Operation: Configure Messaging setup + HTTP Status Response Codes: 201 Created, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- MessagingSetupCreate {server_name (string): SMTP Server Name,user_name (string, optional): Username,password (string, optional): Password,default_from_address (string): Default FROM Address,connection_security (string, optional) = ['ssl' or 'startTLS' or 'none']: Connection Security,port (int, optional): Port Number,connection_timeout (int, optional): Connection Timeout } + Required Body Parameters (type(dict) body example)- { + "server_name": "", + "user_name": "", + "password": "", + "default_from_address": "", + "connection_security": "", + "port": "int", + "connection_timeout": "int" + } + """ + url_path = "/messaging-setup" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def delete_messaging_setup(self, body=({})): + """ + Operation: Reset Messaging setup configuration + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- MessagingSetupCreate {server_name (string): SMTP Server Name,user_name (string, optional): Username,password (string, optional): Password,default_from_address (string): Default FROM Address,connection_security (string, optional) = ['ssl' or 'startTLS' or 'none']: Connection Security,port (int, optional): Port Number,connection_timeout (int, optional): Connection Timeout } + Required Body Parameters (type(dict) body example)- { + "server_name": "", + "user_name": "", + "password": "", + "default_from_address": "", + "connection_security": "", + "port": "int", + "connection_timeout": "int" + } + """ + url_path = "/messaging-setup" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="delete", query=body + ) + + # Function Section Name:OperatorProfile + # Function Section Description: Manage operator profiles + + def get_operator_profile( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of operator profiles + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/operator-profile" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_operator_profile(self, body=({})): + """ + Operation: Create a new operator profile + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- OperatorProfile {id (integer, optional),name (string): Enter a name for this operator profile,comment (string, optional): Comments or descriptive text about the operator profile,enabled (boolean, optional): If unchecked, operators with this profile will not be able to log in,privileges (array[string], optional): Select the privileges that will be granted to this operator login,user_dbs_list (string, optional): Select the visitor account roles that these operators are permitted to use,sponsor_filter (string): Select the default operator filtering to apply to guest accounts,filter_useraccount (string, optional): Enter a comma-delimited list of field=value pairs to create an account filter,filter_radacct (string, optional): Enter a comma-delimited list of field=value pairs to create a session filter,max_users (string, optional): Maximum number of guests the operator can create. + Leave blank for no limit,max_devices (string, optional): Maximum number of devices the operator can create. + Leave blank for no limit,userskin (string, optional): Choose the skin to use for operators with this profile,userskin_name (string, optional),start_page (string, optional): The initial page to show this operator after logging in,lang (string, optional): Select the default language to use for operators with this profile,timezone_id (string, optional): Select the default time zone for operators with this profile,override_ui (boolean, optional): If checked, you can specify different default forms and views to use,override_guest_sessions (string, optional): Override the Active Sessions view,override_change_expiration (string, optional): Override the Change Expiration form,override_create_multi_result (string, optional): Override the Create Multiple Accounts Results form,override_create_multi (string, optional): Override the Create Multiple Guest Accounts form,override_mac_create (string, optional): Override the Create New Device form,override_mac_create_receipt (string, optional): Override the Create New Device Receipt form,override_create_user (string, optional): Override the Create New Guest Account form,override_create_user_receipt (string, optional): Override the Create New Guest Account Receipt form,override_guest_edit (string, optional): Override the Edit Account form,override_guest_multi (string, optional): Override the Edit Accounts view,override_mac_edit (string, optional): Override the Edit Device form,override_mac_multi (string, optional): Override the Edit Devices view,override_guest_multi_form (string, optional): Override the Edit Guest Accounts form,override_mac_multi_form (string, optional): Override the Edit Guest Devices form,override_guest_multi_result (string, optional): Override the Edit Multiple Accounts Results form,override_mac_multi_result (string, optional): Override the Edit Multiple Devices Results form,override_mac_export (string, optional): Override the Export Devices view,override_guest_export (string, optional): Override the Export Guest Accounts view,override_mac_list (string, optional): Override the Manage Devices view,override_guest_users (string, optional): Override the Manage Guest Accounts view,override_guest_edit_receipt (string, optional): Override the Updated Account Details form,override_mac_edit_receipt (string, optional): Override the Updated Device Details form} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "comment": "", + "enabled": false, + "privileges": [ + "" + ], + "user_dbs_list": "", + "sponsor_filter": "", + "filter_useraccount": "", + "filter_radacct": "", + "max_users": "", + "max_devices": "", + "userskin": "", + "userskin_name": "", + "start_page": "", + "lang": "", + "timezone_id": "", + "override_ui": false, + "override_guest_sessions": "", + "override_change_expiration": "", + "override_create_multi_result": "", + "override_create_multi": "", + "override_mac_create": "", + "override_mac_create_receipt": "", + "override_create_user": "", + "override_create_user_receipt": "", + "override_guest_edit": "", + "override_guest_multi": "", + "override_mac_edit": "", + "override_mac_multi": "", + "override_guest_multi_form": "", + "override_mac_multi_form": "", + "override_guest_multi_result": "", + "override_mac_multi_result": "", + "override_mac_export": "", + "override_guest_export": "", + "override_mac_list": "", + "override_guest_users": "", + "override_guest_edit_receipt": "", + "override_mac_edit_receipt": "" + } + """ + url_path = "/operator-profile" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_operator_profile_by_id(self, id=""): + """ + Operation: Get an operator profile + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the operator profile + """ + url_path = "/operator-profile/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_operator_profile_by_id(self, id="", body=({})): + """ + Operation: Update an operator profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the operator profile + Required Body Parameters (body description)- OperatorProfile {id (integer, optional),name (string): Enter a name for this operator profile,comment (string, optional): Comments or descriptive text about the operator profile,enabled (boolean, optional): If unchecked, operators with this profile will not be able to log in,privileges (array[string], optional): Select the privileges that will be granted to this operator login,user_dbs_list (string, optional): Select the visitor account roles that these operators are permitted to use,sponsor_filter (string): Select the default operator filtering to apply to guest accounts,filter_useraccount (string, optional): Enter a comma-delimited list of field=value pairs to create an account filter,filter_radacct (string, optional): Enter a comma-delimited list of field=value pairs to create a session filter,max_users (string, optional): Maximum number of guests the operator can create. + Leave blank for no limit,max_devices (string, optional): Maximum number of devices the operator can create. + Leave blank for no limit,userskin (string, optional): Choose the skin to use for operators with this profile,userskin_name (string, optional),start_page (string, optional): The initial page to show this operator after logging in,lang (string, optional): Select the default language to use for operators with this profile,timezone_id (string, optional): Select the default time zone for operators with this profile,override_ui (boolean, optional): If checked, you can specify different default forms and views to use,override_guest_sessions (string, optional): Override the Active Sessions view,override_change_expiration (string, optional): Override the Change Expiration form,override_create_multi_result (string, optional): Override the Create Multiple Accounts Results form,override_create_multi (string, optional): Override the Create Multiple Guest Accounts form,override_mac_create (string, optional): Override the Create New Device form,override_mac_create_receipt (string, optional): Override the Create New Device Receipt form,override_create_user (string, optional): Override the Create New Guest Account form,override_create_user_receipt (string, optional): Override the Create New Guest Account Receipt form,override_guest_edit (string, optional): Override the Edit Account form,override_guest_multi (string, optional): Override the Edit Accounts view,override_mac_edit (string, optional): Override the Edit Device form,override_mac_multi (string, optional): Override the Edit Devices view,override_guest_multi_form (string, optional): Override the Edit Guest Accounts form,override_mac_multi_form (string, optional): Override the Edit Guest Devices form,override_guest_multi_result (string, optional): Override the Edit Multiple Accounts Results form,override_mac_multi_result (string, optional): Override the Edit Multiple Devices Results form,override_mac_export (string, optional): Override the Export Devices view,override_guest_export (string, optional): Override the Export Guest Accounts view,override_mac_list (string, optional): Override the Manage Devices view,override_guest_users (string, optional): Override the Manage Guest Accounts view,override_guest_edit_receipt (string, optional): Override the Updated Account Details form,override_mac_edit_receipt (string, optional): Override the Updated Device Details form} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "comment": "", + "enabled": false, + "privileges": [ + "" + ], + "user_dbs_list": "", + "sponsor_filter": "", + "filter_useraccount": "", + "filter_radacct": "", + "max_users": "", + "max_devices": "", + "userskin": "", + "userskin_name": "", + "start_page": "", + "lang": "", + "timezone_id": "", + "override_ui": false, + "override_guest_sessions": "", + "override_change_expiration": "", + "override_create_multi_result": "", + "override_create_multi": "", + "override_mac_create": "", + "override_mac_create_receipt": "", + "override_create_user": "", + "override_create_user_receipt": "", + "override_guest_edit": "", + "override_guest_multi": "", + "override_mac_edit": "", + "override_mac_multi": "", + "override_guest_multi_form": "", + "override_mac_multi_form": "", + "override_guest_multi_result": "", + "override_mac_multi_result": "", + "override_mac_export": "", + "override_guest_export": "", + "override_mac_list": "", + "override_guest_users": "", + "override_guest_edit_receipt": "", + "override_mac_edit_receipt": "" + } + """ + url_path = "/operator-profile/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_operator_profile_by_id(self, id="", body=({})): + """ + Operation: Replace an operator profile + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the operator profile + Required Body Parameters (body description)- OperatorProfile {id (integer, optional),name (string): Enter a name for this operator profile,comment (string, optional): Comments or descriptive text about the operator profile,enabled (boolean, optional): If unchecked, operators with this profile will not be able to log in,privileges (array[string], optional): Select the privileges that will be granted to this operator login,user_dbs_list (string, optional): Select the visitor account roles that these operators are permitted to use,sponsor_filter (string): Select the default operator filtering to apply to guest accounts,filter_useraccount (string, optional): Enter a comma-delimited list of field=value pairs to create an account filter,filter_radacct (string, optional): Enter a comma-delimited list of field=value pairs to create a session filter,max_users (string, optional): Maximum number of guests the operator can create. + Leave blank for no limit,max_devices (string, optional): Maximum number of devices the operator can create. + Leave blank for no limit,userskin (string, optional): Choose the skin to use for operators with this profile,userskin_name (string, optional),start_page (string, optional): The initial page to show this operator after logging in,lang (string, optional): Select the default language to use for operators with this profile,timezone_id (string, optional): Select the default time zone for operators with this profile,override_ui (boolean, optional): If checked, you can specify different default forms and views to use,override_guest_sessions (string, optional): Override the Active Sessions view,override_change_expiration (string, optional): Override the Change Expiration form,override_create_multi_result (string, optional): Override the Create Multiple Accounts Results form,override_create_multi (string, optional): Override the Create Multiple Guest Accounts form,override_mac_create (string, optional): Override the Create New Device form,override_mac_create_receipt (string, optional): Override the Create New Device Receipt form,override_create_user (string, optional): Override the Create New Guest Account form,override_create_user_receipt (string, optional): Override the Create New Guest Account Receipt form,override_guest_edit (string, optional): Override the Edit Account form,override_guest_multi (string, optional): Override the Edit Accounts view,override_mac_edit (string, optional): Override the Edit Device form,override_mac_multi (string, optional): Override the Edit Devices view,override_guest_multi_form (string, optional): Override the Edit Guest Accounts form,override_mac_multi_form (string, optional): Override the Edit Guest Devices form,override_guest_multi_result (string, optional): Override the Edit Multiple Accounts Results form,override_mac_multi_result (string, optional): Override the Edit Multiple Devices Results form,override_mac_export (string, optional): Override the Export Devices view,override_guest_export (string, optional): Override the Export Guest Accounts view,override_mac_list (string, optional): Override the Manage Devices view,override_guest_users (string, optional): Override the Manage Guest Accounts view,override_guest_edit_receipt (string, optional): Override the Updated Account Details form,override_mac_edit_receipt (string, optional): Override the Updated Device Details form} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "comment": "", + "enabled": false, + "privileges": [ + "" + ], + "user_dbs_list": "", + "sponsor_filter": "", + "filter_useraccount": "", + "filter_radacct": "", + "max_users": "", + "max_devices": "", + "userskin": "", + "userskin_name": "", + "start_page": "", + "lang": "", + "timezone_id": "", + "override_ui": false, + "override_guest_sessions": "", + "override_change_expiration": "", + "override_create_multi_result": "", + "override_create_multi": "", + "override_mac_create": "", + "override_mac_create_receipt": "", + "override_create_user": "", + "override_create_user_receipt": "", + "override_guest_edit": "", + "override_guest_multi": "", + "override_mac_edit": "", + "override_mac_multi": "", + "override_guest_multi_form": "", + "override_mac_multi_form": "", + "override_guest_multi_result": "", + "override_mac_multi_result": "", + "override_mac_export": "", + "override_guest_export": "", + "override_mac_list": "", + "override_guest_users": "", + "override_guest_edit_receipt": "", + "override_mac_edit_receipt": "" + } + """ + url_path = "/operator-profile/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_operator_profile_by_id(self, id=""): + """ + Operation: Delete an operator profile + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: Numeric ID of the operator profile + """ + url_path = "/operator-profile/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_operator_profile_name_by_name(self, name=""): + """ + Operation: Get an operator profile by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Name of the operator profile + """ + url_path = "/operator-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_operator_profile_name_by_name(self, name="", body=({})): + """ + Operation: Update an operator profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Name of the operator profile + Required Body Parameters (body description)- OperatorProfile {id (integer, optional),name (string): Enter a name for this operator profile,comment (string, optional): Comments or descriptive text about the operator profile,enabled (boolean, optional): If unchecked, operators with this profile will not be able to log in,privileges (array[string], optional): Select the privileges that will be granted to this operator login,user_dbs_list (string, optional): Select the visitor account roles that these operators are permitted to use,sponsor_filter (string): Select the default operator filtering to apply to guest accounts,filter_useraccount (string, optional): Enter a comma-delimited list of field=value pairs to create an account filter,filter_radacct (string, optional): Enter a comma-delimited list of field=value pairs to create a session filter,max_users (string, optional): Maximum number of guests the operator can create. + Leave blank for no limit,max_devices (string, optional): Maximum number of devices the operator can create. + Leave blank for no limit,userskin (string, optional): Choose the skin to use for operators with this profile,userskin_name (string, optional),start_page (string, optional): The initial page to show this operator after logging in,lang (string, optional): Select the default language to use for operators with this profile,timezone_id (string, optional): Select the default time zone for operators with this profile,override_ui (boolean, optional): If checked, you can specify different default forms and views to use,override_guest_sessions (string, optional): Override the Active Sessions view,override_change_expiration (string, optional): Override the Change Expiration form,override_create_multi_result (string, optional): Override the Create Multiple Accounts Results form,override_create_multi (string, optional): Override the Create Multiple Guest Accounts form,override_mac_create (string, optional): Override the Create New Device form,override_mac_create_receipt (string, optional): Override the Create New Device Receipt form,override_create_user (string, optional): Override the Create New Guest Account form,override_create_user_receipt (string, optional): Override the Create New Guest Account Receipt form,override_guest_edit (string, optional): Override the Edit Account form,override_guest_multi (string, optional): Override the Edit Accounts view,override_mac_edit (string, optional): Override the Edit Device form,override_mac_multi (string, optional): Override the Edit Devices view,override_guest_multi_form (string, optional): Override the Edit Guest Accounts form,override_mac_multi_form (string, optional): Override the Edit Guest Devices form,override_guest_multi_result (string, optional): Override the Edit Multiple Accounts Results form,override_mac_multi_result (string, optional): Override the Edit Multiple Devices Results form,override_mac_export (string, optional): Override the Export Devices view,override_guest_export (string, optional): Override the Export Guest Accounts view,override_mac_list (string, optional): Override the Manage Devices view,override_guest_users (string, optional): Override the Manage Guest Accounts view,override_guest_edit_receipt (string, optional): Override the Updated Account Details form,override_mac_edit_receipt (string, optional): Override the Updated Device Details form} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "comment": "", + "enabled": false, + "privileges": [ + "" + ], + "user_dbs_list": "", + "sponsor_filter": "", + "filter_useraccount": "", + "filter_radacct": "", + "max_users": "", + "max_devices": "", + "userskin": "", + "userskin_name": "", + "start_page": "", + "lang": "", + "timezone_id": "", + "override_ui": false, + "override_guest_sessions": "", + "override_change_expiration": "", + "override_create_multi_result": "", + "override_create_multi": "", + "override_mac_create": "", + "override_mac_create_receipt": "", + "override_create_user": "", + "override_create_user_receipt": "", + "override_guest_edit": "", + "override_guest_multi": "", + "override_mac_edit": "", + "override_mac_multi": "", + "override_guest_multi_form": "", + "override_mac_multi_form": "", + "override_guest_multi_result": "", + "override_mac_multi_result": "", + "override_mac_export": "", + "override_guest_export": "", + "override_mac_list": "", + "override_guest_users": "", + "override_guest_edit_receipt": "", + "override_mac_edit_receipt": "" + } + """ + url_path = "/operator-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_operator_profile_name_by_name(self, name="", body=({})): + """ + Operation: Replace an operator profile by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Name of the operator profile + Required Body Parameters (body description)- OperatorProfile {id (integer, optional),name (string): Enter a name for this operator profile,comment (string, optional): Comments or descriptive text about the operator profile,enabled (boolean, optional): If unchecked, operators with this profile will not be able to log in,privileges (array[string], optional): Select the privileges that will be granted to this operator login,user_dbs_list (string, optional): Select the visitor account roles that these operators are permitted to use,sponsor_filter (string): Select the default operator filtering to apply to guest accounts,filter_useraccount (string, optional): Enter a comma-delimited list of field=value pairs to create an account filter,filter_radacct (string, optional): Enter a comma-delimited list of field=value pairs to create a session filter,max_users (string, optional): Maximum number of guests the operator can create. + Leave blank for no limit,max_devices (string, optional): Maximum number of devices the operator can create. + Leave blank for no limit,userskin (string, optional): Choose the skin to use for operators with this profile,userskin_name (string, optional),start_page (string, optional): The initial page to show this operator after logging in,lang (string, optional): Select the default language to use for operators with this profile,timezone_id (string, optional): Select the default time zone for operators with this profile,override_ui (boolean, optional): If checked, you can specify different default forms and views to use,override_guest_sessions (string, optional): Override the Active Sessions view,override_change_expiration (string, optional): Override the Change Expiration form,override_create_multi_result (string, optional): Override the Create Multiple Accounts Results form,override_create_multi (string, optional): Override the Create Multiple Guest Accounts form,override_mac_create (string, optional): Override the Create New Device form,override_mac_create_receipt (string, optional): Override the Create New Device Receipt form,override_create_user (string, optional): Override the Create New Guest Account form,override_create_user_receipt (string, optional): Override the Create New Guest Account Receipt form,override_guest_edit (string, optional): Override the Edit Account form,override_guest_multi (string, optional): Override the Edit Accounts view,override_mac_edit (string, optional): Override the Edit Device form,override_mac_multi (string, optional): Override the Edit Devices view,override_guest_multi_form (string, optional): Override the Edit Guest Accounts form,override_mac_multi_form (string, optional): Override the Edit Guest Devices form,override_guest_multi_result (string, optional): Override the Edit Multiple Accounts Results form,override_mac_multi_result (string, optional): Override the Edit Multiple Devices Results form,override_mac_export (string, optional): Override the Export Devices view,override_guest_export (string, optional): Override the Export Guest Accounts view,override_mac_list (string, optional): Override the Manage Devices view,override_guest_users (string, optional): Override the Manage Guest Accounts view,override_guest_edit_receipt (string, optional): Override the Updated Account Details form,override_mac_edit_receipt (string, optional): Override the Updated Device Details form} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "comment": "", + "enabled": false, + "privileges": [ + "" + ], + "user_dbs_list": "", + "sponsor_filter": "", + "filter_useraccount": "", + "filter_radacct": "", + "max_users": "", + "max_devices": "", + "userskin": "", + "userskin_name": "", + "start_page": "", + "lang": "", + "timezone_id": "", + "override_ui": false, + "override_guest_sessions": "", + "override_change_expiration": "", + "override_create_multi_result": "", + "override_create_multi": "", + "override_mac_create": "", + "override_mac_create_receipt": "", + "override_create_user": "", + "override_create_user_receipt": "", + "override_guest_edit": "", + "override_guest_multi": "", + "override_mac_edit": "", + "override_mac_multi": "", + "override_guest_multi_form": "", + "override_mac_multi_form": "", + "override_guest_multi_result": "", + "override_mac_multi_result": "", + "override_mac_export": "", + "override_guest_export": "", + "override_mac_list": "", + "override_guest_users": "", + "override_guest_edit_receipt": "", + "override_mac_edit_receipt": "" + } + """ + url_path = "/operator-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_operator_profile_name_by_name(self, name=""): + """ + Operation: Delete an operator profile by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Name of the operator profile + """ + url_path = "/operator-profile/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:PolicyManagerZone + # Function Section Description: Manage Policy Manager Zones + + def get_server_policy_manager_zones(self, name=""): + """ + Operation: Get list of Policy Manager Zones + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the operator profile + """ + url_path = "/server/policy-manager-zones" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_server_policy_manager_zones(self, body=({})): + """ + Operation: Create Policy Manager Zone + HTTP Status Response Codes: 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- PolicyManagerZoneCreate {zone_name (string): Name of the Policy Manager Zone} + Required Body Parameters (type(dict) body example)- { + "zone_name": "" + } + """ + url_path = "/server/policy-manager-zones" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_server_policy_manager_zones_by_zone_id(self, zone_id=""): + """ + Operation: Get Policy Manager Zone + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: zone_id, Description: Numeric ID of the policy manager zone + """ + url_path = "/server/policy-manager-zones/{zone_id}" + dict_path = {"zone_id": zone_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_server_policy_manager_zones_by_zone_id(self, zone_id="", body=({})): + """ + Operation: Update Policy Manager Zone + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: zone_id, Description: Numeric ID of the policy manager zone + Required Body Parameters (body description)- PolicyManagerZoneReplace {zone_name (string): Name of the Policy Manager Zone} + Required Body Parameters (type(dict) body example)- { + "zone_name": "" + } + """ + url_path = "/server/policy-manager-zones/{zone_id}" + dict_path = {"zone_id": zone_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_server_policy_manager_zones_by_zone_id(self, zone_id=""): + """ + Operation: Delete Policy Manager Zone + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: zone_id, Description: Numeric ID of the policy manager zone + """ + url_path = "/server/policy-manager-zones/{zone_id}" + dict_path = {"zone_id": zone_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_server_policy_manager_zones_name_by_name(self, name=""): + """ + Operation: Get Policy Manager Zone by name + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + """ + url_path = "/server/policy-manager-zones/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_server_policy_manager_zones_name_by_name(self, name="", body=({})): + """ + Operation: Update Policy Manager Zone by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + Required Body Parameters (body description)- PolicyManagerZoneReplace {zone_name (string): Name of the Policy Manager Zone} + Required Body Parameters (type(dict) body example)- { + "zone_name": "" + } + """ + url_path = "/server/policy-manager-zones/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_server_policy_manager_zones_name_by_name(self, name=""): + """ + Operation: Delete Policy Manager Zone by name + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the policy manager zone + """ + url_path = "/server/policy-manager-zones/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:SnmpTrapReceiver + # Function Section Description: Manage Snmp Trap Receiver + + def get_snmp_trap_receiver( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of Snmp Trap Receiver + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/snmp-trap-receiver" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_snmp_trap_receiver(self, body=({})): + """ + Operation: Create a new Snmp Trap Receiver + HTTP Status Response Codes: 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SnmpTrapReceiverCreate {host_address (string): HostName of the SNMP Trap Server,description (string, optional): Description of the SNMP Trap Server,snmp_version (string): SNMP Version of the SNMP Trap Server,community_string (string, optional): Community String of the SNMP Trap Server,server_port (string, optional): Server Port of the SNMP Trap Server,user (string, optional): Username of the SNMP Trap Server,type (string, optional) = ['Inform' or 'Trap']: Type of SNMP Trap Server,auth_key (string, optional): Authentication key of the SNMP Trap Server,priv_key (string, optional): Privacy key of the SNMP Trap Server,priv_protocol (object, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy Protocol,auth_protocol (object, optional) = ['MD5' or 'SHA']: Authentication Protocol,security_level (object, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: SNMP Version} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "snmp_version": "", + "community_string": "", + "server_port": "", + "user": "", + "type": "", + "auth_key": "", + "priv_key": "", + "priv_protocol": "object", + "auth_protocol": "object", + "security_level": "object" + } + """ + url_path = "/snmp-trap-receiver" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_snmp_trap_receiver_by_snmp_trap_receiver_id(self, snmp_trap_receiver_id=""): + """ + Operation: Get a Snmp Trap Receiver + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: snmp_trap_receiver_id, Description: Numeric ID of the SNMPTrap Server + """ + url_path = "/snmp-trap-receiver/{snmp_trap_receiver_id}" + dict_path = {"snmp_trap_receiver_id": snmp_trap_receiver_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_snmp_trap_receiver_by_snmp_trap_receiver_id( + self, snmp_trap_receiver_id="", body=({}) + ): + """ + Operation: Update some fields of Snmp Trap Receiver + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: snmp_trap_receiver_id, Description: Numeric ID of the SNMPTrap Server + Required Body Parameters (body description)- SnmpTrapReceiverUpdate {host_address (string, optional): HostName of the SNMP Trap Server,description (string, optional): Description of the SNMP Trap Server,snmp_version (string, optional): SNMP Version of the SNMP Trap Server,community_string (string, optional): Community String of the SNMP Trap Server,server_port (string, optional): Server Port of the SNMP Trap Server,user (string, optional): Username of the SNMP Trap Server,type (string, optional) = ['Inform' or 'Trap']: Type of SNMP Trap Server,auth_key (string, optional): Authentication key of the SNMP Trap Server,priv_key (string, optional): Privacy key of the SNMP Trap Server,priv_protocol (object, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy Protocol,auth_protocol (object, optional) = ['MD5' or 'SHA']: Authentication Protocol,security_level (object, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: SNMP Version} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "snmp_version": "", + "community_string": "", + "server_port": "", + "user": "", + "type": "", + "auth_key": "", + "priv_key": "", + "priv_protocol": "object", + "auth_protocol": "object", + "security_level": "object" + } + """ + url_path = "/snmp-trap-receiver/{snmp_trap_receiver_id}" + dict_path = {"snmp_trap_receiver_id": snmp_trap_receiver_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_snmp_trap_receiver_by_snmp_trap_receiver_id( + self, snmp_trap_receiver_id="", body=({}) + ): + """ + Operation: Replace a Snmp Trap Receiver + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: snmp_trap_receiver_id, Description: Numeric ID of the SNMPTrap Server + Required Body Parameters (body description)- SnmpTrapReceiverReplace {host_address (string): HostName of the SNMP Trap Server,description (string, optional): Description of the SNMP Trap Server,snmp_version (string): SNMP Version of the SNMP Trap Server,community_string (string, optional): Community String of the SNMP Trap Server,server_port (string, optional): Server Port of the SNMP Trap Server,user (string, optional): Username of the SNMP Trap Server,type (string, optional) = ['Inform' or 'Trap']: Type of SNMP Trap Server,auth_key (string, optional): Authentication key of the SNMP Trap Server,priv_key (string, optional): Privacy key of the SNMP Trap Server,priv_protocol (object, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy Protocol,auth_protocol (object, optional) = ['MD5' or 'SHA']: Authentication Protocol,security_level (object, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: SNMP Version} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "snmp_version": "", + "community_string": "", + "server_port": "", + "user": "", + "type": "", + "auth_key": "", + "priv_key": "", + "priv_protocol": "object", + "auth_protocol": "object", + "security_level": "object" + } + """ + url_path = "/snmp-trap-receiver/{snmp_trap_receiver_id}" + dict_path = {"snmp_trap_receiver_id": snmp_trap_receiver_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_snmp_trap_receiver_by_snmp_trap_receiver_id( + self, snmp_trap_receiver_id="" + ): + """ + Operation: Delete a Snmp Trap Receiver + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: snmp_trap_receiver_id, Description: Numeric ID of the SNMPTrap Server + """ + url_path = "/snmp-trap-receiver/{snmp_trap_receiver_id}" + dict_path = {"snmp_trap_receiver_id": snmp_trap_receiver_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_snmp_trap_receiver_name_by_name(self, name=""): + """ + Operation: Get a Snmp Trap Receiver by name + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the Host Address + """ + url_path = "/snmp-trap-receiver/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_snmp_trap_receiver_name_by_name(self, name="", body=({})): + """ + Operation: Update some fields of Snmp Trap Receiver by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the Host Address + Required Body Parameters (body description)- SnmpTrapReceiverUpdate {host_address (string, optional): HostName of the SNMP Trap Server,description (string, optional): Description of the SNMP Trap Server,snmp_version (string, optional): SNMP Version of the SNMP Trap Server,community_string (string, optional): Community String of the SNMP Trap Server,server_port (string, optional): Server Port of the SNMP Trap Server,user (string, optional): Username of the SNMP Trap Server,type (string, optional) = ['Inform' or 'Trap']: Type of SNMP Trap Server,auth_key (string, optional): Authentication key of the SNMP Trap Server,priv_key (string, optional): Privacy key of the SNMP Trap Server,priv_protocol (object, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy Protocol,auth_protocol (object, optional) = ['MD5' or 'SHA']: Authentication Protocol,security_level (object, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: SNMP Version} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "snmp_version": "", + "community_string": "", + "server_port": "", + "user": "", + "type": "", + "auth_key": "", + "priv_key": "", + "priv_protocol": "object", + "auth_protocol": "object", + "security_level": "object" + } + """ + url_path = "/snmp-trap-receiver/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_snmp_trap_receiver_name_by_name(self, name="", body=({})): + """ + Operation: Replace a Snmp Trap Receiver by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the Host Address + Required Body Parameters (body description)- SnmpTrapReceiverReplace {host_address (string): HostName of the SNMP Trap Server,description (string, optional): Description of the SNMP Trap Server,snmp_version (string): SNMP Version of the SNMP Trap Server,community_string (string, optional): Community String of the SNMP Trap Server,server_port (string, optional): Server Port of the SNMP Trap Server,user (string, optional): Username of the SNMP Trap Server,type (string, optional) = ['Inform' or 'Trap']: Type of SNMP Trap Server,auth_key (string, optional): Authentication key of the SNMP Trap Server,priv_key (string, optional): Privacy key of the SNMP Trap Server,priv_protocol (object, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy Protocol,auth_protocol (object, optional) = ['MD5' or 'SHA']: Authentication Protocol,security_level (object, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: SNMP Version} + Required Body Parameters (type(dict) body example)- { + "host_address": "", + "description": "", + "snmp_version": "", + "community_string": "", + "server_port": "", + "user": "", + "type": "", + "auth_key": "", + "priv_key": "", + "priv_protocol": "object", + "auth_protocol": "object", + "security_level": "object" + } + """ + url_path = "/snmp-trap-receiver/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_snmp_trap_receiver_name_by_name(self, name=""): + """ + Operation: Delete a Snmp Trap Receiver by name + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the Host Address + """ + url_path = "/snmp-trap-receiver/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_guestactions_v1.py b/pyclearpass/api_explorer_guestactions_v1.py new file mode 100644 index 0000000..7f6b55d --- /dev/null +++ b/pyclearpass/api_explorer_guestactions_v1.py @@ -0,0 +1,115 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_guestactions_v1.py + + +class ApiGuestActions(ClearPassAPILogin): + # Function Section Name:GenerateGuestDigitalPass + # Function Section Description: Operations for GenerateGuestDigitalPass + + def get_guest_by_guest_id_pass_id(self, guest_id="", id=""): + """ + Operation: Generate digital pass for guest account based on template specified by ID + HTTP Status Response Codes: 200 OK, 400 Bad Request, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + Required Path Parameter Name: id, Description: Numeric ID of the digital pass template + """ + url_path = "/guest/{guest_id}/pass/{id}" + dict_path = {"guest_id": guest_id, "id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:GenerateGuestReceipt + # Function Section Description: Generate a guest account receipt + + def get_guest_by_guest_id_receipt_id(self, guest_id="", id=""): + """ + Operation: Generate print template for guest account, using specified template ID + HTTP Status Response Codes: 200 OK, 400 Bad Request, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + Required Path Parameter Name: id, Description: Numeric ID of the print template + """ + url_path = "/guest/{guest_id}/receipt/{id}" + dict_path = {"guest_id": guest_id, "id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:SendSmsReceipt + # Function Section Description: Operations for SendSmsReceipt + + def new_guest_by_guest_id_sendreceipt_sms(self, guest_id="", body=({})): + """ + Operation: Resend guest receipt for guest account, via SMS + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + Required Body Parameters (body description)- SendSmsReceipt {confirm (boolean): Flag to confirm sending guest receipt via SMS} + Required Body Parameters (type(dict) body example)- { + "confirm": false + } + """ + url_path = "/guest/{guest_id}/sendreceipt/sms" + dict_path = {"guest_id": guest_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:SendSmtpReceipt + # Function Section Description: Operations for SendSmtpReceipt + + def new_guest_by_guest_id_sendreceipt_smtp(self, guest_id="", body=({})): + """ + Operation: Resend guest receipt for guest account, via SMTP + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: URL parameter guest_id + Required Body Parameters (body description)- SendSmtpReceipt {confirm (boolean): Flag to confirm sending guest receipt via SMTP} + Required Body Parameters (type(dict) body example)- { + "confirm": false + } + """ + url_path = "/guest/{guest_id}/sendreceipt/smtp" + dict_path = {"guest_id": guest_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:SponsorshipApproval + # Function Section Description: Sponsor confirmation for guest accounts + + def new_guest_by_guest_id_sponsor(self, guest_id="", body=({}), gsr_id=""): + """ + Operation: Accept or reject a guest sponsorship request + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + Required Body Parameters (body description)- SponsorshipApproval {token (string): Registration token,register_token (string): Registration token,register_reject (boolean, optional): Set to true to reject the sponsorship request,role_id (integer, optional): Override the guest role,modify_expire_time (string, optional): Override the guest expiration time,confirm_expire_time (string, optional): Timestamp for new expiration time; used if modify_expire_time is "expire_time"} + Required Body Parameters (type(dict) body example)- { + "token": "", + "register_token": "", + "register_reject": false, + "role_id": 0, + "modify_expire_time": "", + "confirm_expire_time": "" + } + Optional Query Parameter Name: gsr_id, Description: Optional name of the self-registration with the sponsor confirmation configuration. + """ + url_path = "/guest/{guest_id}/sponsor" + dict_path = {"guest_id": guest_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"gsr_id": gsr_id} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) diff --git a/pyclearpass/api_explorer_guestconfiguration_v1.py b/pyclearpass/api_explorer_guestconfiguration_v1.py new file mode 100644 index 0000000..6e65a04 --- /dev/null +++ b/pyclearpass/api_explorer_guestconfiguration_v1.py @@ -0,0 +1,1342 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_guestconfiguration_v1.py + + +class ApiGuestConfiguration(ClearPassAPILogin): + # Function Section Name:DigitalPassTemplate + # Function Section Description: Manage pass templates + + def get_template_pass( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of pass templates + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default -id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/template/pass" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_template_pass(self, body=({})): + """ + Operation: Create a new pass template + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- DigitalPassTemplate {id (integer, optional),name (string, optional),description (string, optional),background_color (string, optional),foreground_color (string, optional),reset (string, optional),label_color (string, optional),summary_template (string, optional),pass_style (string, optional),transit_type (string, optional),icon_image (string, optional),logo_image (string, optional),logo_text_template (string, optional),background_image (integer, optional),thumbnail_image (integer, optional),strip_image (integer, optional),strip_shine (string, optional),footer_image (integer, optional),pass_fields (array[string], optional),relevant_locations (boolean, optional),pass_locations (array[string], optional),relevant_date (boolean, optional),relevant_date_mode (string, optional),relevant_date_rank (integer, optional),relevant_date_template (string, optional),associated_apps (boolean, optional),pass_apps (array[string], optional)} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "background_color": "", + "foreground_color": "", + "reset": "", + "label_color": "", + "summary_template": "", + "pass_style": "", + "transit_type": "", + "icon_image": "", + "logo_image": "", + "logo_text_template": "", + "background_image": 0, + "thumbnail_image": 0, + "strip_image": 0, + "strip_shine": "", + "footer_image": 0, + "pass_fields": [ + "" + ], + "relevant_locations": false, + "pass_locations": [ + "" + ], + "relevant_date": false, + "relevant_date_mode": "", + "relevant_date_rank": 0, + "relevant_date_template": "", + "associated_apps": false, + "pass_apps": [ + "" + ] + } + """ + url_path = "/template/pass" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_template_pass_by_id(self, id=""): + """ + Operation: Get a pass template + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/template/pass/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_template_pass_by_id(self, id="", body=({})): + """ + Operation: Update some fields of a pass template + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: URL parameter id + Required Body Parameters (body description)- DigitalPassTemplate {id (integer, optional),name (string, optional),description (string, optional),background_color (string, optional),foreground_color (string, optional),reset (string, optional),label_color (string, optional),summary_template (string, optional),pass_style (string, optional),transit_type (string, optional),icon_image (string, optional),logo_image (string, optional),logo_text_template (string, optional),background_image (integer, optional),thumbnail_image (integer, optional),strip_image (integer, optional),strip_shine (string, optional),footer_image (integer, optional),pass_fields (array[string], optional),relevant_locations (boolean, optional),pass_locations (array[string], optional),relevant_date (boolean, optional),relevant_date_mode (string, optional),relevant_date_rank (integer, optional),relevant_date_template (string, optional),associated_apps (boolean, optional),pass_apps (array[string], optional)} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "background_color": "", + "foreground_color": "", + "reset": "", + "label_color": "", + "summary_template": "", + "pass_style": "", + "transit_type": "", + "icon_image": "", + "logo_image": "", + "logo_text_template": "", + "background_image": 0, + "thumbnail_image": 0, + "strip_image": 0, + "strip_shine": "", + "footer_image": 0, + "pass_fields": [ + "" + ], + "relevant_locations": false, + "pass_locations": [ + "" + ], + "relevant_date": false, + "relevant_date_mode": "", + "relevant_date_rank": 0, + "relevant_date_template": "", + "associated_apps": false, + "pass_apps": [ + "" + ] + } + """ + url_path = "/template/pass/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_template_pass_by_id(self, id="", body=({})): + """ + Operation: Replace a pass template + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: URL parameter id + Required Body Parameters (body description)- DigitalPassTemplate {id (integer, optional),name (string, optional),description (string, optional),background_color (string, optional),foreground_color (string, optional),reset (string, optional),label_color (string, optional),summary_template (string, optional),pass_style (string, optional),transit_type (string, optional),icon_image (string, optional),logo_image (string, optional),logo_text_template (string, optional),background_image (integer, optional),thumbnail_image (integer, optional),strip_image (integer, optional),strip_shine (string, optional),footer_image (integer, optional),pass_fields (array[string], optional),relevant_locations (boolean, optional),pass_locations (array[string], optional),relevant_date (boolean, optional),relevant_date_mode (string, optional),relevant_date_rank (integer, optional),relevant_date_template (string, optional),associated_apps (boolean, optional),pass_apps (array[string], optional)} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "background_color": "", + "foreground_color": "", + "reset": "", + "label_color": "", + "summary_template": "", + "pass_style": "", + "transit_type": "", + "icon_image": "", + "logo_image": "", + "logo_text_template": "", + "background_image": 0, + "thumbnail_image": 0, + "strip_image": 0, + "strip_shine": "", + "footer_image": 0, + "pass_fields": [ + "" + ], + "relevant_locations": false, + "pass_locations": [ + "" + ], + "relevant_date": false, + "relevant_date_mode": "", + "relevant_date_rank": 0, + "relevant_date_template": "", + "associated_apps": false, + "pass_apps": [ + "" + ] + } + """ + url_path = "/template/pass/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_template_pass_by_id(self, id=""): + """ + Operation: Delete a pass template + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/template/pass/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:GuestAuthenticationConfiguration + # Function Section Description: Manage settings in Configuration -> Authentication + + def get_guest_authentication(self, id=""): + """ + Operation: Return settings from Configuration -> Authentication + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/guest/authentication" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_guest_authentication(self, body=({})): + """ + Operation: Modify settings at Configuration -> Authentication + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- GuestAuthenticationConfiguration {g_admin_access_guest_require_https (boolean, optional): If checked, HTTP access by guests will be redirected to use HTTPS instead,change_of_authorization (boolean, optional): Global to automatically send disconnects when enabled/role values change. + Requires a NAS Type supporting RFC-3576,g_radius_default_vendor (string, optional) = ['other' or 'rfc3576' or 'coa_3576' or 'appauth_3576' or 'appauthz_3576' or 'aerohive_3576' or 'alu_3576' or 'alu' or 'arista_3576' or 'arista_nr_3576' or 'aruba_3576' or 'aruba' or 'bluesocket' or 'chillispot_3576' or 'cisco_3576' or 'cisco' or 'colubris' or 'consentry' or 'enterasys' or 'dell_3576' or 'dell' or 'extreme' or 'extricom' or 'fortinet_3576' or 'fortinet' or 'hpe_3576' or 'hpe_msm_3576' or 'hpe_uww_3576' or 'juniper' or 'meraki' or 'meraki_splash' or 'meru' or 'motorola_3576' or 'ruckus_3576' or 'ruckus' or 'saml' or 'saml_authorize_only' or 'saml_via' or 'trapeze_3576' or 'trendnet' or 'xirrus']: Select the default type for network access servers,g_radius_server_bind_3576 (string, optional): Force a specific bind address for RFC-3576 requests. This may be needed in an AirGroup environment. + Defaults to '0.0.0.0' or '::' depending on your network,g_radius_internal_auth_type (string) = ['pap' or 'chap' or 'mschap']: Controls the RADIUS authentication type used for internal RADIUS authentication requests} + Required Body Parameters (type(dict) body example)- { + "g_admin_access_guest_require_https": false, + "change_of_authorization": false, + "g_radius_default_vendor": "", + "g_radius_server_bind_3576": "", + "g_radius_internal_auth_type": "" + } + """ + url_path = "/guest/authentication" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def update_guest_authentication(self, body=({})): + """ + Operation: Modify settings at Configuration -> Authentication + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- GuestAuthenticationConfiguration {g_admin_access_guest_require_https (boolean, optional): If checked, HTTP access by guests will be redirected to use HTTPS instead,change_of_authorization (boolean, optional): Global to automatically send disconnects when enabled/role values change. + Requires a NAS Type supporting RFC-3576,g_radius_default_vendor (string, optional) = ['other' or 'rfc3576' or 'coa_3576' or 'appauth_3576' or 'appauthz_3576' or 'aerohive_3576' or 'alu_3576' or 'alu' or 'arista_3576' or 'arista_nr_3576' or 'aruba_3576' or 'aruba' or 'bluesocket' or 'chillispot_3576' or 'cisco_3576' or 'cisco' or 'colubris' or 'consentry' or 'enterasys' or 'dell_3576' or 'dell' or 'extreme' or 'extricom' or 'fortinet_3576' or 'fortinet' or 'hpe_3576' or 'hpe_msm_3576' or 'hpe_uww_3576' or 'juniper' or 'meraki' or 'meraki_splash' or 'meru' or 'motorola_3576' or 'ruckus_3576' or 'ruckus' or 'saml' or 'saml_authorize_only' or 'saml_via' or 'trapeze_3576' or 'trendnet' or 'xirrus']: Select the default type for network access servers,g_radius_server_bind_3576 (string, optional): Force a specific bind address for RFC-3576 requests. This may be needed in an AirGroup environment. + Defaults to '0.0.0.0' or '::' depending on your network,g_radius_internal_auth_type (string) = ['pap' or 'chap' or 'mschap']: Controls the RADIUS authentication type used for internal RADIUS authentication requests} + Required Body Parameters (type(dict) body example)- { + "g_admin_access_guest_require_https": false, + "change_of_authorization": false, + "g_radius_default_vendor": "", + "g_radius_server_bind_3576": "", + "g_radius_internal_auth_type": "" + } + """ + url_path = "/guest/authentication" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:GuestManager + # Function Section Description: Manage settings in Configuration -> Guest Manager + + def get_guestmanager(self, body=({})): + """ + Operation: Return settings from Configuration -> Guest Manager + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- GuestAuthenticationConfiguration {g_admin_access_guest_require_https (boolean, optional): If checked, HTTP access by guests will be redirected to use HTTPS instead,change_of_authorization (boolean, optional): Global to automatically send disconnects when enabled/role values change. + Requires a NAS Type supporting RFC-3576,g_radius_default_vendor (string, optional) = ['other' or 'rfc3576' or 'coa_3576' or 'appauth_3576' or 'appauthz_3576' or 'aerohive_3576' or 'alu_3576' or 'alu' or 'arista_3576' or 'arista_nr_3576' or 'aruba_3576' or 'aruba' or 'bluesocket' or 'chillispot_3576' or 'cisco_3576' or 'cisco' or 'colubris' or 'consentry' or 'enterasys' or 'dell_3576' or 'dell' or 'extreme' or 'extricom' or 'fortinet_3576' or 'fortinet' or 'hpe_3576' or 'hpe_msm_3576' or 'hpe_uww_3576' or 'juniper' or 'meraki' or 'meraki_splash' or 'meru' or 'motorola_3576' or 'ruckus_3576' or 'ruckus' or 'saml' or 'saml_authorize_only' or 'saml_via' or 'trapeze_3576' or 'trendnet' or 'xirrus']: Select the default type for network access servers,g_radius_server_bind_3576 (string, optional): Force a specific bind address for RFC-3576 requests. This may be needed in an AirGroup environment. + Defaults to '0.0.0.0' or '::' depending on your network,g_radius_internal_auth_type (string) = ['pap' or 'chap' or 'mschap']: Controls the RADIUS authentication type used for internal RADIUS authentication requests} + Required Body Parameters (type(dict) body example)- { + "g_admin_access_guest_require_https": false, + "change_of_authorization": false, + "g_radius_default_vendor": "", + "g_radius_server_bind_3576": "", + "g_radius_internal_auth_type": "" + } + """ + url_path = "/guestmanager" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_guestmanager(self, body=({})): + """ + Operation: Modify settings at Configuration -> Guest Manager + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- GuestManager {random_username_method (string) = ['nwa_digits_password' or 'nwa_letters_password' or 'nwa_novowels_password' or 'nwa_lettersdigits_password' or 'nwa_picture_password' or 'nwa_sequence']: The method used to generate random account usernames,random_username_multi_prefix (string, optional): Identifier string to prepend to usernames. + Dynamic entries based on a user attribute can be entered as '_' + attribute. For example '_role_name'. + The username length will determine the length of the numeric sequence only. Recommend 4,random_username_picture (string, optional): Format picture (see below) describing the usernames that will be created for visitors. + + • Alphanumeric characters are passed through without modification. + • ‘#’ is replaced with a random digit [0-9]. + • ‘$’ or ‘?’ is replaced with a random letter [A-Za-z] + • ‘_’ is replaced with a random lowercase letter [a-z] + • ‘^’ is replaced with a random uppercase letter [A-Z] + • ‘*’ is replaced with a random letter or digit [A-Za-z0-9]. + • ‘!’ is replaced with a random punctuation symbol [excluding apostrophe, quotes] + • ‘&’ is replaced with a random character (union of sets ! and *) + • ‘@’ is replaced with a random letter or digit, excluding vowels + • '%' is replaced with a random letter or digit, excluding vowels and anything that looks like another (il1, B8, O0, Z2),random_username_length (integer): The length, in characters, of generated account usernames,guest_initial_sequence_options (object, optional): Create multi next available sequence number. These values will be used when multi_initial_sequence is set to -1,random_password_method (string) = ['nwa_digits_password' or 'nwa_letters_password' or 'nwa_novowels_password' or 'nwa_lettersdigits_password' or 'nwa_alnum_password' or 'nwa_strong_password' or 'nwa_complex_password' or 'nwa_complexity_password' or 'nwa_words_password' or 'nwa_picture_password']: The method used to generate a random account password,random_password_picture (string, optional): Format picture (see below) describing the passwords that will be created for visitors. + + • Alphanumeric characters are passed through without modification. + • ‘#’ is replaced with a random digit [0-9]. + • ‘$’ or ‘?’ is replaced with a random letter [A-Za-z] + • ‘_’ is replaced with a random lowercase letter [a-z] + • ‘^’ is replaced with a random uppercase letter [A-Z] + • ‘*’ is replaced with a random letter or digit [A-Za-z0-9]. + • ‘!’ is replaced with a random punctuation symbol [excluding apostrophe, quotes] + • ‘&’ is replaced with a random character (union of sets ! and *) + • ‘@’ is replaced with a random letter or digit, excluding vowels + • '%' is replaced with a random letter or digit, excluding vowels and anything that looks like another (il1, B8, O0, Z2),random_password_length (integer): Number of characters to include in randomly-generated account passwords,guest_password_complexity (string) = ['none' or 'case' or 'number' or 'alphanumeric' or 'casenumeric' or 'punctuation' or 'complex']: Password complexity to enforce for manually-entered guest passwords. + Requires the random password type ‘A password matching the password complexity requirements’ + and the field validator ‘NwaIsValidPasswordComplexity’ for manual password entry,guest_password_minimum (integer): The minimum number of characters that a guest password must contain,guest_password_disallowed (string, optional): Characters which cannot appear in a user-generated password,guest_password_disallowed_words (string, optional): Comma separated list of words disallowed in the random words password generator,guest_view_account_password (boolean, optional): If selected, guest and device Wi-Fi passwords may be displayed to an operator. + This is only possible if operators have the View Passwords privilege as well,guest_do_expire (integer) = ['4' or '3' or '2' or '1']: Default action to take when the expire_time is reached. + Note that a logout can only occur if the NAS is RFC-3576 compliant,guest_account_expiry_options (object): The available options to select from when choosing the expiration time of a guest account (expire_after). + Expiration times are specified in hours,guest_modify_expire_time_options (object): The available options to select from when modifying an account's expiration (modify_expire_time). + Note some items may be dynamically removed based on the state of the account,guest_lifetime_options (object): The available options to select from when choosing the lifetime of a guest account (expire_postlogin). + Lifetime values are specified in minutes,g_action_notify_account_expire_enabled (boolean, optional): If checked, users will receive an email notification when their device’s network credentials are due to expire. + Accounts must contain the ’expired_notify_status’ field with a value of ’1’. Once a notification is sent, this field will show as ’0’,g_action_notify_account_expiration_duration (integer, optional): Account expiration emails are sent this many days before the account expires. + Enter a value between 1 and 30,g_action_notify_account_expire_email_unknown (string, optional) = ['none' or 'fixed' or 'domain']: Specify where to send emails if the user’s account doesn’t have an email address recorded,g_action_notify_account_expire_email_unknown_fixed (string, optional): Address used when no email address is known for a user,g_action_notify_account_expire_email_unknown_domain (string, optional): Domain to append to the username to form an email address,g_action_notify_account_expire_subject (string, optional): Enter a subject for the notification email,g_action_notify_account_expire_message (integer, optional) = ['2' or '13' or '7' or '12' or '5' or '6' or '1' or '3' or '8' or '9' or '11' or '10' or '14' or '4']: The plain text or HTML print template to use when generating an email message,g_action_notify_account_expire_skin (string, optional) = ['' or 'plaintext' or 'html_embedded' or 'receipt' or 'default' or 'Aruba Amigopod Skin' or 'Blank Skin' or 'ClearPass Guest Skin' or 'Custom Skin 1' or 'Custom Skin 2' or 'Galleria Skin' or 'Galleria Skin 2']: The format in which to send email receipts,g_action_notify_account_expire_copies (string, optional) = ['never' or 'always_cc' or 'always_bcc']: Specify when to send to the recipients in the Copies To list,g_action_notify_account_expire_copies_to (string, optional): An optional list of email addresses to which copies of expiry notifications will be sent,g_action_notify_device_expire_email_unknown (string, optional) = ['none' or 'fixed']: Specify where to send emails if the user’s account doesn’t have an email or sponsor_email address recorded,g_action_notify_device_expire_email_unknown_fixed (string, optional): Address used when no email address is known for a device,g_action_notify_device_expire_subject (string, optional): Enter a subject for the notification email,g_action_notify_device_expire_message (integer, optional) = ['2' or '13' or '7' or '12' or '5' or '6' or '1' or '3' or '8' or '9' or '11' or '10' or '14' or '4']: The plain text or HTML print template to use when generating an email message,g_action_notify_device_expire_skin (string, optional) = ['' or 'plaintext' or 'html_embedded' or 'receipt' or 'default' or 'Aruba Amigopod Skin' or 'Blank Skin' or 'ClearPass Guest Skin' or 'Custom Skin 1' or 'Custom Skin 2' or 'Galleria Skin' or 'Galleria Skin 2']: The format in which to send email receipts,g_action_notify_device_expire_copies (string, optional) = ['never' or 'always_cc' or 'always_bcc']: Specify when to send to the recipients in the Copies To list,g_action_notify_device_expire_copies_to (string, optional): An optional list of email addresses to which copies of expiry notifications will be sent,site_ssid (string, optional): The SSID of the wireless LAN, if applicable. This will appear on guest account print receipts,site_wpa_key (string, optional): The WPA key for the wireless LAN, if applicable. This will appear on guest account print receipts,guest_receipt_print_button (boolean, optional): Guest receipts can print simply by selecting the template in the dropdown, or by clicking a link,guest_account_terms_of_use_url (string, optional): The URL of a terms and conditions page. The URL will appear in any terms checkbox with: + {nwa_global name=guest_account_terms_of_use_url} + It is recommended to upload your terms in Content Manager, where the files will be referenced with the "public/" prefix. + Alternatively, you can edit Terms and Conditions under Configuration > Pages > Web Pages. + If your site is hosted externally, be sure the proper access control lists (ACLs) are in place. + If terms are not required, it is recommended to edit the terms field on your forms to a UI type "hidden" and an Initial Value of 1,guest_active_sessions (integer, optional): Enable limiting the number of active sessions a guest account may have. + Enter 0 to allow an unlimited number of sessions,guest_about_guest_network_access (string, optional): Template code to display on the Guest Manager start page, under the + “About Guest Network Access” heading. Leave blank to use the default text, + or enter a hyphen (“-”) to remove the default text and the heading} + Required Body Parameters (type(dict) body example)- { + "random_username_method": "", + "random_username_multi_prefix": "", + "random_username_picture": "", + "random_username_length": 0, + "guest_initial_sequence_options": "object", + "random_password_method": "", + "random_password_picture": "", + "random_password_length": 0, + "guest_password_complexity": "", + "guest_password_minimum": 0, + "guest_password_disallowed": "", + "guest_password_disallowed_words": "", + "guest_view_account_password": false, + "guest_do_expire": 0, + "guest_account_expiry_options": "object", + "guest_modify_expire_time_options": "object", + "guest_lifetime_options": "object", + "g_action_notify_account_expire_enabled": false, + "g_action_notify_account_expiration_duration": 0, + "g_action_notify_account_expire_email_unknown": "", + "g_action_notify_account_expire_email_unknown_fixed": "", + "g_action_notify_account_expire_email_unknown_domain": "", + "g_action_notify_account_expire_subject": "", + "g_action_notify_account_expire_message": 0, + "g_action_notify_account_expire_skin": "", + "g_action_notify_account_expire_copies": "", + "g_action_notify_account_expire_copies_to": "", + "g_action_notify_device_expire_email_unknown": "", + "g_action_notify_device_expire_email_unknown_fixed": "", + "g_action_notify_device_expire_subject": "", + "g_action_notify_device_expire_message": 0, + "g_action_notify_device_expire_skin": "", + "g_action_notify_device_expire_copies": "", + "g_action_notify_device_expire_copies_to": "", + "site_ssid": "", + "site_wpa_key": "", + "guest_receipt_print_button": false, + "guest_account_terms_of_use_url": "", + "guest_active_sessions": 0, + "guest_about_guest_network_access": "" + } + """ + url_path = "/guestmanager" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def update_guestmanager(self, body=({})): + """ + Operation: Modify settings at Configuration -> Guest Manager + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- GuestManager {random_username_method (string) = ['nwa_digits_password' or 'nwa_letters_password' or 'nwa_novowels_password' or 'nwa_lettersdigits_password' or 'nwa_picture_password' or 'nwa_sequence']: The method used to generate random account usernames,random_username_multi_prefix (string, optional): Identifier string to prepend to usernames. + Dynamic entries based on a user attribute can be entered as '_' + attribute. For example '_role_name'. + The username length will determine the length of the numeric sequence only. Recommend 4,random_username_picture (string, optional): Format picture (see below) describing the usernames that will be created for visitors. + + • Alphanumeric characters are passed through without modification. + • ‘#’ is replaced with a random digit [0-9]. + • ‘$’ or ‘?’ is replaced with a random letter [A-Za-z] + • ‘_’ is replaced with a random lowercase letter [a-z] + • ‘^’ is replaced with a random uppercase letter [A-Z] + • ‘*’ is replaced with a random letter or digit [A-Za-z0-9]. + • ‘!’ is replaced with a random punctuation symbol [excluding apostrophe, quotes] + • ‘&’ is replaced with a random character (union of sets ! and *) + • ‘@’ is replaced with a random letter or digit, excluding vowels + • '%' is replaced with a random letter or digit, excluding vowels and anything that looks like another (il1, B8, O0, Z2),random_username_length (integer): The length, in characters, of generated account usernames,guest_initial_sequence_options (object, optional): Create multi next available sequence number. These values will be used when multi_initial_sequence is set to -1,random_password_method (string) = ['nwa_digits_password' or 'nwa_letters_password' or 'nwa_novowels_password' or 'nwa_lettersdigits_password' or 'nwa_alnum_password' or 'nwa_strong_password' or 'nwa_complex_password' or 'nwa_complexity_password' or 'nwa_words_password' or 'nwa_picture_password']: The method used to generate a random account password,random_password_picture (string, optional): Format picture (see below) describing the passwords that will be created for visitors. + + • Alphanumeric characters are passed through without modification. + • ‘#’ is replaced with a random digit [0-9]. + • ‘$’ or ‘?’ is replaced with a random letter [A-Za-z] + • ‘_’ is replaced with a random lowercase letter [a-z] + • ‘^’ is replaced with a random uppercase letter [A-Z] + • ‘*’ is replaced with a random letter or digit [A-Za-z0-9]. + • ‘!’ is replaced with a random punctuation symbol [excluding apostrophe, quotes] + • ‘&’ is replaced with a random character (union of sets ! and *) + • ‘@’ is replaced with a random letter or digit, excluding vowels + • '%' is replaced with a random letter or digit, excluding vowels and anything that looks like another (il1, B8, O0, Z2),random_password_length (integer): Number of characters to include in randomly-generated account passwords,guest_password_complexity (string) = ['none' or 'case' or 'number' or 'alphanumeric' or 'casenumeric' or 'punctuation' or 'complex']: Password complexity to enforce for manually-entered guest passwords. + Requires the random password type ‘A password matching the password complexity requirements’ + and the field validator ‘NwaIsValidPasswordComplexity’ for manual password entry,guest_password_minimum (integer): The minimum number of characters that a guest password must contain,guest_password_disallowed (string, optional): Characters which cannot appear in a user-generated password,guest_password_disallowed_words (string, optional): Comma separated list of words disallowed in the random words password generator,guest_view_account_password (boolean, optional): If selected, guest and device Wi-Fi passwords may be displayed to an operator. + This is only possible if operators have the View Passwords privilege as well,guest_do_expire (integer) = ['4' or '3' or '2' or '1']: Default action to take when the expire_time is reached. + Note that a logout can only occur if the NAS is RFC-3576 compliant,guest_account_expiry_options (object): The available options to select from when choosing the expiration time of a guest account (expire_after). + Expiration times are specified in hours,guest_modify_expire_time_options (object): The available options to select from when modifying an account's expiration (modify_expire_time). + Note some items may be dynamically removed based on the state of the account,guest_lifetime_options (object): The available options to select from when choosing the lifetime of a guest account (expire_postlogin). + Lifetime values are specified in minutes,g_action_notify_account_expire_enabled (boolean, optional): If checked, users will receive an email notification when their device’s network credentials are due to expire. + Accounts must contain the ’expired_notify_status’ field with a value of ’1’. Once a notification is sent, this field will show as ’0’,g_action_notify_account_expiration_duration (integer, optional): Account expiration emails are sent this many days before the account expires. + Enter a value between 1 and 30,g_action_notify_account_expire_email_unknown (string, optional) = ['none' or 'fixed' or 'domain']: Specify where to send emails if the user’s account doesn’t have an email address recorded,g_action_notify_account_expire_email_unknown_fixed (string, optional): Address used when no email address is known for a user,g_action_notify_account_expire_email_unknown_domain (string, optional): Domain to append to the username to form an email address,g_action_notify_account_expire_subject (string, optional): Enter a subject for the notification email,g_action_notify_account_expire_message (integer, optional) = ['2' or '13' or '7' or '12' or '5' or '6' or '1' or '3' or '8' or '9' or '11' or '10' or '14' or '4']: The plain text or HTML print template to use when generating an email message,g_action_notify_account_expire_skin (string, optional) = ['' or 'plaintext' or 'html_embedded' or 'receipt' or 'default' or 'Aruba Amigopod Skin' or 'Blank Skin' or 'ClearPass Guest Skin' or 'Custom Skin 1' or 'Custom Skin 2' or 'Galleria Skin' or 'Galleria Skin 2']: The format in which to send email receipts,g_action_notify_account_expire_copies (string, optional) = ['never' or 'always_cc' or 'always_bcc']: Specify when to send to the recipients in the Copies To list,g_action_notify_account_expire_copies_to (string, optional): An optional list of email addresses to which copies of expiry notifications will be sent,g_action_notify_device_expire_email_unknown (string, optional) = ['none' or 'fixed']: Specify where to send emails if the user’s account doesn’t have an email or sponsor_email address recorded,g_action_notify_device_expire_email_unknown_fixed (string, optional): Address used when no email address is known for a device,g_action_notify_device_expire_subject (string, optional): Enter a subject for the notification email,g_action_notify_device_expire_message (integer, optional) = ['2' or '13' or '7' or '12' or '5' or '6' or '1' or '3' or '8' or '9' or '11' or '10' or '14' or '4']: The plain text or HTML print template to use when generating an email message,g_action_notify_device_expire_skin (string, optional) = ['' or 'plaintext' or 'html_embedded' or 'receipt' or 'default' or 'Aruba Amigopod Skin' or 'Blank Skin' or 'ClearPass Guest Skin' or 'Custom Skin 1' or 'Custom Skin 2' or 'Galleria Skin' or 'Galleria Skin 2']: The format in which to send email receipts,g_action_notify_device_expire_copies (string, optional) = ['never' or 'always_cc' or 'always_bcc']: Specify when to send to the recipients in the Copies To list,g_action_notify_device_expire_copies_to (string, optional): An optional list of email addresses to which copies of expiry notifications will be sent,site_ssid (string, optional): The SSID of the wireless LAN, if applicable. This will appear on guest account print receipts,site_wpa_key (string, optional): The WPA key for the wireless LAN, if applicable. This will appear on guest account print receipts,guest_receipt_print_button (boolean, optional): Guest receipts can print simply by selecting the template in the dropdown, or by clicking a link,guest_account_terms_of_use_url (string, optional): The URL of a terms and conditions page. The URL will appear in any terms checkbox with: + {nwa_global name=guest_account_terms_of_use_url} + It is recommended to upload your terms in Content Manager, where the files will be referenced with the "public/" prefix. + Alternatively, you can edit Terms and Conditions under Configuration > Pages > Web Pages. + If your site is hosted externally, be sure the proper access control lists (ACLs) are in place. + If terms are not required, it is recommended to edit the terms field on your forms to a UI type "hidden" and an Initial Value of 1,guest_active_sessions (integer, optional): Enable limiting the number of active sessions a guest account may have. + Enter 0 to allow an unlimited number of sessions,guest_about_guest_network_access (string, optional): Template code to display on the Guest Manager start page, under the + “About Guest Network Access” heading. Leave blank to use the default text, + or enter a hyphen (“-”) to remove the default text and the heading} + Required Body Parameters (type(dict) body example)- { + "random_username_method": "", + "random_username_multi_prefix": "", + "random_username_picture": "", + "random_username_length": 0, + "guest_initial_sequence_options": "object", + "random_password_method": "", + "random_password_picture": "", + "random_password_length": 0, + "guest_password_complexity": "", + "guest_password_minimum": 0, + "guest_password_disallowed": "", + "guest_password_disallowed_words": "", + "guest_view_account_password": false, + "guest_do_expire": 0, + "guest_account_expiry_options": "object", + "guest_modify_expire_time_options": "object", + "guest_lifetime_options": "object", + "g_action_notify_account_expire_enabled": false, + "g_action_notify_account_expiration_duration": 0, + "g_action_notify_account_expire_email_unknown": "", + "g_action_notify_account_expire_email_unknown_fixed": "", + "g_action_notify_account_expire_email_unknown_domain": "", + "g_action_notify_account_expire_subject": "", + "g_action_notify_account_expire_message": 0, + "g_action_notify_account_expire_skin": "", + "g_action_notify_account_expire_copies": "", + "g_action_notify_account_expire_copies_to": "", + "g_action_notify_device_expire_email_unknown": "", + "g_action_notify_device_expire_email_unknown_fixed": "", + "g_action_notify_device_expire_subject": "", + "g_action_notify_device_expire_message": 0, + "g_action_notify_device_expire_skin": "", + "g_action_notify_device_expire_copies": "", + "g_action_notify_device_expire_copies_to": "", + "site_ssid": "", + "site_wpa_key": "", + "guest_receipt_print_button": false, + "guest_account_terms_of_use_url": "", + "guest_active_sessions": 0, + "guest_about_guest_network_access": "" + } + """ + url_path = "/guestmanager" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:PrintTemplate + # Function Section Description: Manage print templates + + def get_template_print( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of print templates + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default -id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/template/print" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_template_print(self, body=({})): + """ + Operation: Create a new print template + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- PrintTemplate {id (integer, optional): Numeric ID of the template,name (string, optional): Name of the template,enabled (boolean, optional): Flag indicating if the template is enabled,columns (integer, optional): Columns in a template.,per_account (string, optional): HTML template code used to generate a single account receipt,header (string, optional): HTML template code used at the beginning of the document,footer (string, optional): HTML template code used at the end of the document,wizard_template (string, optional): Style of print template to use,wizard_logo (string, optional): Image to use on the template,wizard_title (string, optional): Title which will be displayed on the template,wizard_subtitle (string, optional): Subtitle to display on the template,wizard_field_header (string, optional): Field header for the details displayed on the template,wizard_fields (string, optional): Visitor account fields,wizard_notes (string, optional): Notes to display on the template,wizard_footer (string, optional): Footer text to display on the template} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "enabled": false, + "columns": 0, + "per_account": "", + "header": "", + "footer": "", + "wizard_template": "", + "wizard_logo": "", + "wizard_title": "", + "wizard_subtitle": "", + "wizard_field_header": "", + "wizard_fields": "", + "wizard_notes": "", + "wizard_footer": "" + } + """ + url_path = "/template/print" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_template_print_by_id(self, id=""): + """ + Operation: Get a print template + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/template/print/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_template_print_by_id(self, id="", body=({})): + """ + Operation: Update some fields of a print template + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: URL parameter id + Required Body Parameters (body description)- PrintTemplate {id (integer, optional): Numeric ID of the template,name (string, optional): Name of the template,enabled (boolean, optional): Flag indicating if the template is enabled,columns (integer, optional): Columns in a template.,per_account (string, optional): HTML template code used to generate a single account receipt,header (string, optional): HTML template code used at the beginning of the document,footer (string, optional): HTML template code used at the end of the document,wizard_template (string, optional): Style of print template to use,wizard_logo (string, optional): Image to use on the template,wizard_title (string, optional): Title which will be displayed on the template,wizard_subtitle (string, optional): Subtitle to display on the template,wizard_field_header (string, optional): Field header for the details displayed on the template,wizard_fields (string, optional): Visitor account fields,wizard_notes (string, optional): Notes to display on the template,wizard_footer (string, optional): Footer text to display on the template} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "enabled": false, + "columns": 0, + "per_account": "", + "header": "", + "footer": "", + "wizard_template": "", + "wizard_logo": "", + "wizard_title": "", + "wizard_subtitle": "", + "wizard_field_header": "", + "wizard_fields": "", + "wizard_notes": "", + "wizard_footer": "" + } + """ + url_path = "/template/print/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_template_print_by_id(self, id="", body=({})): + """ + Operation: Replace a print template + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: URL parameter id + Required Body Parameters (body description)- PrintTemplate {id (integer, optional): Numeric ID of the template,name (string, optional): Name of the template,enabled (boolean, optional): Flag indicating if the template is enabled,columns (integer, optional): Columns in a template.,per_account (string, optional): HTML template code used to generate a single account receipt,header (string, optional): HTML template code used at the beginning of the document,footer (string, optional): HTML template code used at the end of the document,wizard_template (string, optional): Style of print template to use,wizard_logo (string, optional): Image to use on the template,wizard_title (string, optional): Title which will be displayed on the template,wizard_subtitle (string, optional): Subtitle to display on the template,wizard_field_header (string, optional): Field header for the details displayed on the template,wizard_fields (string, optional): Visitor account fields,wizard_notes (string, optional): Notes to display on the template,wizard_footer (string, optional): Footer text to display on the template} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "enabled": false, + "columns": 0, + "per_account": "", + "header": "", + "footer": "", + "wizard_template": "", + "wizard_logo": "", + "wizard_title": "", + "wizard_subtitle": "", + "wizard_field_header": "", + "wizard_fields": "", + "wizard_notes": "", + "wizard_footer": "" + } + """ + url_path = "/template/print/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_template_print_by_id(self, id=""): + """ + Operation: Delete a print template + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/template/print/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:WebLogin + # Function Section Description: Manage web logins + + def get_weblogin(self, filter="", sort="", offset="", limit="", calculate_count=""): + """ + Operation: Get a list of web login pages + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +name) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/weblogin" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_weblogin(self, body=({})): + """ + Operation: Create a new web login page + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- WebLogin {id (integer, optional): Unique ID of the web login,name (string): Enter a name for this web login page,page_name (string, optional): Enter a page name for this web login. + The web login will be accessible from “/guest/page_name.php”,description (string, optional): Comments or descriptive text about the web login,vendor_preset (string): Select a predefined group of settings suitable for standard network configurations,vendor_ip (string, optional): Enter the hostname (FQDN) of the vendor’s product here. + When using Secure Login over HTTPS, this name should match the name of the HTTPS certificate installed on your device,require_https (string, optional): Select a security option to apply to the web login process,webauth (string, optional): Select how the user’s network login will be handled. + Server-initiated logins require the user’s MAC address to be available, usually from the captive portal redirection process,form_action (string): The URL of the NAS device’s login form,form_method (string): Choose the method to use when submitting the login form to the NAS,form_username_label (string, optional): The form label for the username field. + Leave blank to use the default (Username:),form_username (string): The name of the username field for the login form. This will be passed to the NAS device when the form is submitted,form_username_suffix (string, optional): The suffix is automatically appended to the username before submitting the login form to the NAS,form_password_label (string, optional): The form label for the password field. + Leave blank to use the default (Password:),form_password (string): The name of the password field for the login form. This will be passed to the NAS device when the form is submitted,form_extra (string, optional): Specify any additional field names and values to send to the NAS device as name=value pairs, one per line,submit_label (string, optional): The form label for the log in button. + Leave blank to use the default (Log In),form_password_encryption (string): Choose the type of password encryption to use when submitting the login form,uam_secret (string, optional): Enter the shared secret between the NAS device and the web login form,url (string, optional): The name of the destination field required by the NAS,default_url (string, optional): Enter the default URL to redirect clients. + Please ensure you prepend "http://" for any external domain,default_url_override (boolean, optional): If selected, the client’s default destination will be overridden regardless of its value,dynamic_address (boolean, optional): In multi-controller deployments, it is often required to post credentials to different addresses made available as part of the original redirection. + The address above will be used whenever the parameter is not available or fails the requirements below,dynamic_allowlist (string, optional): Enter the IP addresses and networks from which dynamic addresses are permitted,dynamic_denylist (string, optional): Enter the IP addresses and networks from which dynamic addresses are denied,access_allowlist (string, optional): Enter the IP addresses and networks from which logins are permitted,access_denylist (string, optional): Enter the IP addresses and networks that are denied login access,access_if_denied (string): Select the response of the system to a request that is not permitted,login_title (string, optional): The title to display on the web login page. + Leave blank to use the default (Login),login_header (string, optional): HTML template code displayed before the login form,login_footer (string, optional): HTML template code displayed after the login form,login_message (string, optional): HTML template code displayed while the login attempt is in progress,login_delay (number): The time in seconds to delay while displaying the login message,login_skin (string): Choose the skin to use when this web login page is displayed,login_terms_require (boolean, optional): If checked, the user will be forced to accept a Terms and Conditions checkbox,login_terms_label (string, optional): The form label for the terms checkbox. + Leave blank to use the default (Terms:),login_terms_text (string, optional): HTML code containing your Terms and Conditions. + Leave blank to use the default (I accept the terms of use),login_terms_layout (string, optional): Select the layout for the terms and conditions text,login_terms_error (string, optional): The text to display if the terms are not accepted. + Leave blank to use the default (In order to log in, you must accept the terms and conditions.),login_captcha (string, optional): Select a CAPTCHA mode,username_auth (string, optional): Select the authentication requirement. + Access Code requires a single code (username) to be entered. + Anonymous allows a blank form requiring just the terms or a Log In button. A pre-existing account is required. + Auto is similar to anonymous but the page is automatically submitted. + Access Code and Anonymous require the account to have the Username Authentication field set,certificate_request (string, optional): Choose whether the user should select a client certificate when authenticating,username_auth_username (string, optional): The account to use for anonymous authentication. + The password will be visible within the HTML. + It is recommended to increase the account Session Limit to the number of guests you wish to support,certificate_auth (string, optional): Choose whether other credentials must also be provided in addition to a certificate,register_policy_manager (boolean, optional): If selected, the endpoint’s attributes will also be updated with other details from the user account,register_policy_manager_adv (boolean, optional): Customize attributes stored with the endpoint,register_policy_manager_attrs (string, optional): List of name|value pairs to pass along. + user_field | Endpoint Attribute,hash_url (string, optional): Select the level of checking to apply to URL parameters passed to the web login page. + Use this option to detect when URL parameters have been modified by the user, for example their MAC address,hash_secret (string, optional): The redirection URL will be hashed using this shared secret,bypass_cna (boolean, optional): The Apple Captive Network Assistant (CNA) is the pop-up browser shown when joining a network that has a captive portal. + Note that this option may not work with all vendors, depending on how the captive portal is implemented,capport_venue_url (string, optional): Enter an optional URL to send as the Venue Info URL for CAPPORT RFC-8908. + https://www.rfc-editor.org/rfc/rfc8908.html,onguard_healthcheck (boolean, optional): If selected, the guest will be required to pass a health check prior to accessing the network,onguard_agents (string, optional): Select the agent options for client scanning. + Native agents are available for Microsoft Windows and Apple OS X. All other OS will fall back to Java,onguard_header (string, optional): HTML template code displayed before the health check text,onguard_footer (string, optional): HTML template code displayed after the health check text,oauth_enabled (boolean, optional): Enable logins with cloud identity / social network credentials,oauth_debug (boolean, optional): Log debugging data,oauth_providers (object, optional): Configuration for cloud identity authentication providers,login_custom_form (boolean, optional): If selected, you must supply your own HTML login form in the Header or Footer HTML areas,login_pre_auth_check (string): Select how the username and password should be checked before proceeding to the NAS authentication,login_pre_auth_error (string, optional): The text to display if the username and password lookup fails. + Leave blank to use the default (Invalid username or password),mfa_enabled (string, optional),mfa_first (string, optional): All options with credentials must pass the Pre-Auth Check whenever a new user authenticates a device,mfa_duo_ikey (string, optional),mfa_duo_skey (string, optional),mfa_duo_host (string, optional),mfa_fn_client_id (string, optional),mfa_fn_client_secret (string, optional),mfa_fn_factors (string, optional): Enter the number of factors to require,mfa_fn_email (boolean, optional): If disabled, the user must scan the QR code,mfa_iws_tenant (string, optional),mfa_iws_app (string, optional),mfa_iws_hostname (string, optional): Enter the hostname of the ImageWare server,mfa_mc_scope (string, optional): OAuth 2.0 scope value. Only mc_authn is supported for this release,mfa_mc_context (string, optional): Message which will be displayed on the authorization device,mfa_mc_binding_message (string, optional): Plain text reference to interlock the consumption device and authorization device,mfa_mc_acr_values (string, optional): Authentication Context class reference. Values as specified by ISO/IEC 29115 Clause 6,mfa_mc_display (string, optional): User interface display for Authentication,mfa_mc_prompt (string, optional): Value to specify to the Authorisation server about type of prompt,mfa_mc_max_age (integer, optional): Maximum elapsed time in secs since last authenticaiton,mfa_mc_login_hint (string, optional): An indication to IDP on what ID to use for login,mfa_mc_version (string, optional),mfa_mc_discovery_service_endpoint (string, optional): Provide the endpoint URL provided by Mobile Connect during configuration,mfa_mc_redirect_url (string, optional): Mobile Connect Redirect URL provided during configuration,mfa_mc_client_id (string, optional),mfa_mc_client_secret (string, optional),mfa_header_html (string, optional): HTML template code displayed before the provider’s vendor-specific authentication area,mfa_footer_html (string, optional): HTML template code displayed after the provider’s vendor-specific authentication area} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "page_name": "", + "description": "", + "vendor_preset": "", + "vendor_ip": "", + "require_https": "", + "webauth": "", + "form_action": "", + "form_method": "", + "form_username_label": "", + "form_username": "", + "form_username_suffix": "", + "form_password_label": "", + "form_password": "", + "form_extra": "", + "submit_label": "", + "form_password_encryption": "", + "uam_secret": "", + "url": "", + "default_url": "", + "default_url_override": false, + "dynamic_address": false, + "dynamic_allowlist": "", + "dynamic_denylist": "", + "access_allowlist": "", + "access_denylist": "", + "access_if_denied": "", + "login_title": "", + "login_header": "", + "login_footer": "", + "login_message": "", + "login_delay": 0, + "login_skin": "", + "login_terms_require": false, + "login_terms_label": "", + "login_terms_text": "", + "login_terms_layout": "", + "login_terms_error": "", + "login_captcha": "", + "username_auth": "", + "certificate_request": "", + "username_auth_username": "", + "certificate_auth": "", + "register_policy_manager": false, + "register_policy_manager_adv": false, + "register_policy_manager_attrs": "", + "hash_url": "", + "hash_secret": "", + "bypass_cna": false, + "capport_venue_url": "", + "onguard_healthcheck": false, + "onguard_agents": "", + "onguard_header": "", + "onguard_footer": "", + "oauth_enabled": false, + "oauth_debug": false, + "oauth_providers": "object", + "login_custom_form": false, + "login_pre_auth_check": "", + "login_pre_auth_error": "", + "mfa_enabled": "", + "mfa_first": "", + "mfa_duo_ikey": "", + "mfa_duo_skey": "", + "mfa_duo_host": "", + "mfa_fn_client_id": "", + "mfa_fn_client_secret": "", + "mfa_fn_factors": "", + "mfa_fn_email": false, + "mfa_iws_tenant": "", + "mfa_iws_app": "", + "mfa_iws_hostname": "", + "mfa_mc_scope": "", + "mfa_mc_context": "", + "mfa_mc_binding_message": "", + "mfa_mc_acr_values": "", + "mfa_mc_display": "", + "mfa_mc_prompt": "", + "mfa_mc_max_age": 0, + "mfa_mc_login_hint": "", + "mfa_mc_version": "", + "mfa_mc_discovery_service_endpoint": "", + "mfa_mc_redirect_url": "", + "mfa_mc_client_id": "", + "mfa_mc_client_secret": "", + "mfa_header_html": "", + "mfa_footer_html": "" + } + """ + url_path = "/weblogin" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_weblogin_by_id(self, id=""): + """ + Operation: Get a web login page + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/weblogin/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_weblogin_by_id(self, id="", body=({})): + """ + Operation: Update some fields of a web login page + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: URL parameter id + Required Body Parameters (body description)- WebLogin {id (integer, optional): Unique ID of the web login,name (string): Enter a name for this web login page,page_name (string, optional): Enter a page name for this web login. + The web login will be accessible from “/guest/page_name.php”,description (string, optional): Comments or descriptive text about the web login,vendor_preset (string): Select a predefined group of settings suitable for standard network configurations,vendor_ip (string, optional): Enter the hostname (FQDN) of the vendor’s product here. + When using Secure Login over HTTPS, this name should match the name of the HTTPS certificate installed on your device,require_https (string, optional): Select a security option to apply to the web login process,webauth (string, optional): Select how the user’s network login will be handled. + Server-initiated logins require the user’s MAC address to be available, usually from the captive portal redirection process,form_action (string): The URL of the NAS device’s login form,form_method (string): Choose the method to use when submitting the login form to the NAS,form_username_label (string, optional): The form label for the username field. + Leave blank to use the default (Username:),form_username (string): The name of the username field for the login form. This will be passed to the NAS device when the form is submitted,form_username_suffix (string, optional): The suffix is automatically appended to the username before submitting the login form to the NAS,form_password_label (string, optional): The form label for the password field. + Leave blank to use the default (Password:),form_password (string): The name of the password field for the login form. This will be passed to the NAS device when the form is submitted,form_extra (string, optional): Specify any additional field names and values to send to the NAS device as name=value pairs, one per line,submit_label (string, optional): The form label for the log in button. + Leave blank to use the default (Log In),form_password_encryption (string): Choose the type of password encryption to use when submitting the login form,uam_secret (string, optional): Enter the shared secret between the NAS device and the web login form,url (string, optional): The name of the destination field required by the NAS,default_url (string, optional): Enter the default URL to redirect clients. + Please ensure you prepend "http://" for any external domain,default_url_override (boolean, optional): If selected, the client’s default destination will be overridden regardless of its value,dynamic_address (boolean, optional): In multi-controller deployments, it is often required to post credentials to different addresses made available as part of the original redirection. + The address above will be used whenever the parameter is not available or fails the requirements below,dynamic_allowlist (string, optional): Enter the IP addresses and networks from which dynamic addresses are permitted,dynamic_denylist (string, optional): Enter the IP addresses and networks from which dynamic addresses are denied,access_allowlist (string, optional): Enter the IP addresses and networks from which logins are permitted,access_denylist (string, optional): Enter the IP addresses and networks that are denied login access,access_if_denied (string): Select the response of the system to a request that is not permitted,login_title (string, optional): The title to display on the web login page. + Leave blank to use the default (Login),login_header (string, optional): HTML template code displayed before the login form,login_footer (string, optional): HTML template code displayed after the login form,login_message (string, optional): HTML template code displayed while the login attempt is in progress,login_delay (number): The time in seconds to delay while displaying the login message,login_skin (string): Choose the skin to use when this web login page is displayed,login_terms_require (boolean, optional): If checked, the user will be forced to accept a Terms and Conditions checkbox,login_terms_label (string, optional): The form label for the terms checkbox. + Leave blank to use the default (Terms:),login_terms_text (string, optional): HTML code containing your Terms and Conditions. + Leave blank to use the default (I accept the terms of use),login_terms_layout (string, optional): Select the layout for the terms and conditions text,login_terms_error (string, optional): The text to display if the terms are not accepted. + Leave blank to use the default (In order to log in, you must accept the terms and conditions.),login_captcha (string, optional): Select a CAPTCHA mode,username_auth (string, optional): Select the authentication requirement. + Access Code requires a single code (username) to be entered. + Anonymous allows a blank form requiring just the terms or a Log In button. A pre-existing account is required. + Auto is similar to anonymous but the page is automatically submitted. + Access Code and Anonymous require the account to have the Username Authentication field set,certificate_request (string, optional): Choose whether the user should select a client certificate when authenticating,username_auth_username (string, optional): The account to use for anonymous authentication. + The password will be visible within the HTML. + It is recommended to increase the account Session Limit to the number of guests you wish to support,certificate_auth (string, optional): Choose whether other credentials must also be provided in addition to a certificate,register_policy_manager (boolean, optional): If selected, the endpoint’s attributes will also be updated with other details from the user account,register_policy_manager_adv (boolean, optional): Customize attributes stored with the endpoint,register_policy_manager_attrs (string, optional): List of name|value pairs to pass along. + user_field | Endpoint Attribute,hash_url (string, optional): Select the level of checking to apply to URL parameters passed to the web login page. + Use this option to detect when URL parameters have been modified by the user, for example their MAC address,hash_secret (string, optional): The redirection URL will be hashed using this shared secret,bypass_cna (boolean, optional): The Apple Captive Network Assistant (CNA) is the pop-up browser shown when joining a network that has a captive portal. + Note that this option may not work with all vendors, depending on how the captive portal is implemented,capport_venue_url (string, optional): Enter an optional URL to send as the Venue Info URL for CAPPORT RFC-8908. + https://www.rfc-editor.org/rfc/rfc8908.html,onguard_healthcheck (boolean, optional): If selected, the guest will be required to pass a health check prior to accessing the network,onguard_agents (string, optional): Select the agent options for client scanning. + Native agents are available for Microsoft Windows and Apple OS X. All other OS will fall back to Java,onguard_header (string, optional): HTML template code displayed before the health check text,onguard_footer (string, optional): HTML template code displayed after the health check text,oauth_enabled (boolean, optional): Enable logins with cloud identity / social network credentials,oauth_debug (boolean, optional): Log debugging data,oauth_providers (object, optional): Configuration for cloud identity authentication providers,login_custom_form (boolean, optional): If selected, you must supply your own HTML login form in the Header or Footer HTML areas,login_pre_auth_check (string): Select how the username and password should be checked before proceeding to the NAS authentication,login_pre_auth_error (string, optional): The text to display if the username and password lookup fails. + Leave blank to use the default (Invalid username or password),mfa_enabled (string, optional),mfa_first (string, optional): All options with credentials must pass the Pre-Auth Check whenever a new user authenticates a device,mfa_duo_ikey (string, optional),mfa_duo_skey (string, optional),mfa_duo_host (string, optional),mfa_fn_client_id (string, optional),mfa_fn_client_secret (string, optional),mfa_fn_factors (string, optional): Enter the number of factors to require,mfa_fn_email (boolean, optional): If disabled, the user must scan the QR code,mfa_iws_tenant (string, optional),mfa_iws_app (string, optional),mfa_iws_hostname (string, optional): Enter the hostname of the ImageWare server,mfa_mc_scope (string, optional): OAuth 2.0 scope value. Only mc_authn is supported for this release,mfa_mc_context (string, optional): Message which will be displayed on the authorization device,mfa_mc_binding_message (string, optional): Plain text reference to interlock the consumption device and authorization device,mfa_mc_acr_values (string, optional): Authentication Context class reference. Values as specified by ISO/IEC 29115 Clause 6,mfa_mc_display (string, optional): User interface display for Authentication,mfa_mc_prompt (string, optional): Value to specify to the Authorisation server about type of prompt,mfa_mc_max_age (integer, optional): Maximum elapsed time in secs since last authenticaiton,mfa_mc_login_hint (string, optional): An indication to IDP on what ID to use for login,mfa_mc_version (string, optional),mfa_mc_discovery_service_endpoint (string, optional): Provide the endpoint URL provided by Mobile Connect during configuration,mfa_mc_redirect_url (string, optional): Mobile Connect Redirect URL provided during configuration,mfa_mc_client_id (string, optional),mfa_mc_client_secret (string, optional),mfa_header_html (string, optional): HTML template code displayed before the provider’s vendor-specific authentication area,mfa_footer_html (string, optional): HTML template code displayed after the provider’s vendor-specific authentication area} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "page_name": "", + "description": "", + "vendor_preset": "", + "vendor_ip": "", + "require_https": "", + "webauth": "", + "form_action": "", + "form_method": "", + "form_username_label": "", + "form_username": "", + "form_username_suffix": "", + "form_password_label": "", + "form_password": "", + "form_extra": "", + "submit_label": "", + "form_password_encryption": "", + "uam_secret": "", + "url": "", + "default_url": "", + "default_url_override": false, + "dynamic_address": false, + "dynamic_allowlist": "", + "dynamic_denylist": "", + "access_allowlist": "", + "access_denylist": "", + "access_if_denied": "", + "login_title": "", + "login_header": "", + "login_footer": "", + "login_message": "", + "login_delay": 0, + "login_skin": "", + "login_terms_require": false, + "login_terms_label": "", + "login_terms_text": "", + "login_terms_layout": "", + "login_terms_error": "", + "login_captcha": "", + "username_auth": "", + "certificate_request": "", + "username_auth_username": "", + "certificate_auth": "", + "register_policy_manager": false, + "register_policy_manager_adv": false, + "register_policy_manager_attrs": "", + "hash_url": "", + "hash_secret": "", + "bypass_cna": false, + "capport_venue_url": "", + "onguard_healthcheck": false, + "onguard_agents": "", + "onguard_header": "", + "onguard_footer": "", + "oauth_enabled": false, + "oauth_debug": false, + "oauth_providers": "object", + "login_custom_form": false, + "login_pre_auth_check": "", + "login_pre_auth_error": "", + "mfa_enabled": "", + "mfa_first": "", + "mfa_duo_ikey": "", + "mfa_duo_skey": "", + "mfa_duo_host": "", + "mfa_fn_client_id": "", + "mfa_fn_client_secret": "", + "mfa_fn_factors": "", + "mfa_fn_email": false, + "mfa_iws_tenant": "", + "mfa_iws_app": "", + "mfa_iws_hostname": "", + "mfa_mc_scope": "", + "mfa_mc_context": "", + "mfa_mc_binding_message": "", + "mfa_mc_acr_values": "", + "mfa_mc_display": "", + "mfa_mc_prompt": "", + "mfa_mc_max_age": 0, + "mfa_mc_login_hint": "", + "mfa_mc_version": "", + "mfa_mc_discovery_service_endpoint": "", + "mfa_mc_redirect_url": "", + "mfa_mc_client_id": "", + "mfa_mc_client_secret": "", + "mfa_header_html": "", + "mfa_footer_html": "" + } + """ + url_path = "/weblogin/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_weblogin_by_id(self, id="", body=({})): + """ + Operation: Replace a web login page + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: URL parameter id + Required Body Parameters (body description)- WebLogin {id (integer, optional): Unique ID of the web login,name (string): Enter a name for this web login page,page_name (string, optional): Enter a page name for this web login. + The web login will be accessible from “/guest/page_name.php”,description (string, optional): Comments or descriptive text about the web login,vendor_preset (string): Select a predefined group of settings suitable for standard network configurations,vendor_ip (string, optional): Enter the hostname (FQDN) of the vendor’s product here. + When using Secure Login over HTTPS, this name should match the name of the HTTPS certificate installed on your device,require_https (string, optional): Select a security option to apply to the web login process,webauth (string, optional): Select how the user’s network login will be handled. + Server-initiated logins require the user’s MAC address to be available, usually from the captive portal redirection process,form_action (string): The URL of the NAS device’s login form,form_method (string): Choose the method to use when submitting the login form to the NAS,form_username_label (string, optional): The form label for the username field. + Leave blank to use the default (Username:),form_username (string): The name of the username field for the login form. This will be passed to the NAS device when the form is submitted,form_username_suffix (string, optional): The suffix is automatically appended to the username before submitting the login form to the NAS,form_password_label (string, optional): The form label for the password field. + Leave blank to use the default (Password:),form_password (string): The name of the password field for the login form. This will be passed to the NAS device when the form is submitted,form_extra (string, optional): Specify any additional field names and values to send to the NAS device as name=value pairs, one per line,submit_label (string, optional): The form label for the log in button. + Leave blank to use the default (Log In),form_password_encryption (string): Choose the type of password encryption to use when submitting the login form,uam_secret (string, optional): Enter the shared secret between the NAS device and the web login form,url (string, optional): The name of the destination field required by the NAS,default_url (string, optional): Enter the default URL to redirect clients. + Please ensure you prepend "http://" for any external domain,default_url_override (boolean, optional): If selected, the client’s default destination will be overridden regardless of its value,dynamic_address (boolean, optional): In multi-controller deployments, it is often required to post credentials to different addresses made available as part of the original redirection. + The address above will be used whenever the parameter is not available or fails the requirements below,dynamic_allowlist (string, optional): Enter the IP addresses and networks from which dynamic addresses are permitted,dynamic_denylist (string, optional): Enter the IP addresses and networks from which dynamic addresses are denied,access_allowlist (string, optional): Enter the IP addresses and networks from which logins are permitted,access_denylist (string, optional): Enter the IP addresses and networks that are denied login access,access_if_denied (string): Select the response of the system to a request that is not permitted,login_title (string, optional): The title to display on the web login page. + Leave blank to use the default (Login),login_header (string, optional): HTML template code displayed before the login form,login_footer (string, optional): HTML template code displayed after the login form,login_message (string, optional): HTML template code displayed while the login attempt is in progress,login_delay (number): The time in seconds to delay while displaying the login message,login_skin (string): Choose the skin to use when this web login page is displayed,login_terms_require (boolean, optional): If checked, the user will be forced to accept a Terms and Conditions checkbox,login_terms_label (string, optional): The form label for the terms checkbox. + Leave blank to use the default (Terms:),login_terms_text (string, optional): HTML code containing your Terms and Conditions. + Leave blank to use the default (I accept the terms of use),login_terms_layout (string, optional): Select the layout for the terms and conditions text,login_terms_error (string, optional): The text to display if the terms are not accepted. + Leave blank to use the default (In order to log in, you must accept the terms and conditions.),login_captcha (string, optional): Select a CAPTCHA mode,username_auth (string, optional): Select the authentication requirement. + Access Code requires a single code (username) to be entered. + Anonymous allows a blank form requiring just the terms or a Log In button. A pre-existing account is required. + Auto is similar to anonymous but the page is automatically submitted. + Access Code and Anonymous require the account to have the Username Authentication field set,certificate_request (string, optional): Choose whether the user should select a client certificate when authenticating,username_auth_username (string, optional): The account to use for anonymous authentication. + The password will be visible within the HTML. + It is recommended to increase the account Session Limit to the number of guests you wish to support,certificate_auth (string, optional): Choose whether other credentials must also be provided in addition to a certificate,register_policy_manager (boolean, optional): If selected, the endpoint’s attributes will also be updated with other details from the user account,register_policy_manager_adv (boolean, optional): Customize attributes stored with the endpoint,register_policy_manager_attrs (string, optional): List of name|value pairs to pass along. + user_field | Endpoint Attribute,hash_url (string, optional): Select the level of checking to apply to URL parameters passed to the web login page. + Use this option to detect when URL parameters have been modified by the user, for example their MAC address,hash_secret (string, optional): The redirection URL will be hashed using this shared secret,bypass_cna (boolean, optional): The Apple Captive Network Assistant (CNA) is the pop-up browser shown when joining a network that has a captive portal. + Note that this option may not work with all vendors, depending on how the captive portal is implemented,capport_venue_url (string, optional): Enter an optional URL to send as the Venue Info URL for CAPPORT RFC-8908. + https://www.rfc-editor.org/rfc/rfc8908.html,onguard_healthcheck (boolean, optional): If selected, the guest will be required to pass a health check prior to accessing the network,onguard_agents (string, optional): Select the agent options for client scanning. + Native agents are available for Microsoft Windows and Apple OS X. All other OS will fall back to Java,onguard_header (string, optional): HTML template code displayed before the health check text,onguard_footer (string, optional): HTML template code displayed after the health check text,oauth_enabled (boolean, optional): Enable logins with cloud identity / social network credentials,oauth_debug (boolean, optional): Log debugging data,oauth_providers (object, optional): Configuration for cloud identity authentication providers,login_custom_form (boolean, optional): If selected, you must supply your own HTML login form in the Header or Footer HTML areas,login_pre_auth_check (string): Select how the username and password should be checked before proceeding to the NAS authentication,login_pre_auth_error (string, optional): The text to display if the username and password lookup fails. + Leave blank to use the default (Invalid username or password),mfa_enabled (string, optional),mfa_first (string, optional): All options with credentials must pass the Pre-Auth Check whenever a new user authenticates a device,mfa_duo_ikey (string, optional),mfa_duo_skey (string, optional),mfa_duo_host (string, optional),mfa_fn_client_id (string, optional),mfa_fn_client_secret (string, optional),mfa_fn_factors (string, optional): Enter the number of factors to require,mfa_fn_email (boolean, optional): If disabled, the user must scan the QR code,mfa_iws_tenant (string, optional),mfa_iws_app (string, optional),mfa_iws_hostname (string, optional): Enter the hostname of the ImageWare server,mfa_mc_scope (string, optional): OAuth 2.0 scope value. Only mc_authn is supported for this release,mfa_mc_context (string, optional): Message which will be displayed on the authorization device,mfa_mc_binding_message (string, optional): Plain text reference to interlock the consumption device and authorization device,mfa_mc_acr_values (string, optional): Authentication Context class reference. Values as specified by ISO/IEC 29115 Clause 6,mfa_mc_display (string, optional): User interface display for Authentication,mfa_mc_prompt (string, optional): Value to specify to the Authorisation server about type of prompt,mfa_mc_max_age (integer, optional): Maximum elapsed time in secs since last authenticaiton,mfa_mc_login_hint (string, optional): An indication to IDP on what ID to use for login,mfa_mc_version (string, optional),mfa_mc_discovery_service_endpoint (string, optional): Provide the endpoint URL provided by Mobile Connect during configuration,mfa_mc_redirect_url (string, optional): Mobile Connect Redirect URL provided during configuration,mfa_mc_client_id (string, optional),mfa_mc_client_secret (string, optional),mfa_header_html (string, optional): HTML template code displayed before the provider’s vendor-specific authentication area,mfa_footer_html (string, optional): HTML template code displayed after the provider’s vendor-specific authentication area} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "page_name": "", + "description": "", + "vendor_preset": "", + "vendor_ip": "", + "require_https": "", + "webauth": "", + "form_action": "", + "form_method": "", + "form_username_label": "", + "form_username": "", + "form_username_suffix": "", + "form_password_label": "", + "form_password": "", + "form_extra": "", + "submit_label": "", + "form_password_encryption": "", + "uam_secret": "", + "url": "", + "default_url": "", + "default_url_override": false, + "dynamic_address": false, + "dynamic_allowlist": "", + "dynamic_denylist": "", + "access_allowlist": "", + "access_denylist": "", + "access_if_denied": "", + "login_title": "", + "login_header": "", + "login_footer": "", + "login_message": "", + "login_delay": 0, + "login_skin": "", + "login_terms_require": false, + "login_terms_label": "", + "login_terms_text": "", + "login_terms_layout": "", + "login_terms_error": "", + "login_captcha": "", + "username_auth": "", + "certificate_request": "", + "username_auth_username": "", + "certificate_auth": "", + "register_policy_manager": false, + "register_policy_manager_adv": false, + "register_policy_manager_attrs": "", + "hash_url": "", + "hash_secret": "", + "bypass_cna": false, + "capport_venue_url": "", + "onguard_healthcheck": false, + "onguard_agents": "", + "onguard_header": "", + "onguard_footer": "", + "oauth_enabled": false, + "oauth_debug": false, + "oauth_providers": "object", + "login_custom_form": false, + "login_pre_auth_check": "", + "login_pre_auth_error": "", + "mfa_enabled": "", + "mfa_first": "", + "mfa_duo_ikey": "", + "mfa_duo_skey": "", + "mfa_duo_host": "", + "mfa_fn_client_id": "", + "mfa_fn_client_secret": "", + "mfa_fn_factors": "", + "mfa_fn_email": false, + "mfa_iws_tenant": "", + "mfa_iws_app": "", + "mfa_iws_hostname": "", + "mfa_mc_scope": "", + "mfa_mc_context": "", + "mfa_mc_binding_message": "", + "mfa_mc_acr_values": "", + "mfa_mc_display": "", + "mfa_mc_prompt": "", + "mfa_mc_max_age": 0, + "mfa_mc_login_hint": "", + "mfa_mc_version": "", + "mfa_mc_discovery_service_endpoint": "", + "mfa_mc_redirect_url": "", + "mfa_mc_client_id": "", + "mfa_mc_client_secret": "", + "mfa_header_html": "", + "mfa_footer_html": "" + } + """ + url_path = "/weblogin/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_weblogin_by_id(self, id=""): + """ + Operation: Delete a web login page + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/weblogin/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_weblogin_page_name_by_page_name(self, page__name=""): + """ + Operation: Get a web login page by page-name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: page-name, Description: Unique page name of the web login + """ + url_path = "/weblogin/page-name/{page__name}" + dict_path = {"page__name": page__name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_weblogin_page_name_by_page_name(self, page__name="", body=({})): + """ + Operation: Update some fields of a web login page by page-name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: page-name, Description: Unique page name of the web login + Required Body Parameters (body description)- WebLogin {id (integer, optional): Unique ID of the web login,name (string): Enter a name for this web login page,page_name (string, optional): Enter a page name for this web login. + The web login will be accessible from “/guest/page_name.php”,description (string, optional): Comments or descriptive text about the web login,vendor_preset (string): Select a predefined group of settings suitable for standard network configurations,vendor_ip (string, optional): Enter the hostname (FQDN) of the vendor’s product here. + When using Secure Login over HTTPS, this name should match the name of the HTTPS certificate installed on your device,require_https (string, optional): Select a security option to apply to the web login process,webauth (string, optional): Select how the user’s network login will be handled. + Server-initiated logins require the user’s MAC address to be available, usually from the captive portal redirection process,form_action (string): The URL of the NAS device’s login form,form_method (string): Choose the method to use when submitting the login form to the NAS,form_username_label (string, optional): The form label for the username field. + Leave blank to use the default (Username:),form_username (string): The name of the username field for the login form. This will be passed to the NAS device when the form is submitted,form_username_suffix (string, optional): The suffix is automatically appended to the username before submitting the login form to the NAS,form_password_label (string, optional): The form label for the password field. + Leave blank to use the default (Password:),form_password (string): The name of the password field for the login form. This will be passed to the NAS device when the form is submitted,form_extra (string, optional): Specify any additional field names and values to send to the NAS device as name=value pairs, one per line,submit_label (string, optional): The form label for the log in button. + Leave blank to use the default (Log In),form_password_encryption (string): Choose the type of password encryption to use when submitting the login form,uam_secret (string, optional): Enter the shared secret between the NAS device and the web login form,url (string, optional): The name of the destination field required by the NAS,default_url (string, optional): Enter the default URL to redirect clients. + Please ensure you prepend "http://" for any external domain,default_url_override (boolean, optional): If selected, the client’s default destination will be overridden regardless of its value,dynamic_address (boolean, optional): In multi-controller deployments, it is often required to post credentials to different addresses made available as part of the original redirection. + The address above will be used whenever the parameter is not available or fails the requirements below,dynamic_allowlist (string, optional): Enter the IP addresses and networks from which dynamic addresses are permitted,dynamic_denylist (string, optional): Enter the IP addresses and networks from which dynamic addresses are denied,access_allowlist (string, optional): Enter the IP addresses and networks from which logins are permitted,access_denylist (string, optional): Enter the IP addresses and networks that are denied login access,access_if_denied (string): Select the response of the system to a request that is not permitted,login_title (string, optional): The title to display on the web login page. + Leave blank to use the default (Login),login_header (string, optional): HTML template code displayed before the login form,login_footer (string, optional): HTML template code displayed after the login form,login_message (string, optional): HTML template code displayed while the login attempt is in progress,login_delay (number): The time in seconds to delay while displaying the login message,login_skin (string): Choose the skin to use when this web login page is displayed,login_terms_require (boolean, optional): If checked, the user will be forced to accept a Terms and Conditions checkbox,login_terms_label (string, optional): The form label for the terms checkbox. + Leave blank to use the default (Terms:),login_terms_text (string, optional): HTML code containing your Terms and Conditions. + Leave blank to use the default (I accept the terms of use),login_terms_layout (string, optional): Select the layout for the terms and conditions text,login_terms_error (string, optional): The text to display if the terms are not accepted. + Leave blank to use the default (In order to log in, you must accept the terms and conditions.),login_captcha (string, optional): Select a CAPTCHA mode,username_auth (string, optional): Select the authentication requirement. + Access Code requires a single code (username) to be entered. + Anonymous allows a blank form requiring just the terms or a Log In button. A pre-existing account is required. + Auto is similar to anonymous but the page is automatically submitted. + Access Code and Anonymous require the account to have the Username Authentication field set,certificate_request (string, optional): Choose whether the user should select a client certificate when authenticating,username_auth_username (string, optional): The account to use for anonymous authentication. + The password will be visible within the HTML. + It is recommended to increase the account Session Limit to the number of guests you wish to support,certificate_auth (string, optional): Choose whether other credentials must also be provided in addition to a certificate,register_policy_manager (boolean, optional): If selected, the endpoint’s attributes will also be updated with other details from the user account,register_policy_manager_adv (boolean, optional): Customize attributes stored with the endpoint,register_policy_manager_attrs (string, optional): List of name|value pairs to pass along. + user_field | Endpoint Attribute,hash_url (string, optional): Select the level of checking to apply to URL parameters passed to the web login page. + Use this option to detect when URL parameters have been modified by the user, for example their MAC address,hash_secret (string, optional): The redirection URL will be hashed using this shared secret,bypass_cna (boolean, optional): The Apple Captive Network Assistant (CNA) is the pop-up browser shown when joining a network that has a captive portal. + Note that this option may not work with all vendors, depending on how the captive portal is implemented,capport_venue_url (string, optional): Enter an optional URL to send as the Venue Info URL for CAPPORT RFC-8908. + https://www.rfc-editor.org/rfc/rfc8908.html,onguard_healthcheck (boolean, optional): If selected, the guest will be required to pass a health check prior to accessing the network,onguard_agents (string, optional): Select the agent options for client scanning. + Native agents are available for Microsoft Windows and Apple OS X. All other OS will fall back to Java,onguard_header (string, optional): HTML template code displayed before the health check text,onguard_footer (string, optional): HTML template code displayed after the health check text,oauth_enabled (boolean, optional): Enable logins with cloud identity / social network credentials,oauth_debug (boolean, optional): Log debugging data,oauth_providers (object, optional): Configuration for cloud identity authentication providers,login_custom_form (boolean, optional): If selected, you must supply your own HTML login form in the Header or Footer HTML areas,login_pre_auth_check (string): Select how the username and password should be checked before proceeding to the NAS authentication,login_pre_auth_error (string, optional): The text to display if the username and password lookup fails. + Leave blank to use the default (Invalid username or password),mfa_enabled (string, optional),mfa_first (string, optional): All options with credentials must pass the Pre-Auth Check whenever a new user authenticates a device,mfa_duo_ikey (string, optional),mfa_duo_skey (string, optional),mfa_duo_host (string, optional),mfa_fn_client_id (string, optional),mfa_fn_client_secret (string, optional),mfa_fn_factors (string, optional): Enter the number of factors to require,mfa_fn_email (boolean, optional): If disabled, the user must scan the QR code,mfa_iws_tenant (string, optional),mfa_iws_app (string, optional),mfa_iws_hostname (string, optional): Enter the hostname of the ImageWare server,mfa_mc_scope (string, optional): OAuth 2.0 scope value. Only mc_authn is supported for this release,mfa_mc_context (string, optional): Message which will be displayed on the authorization device,mfa_mc_binding_message (string, optional): Plain text reference to interlock the consumption device and authorization device,mfa_mc_acr_values (string, optional): Authentication Context class reference. Values as specified by ISO/IEC 29115 Clause 6,mfa_mc_display (string, optional): User interface display for Authentication,mfa_mc_prompt (string, optional): Value to specify to the Authorisation server about type of prompt,mfa_mc_max_age (integer, optional): Maximum elapsed time in secs since last authenticaiton,mfa_mc_login_hint (string, optional): An indication to IDP on what ID to use for login,mfa_mc_version (string, optional),mfa_mc_discovery_service_endpoint (string, optional): Provide the endpoint URL provided by Mobile Connect during configuration,mfa_mc_redirect_url (string, optional): Mobile Connect Redirect URL provided during configuration,mfa_mc_client_id (string, optional),mfa_mc_client_secret (string, optional),mfa_header_html (string, optional): HTML template code displayed before the provider’s vendor-specific authentication area,mfa_footer_html (string, optional): HTML template code displayed after the provider’s vendor-specific authentication area} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "page_name": "", + "description": "", + "vendor_preset": "", + "vendor_ip": "", + "require_https": "", + "webauth": "", + "form_action": "", + "form_method": "", + "form_username_label": "", + "form_username": "", + "form_username_suffix": "", + "form_password_label": "", + "form_password": "", + "form_extra": "", + "submit_label": "", + "form_password_encryption": "", + "uam_secret": "", + "url": "", + "default_url": "", + "default_url_override": false, + "dynamic_address": false, + "dynamic_allowlist": "", + "dynamic_denylist": "", + "access_allowlist": "", + "access_denylist": "", + "access_if_denied": "", + "login_title": "", + "login_header": "", + "login_footer": "", + "login_message": "", + "login_delay": 0, + "login_skin": "", + "login_terms_require": false, + "login_terms_label": "", + "login_terms_text": "", + "login_terms_layout": "", + "login_terms_error": "", + "login_captcha": "", + "username_auth": "", + "certificate_request": "", + "username_auth_username": "", + "certificate_auth": "", + "register_policy_manager": false, + "register_policy_manager_adv": false, + "register_policy_manager_attrs": "", + "hash_url": "", + "hash_secret": "", + "bypass_cna": false, + "capport_venue_url": "", + "onguard_healthcheck": false, + "onguard_agents": "", + "onguard_header": "", + "onguard_footer": "", + "oauth_enabled": false, + "oauth_debug": false, + "oauth_providers": "object", + "login_custom_form": false, + "login_pre_auth_check": "", + "login_pre_auth_error": "", + "mfa_enabled": "", + "mfa_first": "", + "mfa_duo_ikey": "", + "mfa_duo_skey": "", + "mfa_duo_host": "", + "mfa_fn_client_id": "", + "mfa_fn_client_secret": "", + "mfa_fn_factors": "", + "mfa_fn_email": false, + "mfa_iws_tenant": "", + "mfa_iws_app": "", + "mfa_iws_hostname": "", + "mfa_mc_scope": "", + "mfa_mc_context": "", + "mfa_mc_binding_message": "", + "mfa_mc_acr_values": "", + "mfa_mc_display": "", + "mfa_mc_prompt": "", + "mfa_mc_max_age": 0, + "mfa_mc_login_hint": "", + "mfa_mc_version": "", + "mfa_mc_discovery_service_endpoint": "", + "mfa_mc_redirect_url": "", + "mfa_mc_client_id": "", + "mfa_mc_client_secret": "", + "mfa_header_html": "", + "mfa_footer_html": "" + } + """ + url_path = "/weblogin/page-name/{page__name}" + dict_path = {"page__name": page__name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_weblogin_page_name_by_page_name(self, page__name="", body=({})): + """ + Operation: Replace a web login page by page-name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: page-name, Description: Unique page name of the web login + Required Body Parameters (body description)- WebLogin {id (integer, optional): Unique ID of the web login,name (string): Enter a name for this web login page,page_name (string, optional): Enter a page name for this web login. + The web login will be accessible from “/guest/page_name.php”,description (string, optional): Comments or descriptive text about the web login,vendor_preset (string): Select a predefined group of settings suitable for standard network configurations,vendor_ip (string, optional): Enter the hostname (FQDN) of the vendor’s product here. + When using Secure Login over HTTPS, this name should match the name of the HTTPS certificate installed on your device,require_https (string, optional): Select a security option to apply to the web login process,webauth (string, optional): Select how the user’s network login will be handled. + Server-initiated logins require the user’s MAC address to be available, usually from the captive portal redirection process,form_action (string): The URL of the NAS device’s login form,form_method (string): Choose the method to use when submitting the login form to the NAS,form_username_label (string, optional): The form label for the username field. + Leave blank to use the default (Username:),form_username (string): The name of the username field for the login form. This will be passed to the NAS device when the form is submitted,form_username_suffix (string, optional): The suffix is automatically appended to the username before submitting the login form to the NAS,form_password_label (string, optional): The form label for the password field. + Leave blank to use the default (Password:),form_password (string): The name of the password field for the login form. This will be passed to the NAS device when the form is submitted,form_extra (string, optional): Specify any additional field names and values to send to the NAS device as name=value pairs, one per line,submit_label (string, optional): The form label for the log in button. + Leave blank to use the default (Log In),form_password_encryption (string): Choose the type of password encryption to use when submitting the login form,uam_secret (string, optional): Enter the shared secret between the NAS device and the web login form,url (string, optional): The name of the destination field required by the NAS,default_url (string, optional): Enter the default URL to redirect clients. + Please ensure you prepend "http://" for any external domain,default_url_override (boolean, optional): If selected, the client’s default destination will be overridden regardless of its value,dynamic_address (boolean, optional): In multi-controller deployments, it is often required to post credentials to different addresses made available as part of the original redirection. + The address above will be used whenever the parameter is not available or fails the requirements below,dynamic_allowlist (string, optional): Enter the IP addresses and networks from which dynamic addresses are permitted,dynamic_denylist (string, optional): Enter the IP addresses and networks from which dynamic addresses are denied,access_allowlist (string, optional): Enter the IP addresses and networks from which logins are permitted,access_denylist (string, optional): Enter the IP addresses and networks that are denied login access,access_if_denied (string): Select the response of the system to a request that is not permitted,login_title (string, optional): The title to display on the web login page. + Leave blank to use the default (Login),login_header (string, optional): HTML template code displayed before the login form,login_footer (string, optional): HTML template code displayed after the login form,login_message (string, optional): HTML template code displayed while the login attempt is in progress,login_delay (number): The time in seconds to delay while displaying the login message,login_skin (string): Choose the skin to use when this web login page is displayed,login_terms_require (boolean, optional): If checked, the user will be forced to accept a Terms and Conditions checkbox,login_terms_label (string, optional): The form label for the terms checkbox. + Leave blank to use the default (Terms:),login_terms_text (string, optional): HTML code containing your Terms and Conditions. + Leave blank to use the default (I accept the terms of use),login_terms_layout (string, optional): Select the layout for the terms and conditions text,login_terms_error (string, optional): The text to display if the terms are not accepted. + Leave blank to use the default (In order to log in, you must accept the terms and conditions.),login_captcha (string, optional): Select a CAPTCHA mode,username_auth (string, optional): Select the authentication requirement. + Access Code requires a single code (username) to be entered. + Anonymous allows a blank form requiring just the terms or a Log In button. A pre-existing account is required. + Auto is similar to anonymous but the page is automatically submitted. + Access Code and Anonymous require the account to have the Username Authentication field set,certificate_request (string, optional): Choose whether the user should select a client certificate when authenticating,username_auth_username (string, optional): The account to use for anonymous authentication. + The password will be visible within the HTML. + It is recommended to increase the account Session Limit to the number of guests you wish to support,certificate_auth (string, optional): Choose whether other credentials must also be provided in addition to a certificate,register_policy_manager (boolean, optional): If selected, the endpoint’s attributes will also be updated with other details from the user account,register_policy_manager_adv (boolean, optional): Customize attributes stored with the endpoint,register_policy_manager_attrs (string, optional): List of name|value pairs to pass along. + user_field | Endpoint Attribute,hash_url (string, optional): Select the level of checking to apply to URL parameters passed to the web login page. + Use this option to detect when URL parameters have been modified by the user, for example their MAC address,hash_secret (string, optional): The redirection URL will be hashed using this shared secret,bypass_cna (boolean, optional): The Apple Captive Network Assistant (CNA) is the pop-up browser shown when joining a network that has a captive portal. + Note that this option may not work with all vendors, depending on how the captive portal is implemented,capport_venue_url (string, optional): Enter an optional URL to send as the Venue Info URL for CAPPORT RFC-8908. + https://www.rfc-editor.org/rfc/rfc8908.html,onguard_healthcheck (boolean, optional): If selected, the guest will be required to pass a health check prior to accessing the network,onguard_agents (string, optional): Select the agent options for client scanning. + Native agents are available for Microsoft Windows and Apple OS X. All other OS will fall back to Java,onguard_header (string, optional): HTML template code displayed before the health check text,onguard_footer (string, optional): HTML template code displayed after the health check text,oauth_enabled (boolean, optional): Enable logins with cloud identity / social network credentials,oauth_debug (boolean, optional): Log debugging data,oauth_providers (object, optional): Configuration for cloud identity authentication providers,login_custom_form (boolean, optional): If selected, you must supply your own HTML login form in the Header or Footer HTML areas,login_pre_auth_check (string): Select how the username and password should be checked before proceeding to the NAS authentication,login_pre_auth_error (string, optional): The text to display if the username and password lookup fails. + Leave blank to use the default (Invalid username or password),mfa_enabled (string, optional),mfa_first (string, optional): All options with credentials must pass the Pre-Auth Check whenever a new user authenticates a device,mfa_duo_ikey (string, optional),mfa_duo_skey (string, optional),mfa_duo_host (string, optional),mfa_fn_client_id (string, optional),mfa_fn_client_secret (string, optional),mfa_fn_factors (string, optional): Enter the number of factors to require,mfa_fn_email (boolean, optional): If disabled, the user must scan the QR code,mfa_iws_tenant (string, optional),mfa_iws_app (string, optional),mfa_iws_hostname (string, optional): Enter the hostname of the ImageWare server,mfa_mc_scope (string, optional): OAuth 2.0 scope value. Only mc_authn is supported for this release,mfa_mc_context (string, optional): Message which will be displayed on the authorization device,mfa_mc_binding_message (string, optional): Plain text reference to interlock the consumption device and authorization device,mfa_mc_acr_values (string, optional): Authentication Context class reference. Values as specified by ISO/IEC 29115 Clause 6,mfa_mc_display (string, optional): User interface display for Authentication,mfa_mc_prompt (string, optional): Value to specify to the Authorisation server about type of prompt,mfa_mc_max_age (integer, optional): Maximum elapsed time in secs since last authenticaiton,mfa_mc_login_hint (string, optional): An indication to IDP on what ID to use for login,mfa_mc_version (string, optional),mfa_mc_discovery_service_endpoint (string, optional): Provide the endpoint URL provided by Mobile Connect during configuration,mfa_mc_redirect_url (string, optional): Mobile Connect Redirect URL provided during configuration,mfa_mc_client_id (string, optional),mfa_mc_client_secret (string, optional),mfa_header_html (string, optional): HTML template code displayed before the provider’s vendor-specific authentication area,mfa_footer_html (string, optional): HTML template code displayed after the provider’s vendor-specific authentication area} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "page_name": "", + "description": "", + "vendor_preset": "", + "vendor_ip": "", + "require_https": "", + "webauth": "", + "form_action": "", + "form_method": "", + "form_username_label": "", + "form_username": "", + "form_username_suffix": "", + "form_password_label": "", + "form_password": "", + "form_extra": "", + "submit_label": "", + "form_password_encryption": "", + "uam_secret": "", + "url": "", + "default_url": "", + "default_url_override": false, + "dynamic_address": false, + "dynamic_allowlist": "", + "dynamic_denylist": "", + "access_allowlist": "", + "access_denylist": "", + "access_if_denied": "", + "login_title": "", + "login_header": "", + "login_footer": "", + "login_message": "", + "login_delay": 0, + "login_skin": "", + "login_terms_require": false, + "login_terms_label": "", + "login_terms_text": "", + "login_terms_layout": "", + "login_terms_error": "", + "login_captcha": "", + "username_auth": "", + "certificate_request": "", + "username_auth_username": "", + "certificate_auth": "", + "register_policy_manager": false, + "register_policy_manager_adv": false, + "register_policy_manager_attrs": "", + "hash_url": "", + "hash_secret": "", + "bypass_cna": false, + "capport_venue_url": "", + "onguard_healthcheck": false, + "onguard_agents": "", + "onguard_header": "", + "onguard_footer": "", + "oauth_enabled": false, + "oauth_debug": false, + "oauth_providers": "object", + "login_custom_form": false, + "login_pre_auth_check": "", + "login_pre_auth_error": "", + "mfa_enabled": "", + "mfa_first": "", + "mfa_duo_ikey": "", + "mfa_duo_skey": "", + "mfa_duo_host": "", + "mfa_fn_client_id": "", + "mfa_fn_client_secret": "", + "mfa_fn_factors": "", + "mfa_fn_email": false, + "mfa_iws_tenant": "", + "mfa_iws_app": "", + "mfa_iws_hostname": "", + "mfa_mc_scope": "", + "mfa_mc_context": "", + "mfa_mc_binding_message": "", + "mfa_mc_acr_values": "", + "mfa_mc_display": "", + "mfa_mc_prompt": "", + "mfa_mc_max_age": 0, + "mfa_mc_login_hint": "", + "mfa_mc_version": "", + "mfa_mc_discovery_service_endpoint": "", + "mfa_mc_redirect_url": "", + "mfa_mc_client_id": "", + "mfa_mc_client_secret": "", + "mfa_header_html": "", + "mfa_footer_html": "" + } + """ + url_path = "/weblogin/page-name/{page__name}" + dict_path = {"page__name": page__name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_weblogin_page_name_by_page_name(self, page__name=""): + """ + Operation: Delete a web login page by page-name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: page-name, Description: Unique page name of the web login + """ + url_path = "/weblogin/page-name/{page__name}" + dict_path = {"page__name": page__name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_identities_v1.py b/pyclearpass/api_explorer_identities_v1.py new file mode 100644 index 0000000..54eeac5 --- /dev/null +++ b/pyclearpass/api_explorer_identities_v1.py @@ -0,0 +1,1427 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_identities_v1.py + + +class ApiIdentities(ClearPassAPILogin): + # Function Section Name:ApiClient + # Function Section Description: Manage API clients at Administration -> API Services -> API Clients + + def get_api_client( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of API clients + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/api-client" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_api_client(self, body=({})): + """ + Operation: Create a new API client + HTTP Status Response Codes: 201 Created, 400 Client Error, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 400 Client Error, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ApiClient {access_lifetime (string, optional): Lifetime of an OAuth2 access token,access_token_lifetime (string): Specify the lifetime of an OAuth2 access token,access_token_lifetime_units (string): Specify the lifetime of an OAuth2 access token,auto_confirm (integer, optional): Not supported at this time,client_description (string, optional): Use this field to store comments or notes about this API client,client_id (string): The unique string identifying this API client. Use this value in the OAuth2 “client_id” parameter,client_public (boolean, optional): Public clients have no client secret,client_refresh (boolean, optional): An OAuth2 refresh token may be used to obtain an updated access token. + Use grant_type=refresh_token for this,client_secret (string, optional): Use this value in the OAuth2 “client_secret” parameter. NOTE: This value is encrypted when stored and cannot be retrieved.,enabled (boolean, optional): Enable API client,id (string): The unique string identifying this API client. Use this value in the OAuth2 “client_id” parameter,grant_types (string, optional): Only the selected authentication method will be permitted for use with this client ID,profile_id (integer, optional): The operator profile applies role-based access control to authorized OAuth2 clients. + This determines what API objects and methods are available for use,profile_name (string, optional): Name of operator profile,redirect_uri (string, optional): Not supported at this time,refresh_lifetime (string, optional): Lifetime of an OAuth2 refresh token,refresh_token_lifetime (string): Specify the lifetime of an OAuth2 refresh token,refresh_token_lifetime_units (string): Specify the lifetime of an OAuth2 refresh token,scope (string, optional): Not supported at this time,user_id (string, optional): Not supported at this time} + Required Body Parameters (type(dict) body example)- { + "access_lifetime": "", + "access_token_lifetime": "", + "access_token_lifetime_units": "", + "auto_confirm": 0, + "client_description": "", + "client_id": "", + "client_public": false, + "client_refresh": false, + "client_secret": "", + "enabled": false, + "id": "", + "grant_types": "", + "profile_id": 0, + "profile_name": "", + "redirect_uri": "", + "refresh_lifetime": "", + "refresh_token_lifetime": "", + "refresh_token_lifetime_units": "", + "scope": "", + "user_id": "" + } + """ + url_path = "/api-client" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_api_client_by_client_id(self, client_id=""): + """ + Operation: Get an API client + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: client_id, Description: URL parameter client_id + """ + url_path = "/api-client/{client_id}" + dict_path = {"client_id": client_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_api_client_by_client_id(self, client_id="", body=({})): + """ + Operation: Update some fields of an API client + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 400 Client Error, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 400 Client Error, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: client_id, Description: URL parameter client_id + Required Body Parameters (body description)- ApiClient {access_lifetime (string, optional): Lifetime of an OAuth2 access token,access_token_lifetime (string): Specify the lifetime of an OAuth2 access token,access_token_lifetime_units (string): Specify the lifetime of an OAuth2 access token,auto_confirm (integer, optional): Not supported at this time,client_description (string, optional): Use this field to store comments or notes about this API client,client_id (string): The unique string identifying this API client. Use this value in the OAuth2 “client_id” parameter,client_public (boolean, optional): Public clients have no client secret,client_refresh (boolean, optional): An OAuth2 refresh token may be used to obtain an updated access token. + Use grant_type=refresh_token for this,client_secret (string, optional): Use this value in the OAuth2 “client_secret” parameter. NOTE: This value is encrypted when stored and cannot be retrieved.,enabled (boolean, optional): Enable API client,id (string): The unique string identifying this API client. Use this value in the OAuth2 “client_id” parameter,grant_types (string, optional): Only the selected authentication method will be permitted for use with this client ID,profile_id (integer, optional): The operator profile applies role-based access control to authorized OAuth2 clients. + This determines what API objects and methods are available for use,profile_name (string, optional): Name of operator profile,redirect_uri (string, optional): Not supported at this time,refresh_lifetime (string, optional): Lifetime of an OAuth2 refresh token,refresh_token_lifetime (string): Specify the lifetime of an OAuth2 refresh token,refresh_token_lifetime_units (string): Specify the lifetime of an OAuth2 refresh token,scope (string, optional): Not supported at this time,user_id (string, optional): Not supported at this time} + Required Body Parameters (type(dict) body example)- { + "access_lifetime": "", + "access_token_lifetime": "", + "access_token_lifetime_units": "", + "auto_confirm": 0, + "client_description": "", + "client_id": "", + "client_public": false, + "client_refresh": false, + "client_secret": "", + "enabled": false, + "id": "", + "grant_types": "", + "profile_id": 0, + "profile_name": "", + "redirect_uri": "", + "refresh_lifetime": "", + "refresh_token_lifetime": "", + "refresh_token_lifetime_units": "", + "scope": "", + "user_id": "" + } + """ + url_path = "/api-client/{client_id}" + dict_path = {"client_id": client_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_api_client_by_client_id(self, client_id="", body=({})): + """ + Operation: Replace an API client + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 400 Client Error, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 400 Client Error, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: client_id, Description: URL parameter client_id + Required Body Parameters (body description)- ApiClient {access_lifetime (string, optional): Lifetime of an OAuth2 access token,access_token_lifetime (string): Specify the lifetime of an OAuth2 access token,access_token_lifetime_units (string): Specify the lifetime of an OAuth2 access token,auto_confirm (integer, optional): Not supported at this time,client_description (string, optional): Use this field to store comments or notes about this API client,client_id (string): The unique string identifying this API client. Use this value in the OAuth2 “client_id” parameter,client_public (boolean, optional): Public clients have no client secret,client_refresh (boolean, optional): An OAuth2 refresh token may be used to obtain an updated access token. + Use grant_type=refresh_token for this,client_secret (string, optional): Use this value in the OAuth2 “client_secret” parameter. NOTE: This value is encrypted when stored and cannot be retrieved.,enabled (boolean, optional): Enable API client,id (string): The unique string identifying this API client. Use this value in the OAuth2 “client_id” parameter,grant_types (string, optional): Only the selected authentication method will be permitted for use with this client ID,profile_id (integer, optional): The operator profile applies role-based access control to authorized OAuth2 clients. + This determines what API objects and methods are available for use,profile_name (string, optional): Name of operator profile,redirect_uri (string, optional): Not supported at this time,refresh_lifetime (string, optional): Lifetime of an OAuth2 refresh token,refresh_token_lifetime (string): Specify the lifetime of an OAuth2 refresh token,refresh_token_lifetime_units (string): Specify the lifetime of an OAuth2 refresh token,scope (string, optional): Not supported at this time,user_id (string, optional): Not supported at this time} + Required Body Parameters (type(dict) body example)- { + "access_lifetime": "", + "access_token_lifetime": "", + "access_token_lifetime_units": "", + "auto_confirm": 0, + "client_description": "", + "client_id": "", + "client_public": false, + "client_refresh": false, + "client_secret": "", + "enabled": false, + "id": "", + "grant_types": "", + "profile_id": 0, + "profile_name": "", + "redirect_uri": "", + "refresh_lifetime": "", + "refresh_token_lifetime": "", + "refresh_token_lifetime_units": "", + "scope": "", + "user_id": "" + } + """ + url_path = "/api-client/{client_id}" + dict_path = {"client_id": client_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_api_client_by_client_id(self, client_id=""): + """ + Operation: Delete an API client + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: client_id, Description: URL parameter client_id + """ + url_path = "/api-client/{client_id}" + dict_path = {"client_id": client_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:DenyListedUsers + # Function Section Description: Manage deny listed users + + def get_deny_listed_users( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of deny listed users + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/deny-listed-users" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_deny_listed_users_by_deny_listed_users_id(self, deny_listed_users_id=""): + """ + Operation: Get a deny listed user + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: deny_listed_users_id, Description: Numeric ID of the deny listed user + """ + url_path = "/deny-listed-users/{deny_listed_users_id}" + dict_path = {"deny_listed_users_id": deny_listed_users_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def delete_deny_listed_users_by_deny_listed_users_id(self, deny_listed_users_id=""): + """ + Operation: Delete a deny listed user + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: deny_listed_users_id, Description: Numeric ID of the deny listed user + """ + url_path = "/deny-listed-users/{deny_listed_users_id}" + dict_path = {"deny_listed_users_id": deny_listed_users_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_deny_listed_users_user_id_by_user_id_mac_address_mac_address( + self, user_id="", mac_address="" + ): + """ + Operation: Get a deny listed user by Username and MAC Address + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: user_id, Description: User ID of the deny listed user + Required Path Parameter Name: mac_address, Description: MAC address of the deny listed user + """ + url_path = "/deny-listed-users/user_id/{user_id}/mac_address/{mac_address}" + dict_path = {"user_id": user_id, "mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def delete_deny_listed_users_user_id_by_user_id_mac_address_mac_address( + self, user_id="", mac_address="" + ): + """ + Operation: Delete a deny listed user by Username and MAC Address + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: user_id, Description: User ID of the deny listed user + Required Path Parameter Name: mac_address, Description: MAC address of the deny listed user + """ + url_path = "/deny-listed-users/user_id/{user_id}/mac_address/{mac_address}" + dict_path = {"user_id": user_id, "mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:Device + # Function Section Description: Manage device accounts + + def get_device(self, filter="", sort="", offset="", limit="", calculate_count=""): + """ + Operation: Get a list of device accounts + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default -id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/device" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_device(self, body=({}), change_of_authorization=""): + """ + Operation: Create a new device account + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- DeviceCreate {create_time (string, optional): Time at which the account was created,current_state (string, optional) = ['active' or 'disabled' or 'expired' or 'pending']: Read-only property indicating the current state of the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,mac (string): MAC address of the device,notes (string, optional): Comments or notes stored with the account,role_id (integer): Role to assign to the account,role_name (string, optional): Name of the role assigned to the account,source (string, optional): Origin of the account,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Numeric operator profile ID for the account’s sponsor,sponsor_profile_name (string, optional): Name of the operator profile for the account’s sponsor,start_time (string, optional): Time at which the account will be enabled,visitor_name (string, optional): Name to display for the account,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "current_state": "", + "enabled": false, + "expire_time": "", + "mac": "", + "notes": "", + "role_id": 0, + "role_name": "", + "source": "", + "sponsor_name": "", + "sponsor_profile": "", + "sponsor_profile_name": "", + "start_time": "", + "visitor_name": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/device" + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_device_by_device_id(self, device_id=""): + """ + Operation: Get a device account + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: device_id, Description: Numeric ID of the device account + """ + url_path = "/device/{device_id}" + dict_path = {"device_id": device_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_device_by_device_id( + self, device_id="", body=({}), change_of_authorization="" + ): + """ + Operation: Update some fields of a device account + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: device_id, Description: Numeric ID of the device account + Required Body Parameters (body description)- DeviceUpdate {create_time (string, optional): Time at which the account was created,current_state (string, optional) = ['active' or 'disabled' or 'expired' or 'pending']: Read-only property indicating the current state of the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the device account (cannot be changed),mac (string, optional): MAC address of the device,mac_auth (boolean, optional): Flag indicating the account is a device, always set to true,notes (string, optional): Comments or notes stored with the account,password (string, optional),role_id (integer, optional): Role to assign to the account,role_name (string, optional): Name of the role assigned to the account,source (string, optional): Origin of the account,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Numeric operator profile ID for the account’s sponsor,sponsor_profile_name (string, optional): Name of the operator profile for the account’s sponsor,start_time (string, optional): Time at which the account will be enabled,username (string, optional),visitor_name (string, optional): Name to display for the account,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "current_state": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "mac_auth": false, + "notes": "", + "password": "", + "role_id": 0, + "role_name": "", + "source": "", + "sponsor_name": "", + "sponsor_profile": "", + "sponsor_profile_name": "", + "start_time": "", + "username": "", + "visitor_name": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/device/{device_id}" + dict_path = {"device_id": device_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_device_by_device_id( + self, device_id="", body=({}), change_of_authorization="" + ): + """ + Operation: Replace a device account + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: device_id, Description: Numeric ID of the device account + Required Body Parameters (body description)- DeviceReplace {create_time (string, optional): Time at which the account was created,current_state (string, optional) = ['active' or 'disabled' or 'expired' or 'pending']: Read-only property indicating the current state of the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the device account (cannot be changed),mac (string): MAC address of the device,notes (string, optional): Comments or notes stored with the account,role_id (integer): Role to assign to the account,role_name (string, optional): Name of the role assigned to the account,source (string, optional): Origin of the account,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Numeric operator profile ID for the account’s sponsor,sponsor_profile_name (string, optional): Name of the operator profile for the account’s sponsor,start_time (string, optional): Time at which the account will be enabled,visitor_name (string, optional): Name to display for the account,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "current_state": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "notes": "", + "role_id": 0, + "role_name": "", + "source": "", + "sponsor_name": "", + "sponsor_profile": "", + "sponsor_profile_name": "", + "start_time": "", + "visitor_name": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/device/{device_id}" + dict_path = {"device_id": device_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_device_by_device_id(self, device_id="", change_of_authorization=""): + """ + Operation: Delete a device account + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: device_id, Description: Numeric ID of the device account + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/device/{device_id}" + dict_path = {"device_id": device_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_device_mac_by_macaddr(self, macaddr=""): + """ + Operation: Get a device account by MAC address + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: macaddr, Description: MAC address of the device account + """ + url_path = "/device/mac/{macaddr}" + dict_path = {"macaddr": macaddr} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_device_mac_by_macaddr( + self, macaddr="", body=({}), change_of_authorization="" + ): + """ + Operation: Update some fields of a device account by MAC address + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: macaddr, Description: MAC address of the device account + Required Body Parameters (body description)- DeviceUpdate {create_time (string, optional): Time at which the account was created,current_state (string, optional) = ['active' or 'disabled' or 'expired' or 'pending']: Read-only property indicating the current state of the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the device account (cannot be changed),mac (string, optional): MAC address of the device,mac_auth (boolean, optional): Flag indicating the account is a device, always set to true,notes (string, optional): Comments or notes stored with the account,password (string, optional),role_id (integer, optional): Role to assign to the account,role_name (string, optional): Name of the role assigned to the account,source (string, optional): Origin of the account,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Numeric operator profile ID for the account’s sponsor,sponsor_profile_name (string, optional): Name of the operator profile for the account’s sponsor,start_time (string, optional): Time at which the account will be enabled,username (string, optional),visitor_name (string, optional): Name to display for the account,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "current_state": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "mac_auth": false, + "notes": "", + "password": "", + "role_id": 0, + "role_name": "", + "source": "", + "sponsor_name": "", + "sponsor_profile": "", + "sponsor_profile_name": "", + "start_time": "", + "username": "", + "visitor_name": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/device/mac/{macaddr}" + dict_path = {"macaddr": macaddr} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_device_mac_by_macaddr( + self, macaddr="", body=({}), change_of_authorization="" + ): + """ + Operation: Replace a device account by MAC address + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: macaddr, Description: MAC address of the device account + Required Body Parameters (body description)- DeviceReplace {create_time (string, optional): Time at which the account was created,current_state (string, optional) = ['active' or 'disabled' or 'expired' or 'pending']: Read-only property indicating the current state of the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the device account (cannot be changed),mac (string): MAC address of the device,notes (string, optional): Comments or notes stored with the account,role_id (integer): Role to assign to the account,role_name (string, optional): Name of the role assigned to the account,source (string, optional): Origin of the account,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Numeric operator profile ID for the account’s sponsor,sponsor_profile_name (string, optional): Name of the operator profile for the account’s sponsor,start_time (string, optional): Time at which the account will be enabled,visitor_name (string, optional): Name to display for the account,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "current_state": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "notes": "", + "role_id": 0, + "role_name": "", + "source": "", + "sponsor_name": "", + "sponsor_profile": "", + "sponsor_profile_name": "", + "start_time": "", + "visitor_name": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/device/mac/{macaddr}" + dict_path = {"macaddr": macaddr} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_device_mac_by_macaddr(self, macaddr="", change_of_authorization=""): + """ + Operation: Delete a device account by MAC address + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: macaddr, Description: MAC address of the device account + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/device/mac/{macaddr}" + dict_path = {"macaddr": macaddr} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:Endpoint + # Function Section Description: Manage endpoints + + def get_endpoint(self, filter="", sort="", offset="", limit="", calculate_count=""): + """ + Operation: Get a list of endpoints + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/endpoint" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_endpoint(self, body=({})): + """ + Operation: Create a new endpoint + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- EndpointCreate {mac_address (string): MAC Address of the endpoint,description (string, optional): Description of the endpoint,status (string) = ['Known' or 'Unknown' or 'Disabled']: Status of the endpoint,device_insight_tags (string, optional): List of Device Insight Tags,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the endpoint} + Required Body Parameters (type(dict) body example)- { + "mac_address": "", + "description": "", + "status": "", + "device_insight_tags": "", + "attributes": "object" + } + """ + url_path = "/endpoint" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_endpoint_by_endpoint_id(self, endpoint_id=""): + """ + Operation: Get an endpoint + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: endpoint_id, Description: Numeric ID of the endpoint + """ + url_path = "/endpoint/{endpoint_id}" + dict_path = {"endpoint_id": endpoint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_endpoint_by_endpoint_id(self, endpoint_id="", body=({})): + """ + Operation: Update some fields of an endpoint + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: endpoint_id, Description: Numeric ID of the endpoint + Required Body Parameters (body description)- EndpointUpdate {mac_address (string, optional): MAC Address of the endpoint,description (string, optional): Description of the endpoint,status (string, optional) = ['Known' or 'Unknown' or 'Disabled']: Status of the endpoint,device_insight_tags (string, optional): List of Device Insight Tags,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the endpoint} + Required Body Parameters (type(dict) body example)- { + "mac_address": "", + "description": "", + "status": "", + "device_insight_tags": "", + "attributes": "object" + } + """ + url_path = "/endpoint/{endpoint_id}" + dict_path = {"endpoint_id": endpoint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_endpoint_by_endpoint_id(self, endpoint_id="", body=({})): + """ + Operation: Replace an endpoint + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: endpoint_id, Description: Numeric ID of the endpoint + Required Body Parameters (body description)- EndpointReplace {mac_address (string): MAC Address of the endpoint,description (string, optional): Description of the endpoint,status (string) = ['Known' or 'Unknown' or 'Disabled']: Status of the endpoint,device_insight_tags (string, optional): List of Device Insight Tags,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the endpoint} + Required Body Parameters (type(dict) body example)- { + "mac_address": "", + "description": "", + "status": "", + "device_insight_tags": "", + "attributes": "object" + } + """ + url_path = "/endpoint/{endpoint_id}" + dict_path = {"endpoint_id": endpoint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_endpoint_by_endpoint_id(self, endpoint_id=""): + """ + Operation: Delete an endpoint + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: endpoint_id, Description: Numeric ID of the endpoint + """ + url_path = "/endpoint/{endpoint_id}" + dict_path = {"endpoint_id": endpoint_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_endpoint_mac_address_by_mac_address(self, mac_address=""): + """ + Operation: Get an endpoint by mac_address + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: mac_address, Description: Unique mac_address of the endpoint + """ + url_path = "/endpoint/mac-address/{mac_address}" + dict_path = {"mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_endpoint_mac_address_by_mac_address(self, mac_address="", body=({})): + """ + Operation: Update some fields of an endpoint by mac_address + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: mac_address, Description: Unique mac_address of the endpoint + Required Body Parameters (body description)- EndpointUpdate {mac_address (string, optional): MAC Address of the endpoint,description (string, optional): Description of the endpoint,status (string, optional) = ['Known' or 'Unknown' or 'Disabled']: Status of the endpoint,device_insight_tags (string, optional): List of Device Insight Tags,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the endpoint} + Required Body Parameters (type(dict) body example)- { + "mac_address": "", + "description": "", + "status": "", + "device_insight_tags": "", + "attributes": "object" + } + """ + url_path = "/endpoint/mac-address/{mac_address}" + dict_path = {"mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_endpoint_mac_address_by_mac_address(self, mac_address="", body=({})): + """ + Operation: Replace an endpoint by mac_address + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: mac_address, Description: Unique mac_address of the endpoint + Required Body Parameters (body description)- EndpointReplace {mac_address (string): MAC Address of the endpoint,description (string, optional): Description of the endpoint,status (string) = ['Known' or 'Unknown' or 'Disabled']: Status of the endpoint,device_insight_tags (string, optional): List of Device Insight Tags,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the endpoint} + Required Body Parameters (type(dict) body example)- { + "mac_address": "", + "description": "", + "status": "", + "device_insight_tags": "", + "attributes": "object" + } + """ + url_path = "/endpoint/mac-address/{mac_address}" + dict_path = {"mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_endpoint_mac_address_by_mac_address(self, mac_address=""): + """ + Operation: Delete an endpoint by mac_address + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: mac_address, Description: Unique mac_address of the endpoint + """ + url_path = "/endpoint/mac-address/{mac_address}" + dict_path = {"mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:ExternalAccount + # Function Section Description: Manage external accounts + + def get_external_account( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of external accounts + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/external-account" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_external_account(self, body=({})): + """ + Operation: Add an external account + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ExternalAccountCreate {name (string): Name of the external account,type (string) = ['SSH' or 'Domain' or 'SNMP']: Type of the external account,description (string, optional): Description of the external account,username (string, optional): User name for the external account,password (string, optional): Password for the external account,domain (string, optional): Domain for WMI external account,enable_password (string, optional): Enable-password for SSH external account,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP Version for SNMP external account,community (string, optional): Community string for V1 and V2C SNMP external account,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level for V3 SNMP external account,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authorization protocol for V3 SNMP external account,auth_key (string, optional): Authorization key for V3 SNMP external account,priv_protocol (string, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy protocol for V3 SNMP external account,priv_key (string, optional): Privacy key for V3 SNMP external account} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "description": "", + "username": "", + "password": "", + "domain": "", + "enable_password": "", + "snmp_version": "", + "community": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "priv_protocol": "", + "priv_key": "" + } + """ + url_path = "/external-account" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_external_account_by_external_account_id(self, external_account_id=""): + """ + Operation: Get an external account + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: external_account_id, Description: Numeric ID of external account + """ + url_path = "/external-account/{external_account_id}" + dict_path = {"external_account_id": external_account_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_external_account_by_external_account_id( + self, external_account_id="", body=({}) + ): + """ + Operation: Update some fields of an external account + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: external_account_id, Description: Numeric ID of external account + Required Body Parameters (body description)- ExternalAccountUpdate {name (string, optional): Name of the external account,type (string, optional) = ['SSH' or 'Domain' or 'SNMP']: Type of the external account,description (string, optional): Description of the external account,username (string, optional): User name for the external account,password (string, optional): Password for the external account,domain (string, optional): Domain for WMI external account,enable_password (string, optional): Enable-password for SSH external account,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP Version for SNMP external account,community (string, optional): Community string for V1 and V2C SNMP external account,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level for V3 SNMP external account,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authorization protocol for V3 SNMP external account,auth_key (string, optional): Authorization key for V3 SNMP external account,priv_protocol (string, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy protocol for V3 SNMP external account,priv_key (string, optional): Privacy key for V3 SNMP external account} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "description": "", + "username": "", + "password": "", + "domain": "", + "enable_password": "", + "snmp_version": "", + "community": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "priv_protocol": "", + "priv_key": "" + } + """ + url_path = "/external-account/{external_account_id}" + dict_path = {"external_account_id": external_account_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_external_account_by_external_account_id( + self, external_account_id="", body=({}) + ): + """ + Operation: Replace an external account + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: external_account_id, Description: Numeric ID of external account + Required Body Parameters (body description)- ExternalAccountReplace {name (string): Name of the external account,type (string) = ['SSH' or 'Domain' or 'SNMP']: Type of the external account,description (string, optional): Description of the external account,username (string, optional): User name for the external account,password (string, optional): Password for the external account,domain (string, optional): Domain for WMI external account,enable_password (string, optional): Enable-password for SSH external account,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP Version for SNMP external account,community (string, optional): Community string for V1 and V2C SNMP external account,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level for V3 SNMP external account,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authorization protocol for V3 SNMP external account,auth_key (string, optional): Authorization key for V3 SNMP external account,priv_protocol (string, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy protocol for V3 SNMP external account,priv_key (string, optional): Privacy key for V3 SNMP external account} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "description": "", + "username": "", + "password": "", + "domain": "", + "enable_password": "", + "snmp_version": "", + "community": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "priv_protocol": "", + "priv_key": "" + } + """ + url_path = "/external-account/{external_account_id}" + dict_path = {"external_account_id": external_account_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_external_account_by_external_account_id(self, external_account_id=""): + """ + Operation: Delete an external account + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: external_account_id, Description: Numeric ID of external account + """ + url_path = "/external-account/{external_account_id}" + dict_path = {"external_account_id": external_account_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_external_account_name_by_name(self, name=""): + """ + Operation: Get an external account by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of external account + """ + url_path = "/external-account/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_external_account_name_by_name(self, name="", body=({})): + """ + Operation: Update some fields of an external account by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of external account + Required Body Parameters (body description)- ExternalAccountUpdate {name (string, optional): Name of the external account,type (string, optional) = ['SSH' or 'Domain' or 'SNMP']: Type of the external account,description (string, optional): Description of the external account,username (string, optional): User name for the external account,password (string, optional): Password for the external account,domain (string, optional): Domain for WMI external account,enable_password (string, optional): Enable-password for SSH external account,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP Version for SNMP external account,community (string, optional): Community string for V1 and V2C SNMP external account,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level for V3 SNMP external account,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authorization protocol for V3 SNMP external account,auth_key (string, optional): Authorization key for V3 SNMP external account,priv_protocol (string, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy protocol for V3 SNMP external account,priv_key (string, optional): Privacy key for V3 SNMP external account} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "description": "", + "username": "", + "password": "", + "domain": "", + "enable_password": "", + "snmp_version": "", + "community": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "priv_protocol": "", + "priv_key": "" + } + """ + url_path = "/external-account/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_external_account_name_by_name(self, name="", body=({})): + """ + Operation: Replace an external account by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of external account + Required Body Parameters (body description)- ExternalAccountReplace {name (string): Name of the external account,type (string) = ['SSH' or 'Domain' or 'SNMP']: Type of the external account,description (string, optional): Description of the external account,username (string, optional): User name for the external account,password (string, optional): Password for the external account,domain (string, optional): Domain for WMI external account,enable_password (string, optional): Enable-password for SSH external account,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP Version for SNMP external account,community (string, optional): Community string for V1 and V2C SNMP external account,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level for V3 SNMP external account,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authorization protocol for V3 SNMP external account,auth_key (string, optional): Authorization key for V3 SNMP external account,priv_protocol (string, optional) = ['DES_CBC' or 'AES_128' or 'AES_192' or 'AES_256']: Privacy protocol for V3 SNMP external account,priv_key (string, optional): Privacy key for V3 SNMP external account} + Required Body Parameters (type(dict) body example)- { + "name": "", + "type": "", + "description": "", + "username": "", + "password": "", + "domain": "", + "enable_password": "", + "snmp_version": "", + "community": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "priv_protocol": "", + "priv_key": "" + } + """ + url_path = "/external-account/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_external_account_name_by_name(self, name=""): + """ + Operation: Delete an external account by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of external account + """ + url_path = "/external-account/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:GuestUser + # Function Section Description: Manage guest accounts + + def get_guest(self, filter="", sort="", offset="", limit="", calculate_count=""): + """ + Operation: Get a list of guest accounts + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default -id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/guest" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_guest(self, body=({}), change_of_authorization=""): + """ + Operation: Create a new guest account + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- GuestUserCreate {create_time (string, optional): Time at which the account was created,do_expire (integer, optional): Action to take when the expire_time is reached,email (string, optional): Email address for the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,mac (string, optional): MAC address of the guest’s device,notes (string, optional): Comments or notes stored with the account,password (string): Password for the account,role_id (integer): Role to assign to the account,simultaneous_use (integer, optional): Number of simultaneous sessions allowed for the account,sponsor_email (string, optional): Email address of the sponsor,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Profile of the sponsor of the account,start_time (string, optional): Time at which the account will be enabled,username (string): Username of the account,visitor_company (string, optional): The guest’s company name,visitor_name (string, optional): The guest’s full name,visitor_phone (string, optional): The guest’s contact telephone number,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "do_expire": 0, + "email": "", + "enabled": false, + "expire_time": "", + "mac": "", + "notes": "", + "password": "", + "role_id": 0, + "simultaneous_use": 0, + "sponsor_email": "", + "sponsor_name": "", + "sponsor_profile": "", + "start_time": "", + "username": "", + "visitor_company": "", + "visitor_name": "", + "visitor_phone": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/guest" + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_guest_by_guest_id(self, guest_id=""): + """ + Operation: Get a guest account + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + """ + url_path = "/guest/{guest_id}" + dict_path = {"guest_id": guest_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_guest_by_guest_id( + self, guest_id="", body=({}), change_of_authorization="" + ): + """ + Operation: Update some fields of a guest account + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + Required Body Parameters (body description)- GuestUserUpdate {create_time (string, optional): Time at which the account was created,do_expire (integer, optional): Action to take when the expire_time is reached,email (string, optional): Email address for the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the guest account (cannot be changed),mac (string, optional): MAC address of the guest’s device,notes (string, optional): Comments or notes stored with the account,password (string, optional): Password for the account,role_id (integer, optional): Role to assign to the account,simultaneous_use (integer, optional): Number of simultaneous sessions allowed for the account,sponsor_email (string, optional): Email address of the sponsor,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Profile of the sponsor of the account,start_time (string, optional): Time at which the account will be enabled,username (string, optional): Username of the account,visitor_company (string, optional): The guest’s company name,visitor_name (string, optional): The guest’s full name,visitor_phone (string, optional): The guest’s contact telephone number,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "do_expire": 0, + "email": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "notes": "", + "password": "", + "role_id": 0, + "simultaneous_use": 0, + "sponsor_email": "", + "sponsor_name": "", + "sponsor_profile": "", + "start_time": "", + "username": "", + "visitor_company": "", + "visitor_name": "", + "visitor_phone": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/guest/{guest_id}" + dict_path = {"guest_id": guest_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_guest_by_guest_id( + self, guest_id="", body=({}), change_of_authorization="" + ): + """ + Operation: Replace a guest account + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + Required Body Parameters (body description)- GuestUserReplace {create_time (string, optional): Time at which the account was created,do_expire (integer, optional): Action to take when the expire_time is reached,email (string, optional): Email address for the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the guest account (cannot be changed),mac (string, optional): MAC address of the guest’s device,notes (string, optional): Comments or notes stored with the account,password (string): Password for the account,role_id (integer): Role to assign to the account,simultaneous_use (integer, optional): Number of simultaneous sessions allowed for the account,sponsor_email (string, optional): Email address of the sponsor,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Profile of the sponsor of the account,start_time (string, optional): Time at which the account will be enabled,username (string): Username of the account,visitor_company (string, optional): The guest’s company name,visitor_name (string, optional): The guest’s full name,visitor_phone (string, optional): The guest’s contact telephone number,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "do_expire": 0, + "email": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "notes": "", + "password": "", + "role_id": 0, + "simultaneous_use": 0, + "sponsor_email": "", + "sponsor_name": "", + "sponsor_profile": "", + "start_time": "", + "username": "", + "visitor_company": "", + "visitor_name": "", + "visitor_phone": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/guest/{guest_id}" + dict_path = {"guest_id": guest_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_guest_by_guest_id(self, guest_id="", change_of_authorization=""): + """ + Operation: Delete a guest account + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: guest_id, Description: Numeric ID of the guest account + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/guest/{guest_id}" + dict_path = {"guest_id": guest_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_guest_username_by_username(self, username=""): + """ + Operation: Get a guest account by username + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: username, Description: Unique username of the guest account + """ + url_path = "/guest/username/{username}" + dict_path = {"username": username} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_guest_username_by_username( + self, username="", body=({}), change_of_authorization="" + ): + """ + Operation: Update some fields of a guest account by username + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: username, Description: Unique username of the guest account + Required Body Parameters (body description)- GuestUserUpdate {create_time (string, optional): Time at which the account was created,do_expire (integer, optional): Action to take when the expire_time is reached,email (string, optional): Email address for the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the guest account (cannot be changed),mac (string, optional): MAC address of the guest’s device,notes (string, optional): Comments or notes stored with the account,password (string, optional): Password for the account,role_id (integer, optional): Role to assign to the account,simultaneous_use (integer, optional): Number of simultaneous sessions allowed for the account,sponsor_email (string, optional): Email address of the sponsor,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Profile of the sponsor of the account,start_time (string, optional): Time at which the account will be enabled,username (string, optional): Username of the account,visitor_company (string, optional): The guest’s company name,visitor_name (string, optional): The guest’s full name,visitor_phone (string, optional): The guest’s contact telephone number,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "do_expire": 0, + "email": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "notes": "", + "password": "", + "role_id": 0, + "simultaneous_use": 0, + "sponsor_email": "", + "sponsor_name": "", + "sponsor_profile": "", + "start_time": "", + "username": "", + "visitor_company": "", + "visitor_name": "", + "visitor_phone": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/guest/username/{username}" + dict_path = {"username": username} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_guest_username_by_username( + self, username="", body=({}), change_of_authorization="" + ): + """ + Operation: Replace a guest account by username + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: username, Description: Unique username of the guest account + Required Body Parameters (body description)- GuestUserReplace {create_time (string, optional): Time at which the account was created,do_expire (integer, optional): Action to take when the expire_time is reached,email (string, optional): Email address for the account,enabled (boolean, optional): Flag indicating if the account is enabled,expire_time (string, optional): Time at which the account will expire,id (integer, optional): Numeric ID of the guest account (cannot be changed),mac (string, optional): MAC address of the guest’s device,notes (string, optional): Comments or notes stored with the account,password (string): Password for the account,role_id (integer): Role to assign to the account,simultaneous_use (integer, optional): Number of simultaneous sessions allowed for the account,sponsor_email (string, optional): Email address of the sponsor,sponsor_name (string, optional): Name of the sponsor of the account,sponsor_profile (string, optional): Profile of the sponsor of the account,start_time (string, optional): Time at which the account will be enabled,username (string): Username of the account,visitor_company (string, optional): The guest’s company name,visitor_name (string, optional): The guest’s full name,visitor_phone (string, optional): The guest’s contact telephone number,... (string, optional): Additional properties (custom fields) may be stored with the account} + Required Body Parameters (type(dict) body example)- { + "create_time": "", + "do_expire": 0, + "email": "", + "enabled": false, + "expire_time": "", + "id": 0, + "mac": "", + "notes": "", + "password": "", + "role_id": 0, + "simultaneous_use": 0, + "sponsor_email": "", + "sponsor_name": "", + "sponsor_profile": "", + "start_time": "", + "username": "", + "visitor_company": "", + "visitor_name": "", + "visitor_phone": "", + "...": "" + } + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/guest/username/{username}" + dict_path = {"username": username} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_guest_username_by_username( + self, username="", change_of_authorization="" + ): + """ + Operation: Delete a guest account by username + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: username, Description: Unique username of the guest account + Optional Query Parameter Name: change_of_authorization, Description: true: Updates the network state using Disconnect-Request or CoA-Request, depending on the changes madefalse: No action is takenblank or unset: Use the default setting from Configuration » Authentication » Dynamic Authorization + """ + url_path = "/guest/username/{username}" + dict_path = {"username": username} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"change_of_authorization": change_of_authorization} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:LocalUser + # Function Section Description: Manage local users + + def get_local_user( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of local users + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/local-user" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_local_user(self, body=({})): + """ + Operation: Create a new local user + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- LocalUserCreate {user_id (string): Unique user id of the local user,password (string): Password of the local user,username (string): User name of the local user,role_name (string): Role name of the local user,enabled (boolean, optional): Flag indicating if the account is enabled,change_pwd_next_login (boolean, optional): Flag indicating if the password change is required in next login,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the local user account} + Required Body Parameters (type(dict) body example)- { + "user_id": "", + "password": "", + "username": "", + "role_name": "", + "enabled": false, + "change_pwd_next_login": false, + "attributes": "object" + } + """ + url_path = "/local-user" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_local_user_by_local_user_id(self, local_user_id=""): + """ + Operation: Get a local user + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: local_user_id, Description: Numeric ID of the local user + """ + url_path = "/local-user/{local_user_id}" + dict_path = {"local_user_id": local_user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_local_user_by_local_user_id(self, local_user_id="", body=({})): + """ + Operation: Update some fields of a local user + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: local_user_id, Description: Numeric ID of the local user + Required Body Parameters (body description)- LocalUserUpdate {user_id (string, optional): Unique user id of the local user,password (string, optional): Password of the local user,username (string, optional): User name of the local user,role_name (string, optional): Role name of the local user,enabled (boolean, optional): Flag indicating if the account is enabled,change_pwd_next_login (boolean, optional): Flag indicating if the password change is required in next login,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the local user account} + Required Body Parameters (type(dict) body example)- { + "user_id": "", + "password": "", + "username": "", + "role_name": "", + "enabled": false, + "change_pwd_next_login": false, + "attributes": "object" + } + """ + url_path = "/local-user/{local_user_id}" + dict_path = {"local_user_id": local_user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_local_user_by_local_user_id(self, local_user_id="", body=({})): + """ + Operation: Replace a local user + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: local_user_id, Description: Numeric ID of the local user + Required Body Parameters (body description)- LocalUserReplace {user_id (string): Unique user id of the local user,password (string): Password of the local user,username (string): User name of the local user,role_name (string): Role name of the local user,enabled (boolean, optional): Flag indicating if the account is enabled,change_pwd_next_login (boolean, optional): Flag indicating if the password change is required in next login,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the local user account} + Required Body Parameters (type(dict) body example)- { + "user_id": "", + "password": "", + "username": "", + "role_name": "", + "enabled": false, + "change_pwd_next_login": false, + "attributes": "object" + } + """ + url_path = "/local-user/{local_user_id}" + dict_path = {"local_user_id": local_user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_local_user_by_local_user_id(self, local_user_id=""): + """ + Operation: Delete a local user + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: local_user_id, Description: Numeric ID of the local user + """ + url_path = "/local-user/{local_user_id}" + dict_path = {"local_user_id": local_user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_local_user_user_id_by_user_id(self, user_id=""): + """ + Operation: Get a local user by user_id + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: user_id, Description: Unique user_id of the local user + """ + url_path = "/local-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_local_user_user_id_by_user_id(self, user_id="", body=({})): + """ + Operation: Update some fields of a local user by user_id + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: user_id, Description: Unique user_id of the local user + Required Body Parameters (body description)- LocalUserUpdate {user_id (string, optional): Unique user id of the local user,password (string, optional): Password of the local user,username (string, optional): User name of the local user,role_name (string, optional): Role name of the local user,enabled (boolean, optional): Flag indicating if the account is enabled,change_pwd_next_login (boolean, optional): Flag indicating if the password change is required in next login,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the local user account} + Required Body Parameters (type(dict) body example)- { + "user_id": "", + "password": "", + "username": "", + "role_name": "", + "enabled": false, + "change_pwd_next_login": false, + "attributes": "object" + } + """ + url_path = "/local-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_local_user_user_id_by_user_id(self, user_id="", body=({})): + """ + Operation: Replace a local user by user_id + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: user_id, Description: Unique user_id of the local user + Required Body Parameters (body description)- LocalUserReplace {user_id (string): Unique user id of the local user,password (string): Password of the local user,username (string): User name of the local user,role_name (string): Role name of the local user,enabled (boolean, optional): Flag indicating if the account is enabled,change_pwd_next_login (boolean, optional): Flag indicating if the password change is required in next login,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the local user account} + Required Body Parameters (type(dict) body example)- { + "user_id": "", + "password": "", + "username": "", + "role_name": "", + "enabled": false, + "change_pwd_next_login": false, + "attributes": "object" + } + """ + url_path = "/local-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_local_user_user_id_by_user_id(self, user_id=""): + """ + Operation: Delete a local user by user_id + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: user_id, Description: Unique user_id of the local user + """ + url_path = "/local-user/user-id/{user_id}" + dict_path = {"user_id": user_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_insight_v1.py b/pyclearpass/api_explorer_insight_v1.py new file mode 100644 index 0000000..639d819 --- /dev/null +++ b/pyclearpass/api_explorer_insight_v1.py @@ -0,0 +1,770 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_insight_v1.py + + +class ApiInsight(ClearPassAPILogin): + # Function Section Name:Alert + # Function Section Description: Operations for Alert + + def get_alert(self, offset="", limit="", calculate_count=""): + """ + Operation: Get all Insight alert configurations. + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Optional Query Parameter Name: offset, Description: Starting point to return rows from a result set. i.e Default: 0 + Optional Query Parameter Name: limit, Description: Limit the number of rows returned from a result set. i.e Default: 25 + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/alert" + dict_query = { + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_alert(self, body=({})): + """ + Operation: Create an Insight alert configuration. + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- Alert {id (integer): Numeric id of the alert,name (string): Name of the alert,description (string, optional): Description of the alert,category (string): Category of the alert,subcategory (string): Sub category is the template name of the alert,email_targets (object): Send alert notification to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send alert notification to the configured SMS targets, e.g. "sms_targets":["...", "..."],config (object, optional): Setting the alert filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + } + },severity (string): Severity of the alert, either "critical" or "warning",threshold (integer): Triggering the alert when reaching the specified numeric threshold value,interval (integer): Triggering the alert at the numeric interval,interval_unit (string): Interval units either "minute" or "hour",is_enabled (boolean, optional): Enable/Disable the alert,is_muted (boolean, optional): Mute/Unmute the alert} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "config": "object", + "severity": "", + "threshold": 0, + "interval": 0, + "interval_unit": "", + "is_enabled": false, + "is_muted": false + } + """ + url_path = "/alert" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_alert_by_id(self, id=""): + """ + Operation: Get an Insight alert configuration by id. + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + """ + url_path = "/alert/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_alert_by_id(self, id="", body=({})): + """ + Operation: Partial update of an Insight alert configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + Required Body Parameters (body description)- Alert {id (integer): Numeric id of the alert,name (string): Name of the alert,description (string, optional): Description of the alert,category (string): Category of the alert,subcategory (string): Sub category is the template name of the alert,email_targets (object): Send alert notification to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send alert notification to the configured SMS targets, e.g. "sms_targets":["...", "..."],config (object, optional): Setting the alert filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + } + },severity (string): Severity of the alert, either "critical" or "warning",threshold (integer): Triggering the alert when reaching the specified numeric threshold value,interval (integer): Triggering the alert at the numeric interval,interval_unit (string): Interval units either "minute" or "hour",is_enabled (boolean, optional): Enable/Disable the alert,is_muted (boolean, optional): Mute/Unmute the alert} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "config": "object", + "severity": "", + "threshold": 0, + "interval": 0, + "interval_unit": "", + "is_enabled": false, + "is_muted": false + } + """ + url_path = "/alert/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_alert_by_id(self, id="", body=({})): + """ + Operation: Complete update of an Insight alert configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + Required Body Parameters (body description)- Alert {id (integer): Numeric id of the alert,name (string): Name of the alert,description (string, optional): Description of the alert,category (string): Category of the alert,subcategory (string): Sub category is the template name of the alert,email_targets (object): Send alert notification to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send alert notification to the configured SMS targets, e.g. "sms_targets":["...", "..."],config (object, optional): Setting the alert filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + } + },severity (string): Severity of the alert, either "critical" or "warning",threshold (integer): Triggering the alert when reaching the specified numeric threshold value,interval (integer): Triggering the alert at the numeric interval,interval_unit (string): Interval units either "minute" or "hour",is_enabled (boolean, optional): Enable/Disable the alert,is_muted (boolean, optional): Mute/Unmute the alert} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "config": "object", + "severity": "", + "threshold": 0, + "interval": 0, + "interval_unit": "", + "is_enabled": false, + "is_muted": false + } + """ + url_path = "/alert/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_alert_by_id(self, id=""): + """ + Operation: Delete an Insight alert configuration by id. + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + """ + url_path = "/alert/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_alert_by_name(self, name=""): + """ + Operation: Get an Insight alert configuration by name. + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + """ + url_path = "/alert/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_alert_by_name(self, name="", body=({})): + """ + Operation: Partial update of an Insight alert configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + Required Body Parameters (body description)- Alert {id (integer): Numeric id of the alert,name (string): Name of the alert,description (string, optional): Description of the alert,category (string): Category of the alert,subcategory (string): Sub category is the template name of the alert,email_targets (object): Send alert notification to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send alert notification to the configured SMS targets, e.g. "sms_targets":["...", "..."],config (object, optional): Setting the alert filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + } + },severity (string): Severity of the alert, either "critical" or "warning",threshold (integer): Triggering the alert when reaching the specified numeric threshold value,interval (integer): Triggering the alert at the numeric interval,interval_unit (string): Interval units either "minute" or "hour",is_enabled (boolean, optional): Enable/Disable the alert,is_muted (boolean, optional): Mute/Unmute the alert} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "config": "object", + "severity": "", + "threshold": 0, + "interval": 0, + "interval_unit": "", + "is_enabled": false, + "is_muted": false + } + """ + url_path = "/alert/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_alert_by_name(self, name="", body=({})): + """ + Operation: Complete update of an Insight alert configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + Required Body Parameters (body description)- Alert {id (integer): Numeric id of the alert,name (string): Name of the alert,description (string, optional): Description of the alert,category (string): Category of the alert,subcategory (string): Sub category is the template name of the alert,email_targets (object): Send alert notification to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send alert notification to the configured SMS targets, e.g. "sms_targets":["...", "..."],config (object, optional): Setting the alert filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + } + },severity (string): Severity of the alert, either "critical" or "warning",threshold (integer): Triggering the alert when reaching the specified numeric threshold value,interval (integer): Triggering the alert at the numeric interval,interval_unit (string): Interval units either "minute" or "hour",is_enabled (boolean, optional): Enable/Disable the alert,is_muted (boolean, optional): Mute/Unmute the alert} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "config": "object", + "severity": "", + "threshold": 0, + "interval": 0, + "interval_unit": "", + "is_enabled": false, + "is_muted": false + } + """ + url_path = "/alert/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_alert_by_name(self, name=""): + """ + Operation: Delete an Insight alert configuration by name. + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + """ + url_path = "/alert/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def update_alert_by_id_enable(self, id=""): + """ + Operation: Enable an Insight alert configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + """ + url_path = "/alert/{id}/enable" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_alert_by_id_disable(self, id=""): + """ + Operation: Disable an Insight alert configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + """ + url_path = "/alert/{id}/disable" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_alert_by_id_mute(self, id=""): + """ + Operation: Mute an Insight alert configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + """ + url_path = "/alert/{id}/mute" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_alert_by_id_unmute(self, id=""): + """ + Operation: Unmute an Insight alert configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the alert + """ + url_path = "/alert/{id}/unmute" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_alert_by_name_enable(self, name=""): + """ + Operation: Enable an Insight alert configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + """ + url_path = "/alert/{name}/enable" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_alert_by_name_disable(self, name=""): + """ + Operation: Disable an Insight alert configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + """ + url_path = "/alert/{name}/disable" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_alert_by_name_mute(self, name=""): + """ + Operation: Mute an Insight alert configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + """ + url_path = "/alert/{name}/mute" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_alert_by_name_unmute(self, name=""): + """ + Operation: Unmute an Insight alert configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the alert + """ + url_path = "/alert/{name}/unmute" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + # Function Section Name:Report + # Function Section Description: Operations for Report + + def get_report(self, offset="", limit="", calculate_count=""): + """ + Operation: Get all Insight report configurations. + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Optional Query Parameter Name: offset, Description: Starting point to return rows from a result set. i.e Default: 0 + Optional Query Parameter Name: limit, Description: Limit the number of rows returned from a result set. i.e Default: 25 + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/report" + dict_query = { + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_report(self, body=({})): + """ + Operation: Create an Insight report configuration. + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- Report {id (integer): Numeric id of the report,name (string): Name of the report,description (string, optional): Description of the report,category (string): Category of the report,subcategory (string): Sub category is the template name of the report,email_targets (object, optional): Send report to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send report to the configured SMS targets, e.g. "sms_targets":["...", "..."],copy_remote (boolean, optional): Enable to copy the report to the configured SCP/SFTP server,config (object, optional): Setting the report filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + }, + csv_cols": ["...", "...", "..."] + },schedule (object, optional): Scheduling the report. Options are [noRepeat, daily, weekly, monthly], + e.g. when running the report "now" itself => "schedule": {} - then "begin_dt" & "end_dt" are mandatory, + when scheduling the report at "daily" => "schedule": {"freq": "daily", "hour": 12} + when scheduling the report at "weekly" => "schedule": {"freq": "weekly", "day": 0, "hour": 12} + when scheduling the report at "monthly" => "schedule": {"freq": "monthly", "date": 1, "hour": 12} + ,begin_dt (integer, optional): Collect the data for the report from this "begin_dt",end_dt (string, optional): Collect the data for the report till this "end_dt",is_enabled (boolean, optional): Enable/Disable the report} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "copy_remote": false, + "config": "object", + "schedule": "object", + "begin_dt": 0, + "end_dt": "", + "is_enabled": false + } + """ + url_path = "/report" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_report_by_id(self, id=""): + """ + Operation: Get an Insight report configuration by id. + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the report + """ + url_path = "/report/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_report_by_id(self, id="", body=({})): + """ + Operation: Partial update of an Insight report configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the report + Required Body Parameters (body description)- Report {id (integer): Numeric id of the report,name (string): Name of the report,description (string, optional): Description of the report,category (string): Category of the report,subcategory (string): Sub category is the template name of the report,email_targets (object, optional): Send report to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send report to the configured SMS targets, e.g. "sms_targets":["...", "..."],copy_remote (boolean, optional): Enable to copy the report to the configured SCP/SFTP server,config (object, optional): Setting the report filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + }, + csv_cols": ["...", "...", "..."] + },schedule (object, optional): Scheduling the report. Options are [noRepeat, daily, weekly, monthly], + e.g. when running the report "now" itself => "schedule": {} - then "begin_dt" & "end_dt" are mandatory, + when scheduling the report at "daily" => "schedule": {"freq": "daily", "hour": 12} + when scheduling the report at "weekly" => "schedule": {"freq": "weekly", "day": 0, "hour": 12} + when scheduling the report at "monthly" => "schedule": {"freq": "monthly", "date": 1, "hour": 12} + ,begin_dt (integer, optional): Collect the data for the report from this "begin_dt",end_dt (string, optional): Collect the data for the report till this "end_dt",is_enabled (boolean, optional): Enable/Disable the report} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "copy_remote": false, + "config": "object", + "schedule": "object", + "begin_dt": 0, + "end_dt": "", + "is_enabled": false + } + """ + url_path = "/report/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_report_by_id(self, id="", body=({})): + """ + Operation: Complete update of an Insight report configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the report + Required Body Parameters (body description)- Report {id (integer): Numeric id of the report,name (string): Name of the report,description (string, optional): Description of the report,category (string): Category of the report,subcategory (string): Sub category is the template name of the report,email_targets (object, optional): Send report to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send report to the configured SMS targets, e.g. "sms_targets":["...", "..."],copy_remote (boolean, optional): Enable to copy the report to the configured SCP/SFTP server,config (object, optional): Setting the report filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + }, + csv_cols": ["...", "...", "..."] + },schedule (object, optional): Scheduling the report. Options are [noRepeat, daily, weekly, monthly], + e.g. when running the report "now" itself => "schedule": {} - then "begin_dt" & "end_dt" are mandatory, + when scheduling the report at "daily" => "schedule": {"freq": "daily", "hour": 12} + when scheduling the report at "weekly" => "schedule": {"freq": "weekly", "day": 0, "hour": 12} + when scheduling the report at "monthly" => "schedule": {"freq": "monthly", "date": 1, "hour": 12} + ,begin_dt (integer, optional): Collect the data for the report from this "begin_dt",end_dt (string, optional): Collect the data for the report till this "end_dt",is_enabled (boolean, optional): Enable/Disable the report} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "copy_remote": false, + "config": "object", + "schedule": "object", + "begin_dt": 0, + "end_dt": "", + "is_enabled": false + } + """ + url_path = "/report/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_report_by_id(self, id=""): + """ + Operation: Delete an Insight report configuration by id. + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the report + """ + url_path = "/report/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_report_by_name(self, name=""): + """ + Operation: Get an Insight report configuration by name. + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the report + """ + url_path = "/report/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_report_by_name(self, name="", body=({})): + """ + Operation: Partial update of an Insight report configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the report + Required Body Parameters (body description)- Report {id (integer): Numeric id of the report,name (string): Name of the report,description (string, optional): Description of the report,category (string): Category of the report,subcategory (string): Sub category is the template name of the report,email_targets (object, optional): Send report to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send report to the configured SMS targets, e.g. "sms_targets":["...", "..."],copy_remote (boolean, optional): Enable to copy the report to the configured SCP/SFTP server,config (object, optional): Setting the report filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + }, + csv_cols": ["...", "...", "..."] + },schedule (object, optional): Scheduling the report. Options are [noRepeat, daily, weekly, monthly], + e.g. when running the report "now" itself => "schedule": {} - then "begin_dt" & "end_dt" are mandatory, + when scheduling the report at "daily" => "schedule": {"freq": "daily", "hour": 12} + when scheduling the report at "weekly" => "schedule": {"freq": "weekly", "day": 0, "hour": 12} + when scheduling the report at "monthly" => "schedule": {"freq": "monthly", "date": 1, "hour": 12} + ,begin_dt (integer, optional): Collect the data for the report from this "begin_dt",end_dt (string, optional): Collect the data for the report till this "end_dt",is_enabled (boolean, optional): Enable/Disable the report} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "copy_remote": false, + "config": "object", + "schedule": "object", + "begin_dt": 0, + "end_dt": "", + "is_enabled": false + } + """ + url_path = "/report/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_report_by_name(self, name="", body=({})): + """ + Operation: Complete update of an Insight report configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the report + Required Body Parameters (body description)- Report {id (integer): Numeric id of the report,name (string): Name of the report,description (string, optional): Description of the report,category (string): Category of the report,subcategory (string): Sub category is the template name of the report,email_targets (object, optional): Send report to the configured email targets, e.g. "email_targets":["...", "..."],sms_targets (object, optional): Send report to the configured SMS targets, e.g. "sms_targets":["...", "..."],copy_remote (boolean, optional): Enable to copy the report to the configured SCP/SFTP server,config (object, optional): Setting the report filter configurations & adding CSV columns for the CSV report, + e.g. "config": { + "filter": { + "auth.ap_name": { + "operator": "EQUALS", + "value": ["..."] + }, + "cppm_cluster.hostname": { + "operator":"CONTAINS", + "value":["...", "..."] + } + }, + csv_cols": ["...", "...", "..."] + },schedule (object, optional): Scheduling the report. Options are [noRepeat, daily, weekly, monthly], + e.g. when running the report "now" itself => "schedule": {} - then "begin_dt" & "end_dt" are mandatory, + when scheduling the report at "daily" => "schedule": {"freq": "daily", "hour": 12} + when scheduling the report at "weekly" => "schedule": {"freq": "weekly", "day": 0, "hour": 12} + when scheduling the report at "monthly" => "schedule": {"freq": "monthly", "date": 1, "hour": 12} + ,begin_dt (integer, optional): Collect the data for the report from this "begin_dt",end_dt (string, optional): Collect the data for the report till this "end_dt",is_enabled (boolean, optional): Enable/Disable the report} + Required Body Parameters (type(dict) body example)- { + "id": 0, + "name": "", + "description": "", + "category": "", + "subcategory": "", + "email_targets": "object", + "sms_targets": "object", + "copy_remote": false, + "config": "object", + "schedule": "object", + "begin_dt": 0, + "end_dt": "", + "is_enabled": false + } + """ + url_path = "/report/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_report_by_name(self, name=""): + """ + Operation: Delete an Insight report configuration by name. + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the report + """ + url_path = "/report/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def update_report_by_id_enable(self, id=""): + """ + Operation: Enable an Insight report configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the report + """ + url_path = "/report/{id}/enable" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_report_by_id_disable(self, id=""): + """ + Operation: Disable an Insight report configuration by id. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the report + """ + url_path = "/report/{id}/disable" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_report_by_name_enable(self, name=""): + """ + Operation: Enable an Insight report configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the report + """ + url_path = "/report/{name}/enable" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_report_by_name_disable(self, name=""): + """ + Operation: Disable an Insight report configuration by name. + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the report + """ + url_path = "/report/{name}/disable" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def new_report_by_id_run(self, id=""): + """ + Operation: Run an Insight report by id. + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: Numeric id of the report + """ + url_path = "/report/{id}/run" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="post") + + def new_report_by_name_run(self, name=""): + """ + Operation: Run an Insight report by name. + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 201 Created, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Name of the report + """ + url_path = "/report/{name}/run" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="post") diff --git a/pyclearpass/api_explorer_integrations_v1.py b/pyclearpass/api_explorer_integrations_v1.py new file mode 100644 index 0000000..7d20e87 --- /dev/null +++ b/pyclearpass/api_explorer_integrations_v1.py @@ -0,0 +1,1342 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_integrations_v1.py + + +class ApiIntegrations(ClearPassAPILogin): + # Function Section Name:ContextServerAction + # Function Section Description: Manage Context Server Actions + + def get_context_server_action( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of Context Server Actions + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/context-server-action" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_context_server_action(self, body=({})): + """ + Operation: Create a new Context Server Action + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ContextServerActionCreate {server_type (string) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type of the Context Server Action,server_name (string, optional): Server Name of the Context Server Action,action_name (string): Action Name of the Context Server Action,action_type (string, optional) = ['Send_Login_Info' or 'Send_HIP_Report' or 'Register_Device' or 'Register_Role' or 'Register_Posture' or 'Send_Logout_Info' or 'Unregister_Device' or 'Unregister_Role' or 'Unregister_Posture']: Action Type of the Context Server Action,description (string, optional): Description of the Context Server Action,http_method (string) = ['GET' or 'POST' or 'PATCH' or 'PUT' or 'DELETE']: Http method of the Context Server Action,auth_method (string, optional) = ['none' or 'basic' or 'oauth2' or 'cert']: Authentication Method of the Context Server Action,url (string): URL of the Context Server Action,content_type (string, optional) = ['HTML' or 'JSON' or 'PLANE' or 'XML']: Content-Type of the Context Server Action. Note : For CUSTOM type use any string,content (string, optional): Content of the Context Server Action,headers (object, optional): Headers(key/value pairs) of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1"},{"attr_name":"key2", "attr_value":"value2"}]),attributes (object, optional): Attributes of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1", "is_sensitive":true},{"attr_name":"key2", "attr_value":"value2", "is_sensitive": false}])} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "action_name": "", + "action_type": "", + "description": "", + "http_method": "", + "auth_method": "", + "url": "", + "content_type": "", + "content": "", + "headers": "object", + "attributes": "object" + } + """ + url_path = "/context-server-action" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_context_server_action_by_context_server_action_id( + self, context_server_action_id="" + ): + """ + Operation: Get a Context Server Action + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: context_server_action_id, Description: Numeric ID of the csa + """ + url_path = "/context-server-action/{context_server_action_id}" + dict_path = {"context_server_action_id": context_server_action_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_context_server_action_by_context_server_action_id( + self, context_server_action_id="", body=({}) + ): + """ + Operation: Update some fields of a Context Server Action + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: context_server_action_id, Description: Numeric ID of the csa + Required Body Parameters (body description)- ContextServerActionUpdate {server_type (string, optional) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type of the Context Server Action,server_name (string, optional): Server Name of the Context Server Action,action_name (string, optional): Action Name of the Context Server Action,action_type (string, optional) = ['Send_Login_Info' or 'Send_HIP_Report' or 'Register_Device' or 'Register_Role' or 'Register_Posture' or 'Send_Logout_Info' or 'Unregister_Device' or 'Unregister_Role' or 'Unregister_Posture']: Action Type of the Context Server Action,description (string, optional): Description of the Context Server Action,http_method (string, optional) = ['GET' or 'POST' or 'PATCH' or 'PUT' or 'DELETE']: Http method of the Context Server Action,auth_method (string, optional) = ['none' or 'basic' or 'oauth2' or 'cert']: Authentication Method of the Context Server Action,url (string, optional): URL of the Context Server Action,content_type (string, optional) = ['HTML' or 'JSON' or 'PLANE' or 'XML']: Content-Type of the Context Server Action. Note : For CUSTOM type use any string,content (string, optional): Content of the Context Server Action,headers (object, optional): Headers(key/value pairs) of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1"},{"attr_name":"key2", "attr_value":"value2"}]),attributes (object, optional): Attributes of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1", "is_sensitive":true},{"attr_name":"key2", "attr_value":"value2", "is_sensitive": false}])} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "action_name": "", + "action_type": "", + "description": "", + "http_method": "", + "auth_method": "", + "url": "", + "content_type": "", + "content": "", + "headers": "object", + "attributes": "object" + } + """ + url_path = "/context-server-action/{context_server_action_id}" + dict_path = {"context_server_action_id": context_server_action_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_context_server_action_by_context_server_action_id( + self, context_server_action_id="", body=({}) + ): + """ + Operation: Replace a Context Server Action + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: context_server_action_id, Description: Numeric ID of the csa + Required Body Parameters (body description)- ContextServerActionReplace {server_type (string) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type of the Context Server Action,server_name (string, optional): Server Name of the Context Server Action,action_name (string): Action Name of the Context Server Action,action_type (string, optional) = ['Send_Login_Info' or 'Send_HIP_Report' or 'Register_Device' or 'Register_Role' or 'Register_Posture' or 'Send_Logout_Info' or 'Unregister_Device' or 'Unregister_Role' or 'Unregister_Posture']: Action Type of the Context Server Action,description (string, optional): Description of the Context Server Action,http_method (string) = ['GET' or 'POST' or 'PATCH' or 'PUT' or 'DELETE']: Http method of the Context Server Action,auth_method (string, optional) = ['none' or 'basic' or 'oauth2' or 'cert']: Authentication Method of the Context Server Action,url (string): URL of the Context Server Action,content_type (string, optional) = ['HTML' or 'JSON' or 'PLANE' or 'XML']: Content-Type of the Context Server Action. Note : For CUSTOM type use any string,content (string, optional): Content of the Context Server Action,headers (object, optional): Headers(key/value pairs) of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1"},{"attr_name":"key2", "attr_value":"value2"}]),attributes (object, optional): Attributes of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1", "is_sensitive":true},{"attr_name":"key2", "attr_value":"value2", "is_sensitive": false}])} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "action_name": "", + "action_type": "", + "description": "", + "http_method": "", + "auth_method": "", + "url": "", + "content_type": "", + "content": "", + "headers": "object", + "attributes": "object" + } + """ + url_path = "/context-server-action/{context_server_action_id}" + dict_path = {"context_server_action_id": context_server_action_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_context_server_action_by_context_server_action_id( + self, context_server_action_id="" + ): + """ + Operation: Delete a Context Server Action + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: context_server_action_id, Description: Numeric ID of the csa + """ + url_path = "/context-server-action/{context_server_action_id}" + dict_path = {"context_server_action_id": context_server_action_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_context_server_action_by_server_type_action_name_action_name( + self, server_type="", action_name="" + ): + """ + Operation: Get a Context Server Action by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_type, Description: Server type of the context server action + Required Path Parameter Name: action_name, Description: Unique action name of the context server action + """ + url_path = "/context-server-action/{server_type}/action-name/{action_name}" + dict_path = {"server_type": server_type, "action_name": action_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_context_server_action_by_server_type_action_name_action_name( + self, server_type="", action_name="", body=({}) + ): + """ + Operation: Update some fields of a Context Server Action by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_type, Description: Server type of the context server action + Required Path Parameter Name: action_name, Description: Unique action name of the context server action + Required Body Parameters (body description)- ContextServerActionUpdate {server_type (string, optional) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type of the Context Server Action,server_name (string, optional): Server Name of the Context Server Action,action_name (string, optional): Action Name of the Context Server Action,action_type (string, optional) = ['Send_Login_Info' or 'Send_HIP_Report' or 'Register_Device' or 'Register_Role' or 'Register_Posture' or 'Send_Logout_Info' or 'Unregister_Device' or 'Unregister_Role' or 'Unregister_Posture']: Action Type of the Context Server Action,description (string, optional): Description of the Context Server Action,http_method (string, optional) = ['GET' or 'POST' or 'PATCH' or 'PUT' or 'DELETE']: Http method of the Context Server Action,auth_method (string, optional) = ['none' or 'basic' or 'oauth2' or 'cert']: Authentication Method of the Context Server Action,url (string, optional): URL of the Context Server Action,content_type (string, optional) = ['HTML' or 'JSON' or 'PLANE' or 'XML']: Content-Type of the Context Server Action. Note : For CUSTOM type use any string,content (string, optional): Content of the Context Server Action,headers (object, optional): Headers(key/value pairs) of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1"},{"attr_name":"key2", "attr_value":"value2"}]),attributes (object, optional): Attributes of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1", "is_sensitive":true},{"attr_name":"key2", "attr_value":"value2", "is_sensitive": false}])} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "action_name": "", + "action_type": "", + "description": "", + "http_method": "", + "auth_method": "", + "url": "", + "content_type": "", + "content": "", + "headers": "object", + "attributes": "object" + } + """ + url_path = "/context-server-action/{server_type}/action-name/{action_name}" + dict_path = {"server_type": server_type, "action_name": action_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_context_server_action_by_server_type_action_name_action_name( + self, server_type="", action_name="", body=({}) + ): + """ + Operation: Replace a Context Server Action by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_type, Description: Server type of the context server action + Required Path Parameter Name: action_name, Description: Unique action name of the context server action + Required Body Parameters (body description)- ContextServerActionReplace {server_type (string) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type of the Context Server Action,server_name (string, optional): Server Name of the Context Server Action,action_name (string): Action Name of the Context Server Action,action_type (string, optional) = ['Send_Login_Info' or 'Send_HIP_Report' or 'Register_Device' or 'Register_Role' or 'Register_Posture' or 'Send_Logout_Info' or 'Unregister_Device' or 'Unregister_Role' or 'Unregister_Posture']: Action Type of the Context Server Action,description (string, optional): Description of the Context Server Action,http_method (string) = ['GET' or 'POST' or 'PATCH' or 'PUT' or 'DELETE']: Http method of the Context Server Action,auth_method (string, optional) = ['none' or 'basic' or 'oauth2' or 'cert']: Authentication Method of the Context Server Action,url (string): URL of the Context Server Action,content_type (string, optional) = ['HTML' or 'JSON' or 'PLANE' or 'XML']: Content-Type of the Context Server Action. Note : For CUSTOM type use any string,content (string, optional): Content of the Context Server Action,headers (object, optional): Headers(key/value pairs) of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1"},{"attr_name":"key2", "attr_value":"value2"}]),attributes (object, optional): Attributes of the Context Server Action (e.g., [{"attr_name":"key1", "attr_value":"value1", "is_sensitive":true},{"attr_name":"key2", "attr_value":"value2", "is_sensitive": false}])} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "action_name": "", + "action_type": "", + "description": "", + "http_method": "", + "auth_method": "", + "url": "", + "content_type": "", + "content": "", + "headers": "object", + "attributes": "object" + } + """ + url_path = "/context-server-action/{server_type}/action-name/{action_name}" + dict_path = {"server_type": server_type, "action_name": action_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_context_server_action_by_server_type_action_name_action_name( + self, server_type="", action_name="" + ): + """ + Operation: Delete a Context Server Action by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_type, Description: Server type of the context server action + Required Path Parameter Name: action_name, Description: Unique action name of the context server action + """ + url_path = "/context-server-action/{server_type}/action-name/{action_name}" + dict_path = {"server_type": server_type, "action_name": action_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:DeviceInsight + # Function Section Description: Manage Device Insight Integration + + def get_device_insight(self, server_type="", action_name=""): + """ + Operation: Get Device Insight Integration details + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_type, Description: Server type of the context server action + Required Path Parameter Name: action_name, Description: Unique action name of the context server action + """ + url_path = "/device-insight" + dict_path = {"server_type": server_type, "action_name": action_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_device_insight(self, body=({})): + """ + Operation: Update Device Insight Integration values + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- DeviceInsightCreate {enable_device_insight (boolean, optional): Enable/Disable Device Insight Integration,activation_token (string, optional): Registration Token,primary_clearpass_server_uuid (string, optional): Primary ClearPass Server UUID,standby_clearpass_server_uuid (string, optional): null,bypass_proxy (boolean, optional): Bypass Proxy,polling_interval (integer, optional): Polling Interval,sync_time (integer, optional): Sync Time,activation_status (string, optional): Activation Status,activation_error (string, optional): Activation Error,activation_timestamp (string, optional): Activation Timestamp,registration_status (string, optional): Registration Status,last_sync_timestamp (string, optional): Last Sync Timestamp,last_sync_run (string, optional): Last Sync Run,aruba_central_tenant_id (string, optional): Aruba Central Tenant Id,device_insight_collector_id (string, optional): Device Insight Collector Id,tag_update_action (string, optional) = ['NONE' or 'ANY' or 'SELECTED']: Tags Update Action,tags_for_disconnect (string, optional): Tags for Disconnect,radius_coa_action (string, optional): Radius CoA action,analyzer_admin_url (string, optional): Analyzer Admin URL} + Required Body Parameters (type(dict) body example)- { + "enable_device_insight": false, + "activation_token": "", + "primary_clearpass_server_uuid": "", + "standby_clearpass_server_uuid": "", + "bypass_proxy": false, + "polling_interval": 0, + "sync_time": 0, + "activation_status": "", + "activation_error": "", + "activation_timestamp": "", + "registration_status": "", + "last_sync_timestamp": "", + "last_sync_run": "", + "aruba_central_tenant_id": "", + "device_insight_collector_id": "", + "tag_update_action": "", + "tags_for_disconnect": "", + "radius_coa_action": "", + "analyzer_admin_url": "" + } + """ + url_path = "/device-insight" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:EndpointContextServer + # Function Section Description: Manage Endpoint Context servers + + def get_endpoint_context_server( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list endpoint context servers + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/endpoint-context-server" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_endpoint_context_server(self, body=({})): + """ + Operation: Create a new endpoint context server + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- EndpointContextServerCreate {server_type (string) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type,server_name (string): Server Name,server_base_url (string): Server Base URL,auth_method (string) = ['basic' or 'oauth2' or 'cert' or 'both']: Authentication Method of the Context Server,username (string, optional): Username,password (string, optional): Password,oauth2_client_id (string, optional): Client ID of OAuth2,oauth2_client_secret (string, optional): Client Secret of OAuth2,oauth2_access_token_url (string, optional): Access token URL of OAuth2,client_cert_CN (string, optional): Client Certificate CN,client_cert_expiry_date (string, optional): Client Certificate expiry date,vendor_attrs (object, optional): Attributes,validate_server (boolean): Enable to validate the server certificate,status (boolean): Enable Server,ip_version (string, optional) = ['ipV4' or 'ipV6' or 'ipBoth']: IP Version,bypass_proxy (boolean): Enable to bypass proxy server} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "server_base_url": "", + "auth_method": "", + "username": "", + "password": "", + "oauth2_client_id": "", + "oauth2_client_secret": "", + "oauth2_access_token_url": "", + "client_cert_CN": "", + "client_cert_expiry_date": "", + "vendor_attrs": "object", + "validate_server": false, + "status": false, + "ip_version": "", + "bypass_proxy": false + } + """ + url_path = "/endpoint-context-server" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_endpoint_context_server_by_endpoint_context_server_id( + self, endpoint_context_server_id="" + ): + """ + Operation: Get an endpoint context server + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: endpoint_context_server_id, Description: URL parameter endpoint_context_server_id + """ + url_path = "/endpoint-context-server/{endpoint_context_server_id}" + dict_path = {"endpoint_context_server_id": endpoint_context_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_endpoint_context_server_by_endpoint_context_server_id( + self, endpoint_context_server_id="", body=({}) + ): + """ + Operation: Update some fields of an endpoint context server + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: endpoint_context_server_id, Description: URL parameter endpoint_context_server_id + Required Body Parameters (body description)- EndpointContextServerUpdate {server_type (string, optional) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type,server_name (string, optional): Server Name,server_base_url (string, optional): Server Base URL,auth_method (string, optional) = ['basic' or 'oauth2' or 'cert' or 'both']: Authentication Method of the Context Server,username (string, optional): Username,password (string, optional): Password,oauth2_client_id (string, optional): Client ID of OAuth2,oauth2_client_secret (string, optional): Client Secret of OAuth2,oauth2_access_token_url (string, optional): Access token URL of OAuth2,client_cert_CN (string, optional): Client Certificate CN,client_cert_expiry_date (string, optional): Client Certificate expiry date,vendor_attrs (object, optional): Attributes,validate_server (boolean, optional): Enable to validate the server certificate,status (boolean, optional): Enable Server,ip_version (string, optional) = ['ipV4' or 'ipV6' or 'ipBoth']: IP Version,bypass_proxy (boolean, optional): Enable to bypass proxy server} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "server_base_url": "", + "auth_method": "", + "username": "", + "password": "", + "oauth2_client_id": "", + "oauth2_client_secret": "", + "oauth2_access_token_url": "", + "client_cert_CN": "", + "client_cert_expiry_date": "", + "vendor_attrs": "object", + "validate_server": false, + "status": false, + "ip_version": "", + "bypass_proxy": false + } + """ + url_path = "/endpoint-context-server/{endpoint_context_server_id}" + dict_path = {"endpoint_context_server_id": endpoint_context_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_endpoint_context_server_by_endpoint_context_server_id( + self, endpoint_context_server_id="", body=({}) + ): + """ + Operation: Replace an endpoint context server + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: endpoint_context_server_id, Description: URL parameter endpoint_context_server_id + Required Body Parameters (body description)- EndpointContextServerReplace {server_type (string) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type,server_name (string): Server Name,server_base_url (string): Server Base URL,auth_method (string) = ['basic' or 'oauth2' or 'cert' or 'both']: Authentication Method of the Context Server,username (string, optional): Username,password (string, optional): Password,oauth2_client_id (string, optional): Client ID of OAuth2,oauth2_client_secret (string, optional): Client Secret of OAuth2,oauth2_access_token_url (string, optional): Access token URL of OAuth2,client_cert_CN (string, optional): Client Certificate CN,client_cert_expiry_date (string, optional): Client Certificate expiry date,vendor_attrs (object, optional): Attributes,validate_server (boolean): Enable to validate the server certificate,status (boolean): Enable Server,ip_version (string, optional) = ['ipV4' or 'ipV6' or 'ipBoth']: IP Version,bypass_proxy (boolean): Enable to bypass proxy server} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "server_base_url": "", + "auth_method": "", + "username": "", + "password": "", + "oauth2_client_id": "", + "oauth2_client_secret": "", + "oauth2_access_token_url": "", + "client_cert_CN": "", + "client_cert_expiry_date": "", + "vendor_attrs": "object", + "validate_server": false, + "status": false, + "ip_version": "", + "bypass_proxy": false + } + """ + url_path = "/endpoint-context-server/{endpoint_context_server_id}" + dict_path = {"endpoint_context_server_id": endpoint_context_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_endpoint_context_server_by_endpoint_context_server_id( + self, endpoint_context_server_id="" + ): + """ + Operation: Delete an endpoint context server + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: endpoint_context_server_id, Description: URL parameter endpoint_context_server_id + """ + url_path = "/endpoint-context-server/{endpoint_context_server_id}" + dict_path = {"endpoint_context_server_id": endpoint_context_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_endpoint_context_server_server_name_by_server_name(self, server_name=""): + """ + Operation: Get an endpoint context server by server name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_name, Description: Unique name of the Endpoint Context Server + """ + url_path = "/endpoint-context-server/server-name/{server_name}" + dict_path = {"server_name": server_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_endpoint_context_server_server_name_by_server_name( + self, server_name="", body=({}) + ): + """ + Operation: Update some fields of an endpoint context server by server name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_name, Description: Unique name of the Endpoint Context Server + Required Body Parameters (body description)- EndpointContextServerUpdate {server_type (string, optional) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type,server_name (string, optional): Server Name,server_base_url (string, optional): Server Base URL,auth_method (string, optional) = ['basic' or 'oauth2' or 'cert' or 'both']: Authentication Method of the Context Server,username (string, optional): Username,password (string, optional): Password,oauth2_client_id (string, optional): Client ID of OAuth2,oauth2_client_secret (string, optional): Client Secret of OAuth2,oauth2_access_token_url (string, optional): Access token URL of OAuth2,client_cert_CN (string, optional): Client Certificate CN,client_cert_expiry_date (string, optional): Client Certificate expiry date,vendor_attrs (object, optional): Attributes,validate_server (boolean, optional): Enable to validate the server certificate,status (boolean, optional): Enable Server,ip_version (string, optional) = ['ipV4' or 'ipV6' or 'ipBoth']: IP Version,bypass_proxy (boolean, optional): Enable to bypass proxy server} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "server_base_url": "", + "auth_method": "", + "username": "", + "password": "", + "oauth2_client_id": "", + "oauth2_client_secret": "", + "oauth2_access_token_url": "", + "client_cert_CN": "", + "client_cert_expiry_date": "", + "vendor_attrs": "object", + "validate_server": false, + "status": false, + "ip_version": "", + "bypass_proxy": false + } + """ + url_path = "/endpoint-context-server/server-name/{server_name}" + dict_path = {"server_name": server_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_endpoint_context_server_server_name_by_server_name( + self, server_name="", body=({}) + ): + """ + Operation: Replace an endpoint context server by server name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_name, Description: Unique name of the Endpoint Context Server + Required Body Parameters (body description)- EndpointContextServerReplace {server_type (string) = ['Aruba Activate' or 'VMware AirWatch' or 'JAMF' or 'MobileIron Core' or 'IBM MaaS360' or 'SAP Afaria' or 'SOTI' or 'Google Admin Console' or 'Palo Alto Networks Panorama' or 'Palo Alto Networks Firewall' or 'Juniper Networks SRX' or 'Citrix XenMobile' or 'Generic HTTP Context Server' or 'Aruba Airwave' or 'Aruba Central' or 'ClearPass Cloud Proxy' or 'Aruba IntroSpect']: Server Type,server_name (string): Server Name,server_base_url (string): Server Base URL,auth_method (string) = ['basic' or 'oauth2' or 'cert' or 'both']: Authentication Method of the Context Server,username (string, optional): Username,password (string, optional): Password,oauth2_client_id (string, optional): Client ID of OAuth2,oauth2_client_secret (string, optional): Client Secret of OAuth2,oauth2_access_token_url (string, optional): Access token URL of OAuth2,client_cert_CN (string, optional): Client Certificate CN,client_cert_expiry_date (string, optional): Client Certificate expiry date,vendor_attrs (object, optional): Attributes,validate_server (boolean): Enable to validate the server certificate,status (boolean): Enable Server,ip_version (string, optional) = ['ipV4' or 'ipV6' or 'ipBoth']: IP Version,bypass_proxy (boolean): Enable to bypass proxy server} + Required Body Parameters (type(dict) body example)- { + "server_type": "", + "server_name": "", + "server_base_url": "", + "auth_method": "", + "username": "", + "password": "", + "oauth2_client_id": "", + "oauth2_client_secret": "", + "oauth2_access_token_url": "", + "client_cert_CN": "", + "client_cert_expiry_date": "", + "vendor_attrs": "object", + "validate_server": false, + "status": false, + "ip_version": "", + "bypass_proxy": false + } + """ + url_path = "/endpoint-context-server/server-name/{server_name}" + dict_path = {"server_name": server_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_endpoint_context_server_server_name_by_server_name(self, server_name=""): + """ + Operation: Delete an endpoint context server by server name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_name, Description: Unique name of the Endpoint Context Server + """ + url_path = "/endpoint-context-server/server-name/{server_name}" + dict_path = {"server_name": server_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def update_endpoint_context_server_by_endpoint_context_server_id_trigger_poll( + self, endpoint_context_server_id="" + ): + """ + Operation: Trigger polling for an endpoint context server + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: endpoint_context_server_id, Description: URL parameter endpoint_context_server_id + """ + url_path = "/endpoint-context-server/{endpoint_context_server_id}/trigger-poll" + dict_path = {"endpoint_context_server_id": endpoint_context_server_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_endpoint_context_server_server_name_by_server_name_trigger_poll( + self, server_name="" + ): + """ + Operation: Trigger polling for an endpoint context server by server name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_name, Description: Unique name of the Endpoint Context Server + """ + url_path = "/endpoint-context-server/server-name/{server_name}/trigger-poll" + dict_path = {"server_name": server_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + # Function Section Name:EventSources + # Function Section Description: Manage event sources + + def get_event_sources( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of event sources + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/event-sources" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_event_sources(self, body=({})): + """ + Operation: Create a new event source + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- EventSourcesCreate {name (string): Event source Name,description (string, optional): Event source description,ipaddress (string): Unique IP Address of the event source,vendor (string) = ['Aruba IntroSpect' or 'Check Point' or 'Infoblox' or 'Juniper Networks' or 'Palo Alto Networks']: Vendor name,type (string) = ['Syslog']: Event source type,enable (boolean, optional): Enable event source} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "ipaddress": "", + "vendor": "", + "type": "", + "enable": false + } + """ + url_path = "/event-sources" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_event_sources_by_event_sources_id(self, event_sources_id=""): + """ + Operation: Get an event source + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: event_sources_id, Description: Unique id of the Event source + """ + url_path = "/event-sources/{event_sources_id}" + dict_path = {"event_sources_id": event_sources_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_event_sources_by_event_sources_id(self, event_sources_id="", body=({})): + """ + Operation: Update some fields of an event source + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: event_sources_id, Description: Unique id of the Event source + Required Body Parameters (body description)- EventSourcesUpdate {name (string, optional): Event source Name,description (string, optional): Event source description,ipaddress (string, optional): Unique IP Address of the event source,vendor (string, optional) = ['Aruba IntroSpect' or 'Check Point' or 'Infoblox' or 'Juniper Networks' or 'Palo Alto Networks']: Vendor name,type (string, optional) = ['Syslog']: Event source type,enable (boolean, optional): Enable event source} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "ipaddress": "", + "vendor": "", + "type": "", + "enable": false + } + """ + url_path = "/event-sources/{event_sources_id}" + dict_path = {"event_sources_id": event_sources_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_event_sources_by_event_sources_id(self, event_sources_id="", body=({})): + """ + Operation: Replace an event source + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: event_sources_id, Description: Unique id of the Event source + Required Body Parameters (body description)- EventSourcesReplace {name (string): Event source Name,description (string, optional): Event source description,ipaddress (string): Unique IP Address of the event source,vendor (string) = ['Aruba IntroSpect' or 'Check Point' or 'Infoblox' or 'Juniper Networks' or 'Palo Alto Networks']: Vendor name,type (string) = ['Syslog']: Event source type,enable (boolean, optional): Enable event source} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "ipaddress": "", + "vendor": "", + "type": "", + "enable": false + } + """ + url_path = "/event-sources/{event_sources_id}" + dict_path = {"event_sources_id": event_sources_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_event_sources_by_event_sources_id(self, event_sources_id=""): + """ + Operation: Delete an event source + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: event_sources_id, Description: Unique id of the Event source + """ + url_path = "/event-sources/{event_sources_id}" + dict_path = {"event_sources_id": event_sources_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_event_sources_name_by_name(self, name=""): + """ + Operation: Get an event source by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the event source + """ + url_path = "/event-sources/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_event_sources_name_by_name(self, name="", body=({})): + """ + Operation: Update some fields of an event source by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the event source + Required Body Parameters (body description)- EventSourcesUpdate {name (string, optional): Event source Name,description (string, optional): Event source description,ipaddress (string, optional): Unique IP Address of the event source,vendor (string, optional) = ['Aruba IntroSpect' or 'Check Point' or 'Infoblox' or 'Juniper Networks' or 'Palo Alto Networks']: Vendor name,type (string, optional) = ['Syslog']: Event source type,enable (boolean, optional): Enable event source} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "ipaddress": "", + "vendor": "", + "type": "", + "enable": false + } + """ + url_path = "/event-sources/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_event_sources_name_by_name(self, name="", body=({})): + """ + Operation: Replace an event source by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the event source + Required Body Parameters (body description)- EventSourcesReplace {name (string): Event source Name,description (string, optional): Event source description,ipaddress (string): Unique IP Address of the event source,vendor (string) = ['Aruba IntroSpect' or 'Check Point' or 'Infoblox' or 'Juniper Networks' or 'Palo Alto Networks']: Vendor name,type (string) = ['Syslog']: Event source type,enable (boolean, optional): Enable event source} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "ipaddress": "", + "vendor": "", + "type": "", + "enable": false + } + """ + url_path = "/event-sources/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_event_sources_name_by_name(self, name=""): + """ + Operation: Delete an event source by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the event source + """ + url_path = "/event-sources/name/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:ExtensionInstance + # Function Section Description: Manage the system’s installed extensions + + def get_extension_instance( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of installed extensions + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +name) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/extension/instance" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_extension_instance(self, body=({})): + """ + Operation: Install an extension + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ExtensionInstanceCreate {state (string, optional) = ['stopped' or 'running']: Desired state of the extension,store_id (string): ID from the extension store,files (object, optional): Maps extension file IDs to local content items, with ‘public:’ or ‘private:’ prefix,ip_address (string, optional): IP address to allocate to the extension, or null,note (string, optional): Note to be displayed with the extension.} + Required Body Parameters (type(dict) body example)- { + "state": "", + "store_id": "", + "files": "object", + "ip_address": "", + "note": "" + } + """ + url_path = "/extension/instance" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_extension_instance_by_id(self, id=""): + """ + Operation: Get details of an installed extension + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: ID of the extension instance + """ + url_path = "/extension/instance/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_extension_instance_by_id(self, id="", body=({})): + """ + Operation: Change the state of an installed extension + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + Required Body Parameters (body description)- ExtensionInstanceModify {state (string, optional) = ['stopped' or 'running']: Desired state of the extension,note (string, optional): Note to be displayed with the extension.} + Required Body Parameters (type(dict) body example)- { + "state": "", + "note": "" + } + """ + url_path = "/extension/instance/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def delete_extension_instance_by_id(self, id="", force=""): + """ + Operation: Uninstall an extension + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + Optional Query Parameter Name: force, Description: True to send a kill signal to the extension before deleting + """ + url_path = "/extension/instance/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"force": force} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:ExtensionInstanceConfig + # Function Section Description: Configure an installed extension + + def get_extension_instance_by_id_config(self, id=""): + """ + Operation: Get the configuration of an installed extension + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + """ + url_path = "/extension/instance/{id}/config" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_extension_instance_by_id_config(self, id="", body=({})): + """ + Operation: Set the configuration of an installed extension + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + Required Body Parameters (body description)- ExtensionInstanceConfig {} + Required Body Parameters (type(dict) body example)- {} + """ + url_path = "/extension/instance/{id}/config" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="put") + + # Function Section Name:ExtensionInstanceLog + # Function Section Description: Read logs from an installed extension + + def get_extension_instance_by_id_log( + self, id="", stdout="", stderr="", since="", timestamps="", tail="" + ): + """ + Operation: Get the log output from an installed extension + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + Optional Query Parameter Name: stdout, Description: Include extension’s standard-output messages + Optional Query Parameter Name: stderr, Description: Include extension’s standard-error messages + Optional Query Parameter Name: since, Description: Specify a UNIX timestamp to only return log entries since that time + Optional Query Parameter Name: timestamps, Description: Prefix every log line with its UTC timestamp + Optional Query Parameter Name: tail, Description: Return this number of lines at the end of the logs, or "all" for everything + """ + url_path = "/extension/instance/{id}/log" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = { + "stdout": stdout, + "stderr": stderr, + "since": since, + "timestamps": timestamps, + "tail": tail, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:ExtensionInstanceReinstall + # Function Section Description: Reinstall an extension + + def new_extension_instance_by_id_reinstall(self, id="", body=({})): + """ + Operation: Reinstall an extension + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + Required Body Parameters (body description)- ExtensionInstanceReinstall {state (string, optional) = ['stopped' or 'running']: Desired state of the extension,files (object, optional): Maps extension file IDs to local content items, with ‘public:’ or ‘private:’ prefix,ip_address (string, optional): IP address to allocate to the extension, or null} + Required Body Parameters (type(dict) body example)- { + "state": "", + "files": "object", + "ip_address": "" + } + """ + url_path = "/extension/instance/{id}/reinstall" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:ExtensionInstanceRestart + # Function Section Description: Restart an installed extension + + def new_extension_instance_by_id_restart(self, id=""): + """ + Operation: Restart an installed extension + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + """ + url_path = "/extension/instance/{id}/restart" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="post") + + # Function Section Name:ExtensionInstanceStart + # Function Section Description: Start an installed extension + + def new_extension_instance_by_id_start(self, id=""): + """ + Operation: Start an installed extension + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + """ + url_path = "/extension/instance/{id}/start" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="post") + + # Function Section Name:ExtensionInstanceStop + # Function Section Description: Stop an installed extension + + def new_extension_instance_by_id_stop(self, id=""): + """ + Operation: Stop an installed extension + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + """ + url_path = "/extension/instance/{id}/stop" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="post") + + # Function Section Name:ExtensionInstanceUpgrade + # Function Section Description: Upgrade an extension + + def get_extension_instance_by_id_upgrade(self, id=""): + """ + Operation: Get information on an extension's available upgrade + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: ID of the extension instance + """ + url_path = "/extension/instance/{id}/upgrade" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_extension_instance_by_id_upgrade(self, id="", body=({})): + """ + Operation: Upgrade an extension + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the extension instance + Required Body Parameters (body description)- ExtensionInstanceUpgrade {major (boolean, optional): Indicated whether to install major extension upgrades. False by default.,state (string, optional) = ['stopped' or 'running']: Desired state of the extension,files (object, optional): Maps extension file IDs to local content items, with ‘public:’ or ‘private:’ prefix,ip_address (string, optional): IP address to allocate to the extension, or null} + Required Body Parameters (type(dict) body example)- { + "major": false, + "state": "", + "files": "object", + "ip_address": "" + } + """ + url_path = "/extension/instance/{id}/upgrade" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:ExtensionStore + # Function Section Description: Query the extension store + + def get_extension_store( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Find a extension in the store + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +name) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/extension/store" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_extension_store_by_id(self, id=""): + """ + Operation: Get details of an extension in the store + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/extension/store/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:IngressEventDictionary + # Function Section Description: Manage Ingress Event Dictionaries + + def get_ingress_event_dictionary( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of Ingress Event Dictionaries + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/ingress-event-dictionary" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_ingress_event_dictionary(self, body=({})): + """ + Operation: Create a new Ingress Event Dictionary + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- IngressEventDictionaryCreate {vendor (string): Vendor of the ingress event,format_name (string): Format Name of the ingress event,prefix (string): Prefix of the ingress event,status (boolean, optional): Status of the ingress event,description (string, optional): Description of the ingress event,format (string, optional): Format of the ingress event,sample (string, optional): Sample of the ingress event,filter (string): Filter of the ingress event,fields (array[Fields]): Fields of the ingress event,generic_fields (array[GenericFields]): Generic Fields of the ingress event}Fields {attr_name (string): Ingress Event Field atrribute name,data_type (string): Ingress Event Field attribute type,allowed_values (string, optional): Allowed values for Ingress Event Field in CSV format}GenericFields {attr_name (string): Ingress Event Generic Field attribute name,generic_name (string): Ingress Event Generic name of the attribute} + Required Body Parameters (type(dict) body example)- { + "vendor": "", + "format_name": "", + "prefix": "", + "status": false, + "description": "", + "format": "", + "sample": "", + "filter": "", + "fields": [ + { + "attr_name": "", + "data_type": "", + "allowed_values": "" + } + ], + "generic_fields": [ + { + "attr_name": "", + "generic_name": "" + } + ] + } + """ + url_path = "/ingress-event-dictionary" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_ingress_event_dictionary_by_ingress_event_dictionary_id( + self, ingress_event_dictionary_id="" + ): + """ + Operation: Get an Ingress Event Dictionary + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: ingress_event_dictionary_id, Description: Numeric ID of the ingress event dictionary + """ + url_path = "/ingress-event-dictionary/{ingress_event_dictionary_id}" + dict_path = {"ingress_event_dictionary_id": ingress_event_dictionary_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_ingress_event_dictionary_by_ingress_event_dictionary_id( + self, ingress_event_dictionary_id="", body=({}) + ): + """ + Operation: Update an Ingress Event Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: ingress_event_dictionary_id, Description: Numeric ID of the ingress event dictionary + Required Body Parameters (body description)- IngressEventDictionaryUpdate {vendor (string, optional): Vendor of the ingress event,format_name (string, optional): Format Name of the ingress event,prefix (string, optional): Prefix of the ingress event,status (boolean, optional): Status of the ingress event,description (string, optional): Description of the ingress event,format (string, optional): Format of the ingress event,sample (string, optional): Sample of the ingress event,filter (string, optional): Filter of the ingress event,fields (array[Fields], optional): Fields of the ingress event,generic_fields (array[GenericFields], optional): Generic Fields of the ingress event}Fields {attr_name (string): Ingress Event Field atrribute name,data_type (string): Ingress Event Field attribute type,allowed_values (string, optional): Allowed values for Ingress Event Field in CSV format}GenericFields {attr_name (string): Ingress Event Generic Field attribute name,generic_name (string): Ingress Event Generic name of the attribute} + Required Body Parameters (type(dict) body example)- { + "vendor": "", + "format_name": "", + "prefix": "", + "status": false, + "description": "", + "format": "", + "sample": "", + "filter": "", + "fields": [ + { + "attr_name": "", + "data_type": "", + "allowed_values": "" + } + ], + "generic_fields": [ + { + "attr_name": "", + "generic_name": "" + } + ] + } + """ + url_path = "/ingress-event-dictionary/{ingress_event_dictionary_id}" + dict_path = {"ingress_event_dictionary_id": ingress_event_dictionary_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_ingress_event_dictionary_by_ingress_event_dictionary_id( + self, ingress_event_dictionary_id="", body=({}) + ): + """ + Operation: Replace an Ingress Event Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: ingress_event_dictionary_id, Description: Numeric ID of the ingress event dictionary + Required Body Parameters (body description)- IngressEventDictionaryReplace {vendor (string): Vendor of the ingress event,format_name (string): Format Name of the ingress event,prefix (string): Prefix of the ingress event,status (boolean, optional): Status of the ingress event,description (string, optional): Description of the ingress event,format (string, optional): Format of the ingress event,sample (string, optional): Sample of the ingress event,filter (string): Filter of the ingress event,fields (array[Fields]): Fields of the ingress event,generic_fields (array[GenericFields]): Generic Fields of the ingress event}Fields {attr_name (string): Ingress Event Field atrribute name,data_type (string): Ingress Event Field attribute type,allowed_values (string, optional): Allowed values for Ingress Event Field in CSV format}GenericFields {attr_name (string): Ingress Event Generic Field attribute name,generic_name (string): Ingress Event Generic name of the attribute} + Required Body Parameters (type(dict) body example)- { + "vendor": "", + "format_name": "", + "prefix": "", + "status": false, + "description": "", + "format": "", + "sample": "", + "filter": "", + "fields": [ + { + "attr_name": "", + "data_type": "", + "allowed_values": "" + } + ], + "generic_fields": [ + { + "attr_name": "", + "generic_name": "" + } + ] + } + """ + url_path = "/ingress-event-dictionary/{ingress_event_dictionary_id}" + dict_path = {"ingress_event_dictionary_id": ingress_event_dictionary_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_ingress_event_dictionary_by_ingress_event_dictionary_id( + self, ingress_event_dictionary_id="" + ): + """ + Operation: Delete an Ingress Event Dictionary + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: ingress_event_dictionary_id, Description: Numeric ID of the ingress event dictionary + """ + url_path = "/ingress-event-dictionary/{ingress_event_dictionary_id}" + dict_path = {"ingress_event_dictionary_id": ingress_event_dictionary_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + def get_ingress_event_dictionary_format_name_by_format_name(self, format_name=""): + """ + Operation: Get an Ingress Event Dictionary by format_name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: format_name, Description: format_name of the ingress event dictionary + """ + url_path = "/ingress-event-dictionary/format_name/{format_name}" + dict_path = {"format_name": format_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_ingress_event_dictionary_format_name_by_format_name( + self, format_name="", body=({}) + ): + """ + Operation: Update an Ingress Event Dictionary by format_name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: format_name, Description: format_name of the ingress event dictionary + Required Body Parameters (body description)- IngressEventDictionaryUpdate {vendor (string, optional): Vendor of the ingress event,format_name (string, optional): Format Name of the ingress event,prefix (string, optional): Prefix of the ingress event,status (boolean, optional): Status of the ingress event,description (string, optional): Description of the ingress event,format (string, optional): Format of the ingress event,sample (string, optional): Sample of the ingress event,filter (string, optional): Filter of the ingress event,fields (array[Fields], optional): Fields of the ingress event,generic_fields (array[GenericFields], optional): Generic Fields of the ingress event}Fields {attr_name (string): Ingress Event Field atrribute name,data_type (string): Ingress Event Field attribute type,allowed_values (string, optional): Allowed values for Ingress Event Field in CSV format}GenericFields {attr_name (string): Ingress Event Generic Field attribute name,generic_name (string): Ingress Event Generic name of the attribute} + Required Body Parameters (type(dict) body example)- { + "vendor": "", + "format_name": "", + "prefix": "", + "status": false, + "description": "", + "format": "", + "sample": "", + "filter": "", + "fields": [ + { + "attr_name": "", + "data_type": "", + "allowed_values": "" + } + ], + "generic_fields": [ + { + "attr_name": "", + "generic_name": "" + } + ] + } + """ + url_path = "/ingress-event-dictionary/format_name/{format_name}" + dict_path = {"format_name": format_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def replace_ingress_event_dictionary_format_name_by_format_name( + self, format_name="", body=({}) + ): + """ + Operation: Replace an Ingress Event Dictionary by format_name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: format_name, Description: format_name of the ingress event dictionary + Required Body Parameters (body description)- IngressEventDictionaryReplace {vendor (string): Vendor of the ingress event,format_name (string): Format Name of the ingress event,prefix (string): Prefix of the ingress event,status (boolean, optional): Status of the ingress event,description (string, optional): Description of the ingress event,format (string, optional): Format of the ingress event,sample (string, optional): Sample of the ingress event,filter (string): Filter of the ingress event,fields (array[Fields]): Fields of the ingress event,generic_fields (array[GenericFields]): Generic Fields of the ingress event}Fields {attr_name (string): Ingress Event Field atrribute name,data_type (string): Ingress Event Field attribute type,allowed_values (string, optional): Allowed values for Ingress Event Field in CSV format}GenericFields {attr_name (string): Ingress Event Generic Field attribute name,generic_name (string): Ingress Event Generic name of the attribute} + Required Body Parameters (type(dict) body example)- { + "vendor": "", + "format_name": "", + "prefix": "", + "status": false, + "description": "", + "format": "", + "sample": "", + "filter": "", + "fields": [ + { + "attr_name": "", + "data_type": "", + "allowed_values": "" + } + ], + "generic_fields": [ + { + "attr_name": "", + "generic_name": "" + } + ] + } + """ + url_path = "/ingress-event-dictionary/format_name/{format_name}" + dict_path = {"format_name": format_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_ingress_event_dictionary_format_name_by_format_name( + self, format_name="" + ): + """ + Operation: Delete an Ingress Event Dictionary by format_name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: format_name, Description: format_name of the ingress event dictionary + """ + url_path = "/ingress-event-dictionary/format_name/{format_name}" + dict_path = {"format_name": format_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_localserverconfiguration_v1.py b/pyclearpass/api_explorer_localserverconfiguration_v1.py new file mode 100644 index 0000000..56ca6f3 --- /dev/null +++ b/pyclearpass/api_explorer_localserverconfiguration_v1.py @@ -0,0 +1,479 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_localserverconfiguration_v1.py + + +class ApiLocalServerConfiguration(ClearPassAPILogin): + # Function Section Name:AccessControl + # Function Section Description: Manage Application access controls + + def get_server_access_control_by_server_uuid(self, server_uuid=""): + """ + Operation: Get all application access controls + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: UUID of the server + """ + url_path = "/server/access-control/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_server_access_control_by_server_uuid_resource_name( + self, server_uuid="", resource_name="" + ): + """ + Operation: Get an application access control by resource name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: resource_name, Description: Unique resource name of the access control + """ + url_path = "/server/access-control/{server_uuid}/{resource_name}" + dict_path = {"server_uuid": server_uuid, "resource_name": resource_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_server_access_control_by_server_uuid_resource_name( + self, server_uuid="", resource_name="", body=({}) + ): + """ + Operation: Replace an application access controls by resource name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: resource_name, Description: Unique resource name of the access control + Required Body Parameters (body description)- AccessControlReplace {access (string) = ['Allow' or 'Deny']: Access type of the Access control application,networks (object): hostname, IP address or subnet (CIDR) of the Networks to be restricted (e.g. ["hostname.example.com", "1.2.3.4", "10.1.0.0/16"])} + Required Body Parameters (type(dict) body example)- { + "access": "", + "networks": "object" + } + """ + url_path = "/server/access-control/{server_uuid}/{resource_name}" + dict_path = {"server_uuid": server_uuid, "resource_name": resource_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def delete_server_access_control_by_server_uuid_resource_name( + self, server_uuid="", resource_name="" + ): + """ + Operation: Delete an application access control by resource name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: resource_name, Description: Unique resource name of the access control + """ + url_path = "/server/access-control/{server_uuid}/{resource_name}" + dict_path = {"server_uuid": server_uuid, "resource_name": resource_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:ADDomain + # Function Section Description: Manage AD Domains + + def get_ad_domain_by_server_uuid(self, server_uuid=""): + """ + Operation: Get a list of AD Domains + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: URL parameter server_uuid + """ + url_path = "/ad-domain/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_ad_domain_by_server_uuid_netbios_name_netbios_name( + self, server_uuid="", netbios_name="" + ): + """ + Operation: GET an AD domain by netbios_name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: URL parameter server_uuid + Required Path Parameter Name: netbios_name, Description: NetBIOS name of the domain + """ + url_path = "/ad-domain/{server_uuid}/netbios-name/{netbios_name}" + dict_path = {"server_uuid": server_uuid, "netbios_name": netbios_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_ad_domain_join_by_server_uuid(self, server_uuid="", body=({})): + """ + Operation: Join AD Domain + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: URL parameter server_uuid + Required Body Parameters (body description)- ADDomainJoin {domain_controller (string): FQDN of the domain controller,netbios_name (string): NetBIOS name of the domain,on_name_conflict (integer): Action to perform in case of a controller name conflict(1 - Use specified Domain Controller, 2 - Use Domain Controller returned by DNS query, 3 - Fail on conflict),username (string): Domain username ,password (string): Domain password} + Required Body Parameters (type(dict) body example)- { + "domain_controller": "", + "netbios_name": "", + "on_name_conflict": 0, + "username": "", + "password": "" + } + """ + url_path = "/ad-domain/join/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def replace_ad_domain_leave_by_server_uuid(self, server_uuid="", body=({})): + """ + Operation: Leave AD domain + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: URL parameter server_uuid + Required Body Parameters (body description)- ADDomainLeave {netbios_name (string): NetBIOS name of the domain,username (string): Domain username ,password (string): Domain password,force_leave (boolean): Leave domain even if AD is down} + Required Body Parameters (type(dict) body example)- { + "netbios_name": "", + "username": "", + "password": "", + "force_leave": false + } + """ + url_path = "/ad-domain/leave/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def update_ad_domain_password_servers_by_server_uuid( + self, server_uuid="", body=({}) + ): + """ + Operation: Configure AD Password Servers + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: URL parameter server_uuid + Required Body Parameters (body description)- ADDomainUpdate {netbios_name (string): NetBIOS name of the domain,password_servers (object): List of Hostname or IP Address of the AD password servers} + Required Body Parameters (type(dict) body example)- { + "netbios_name": "", + "password_servers": "object" + } + """ + url_path = "/ad-domain/password-servers/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:CppmVersion + # Function Section Description: Manage Cppm Version + + def get_cppm_version(self, server_uuid="", body=({})): + """ + Operation: Get Cppm version + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: URL parameter server_uuid + Required Body Parameters (body description)- ADDomainUpdate {netbios_name (string): NetBIOS name of the domain,password_servers (object): List of Hostname or IP Address of the AD password servers} + Required Body Parameters (type(dict) body example)- { + "netbios_name": "", + "password_servers": "object" + } + """ + url_path = "/cppm-version" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + # Function Section Name:ServerConfiguration + # Function Section Description: Manage cluster servers and per-server configuration + + def get_cluster_server(self, server_uuid="", body=({})): + """ + Operation: Get a list of servers in the cluster + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: URL parameter server_uuid + Required Body Parameters (body description)- ADDomainUpdate {netbios_name (string): NetBIOS name of the domain,password_servers (object): List of Hostname or IP Address of the AD password servers} + Required Body Parameters (type(dict) body example)- { + "netbios_name": "", + "password_servers": "object" + } + """ + url_path = "/cluster/server" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def get_cluster_server_by_uuid(self, uuid=""): + """ + Operation: Get configuration of a server + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: uuid, Description: Server UUID, "publisher" or "this" + """ + url_path = "/cluster/server/{uuid}" + dict_path = {"uuid": uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_cluster_server_by_uuid(self, uuid="", body=({})): + """ + Operation: Update configuration of a server + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: uuid, Description: Server UUID, "publisher" or "this" + Required Body Parameters (body description)- ServerConfigurationChange {is_insight_enabled (bool, optional): True if this server has Insight reporting enabled} + Required Body Parameters (type(dict) body example)- { + "is_insight_enabled": "bool" + } + """ + url_path = "/cluster/server/{uuid}" + dict_path = {"uuid": uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:ServerFips + # Function Section Description: Get server FIPS mode information + + def get_server_fips(self, uuid="", body=({})): + """ + Operation: Get server FIPS mode information + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: uuid, Description: Server UUID, "publisher" or "this" + Required Body Parameters (body description)- ServerConfigurationChange {is_insight_enabled (bool, optional): True if this server has Insight reporting enabled} + Required Body Parameters (type(dict) body example)- { + "is_insight_enabled": "bool" + } + """ + url_path = "/server/fips" + dict_path = {"uuid": uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + # Function Section Name:ServerSnmp + # Function Section Description: Manage server snmp settings + + def get_server_snmp_by_server_uuid(self, server_uuid=""): + """ + Operation: Get server snmp settings + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: UUID of the server + """ + url_path = "/server/snmp/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_server_snmp_by_server_uuid(self, server_uuid="", body=({})): + """ + Operation: Replace server snmp settings + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Body Parameters (body description)- ServerSnmpReplace {system_location (string, optional): System location of the system monitoring settings for a server,system_contact (string, optional): System contact of the system monitoring settings for a server,engine_id (string): Engine ID of system monitoring settings,version (string) = ['V1' or 'V2C' or 'V3']: SNMP Version of the system monitoring settings,community_string (string, optional): Community String of the system monitoring settings,username (string, optional): Username for system monitoring settings,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security Level of system monitoring settings,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication Protocol of system monitoring settings,auth_key (string, optional): Authentication key of system monitoring settings,privacy_protocol (string, optional) = ['DES' or 'AES']: Privacy Protocol of system monitoring settings,privacy_key (string, optional): Privacy key of system monitoring settings} + Required Body Parameters (type(dict) body example)- { + "system_location": "", + "system_contact": "", + "engine_id": "", + "version": "", + "community_string": "", + "username": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + } + """ + url_path = "/server/snmp/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def update_server_snmp_by_server_uuid(self, server_uuid="", body=({})): + """ + Operation: Update some fields of server snmp settings + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Body Parameters (body description)- ServerSnmpUpdate {system_location (string, optional): System location of the system monitoring settings for a server,system_contact (string, optional): System contact of the system monitoring settings for a server,engine_id (string, optional): Engine ID of system monitoring settings,version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP Version of the system monitoring settings,community_string (string, optional): Community String of the system monitoring settings,username (string, optional): Username for system monitoring settings,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security Level of system monitoring settings,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication Protocol of system monitoring settings,auth_key (string, optional): Authentication key of system monitoring settings,privacy_protocol (string, optional) = ['DES' or 'AES']: Privacy Protocol of system monitoring settings,privacy_key (string, optional): Privacy key of system monitoring settings} + Required Body Parameters (type(dict) body example)- { + "system_location": "", + "system_contact": "", + "engine_id": "", + "version": "", + "community_string": "", + "username": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + } + """ + url_path = "/server/snmp/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:ServerVersion + # Function Section Description: Get server version information + + def get_server_version(self, server_uuid="", body=({})): + """ + Operation: Get server version information + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Body Parameters (body description)- ServerSnmpUpdate {system_location (string, optional): System location of the system monitoring settings for a server,system_contact (string, optional): System contact of the system monitoring settings for a server,engine_id (string, optional): Engine ID of system monitoring settings,version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP Version of the system monitoring settings,community_string (string, optional): Community String of the system monitoring settings,username (string, optional): Username for system monitoring settings,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security Level of system monitoring settings,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication Protocol of system monitoring settings,auth_key (string, optional): Authentication key of system monitoring settings,privacy_protocol (string, optional) = ['DES' or 'AES']: Privacy Protocol of system monitoring settings,privacy_key (string, optional): Privacy key of system monitoring settings} + Required Body Parameters (type(dict) body example)- { + "system_location": "", + "system_contact": "", + "engine_id": "", + "version": "", + "community_string": "", + "username": "", + "security_level": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + } + """ + url_path = "/server/version" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + # Function Section Name:ServiceParameter + # Function Section Description: Manage service parameters + + def get_service_parameter_by_server_uuid_service_id( + self, server_uuid="", service_id="" + ): + """ + Operation: Get service parameter details + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: service_id, Description: Unique id for the service + """ + url_path = "/service-parameter/{server_uuid}/{service_id}" + dict_path = {"server_uuid": server_uuid, "service_id": service_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_service_parameter_by_server_uuid_service_id( + self, server_uuid="", service_id="", body=({}) + ): + """ + Operation: Update service parameter values + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: service_id, Description: Unique id for the service + Required Body Parameters (body description)- ServiceParameterUpdate {param_name_1 (string, optional): param_value_1,param_name_2 (string, optional): param_value_2...} + Required Body Parameters (type(dict) body example)- { + "param_name_1": "", + "param_name_2": "" + } + """ + url_path = "/service-parameter/{server_uuid}/{service_id}" + dict_path = {"server_uuid": server_uuid, "service_id": service_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + # Function Section Name:SystemServiceControl + # Function Section Description: Control services running on a server + + def get_server_service_by_server_uuid(self, server_uuid=""): + """ + Operation: Get all services + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: AlphaNumeric Unique Id of the Server + """ + url_path = "/server/service/{server_uuid}" + dict_path = {"server_uuid": server_uuid} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_server_service_by_server_uuid_service_name( + self, server_uuid="", service_name="" + ): + """ + Operation: Get a service by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: AlphaNumeric Unique Id of the Server + Required Path Parameter Name: service_name, Description: Unique Name of the SystemServiceControl + """ + url_path = "/server/service/{server_uuid}/{service_name}" + dict_path = {"server_uuid": server_uuid, "service_name": service_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_server_service_by_server_uuid_service_name_start( + self, server_uuid="", service_name="" + ): + """ + Operation: Start a service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: AlphaNumeric Unique Id of the Server + Required Path Parameter Name: service_name, Description: Unique Name of the SystemServiceControl + """ + url_path = "/server/service/{server_uuid}/{service_name}/start" + dict_path = {"server_uuid": server_uuid, "service_name": service_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_server_service_by_server_uuid_service_name_stop( + self, server_uuid="", service_name="" + ): + """ + Operation: Stop a service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: AlphaNumeric Unique Id of the Server + Required Path Parameter Name: service_name, Description: Unique Name of the SystemServiceControl + """ + url_path = "/server/service/{server_uuid}/{service_name}/stop" + dict_path = {"server_uuid": server_uuid, "service_name": service_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") diff --git a/pyclearpass/api_explorer_logs_v1.py b/pyclearpass/api_explorer_logs_v1.py new file mode 100644 index 0000000..01ed24e --- /dev/null +++ b/pyclearpass/api_explorer_logs_v1.py @@ -0,0 +1,124 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_logs_v1.py + + +class ApiLogs(ClearPassAPILogin): + # Function Section Name:EndpointInfo + # Function Section Description: Collection of endpoints + + def get_insight_endpoint_mac_by_mac(self, mac=""): + """ + Operation: Get a single endpoint by MAC address + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: mac, Description: URL parameter mac + """ + url_path = "/insight/endpoint/mac/{mac}" + dict_path = {"mac": mac} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_insight_endpoint_ip_by_ip(self, ip=""): + """ + Operation: Look up endpoints by IP address + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: ip, Description: IPv4/IPv6 address to match with endpoints + """ + url_path = "/insight/endpoint/ip/{ip}" + dict_path = {"ip": ip} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_insight_endpoint_ip_range_by_ip_range(self, ip_range=""): + """ + Operation: Look up endpoints by IP address range + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: ip_range, Description: IPv4/IPv6 address range, e.g. 192.168.1.1-255 or 2001:db8:a0b:12cd::a-f + """ + url_path = "/insight/endpoint/ip-range/{ip_range}" + dict_path = {"ip_range": ip_range} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_insight_endpoint_time_range_by_from_time_to_time( + self, from_time="", to_time="" + ): + """ + Operation: Look up endpoints by time range + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: from_time, Description: Start time for search, as UNIX timestamp + Required Path Parameter Name: to_time, Description: End time for search, as UNIX timestamp + """ + url_path = "/insight/endpoint/time-range/{from_time}/{to_time}" + dict_path = {"from_time": from_time, "to_time": to_time} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:LoginAudit + # Function Section Description: Get previous login details for an admin user + + def get_login_audit_by_name(self, name=""): + """ + Operation: Get previous login details for an admin user + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: User name of admin + """ + url_path = "/login-audit/{name}" + dict_path = {"name": name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:SystemEvents + # Function Section Description: Collection of system events + + def get_system_event( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of system events + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +source) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/system-event" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_system_event(self, body=({})): + """ + Operation: Create a new system event + HTTP Status Response Codes: 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SystemEvents {source (string): Source,level (string) = ['INFO' or 'ERROR' or 'WARN']: Level,category (string): Category,action (string): Action,description (string): Description,timestamp (string): Timestamp} + Required Body Parameters (type(dict) body example)- { + "source": "", + "level": "", + "category": "", + "action": "", + "description": "", + "timestamp": "" + } + """ + url_path = "/system-event" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) diff --git a/pyclearpass/api_explorer_platformcertificates_v1.py b/pyclearpass/api_explorer_platformcertificates_v1.py new file mode 100644 index 0000000..a8dfdd3 --- /dev/null +++ b/pyclearpass/api_explorer_platformcertificates_v1.py @@ -0,0 +1,531 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_platformcertificates_v1.py + + +class ApiPlatformCertificates(ClearPassAPILogin): + # Function Section Name:CertSignRequest + # Function Section Description: Manage Certificate Signing Requests + + def new_cert_sign_request(self, body=({})): + """ + Operation: Post a certificate sign request + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- CertSignRequestCreate {subject_CN (string): Common Name (CN),subject_O (string, optional): Organization (O),subject_OU (string, optional): Organizational Unit (OU),subject_L (string, optional): Location (L),subject_ST (string, optional): State (ST),subject_C (string, optional): Country (C),subject_SAN (string, optional): Subject Alternate Name (SAN),private_key_password (string): Private Key Password,private_key_type (string) = ['2048-bit rsa' or '3072-bit rsa' or '4096-bit rsa' or 'nist/secg curve over a 256 bit prime field' or 'nist/secg curve over a 384 bit prime field' or 'nist/secg curve over a 521 bit prime field']: null,digest_algorithm (string) = ['SHA-1' or 'SHA-224' or 'SHA-256' or 'SHA-384' or 'SHA-512']: Digest Algorithm} + Required Body Parameters (type(dict) body example)- { + "subject_CN": "", + "subject_O": "", + "subject_OU": "", + "subject_L": "", + "subject_ST": "", + "subject_C": "", + "subject_SAN": "", + "private_key_password": "", + "private_key_type": "", + "digest_algorithm": "" + } + """ + url_path = "/cert-sign-request" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:CertTrustList + # Function Section Description: Manage Certificate Trust List + + def get_cert_trust_list( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of certificate trust list + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/cert-trust-list" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_cert_trust_list(self, body=({})): + """ + Operation: Add a new certificate trust list + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- CertTrustListCreate {cert_file (string): Certificate trust list file,enabled (boolean, optional): Enable certificate trust list,cert_usage (array[string]) = ['AD/LDAP Servers' or 'Aruba Infrastructure' or 'Aruba Services' or 'Database' or 'EAP' or 'Endpoint Context Servers' or 'RadSec' or 'SAML' or 'SMTP' or 'EST' or 'Others']: Usage of the certificate} + Required Body Parameters (type(dict) body example)- { + "cert_file": "", + "enabled": false, + "cert_usage": [ + "" + ] + } + """ + url_path = "/cert-trust-list" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_cert_trust_list_by_cert_trust_list_id(self, cert_trust_list_id=""): + """ + Operation: Get a certificate trust list + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: cert_trust_list_id, Description: URL parameter cert_trust_list_id + """ + url_path = "/cert-trust-list/{cert_trust_list_id}" + dict_path = {"cert_trust_list_id": cert_trust_list_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_cert_trust_list_by_cert_trust_list_id( + self, cert_trust_list_id="", body=({}) + ): + """ + Operation: Enbale certificate trust list + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: cert_trust_list_id, Description: URL parameter cert_trust_list_id + Required Body Parameters (body description)- CertTrustListUpdate {cert_file (string, optional): Certificate trust list file,enabled (boolean, optional): Enable certificate trust list,cert_usage (array[string], optional) = ['AD/LDAP Servers' or 'Aruba Infrastructure' or 'Aruba Services' or 'Database' or 'EAP' or 'Endpoint Context Servers' or 'RadSec' or 'SAML' or 'SMTP' or 'EST' or 'Others']: Usage of the certificate} + Required Body Parameters (type(dict) body example)- { + "cert_file": "", + "enabled": false, + "cert_usage": [ + "" + ] + } + """ + url_path = "/cert-trust-list/{cert_trust_list_id}" + dict_path = {"cert_trust_list_id": cert_trust_list_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def delete_cert_trust_list_by_cert_trust_list_id(self, cert_trust_list_id=""): + """ + Operation: Delete a certificate trust list + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: cert_trust_list_id, Description: URL parameter cert_trust_list_id + """ + url_path = "/cert-trust-list/{cert_trust_list_id}" + dict_path = {"cert_trust_list_id": cert_trust_list_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:CertTrustListDetails + # Function Section Description: Manage Certificate Trust List details + + def get_cert_trust_list_details( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of certificate trust list details + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/cert-trust-list-details" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_cert_trust_list_details_by_cert_trust_list_details_id( + self, cert_trust_list_details_id="" + ): + """ + Operation: Get a certificate trust list details + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: cert_trust_list_details_id, Description: URL parameter cert_trust_list_details_id + """ + url_path = "/cert-trust-list-details/{cert_trust_list_details_id}" + dict_path = {"cert_trust_list_details_id": cert_trust_list_details_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:ClientCert + # Function Section Description: Manage Client Certificates + + def get_client_cert( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of client certificates + HTTP Status Response Codes: 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/client-cert" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_client_cert(self, body=({})): + """ + Operation: Add a client certificate + HTTP Status Response Codes: 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ClientCertCreate {certificate_url (string, optional): Certificate File URL,pkcs12_file_url (string, optional): PKCS12 File URL,pkcs12_passphrase (string, optional): PKCS12 passphrase} + Required Body Parameters (type(dict) body example)- { + "certificate_url": "", + "pkcs12_file_url": "", + "pkcs12_passphrase": "" + } + """ + url_path = "/client-cert" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_client_cert_by_client_cert_id(self, client_cert_id=""): + """ + Operation: Get a client certificate + HTTP Status Response Codes: 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: client_cert_id, Description: URL parameter client_cert_id + """ + url_path = "/client-cert/{client_cert_id}" + dict_path = {"client_cert_id": client_cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def delete_client_cert_by_client_cert_id(self, client_cert_id=""): + """ + Operation: Delete a client certificate + HTTP Status Response Codes: 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: client_cert_id, Description: URL parameter client_cert_id + """ + url_path = "/client-cert/{client_cert_id}" + dict_path = {"client_cert_id": client_cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:RevocationList + # Function Section Description: Manage Revocation Certificate List + + def get_revocation_list( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of revocation certificate list + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/revocation-list" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_revocation_list(self, body=({})): + """ + Operation: Add a new revocation certificate list + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RevocationListCreate {url (string): URL of the Certificate,bypass_proxy (boolean, optional): Bypass Proxy status of the Certificate,periodic_update (boolean, optional): Periodic Update status of the Certificate,periodic_update_interval (integer, optional): Periodic update time of the Certificate,last_update_status (string, optional): Last updated status,last_updated_time (string, optional): Last updated time,next_updated_time (string, optional): Next update time} + Required Body Parameters (type(dict) body example)- { + "url": "", + "bypass_proxy": false, + "periodic_update": false, + "periodic_update_interval": 0, + "last_update_status": "", + "last_updated_time": "", + "next_updated_time": "" + } + """ + url_path = "/revocation-list" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_revocation_list_by_revocation_list_id(self, revocation_list_id=""): + """ + Operation: Get a certificate by id + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: revocation_list_id, Description: URL parameter revocation_list_id + """ + url_path = "/revocation-list/{revocation_list_id}" + dict_path = {"revocation_list_id": revocation_list_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def update_revocation_list_by_revocation_list_id( + self, revocation_list_id="", body=({}) + ): + """ + Operation: Update a certificate + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: revocation_list_id, Description: URL parameter revocation_list_id + Required Body Parameters (body description)- RevocationListUpdate {url (string, optional): URL of the Certificate,bypass_proxy (boolean, optional): Bypass Proxy status of the Certificate,periodic_update (boolean, optional): Periodic Update status of the Certificate,periodic_update_interval (integer, optional): Periodic update time of the Certificate,last_update_status (string, optional): Last updated status,last_updated_time (string, optional): Last updated time,next_updated_time (string, optional): Next update time} + Required Body Parameters (type(dict) body example)- { + "url": "", + "bypass_proxy": false, + "periodic_update": false, + "periodic_update_interval": 0, + "last_update_status": "", + "last_updated_time": "", + "next_updated_time": "" + } + """ + url_path = "/revocation-list/{revocation_list_id}" + dict_path = {"revocation_list_id": revocation_list_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="patch", query=body + ) + + def delete_revocation_list_by_revocation_list_id(self, revocation_list_id=""): + """ + Operation: Delete a certificate list by id + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: revocation_list_id, Description: URL parameter revocation_list_id + """ + url_path = "/revocation-list/{revocation_list_id}" + dict_path = {"revocation_list_id": revocation_list_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") + + # Function Section Name:SelfSignedCert + # Function Section Description: Manage Self-Signed Certificates + + def new_self_signed_cert(self, body=({})): + """ + Operation: Create a Self-Signed Certificate + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SelfSignedCertCreate {certificate_type (string) = ['SERVER' or 'SERVICE']: Certificate Type,server (string): Server hostname,type (string) = ['RADIUS/EAP Server Certificate' or 'HTTPS(ECC) Server Certificate' or 'HTTPS(RSA) Server Certificate' or 'RadSec Server Certificate' or 'Database Server Certificate']: Service Type,subject_CN (string): Common Name (CN),subject_O (string, optional): Organization (O),subject_OU (string, optional): Organizational Unit (OU),subject_L (string, optional): Location (L),subject_ST (string, optional): State (ST),subject_C (string, optional): Country (C),subject_SAN (string, optional): Subject Alternate Name (SAN),private_key_password (string): Private Key Password,private_key_type (string) = ['2048-bit rsa' or '3072-bit rsa' or '4096-bit rsa' or 'nist/secg curve over a 256 bit prime field' or 'nist/secg curve over a 384 bit prime field' or 'nist/secg curve over a 521 bit prime field']: Private Key Type,digest_algorithm (string) = ['SHA-1' or 'SHA-224' or 'SHA-256' or 'SHA-384' or 'SHA-512']: Digest Algorithm} + Required Body Parameters (type(dict) body example)- { + "certificate_type": "", + "server": "", + "type": "", + "subject_CN": "", + "subject_O": "", + "subject_OU": "", + "subject_L": "", + "subject_ST": "", + "subject_C": "", + "subject_SAN": "", + "private_key_password": "", + "private_key_type": "", + "digest_algorithm": "" + } + """ + url_path = "/self-signed-cert" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:ServerCert + # Function Section Description: Manage Server Certificates + + def get_server_cert(self, body=({})): + """ + Operation: Get a list of server certificates + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- SelfSignedCertCreate {certificate_type (string) = ['SERVER' or 'SERVICE']: Certificate Type,server (string): Server hostname,type (string) = ['RADIUS/EAP Server Certificate' or 'HTTPS(ECC) Server Certificate' or 'HTTPS(RSA) Server Certificate' or 'RadSec Server Certificate' or 'Database Server Certificate']: Service Type,subject_CN (string): Common Name (CN),subject_O (string, optional): Organization (O),subject_OU (string, optional): Organizational Unit (OU),subject_L (string, optional): Location (L),subject_ST (string, optional): State (ST),subject_C (string, optional): Country (C),subject_SAN (string, optional): Subject Alternate Name (SAN),private_key_password (string): Private Key Password,private_key_type (string) = ['2048-bit rsa' or '3072-bit rsa' or '4096-bit rsa' or 'nist/secg curve over a 256 bit prime field' or 'nist/secg curve over a 384 bit prime field' or 'nist/secg curve over a 521 bit prime field']: Private Key Type,digest_algorithm (string) = ['SHA-1' or 'SHA-224' or 'SHA-256' or 'SHA-384' or 'SHA-512']: Digest Algorithm} + Required Body Parameters (type(dict) body example)- { + "certificate_type": "", + "server": "", + "type": "", + "subject_CN": "", + "subject_O": "", + "subject_OU": "", + "subject_L": "", + "subject_ST": "", + "subject_C": "", + "subject_SAN": "", + "private_key_password": "", + "private_key_type": "", + "digest_algorithm": "" + } + """ + url_path = "/server-cert" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def get_server_cert_name_by_server_uuid_service_name( + self, server_uuid="", service_name="" + ): + """ + Operation: Get a server certificate + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: service_name, Description: Service name (RADIUS, HTTPS(RSA), HTTPS(ECC) or RadSec) + """ + url_path = "/server-cert/name/{server_uuid}/{service_name}" + dict_path = {"server_uuid": server_uuid, "service_name": service_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def replace_server_cert_name_by_server_uuid_service_name( + self, server_uuid="", service_name="", body=({}) + ): + """ + Operation: Add a server certificate + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: service_name, Description: Service name (RADIUS, HTTPS(RSA), HTTPS(ECC) or RadSec) + Required Body Parameters (body description)- ServerCertReplace {certificate_url (string, optional): Certificate File URL,pkcs12_file_url (string, optional): PKCS12 File URL,pkcs12_passphrase (string, optional): PKCS12 passphrase} + Required Body Parameters (type(dict) body example)- { + "certificate_url": "", + "pkcs12_file_url": "", + "pkcs12_passphrase": "" + } + """ + url_path = "/server-cert/name/{server_uuid}/{service_name}" + dict_path = {"server_uuid": server_uuid, "service_name": service_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="put", query=body + ) + + def update_server_cert_name_by_server_uuid_service_name_enable( + self, server_uuid="", service_name="" + ): + """ + Operation: Update a server certificate + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: service_name, Description: Service name (HTTPS(RSA) or HTTPS(ECC)) + """ + url_path = "/server-cert/name/{server_uuid}/{service_name}/enable" + dict_path = {"server_uuid": server_uuid, "service_name": service_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + def update_server_cert_name_by_server_uuid_service_name_disable( + self, server_uuid="", service_name="" + ): + """ + Operation: Update a server certificate + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: server_uuid, Description: UUID of the server + Required Path Parameter Name: service_name, Description: Service name (HTTPS(RSA) or HTTPS(ECC)) + """ + url_path = "/server-cert/name/{server_uuid}/{service_name}/disable" + dict_path = {"server_uuid": server_uuid, "service_name": service_name} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="patch") + + # Function Section Name:ServiceCert + # Function Section Description: Manage Service Certificates + + def get_service_cert( + self, filter="", sort="", offset="", limit="", calculate_count="" + ): + """ + Operation: Get a list of service certificates + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/service-cert" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_service_cert(self, body=({})): + """ + Operation: Add a service certificate + HTTP Status Response Codes: 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ServiceCertCreate {certificate_url (string, optional): Certificate File URL,pkcs12_file_url (string, optional): PKCS12 File URL,pkcs12_passphrase (string, optional): PKCS12 passphrase} + Required Body Parameters (type(dict) body example)- { + "certificate_url": "", + "pkcs12_file_url": "", + "pkcs12_passphrase": "" + } + """ + url_path = "/service-cert" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_service_cert_by_service_cert_id(self, service_cert_id=""): + """ + Operation: Get a service certificate + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: service_cert_id, Description: URL parameter service_cert_id + """ + url_path = "/service-cert/{service_cert_id}" + dict_path = {"service_cert_id": service_cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def delete_service_cert_by_service_cert_id(self, service_cert_id=""): + """ + Operation: Delete a service certificate + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: service_cert_id, Description: URL parameter service_cert_id + """ + url_path = "/service-cert/{service_cert_id}" + dict_path = {"service_cert_id": service_cert_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="delete") diff --git a/pyclearpass/api_explorer_policyelements_v1.py b/pyclearpass/api_explorer_policyelements_v1.py new file mode 100644 index 0000000..e6f4d26 --- /dev/null +++ b/pyclearpass/api_explorer_policyelements_v1.py @@ -0,0 +1,3925 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin +) +#File Name: api_explorer_policyelements_v1.py + +class ApiPolicyElements(ClearPassAPILogin): + + #Function Section Name:ApplicationDictionary + #Function Section Description: Manage Application Dictionaries + + def get_application_dictionary(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of Application Dictionaries + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/application-dictionary' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_application_dictionary(self,body=({})): + ''' + Operation: Create a new Application Dictionary + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ApplicationDictionaryCreate {name (string): Name of the Application Dictionary,description (string, optional): Description of the Application Dictionary,attributes (array[Attributes]): List of Application Dictionary Attributes}Attributes {attr_name (string): Application Dictionary Attribute Name,attr_type (string) = ['Integer' or 'String' or 'Boolean' or 'Date-Time' or 'TimeOfDay' or 'Day' or 'Date' or 'List' or 'Text' or 'IPv4Address' or 'IPv6Address' or 'MACAddress']: Application Dictionary Attribute Type,allowed_values (string, optional): Allowed Values for Application Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "attributes": [ + { + "attr_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/application-dictionary' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_application_dictionary_by_application_dictionary_id(self,application_dictionary_id=""): + ''' + Operation: Get an Application Dictionary + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: application_dictionary_id, Description: Numeric ID of the Application Dictionary + ''' + url_path = '/application-dictionary/{application_dictionary_id}' + dict_path={'application_dictionary_id': application_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_application_dictionary_by_application_dictionary_id(self,application_dictionary_id="",body=({})): + ''' + Operation: Update an Application Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: application_dictionary_id, Description: Numeric ID of the Application Dictionary + Required Body Parameters (body description)- ApplicationDictionaryUpdate {name (string, optional): Name of the Application Dictionary,description (string, optional): Description of the Application Dictionary,attributes (array[Attributes], optional): List of Application Dictionary Attributes}Attributes {attr_name (string): Application Dictionary Attribute Name,attr_type (string) = ['Integer' or 'String' or 'Boolean' or 'Date-Time' or 'TimeOfDay' or 'Day' or 'Date' or 'List' or 'Text' or 'IPv4Address' or 'IPv6Address' or 'MACAddress']: Application Dictionary Attribute Type,allowed_values (string, optional): Allowed Values for Application Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "attributes": [ + { + "attr_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/application-dictionary/{application_dictionary_id}' + dict_path={'application_dictionary_id': application_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_application_dictionary_by_application_dictionary_id(self,application_dictionary_id="",body=({})): + ''' + Operation: Replace an Application Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: application_dictionary_id, Description: Numeric ID of the Application Dictionary + Required Body Parameters (body description)- ApplicationDictionaryReplace {name (string): Name of the Application Dictionary,description (string, optional): Description of the Application Dictionary,attributes (array[Attributes]): List of Application Dictionary Attributes}Attributes {attr_name (string): Application Dictionary Attribute Name,attr_type (string) = ['Integer' or 'String' or 'Boolean' or 'Date-Time' or 'TimeOfDay' or 'Day' or 'Date' or 'List' or 'Text' or 'IPv4Address' or 'IPv6Address' or 'MACAddress']: Application Dictionary Attribute Type,allowed_values (string, optional): Allowed Values for Application Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "attributes": [ + { + "attr_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/application-dictionary/{application_dictionary_id}' + dict_path={'application_dictionary_id': application_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_application_dictionary_by_application_dictionary_id(self,application_dictionary_id=""): + ''' + Operation: Delete an Application Dictionary + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: application_dictionary_id, Description: Numeric ID of the Application Dictionary + ''' + url_path = '/application-dictionary/{application_dictionary_id}' + dict_path={'application_dictionary_id': application_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_application_dictionary_name_by_name(self,name=""): + ''' + Operation: Get an Application Dictionary by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the Application Dictionary + ''' + url_path = '/application-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_application_dictionary_name_by_name(self,name="",body=({})): + ''' + Operation: Update an Application Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the Application Dictionary + Required Body Parameters (body description)- ApplicationDictionaryUpdate {name (string, optional): Name of the Application Dictionary,description (string, optional): Description of the Application Dictionary,attributes (array[Attributes], optional): List of Application Dictionary Attributes}Attributes {attr_name (string): Application Dictionary Attribute Name,attr_type (string) = ['Integer' or 'String' or 'Boolean' or 'Date-Time' or 'TimeOfDay' or 'Day' or 'Date' or 'List' or 'Text' or 'IPv4Address' or 'IPv6Address' or 'MACAddress']: Application Dictionary Attribute Type,allowed_values (string, optional): Allowed Values for Application Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "attributes": [ + { + "attr_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/application-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_application_dictionary_name_by_name(self,name="",body=({})): + ''' + Operation: Replace an Application Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the Application Dictionary + Required Body Parameters (body description)- ApplicationDictionaryReplace {name (string): Name of the Application Dictionary,description (string, optional): Description of the Application Dictionary,attributes (array[Attributes]): List of Application Dictionary Attributes}Attributes {attr_name (string): Application Dictionary Attribute Name,attr_type (string) = ['Integer' or 'String' or 'Boolean' or 'Date-Time' or 'TimeOfDay' or 'Day' or 'Date' or 'List' or 'Text' or 'IPv4Address' or 'IPv6Address' or 'MACAddress']: Application Dictionary Attribute Type,allowed_values (string, optional): Allowed Values for Application Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "attributes": [ + { + "attr_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/application-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_application_dictionary_name_by_name(self,name=""): + ''' + Operation: Delete an Application Dictionary by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the Application Dictionary + ''' + url_path = '/application-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:AuthMethod + #Function Section Description: Manage authentication methods + + def get_auth_method(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of authentication methods + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/auth-method' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_auth_method(self,body=({})): + ''' + Operation: Create a new authentication method + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AuthMethodCreate {name (string): Name of the auth method,description (string, optional): Description of the auth method,method_type (string) = ['Authorize' or 'CHAP' or 'EAP-FAST' or 'EAP-GTC' or 'EAP-MD5' or 'EAP-MSCHAPv2' or 'EAP-PEAP' or 'EAP-PEAP-Public' or 'EAP-PWD' or 'EAP-TLS' or 'EAP-TTLS' or 'MAC-AUTH' or 'MSCHAP' or 'PAP' or 'TEAP']: Type of the auth method,details (AuthMethodDetails, optional): Details JSON object of the auth method,inner_methods (array[string], optional): List of inner methods of the auth method}AuthMethodDetails {tunnel_pac_lifetime (integer, optional): Tunnel PAC Expire Time,tunnel_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Tunnel PAC Expire Time Units,user_auth_pac_enable (boolean, optional): Authorization PAC,user_auth_pac_lifetime (integer, optional): Authorization PAC Expire Time,user_auth_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Authorization PAC Expire Time Units,machine_pac_enable (boolean, optional): Machine PAC,machine_pac_lifetime (integer, optional): Machine PAC Expire Time,machine_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Machine PAC Expire Time Units,posture_pac_enable (boolean, optional): Posture PAC,posture_pac_lifetime (integer, optional): Posture PAC Expire Time,posture_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Posture PAC Expire Time Units,allow_anonymous_provisioning (boolean, optional): Allow anonymous mode (requires no server certificate),auth_provisioning_require_client_cert (boolean, optional): Require end-host certificate for provisioning,client_certificate_auth (boolean, optional): End-Host Authentication,allow_authenticated_provisioning (boolean, optional): Allow authenticated mode (requires server certificate),certificate_comparison (string, optional) = ['none' or 'dn' or 'cn' or 'san' or 'cn_or_san' or 'binary']: Certificate Comparison,session_timeout (integer, optional): Session Timeout,session_cache_enable (boolean, optional): Session Resumption,challenge (string, optional): Challenge,allow_fast_reconnect (boolean, optional): Fast Reconnect,nap_support_enable (boolean, optional): Microsoft NAP Support,enforce_crypto_binding (string, optional) = ['none' or 'optional' or 'required']: Cryptobinding,public_password (string, optional): Public Password,public_username (string, optional): Public Username,group_name (string, optional) = ['256-bit random ECP group' or '384-bit random ECP group' or '521-bit random ECP group' or '192-bit random ECP group' or '224-bit random ECP group']: Group,server_id (string, optional): Server Id,autz_required (boolean, optional): Authorization Required,ocsp_enable (string, optional) = ['none' or 'optional' or 'required']: Verify Certificate using OCSP,ocsp_url (string, optional): OCSP URL,override_cert_url (boolean, optional): Override OCSP URL from Client,encryption_scheme (string, optional) = ['auto' or 'sso']: Enable Aruba-SSO,allow_unknown_clients (boolean, optional): Allow Unknown End-Hosts,pass_reset_flow (boolean, optional) = ['Challenge' or 'Reject']: Password reset sends in,no_of_retries (boolean, optional): Number of retries} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "method_type": "", + "details": { + "tunnel_pac_lifetime": 0, + "tunnel_pac_lifetime_units": "", + "user_auth_pac_enable": false, + "user_auth_pac_lifetime": 0, + "user_auth_pac_lifetime_units": "", + "machine_pac_enable": false, + "machine_pac_lifetime": 0, + "machine_pac_lifetime_units": "", + "posture_pac_enable": false, + "posture_pac_lifetime": 0, + "posture_pac_lifetime_units": "", + "allow_anonymous_provisioning": false, + "auth_provisioning_require_client_cert": false, + "client_certificate_auth": false, + "allow_authenticated_provisioning": false, + "certificate_comparison": "", + "session_timeout": 0, + "session_cache_enable": false, + "challenge": "", + "allow_fast_reconnect": false, + "nap_support_enable": false, + "enforce_crypto_binding": "", + "public_password": "", + "public_username": "", + "group_name": "", + "server_id": "", + "autz_required": false, + "ocsp_enable": "", + "ocsp_url": "", + "override_cert_url": false, + "encryption_scheme": "", + "allow_unknown_clients": false, + "pass_reset_flow": false, + "no_of_retries": false + }, + "inner_methods": [ + "" + ] +} + ''' + url_path = '/auth-method' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_auth_method_by_auth_method_id(self,auth_method_id=""): + ''' + Operation: Get an authentication method + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: auth_method_id, Description: Numeric ID of the authentication method + ''' + url_path = '/auth-method/{auth_method_id}' + dict_path={'auth_method_id': auth_method_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_auth_method_by_auth_method_id(self,auth_method_id="",body=({})): + ''' + Operation: Update some fields of an authentication method + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: auth_method_id, Description: Numeric ID of the authentication method + Required Body Parameters (body description)- AuthMethodUpdate {name (string, optional): Name of the auth method,description (string, optional): Description of the auth method,method_type (string, optional) = ['Authorize' or 'CHAP' or 'EAP-FAST' or 'EAP-GTC' or 'EAP-MD5' or 'EAP-MSCHAPv2' or 'EAP-PEAP' or 'EAP-PEAP-Public' or 'EAP-PWD' or 'EAP-TLS' or 'EAP-TTLS' or 'MAC-AUTH' or 'MSCHAP' or 'PAP' or 'TEAP']: Type of the auth method,details (AuthMethodDetails, optional): Details JSON object of the auth method,inner_methods (array[string], optional): List of inner methods of the auth method}AuthMethodDetails {tunnel_pac_lifetime (integer, optional): Tunnel PAC Expire Time,tunnel_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Tunnel PAC Expire Time Units,user_auth_pac_enable (boolean, optional): Authorization PAC,user_auth_pac_lifetime (integer, optional): Authorization PAC Expire Time,user_auth_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Authorization PAC Expire Time Units,machine_pac_enable (boolean, optional): Machine PAC,machine_pac_lifetime (integer, optional): Machine PAC Expire Time,machine_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Machine PAC Expire Time Units,posture_pac_enable (boolean, optional): Posture PAC,posture_pac_lifetime (integer, optional): Posture PAC Expire Time,posture_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Posture PAC Expire Time Units,allow_anonymous_provisioning (boolean, optional): Allow anonymous mode (requires no server certificate),auth_provisioning_require_client_cert (boolean, optional): Require end-host certificate for provisioning,client_certificate_auth (boolean, optional): End-Host Authentication,allow_authenticated_provisioning (boolean, optional): Allow authenticated mode (requires server certificate),certificate_comparison (string, optional) = ['none' or 'dn' or 'cn' or 'san' or 'cn_or_san' or 'binary']: Certificate Comparison,session_timeout (integer, optional): Session Timeout,session_cache_enable (boolean, optional): Session Resumption,challenge (string, optional): Challenge,allow_fast_reconnect (boolean, optional): Fast Reconnect,nap_support_enable (boolean, optional): Microsoft NAP Support,enforce_crypto_binding (string, optional) = ['none' or 'optional' or 'required']: Cryptobinding,public_password (string, optional): Public Password,public_username (string, optional): Public Username,group_name (string, optional) = ['256-bit random ECP group' or '384-bit random ECP group' or '521-bit random ECP group' or '192-bit random ECP group' or '224-bit random ECP group']: Group,server_id (string, optional): Server Id,autz_required (boolean, optional): Authorization Required,ocsp_enable (string, optional) = ['none' or 'optional' or 'required']: Verify Certificate using OCSP,ocsp_url (string, optional): OCSP URL,override_cert_url (boolean, optional): Override OCSP URL from Client,encryption_scheme (string, optional) = ['auto' or 'sso']: Enable Aruba-SSO,allow_unknown_clients (boolean, optional): Allow Unknown End-Hosts,pass_reset_flow (boolean, optional) = ['Challenge' or 'Reject']: Password reset sends in,no_of_retries (boolean, optional): Number of retries} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "method_type": "", + "details": { + "tunnel_pac_lifetime": 0, + "tunnel_pac_lifetime_units": "", + "user_auth_pac_enable": false, + "user_auth_pac_lifetime": 0, + "user_auth_pac_lifetime_units": "", + "machine_pac_enable": false, + "machine_pac_lifetime": 0, + "machine_pac_lifetime_units": "", + "posture_pac_enable": false, + "posture_pac_lifetime": 0, + "posture_pac_lifetime_units": "", + "allow_anonymous_provisioning": false, + "auth_provisioning_require_client_cert": false, + "client_certificate_auth": false, + "allow_authenticated_provisioning": false, + "certificate_comparison": "", + "session_timeout": 0, + "session_cache_enable": false, + "challenge": "", + "allow_fast_reconnect": false, + "nap_support_enable": false, + "enforce_crypto_binding": "", + "public_password": "", + "public_username": "", + "group_name": "", + "server_id": "", + "autz_required": false, + "ocsp_enable": "", + "ocsp_url": "", + "override_cert_url": false, + "encryption_scheme": "", + "allow_unknown_clients": false, + "pass_reset_flow": false, + "no_of_retries": false + }, + "inner_methods": [ + "" + ] +} + ''' + url_path = '/auth-method/{auth_method_id}' + dict_path={'auth_method_id': auth_method_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_auth_method_by_auth_method_id(self,auth_method_id="",body=({})): + ''' + Operation: Replace an authentication method + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: auth_method_id, Description: Numeric ID of the authentication method + Required Body Parameters (body description)- AuthMethodReplace {name (string): Name of the auth method,description (string, optional): Description of the auth method,method_type (string) = ['Authorize' or 'CHAP' or 'EAP-FAST' or 'EAP-GTC' or 'EAP-MD5' or 'EAP-MSCHAPv2' or 'EAP-PEAP' or 'EAP-PEAP-Public' or 'EAP-PWD' or 'EAP-TLS' or 'EAP-TTLS' or 'MAC-AUTH' or 'MSCHAP' or 'PAP' or 'TEAP']: Type of the auth method,details (AuthMethodDetails, optional): Details JSON object of the auth method,inner_methods (array[string], optional): List of inner methods of the auth method}AuthMethodDetails {tunnel_pac_lifetime (integer, optional): Tunnel PAC Expire Time,tunnel_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Tunnel PAC Expire Time Units,user_auth_pac_enable (boolean, optional): Authorization PAC,user_auth_pac_lifetime (integer, optional): Authorization PAC Expire Time,user_auth_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Authorization PAC Expire Time Units,machine_pac_enable (boolean, optional): Machine PAC,machine_pac_lifetime (integer, optional): Machine PAC Expire Time,machine_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Machine PAC Expire Time Units,posture_pac_enable (boolean, optional): Posture PAC,posture_pac_lifetime (integer, optional): Posture PAC Expire Time,posture_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Posture PAC Expire Time Units,allow_anonymous_provisioning (boolean, optional): Allow anonymous mode (requires no server certificate),auth_provisioning_require_client_cert (boolean, optional): Require end-host certificate for provisioning,client_certificate_auth (boolean, optional): End-Host Authentication,allow_authenticated_provisioning (boolean, optional): Allow authenticated mode (requires server certificate),certificate_comparison (string, optional) = ['none' or 'dn' or 'cn' or 'san' or 'cn_or_san' or 'binary']: Certificate Comparison,session_timeout (integer, optional): Session Timeout,session_cache_enable (boolean, optional): Session Resumption,challenge (string, optional): Challenge,allow_fast_reconnect (boolean, optional): Fast Reconnect,nap_support_enable (boolean, optional): Microsoft NAP Support,enforce_crypto_binding (string, optional) = ['none' or 'optional' or 'required']: Cryptobinding,public_password (string, optional): Public Password,public_username (string, optional): Public Username,group_name (string, optional) = ['256-bit random ECP group' or '384-bit random ECP group' or '521-bit random ECP group' or '192-bit random ECP group' or '224-bit random ECP group']: Group,server_id (string, optional): Server Id,autz_required (boolean, optional): Authorization Required,ocsp_enable (string, optional) = ['none' or 'optional' or 'required']: Verify Certificate using OCSP,ocsp_url (string, optional): OCSP URL,override_cert_url (boolean, optional): Override OCSP URL from Client,encryption_scheme (string, optional) = ['auto' or 'sso']: Enable Aruba-SSO,allow_unknown_clients (boolean, optional): Allow Unknown End-Hosts,pass_reset_flow (boolean, optional) = ['Challenge' or 'Reject']: Password reset sends in,no_of_retries (boolean, optional): Number of retries} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "method_type": "", + "details": { + "tunnel_pac_lifetime": 0, + "tunnel_pac_lifetime_units": "", + "user_auth_pac_enable": false, + "user_auth_pac_lifetime": 0, + "user_auth_pac_lifetime_units": "", + "machine_pac_enable": false, + "machine_pac_lifetime": 0, + "machine_pac_lifetime_units": "", + "posture_pac_enable": false, + "posture_pac_lifetime": 0, + "posture_pac_lifetime_units": "", + "allow_anonymous_provisioning": false, + "auth_provisioning_require_client_cert": false, + "client_certificate_auth": false, + "allow_authenticated_provisioning": false, + "certificate_comparison": "", + "session_timeout": 0, + "session_cache_enable": false, + "challenge": "", + "allow_fast_reconnect": false, + "nap_support_enable": false, + "enforce_crypto_binding": "", + "public_password": "", + "public_username": "", + "group_name": "", + "server_id": "", + "autz_required": false, + "ocsp_enable": "", + "ocsp_url": "", + "override_cert_url": false, + "encryption_scheme": "", + "allow_unknown_clients": false, + "pass_reset_flow": false, + "no_of_retries": false + }, + "inner_methods": [ + "" + ] +} + ''' + url_path = '/auth-method/{auth_method_id}' + dict_path={'auth_method_id': auth_method_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_auth_method_by_auth_method_id(self,auth_method_id=""): + ''' + Operation: Delete an authentication method + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: auth_method_id, Description: Numeric ID of the authentication method + ''' + url_path = '/auth-method/{auth_method_id}' + dict_path={'auth_method_id': auth_method_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_auth_method_name_by_name(self,name=""): + ''' + Operation: Get an authentication method by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the authentication method + ''' + url_path = '/auth-method/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_auth_method_name_by_name(self,name="",body=({})): + ''' + Operation: Update some fields of an authentication method by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the authentication method + Required Body Parameters (body description)- AuthMethodUpdate {name (string, optional): Name of the auth method,description (string, optional): Description of the auth method,method_type (string, optional) = ['Authorize' or 'CHAP' or 'EAP-FAST' or 'EAP-GTC' or 'EAP-MD5' or 'EAP-MSCHAPv2' or 'EAP-PEAP' or 'EAP-PEAP-Public' or 'EAP-PWD' or 'EAP-TLS' or 'EAP-TTLS' or 'MAC-AUTH' or 'MSCHAP' or 'PAP' or 'TEAP']: Type of the auth method,details (AuthMethodDetails, optional): Details JSON object of the auth method,inner_methods (array[string], optional): List of inner methods of the auth method}AuthMethodDetails {tunnel_pac_lifetime (integer, optional): Tunnel PAC Expire Time,tunnel_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Tunnel PAC Expire Time Units,user_auth_pac_enable (boolean, optional): Authorization PAC,user_auth_pac_lifetime (integer, optional): Authorization PAC Expire Time,user_auth_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Authorization PAC Expire Time Units,machine_pac_enable (boolean, optional): Machine PAC,machine_pac_lifetime (integer, optional): Machine PAC Expire Time,machine_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Machine PAC Expire Time Units,posture_pac_enable (boolean, optional): Posture PAC,posture_pac_lifetime (integer, optional): Posture PAC Expire Time,posture_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Posture PAC Expire Time Units,allow_anonymous_provisioning (boolean, optional): Allow anonymous mode (requires no server certificate),auth_provisioning_require_client_cert (boolean, optional): Require end-host certificate for provisioning,client_certificate_auth (boolean, optional): End-Host Authentication,allow_authenticated_provisioning (boolean, optional): Allow authenticated mode (requires server certificate),certificate_comparison (string, optional) = ['none' or 'dn' or 'cn' or 'san' or 'cn_or_san' or 'binary']: Certificate Comparison,session_timeout (integer, optional): Session Timeout,session_cache_enable (boolean, optional): Session Resumption,challenge (string, optional): Challenge,allow_fast_reconnect (boolean, optional): Fast Reconnect,nap_support_enable (boolean, optional): Microsoft NAP Support,enforce_crypto_binding (string, optional) = ['none' or 'optional' or 'required']: Cryptobinding,public_password (string, optional): Public Password,public_username (string, optional): Public Username,group_name (string, optional) = ['256-bit random ECP group' or '384-bit random ECP group' or '521-bit random ECP group' or '192-bit random ECP group' or '224-bit random ECP group']: Group,server_id (string, optional): Server Id,autz_required (boolean, optional): Authorization Required,ocsp_enable (string, optional) = ['none' or 'optional' or 'required']: Verify Certificate using OCSP,ocsp_url (string, optional): OCSP URL,override_cert_url (boolean, optional): Override OCSP URL from Client,encryption_scheme (string, optional) = ['auto' or 'sso']: Enable Aruba-SSO,allow_unknown_clients (boolean, optional): Allow Unknown End-Hosts,pass_reset_flow (boolean, optional) = ['Challenge' or 'Reject']: Password reset sends in,no_of_retries (boolean, optional): Number of retries} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "method_type": "", + "details": { + "tunnel_pac_lifetime": 0, + "tunnel_pac_lifetime_units": "", + "user_auth_pac_enable": false, + "user_auth_pac_lifetime": 0, + "user_auth_pac_lifetime_units": "", + "machine_pac_enable": false, + "machine_pac_lifetime": 0, + "machine_pac_lifetime_units": "", + "posture_pac_enable": false, + "posture_pac_lifetime": 0, + "posture_pac_lifetime_units": "", + "allow_anonymous_provisioning": false, + "auth_provisioning_require_client_cert": false, + "client_certificate_auth": false, + "allow_authenticated_provisioning": false, + "certificate_comparison": "", + "session_timeout": 0, + "session_cache_enable": false, + "challenge": "", + "allow_fast_reconnect": false, + "nap_support_enable": false, + "enforce_crypto_binding": "", + "public_password": "", + "public_username": "", + "group_name": "", + "server_id": "", + "autz_required": false, + "ocsp_enable": "", + "ocsp_url": "", + "override_cert_url": false, + "encryption_scheme": "", + "allow_unknown_clients": false, + "pass_reset_flow": false, + "no_of_retries": false + }, + "inner_methods": [ + "" + ] +} + ''' + url_path = '/auth-method/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_auth_method_name_by_name(self,name="",body=({})): + ''' + Operation: Replace an authentication method by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the authentication method + Required Body Parameters (body description)- AuthMethodReplace {name (string): Name of the auth method,description (string, optional): Description of the auth method,method_type (string) = ['Authorize' or 'CHAP' or 'EAP-FAST' or 'EAP-GTC' or 'EAP-MD5' or 'EAP-MSCHAPv2' or 'EAP-PEAP' or 'EAP-PEAP-Public' or 'EAP-PWD' or 'EAP-TLS' or 'EAP-TTLS' or 'MAC-AUTH' or 'MSCHAP' or 'PAP' or 'TEAP']: Type of the auth method,details (AuthMethodDetails, optional): Details JSON object of the auth method,inner_methods (array[string], optional): List of inner methods of the auth method}AuthMethodDetails {tunnel_pac_lifetime (integer, optional): Tunnel PAC Expire Time,tunnel_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Tunnel PAC Expire Time Units,user_auth_pac_enable (boolean, optional): Authorization PAC,user_auth_pac_lifetime (integer, optional): Authorization PAC Expire Time,user_auth_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Authorization PAC Expire Time Units,machine_pac_enable (boolean, optional): Machine PAC,machine_pac_lifetime (integer, optional): Machine PAC Expire Time,machine_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Machine PAC Expire Time Units,posture_pac_enable (boolean, optional): Posture PAC,posture_pac_lifetime (integer, optional): Posture PAC Expire Time,posture_pac_lifetime_units (string, optional) = ['hours' or 'days' or 'weeks' or 'months' or 'years']: Posture PAC Expire Time Units,allow_anonymous_provisioning (boolean, optional): Allow anonymous mode (requires no server certificate),auth_provisioning_require_client_cert (boolean, optional): Require end-host certificate for provisioning,client_certificate_auth (boolean, optional): End-Host Authentication,allow_authenticated_provisioning (boolean, optional): Allow authenticated mode (requires server certificate),certificate_comparison (string, optional) = ['none' or 'dn' or 'cn' or 'san' or 'cn_or_san' or 'binary']: Certificate Comparison,session_timeout (integer, optional): Session Timeout,session_cache_enable (boolean, optional): Session Resumption,challenge (string, optional): Challenge,allow_fast_reconnect (boolean, optional): Fast Reconnect,nap_support_enable (boolean, optional): Microsoft NAP Support,enforce_crypto_binding (string, optional) = ['none' or 'optional' or 'required']: Cryptobinding,public_password (string, optional): Public Password,public_username (string, optional): Public Username,group_name (string, optional) = ['256-bit random ECP group' or '384-bit random ECP group' or '521-bit random ECP group' or '192-bit random ECP group' or '224-bit random ECP group']: Group,server_id (string, optional): Server Id,autz_required (boolean, optional): Authorization Required,ocsp_enable (string, optional) = ['none' or 'optional' or 'required']: Verify Certificate using OCSP,ocsp_url (string, optional): OCSP URL,override_cert_url (boolean, optional): Override OCSP URL from Client,encryption_scheme (string, optional) = ['auto' or 'sso']: Enable Aruba-SSO,allow_unknown_clients (boolean, optional): Allow Unknown End-Hosts,pass_reset_flow (boolean, optional) = ['Challenge' or 'Reject']: Password reset sends in,no_of_retries (boolean, optional): Number of retries} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "method_type": "", + "details": { + "tunnel_pac_lifetime": 0, + "tunnel_pac_lifetime_units": "", + "user_auth_pac_enable": false, + "user_auth_pac_lifetime": 0, + "user_auth_pac_lifetime_units": "", + "machine_pac_enable": false, + "machine_pac_lifetime": 0, + "machine_pac_lifetime_units": "", + "posture_pac_enable": false, + "posture_pac_lifetime": 0, + "posture_pac_lifetime_units": "", + "allow_anonymous_provisioning": false, + "auth_provisioning_require_client_cert": false, + "client_certificate_auth": false, + "allow_authenticated_provisioning": false, + "certificate_comparison": "", + "session_timeout": 0, + "session_cache_enable": false, + "challenge": "", + "allow_fast_reconnect": false, + "nap_support_enable": false, + "enforce_crypto_binding": "", + "public_password": "", + "public_username": "", + "group_name": "", + "server_id": "", + "autz_required": false, + "ocsp_enable": "", + "ocsp_url": "", + "override_cert_url": false, + "encryption_scheme": "", + "allow_unknown_clients": false, + "pass_reset_flow": false, + "no_of_retries": false + }, + "inner_methods": [ + "" + ] +} + ''' + url_path = '/auth-method/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_auth_method_name_by_name(self,name=""): + ''' + Operation: Delete an authentication method by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the authentication method + ''' + url_path = '/auth-method/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:AuthSource + #Function Section Description: Manage authentication sources + + def get_auth_source(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of authentication sources + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/auth-source' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_auth_source(self,body=({})): + ''' + Operation: Create a new authentication source + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- AuthSourceCreate {name (string): Name of the auth source,description (string, optional): Description of the auth source,type (string) = ['AD' or 'Ldap' or 'Sql' or 'HTTP' or 'Kerberos' or 'Local' or 'SHL' or 'TokenServer']: Type of the auth source,use_for_authorization (boolean, optional): Enable to use this Authentication Source,authorization_source_names (array[string], optional): additional auth-sources from which role-mapping attributes to be fetched,cppm_primary_auth_source_connection_details (AuthSourceConnectionDetailsMetadataCreate): details of Authentication source,auth_source_radius_attributes (AuthSourceRadiusAttributeDetailsCreate, optional): details of authSourceRadiusAttributes,cppm_auth_source_connection_backups (AuthSourceBackupConnectionDetailsMetadataCreate, optional): details of authentication source backups,auth_source_filters (AuthSourceFiltersDetailsCreate, optional): details of auth_source_filters,server_timeout (integer): Time out if the Authentication source fails to send a response to an authorization query,cache_timeout (integer): Specify the duration in number of seconds for which the attributes are cached.}AuthSourceConnectionDetailsMetadataCreate {host_name (string, optional): Host Name of Authentication Source,connection_security (string, optional) = ['None' or 'StartTLS' or 'AD_Over_SSL']: Connection Security of Authentication Source,connection_port (integer, optional): Connection port of Authentication Source,verify_server_certificate (boolean, optional): Boolean to verify Server Certificate for secure connection,trusted_certificate_id (integer, optional): Trusted certificate ID used during verification of server certificate,bind_DN (string, optional): Bind DN of Authentication Source,bind_password (string, optional): Bind Password of Authentication Source,net_BIOS_domain_name (string, optional): Net-BIOS-Domain-Name of Authentication Source,base_DN (string, optional): Base DN of Authentication Source,search_scope (string, optional) = ['Base_Object_Search' or 'One_Level_Search' or 'SubTree_Search']: Search Scope of Authentication Source,ldap_referrals (boolean, optional): Follow referrals for Authentication Source,bind_user (boolean, optional): Allow bind using user password,user_certificate (string, optional): User Certificate of Authentication Source,always_use_netBIOS_name (boolean, optional): Boolean to always use NetBIOS name instead of the domain part in username for authentication,replace_special_char (boolean, optional): Enable special character handling for LDAP query,password_attribute (string, optional): Password Attribute of Authentication Source,password_type (string, optional) = ['ClearText' or 'NT_Hash' or 'LM_Hash' or 'SHA1' or 'SHA256' or 'SHA512' or 'MD5' or 'SHA1_Base64' or 'SHA256_Base64' or 'SHA512_Base64']: Type of the Password,password_header (string, optional): Password Header of Authentication Source,server_name (string, optional): Server Name of Authentication Source,port (integer, optional): Port of SQL Server,database_name (string, optional): Name of the database,login_user_name (string, optional): User name to login to the Server,login_password (string, optional): Password to login to SQL Server,timeout (integer, optional): Timeout of the Connection,odbc_type (string, optional) = ['PostgreSQL' or 'Oracle_11g' or 'MariaDB' or 'MSSQL']: ODBC Type of SQL DB,base_URL (string, optional): Base URL of Authentication Source,realm (string, optional): Realm of Authentication Source,server_principal (string, optional): Server Principal of Authentication Source,server_principal_password (string, optional): Server Principal Password of Authentication Source,authorization_token (string, optional): Authorization Token of Authentication Source,protocol (string, optional): Protocol of Authentication Source,secret (string, optional): Secret key of Authentication Source,tenant_id (string, optional): Tenant ID of Authentication Source,client_id (string, optional): Client ID of Authentication Source,client_secret (string, optional): Client Secret of Authentication Source,static_host_lists (array[string], optional): Static Host Lists of Authentication Source,client_certificate (string, optional): Client Certificates id,status_server_messages (string, optional): Boolean to send status-server messages}AuthSourceRadiusAttributeDetailsCreate {vendor_id (integer, optional): vendor ID of AuthSourceRadiusAttribute,attribute_id (integer, optional): attribute ID of AuthSourceRadiusAttribute,attribute_value (string, optional): attribute value of AuthSourceRadiusAttribute,attribute_operation (integer, optional): attribute operation of AuthSourceRadiusAttribute,attribute_display_value (string, optional): attribute display value of AuthSourceRadiusAttribute}AuthSourceBackupConnectionDetailsMetadataCreate {order_no (integer, optional): Priority of the Authentication Source,cppm_auth_source_connection_details (undefined, optional): Connection Details of the Authentication source backup}AuthSourceFiltersDetailsCreate {source_Id (integer, optional): SourceId of AuthSourceFilter,name (string, optional): Name of AuthSourceFilter,param_values (string, optional): Parameter Values of AuthSourceFilter,query (string, optional): Query of AuthSourceFilter,selected_Dn (string, optional): SelectedDn of AuthSourceFilter,attributes (AttributesMetadataCreate, optional): Details of CppmAuthSourceFilterAttributes,details (DetailsMetadataCreate, optional): Details of CppmAuthSourceFilterDetails}AttributesMetadataCreate {attribute_name (string, optional): Attribute name of AuthSourceFilterAttributes,alias_name (string, optional): AliasName of AuthSourceFilterAttributes,attribute_type (string, optional): attribute_type of AuthSourceFilterAttributes,enable_as_role (boolean, optional): EnableAsRole of AuthSourceFilterAttributes,enable_as_user_attribute (boolean, optional): EnableAsUserAttr of AuthSourceFilterAttributes}DetailsMetadataCreate {attribute_name (string, optional): Attribute name of AuthSourceFilterDetails,attribute_value (string, optional): Attribute Value of AuthSourceFilterDetails} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "use_for_authorization": false, + "authorization_source_names": [ + "" + ], + "cppm_primary_auth_source_connection_details": { + "host_name": "", + "connection_security": "", + "connection_port": 0, + "verify_server_certificate": false, + "trusted_certificate_id": 0, + "bind_DN": "", + "bind_password": "", + "net_BIOS_domain_name": "", + "base_DN": "", + "search_scope": "", + "ldap_referrals": false, + "bind_user": false, + "user_certificate": "", + "always_use_netBIOS_name": false, + "replace_special_char": false, + "password_attribute": "", + "password_type": "", + "password_header": "", + "server_name": "", + "port": 0, + "database_name": "", + "login_user_name": "", + "login_password": "", + "timeout": 0, + "odbc_type": "", + "base_URL": "", + "realm": "", + "server_principal": "", + "server_principal_password": "", + "authorization_token": "", + "protocol": "", + "secret": "", + "tenant_id": "", + "client_id": "", + "client_secret": "", + "static_host_lists": [ + "" + ], + "client_certificate": "", + "status_server_messages": "" + }, + "auth_source_radius_attributes": { + "vendor_id": 0, + "attribute_id": 0, + "attribute_value": "", + "attribute_operation": 0, + "attribute_display_value": "" + }, + "cppm_auth_source_connection_backups": { + "order_no": 0 + }, + "auth_source_filters": { + "source_Id": 0, + "name": "", + "param_values": "", + "query": "", + "selected_Dn": "", + "attributes": { + "attribute_name": "", + "alias_name": "", + "attribute_type": "", + "enable_as_role": false, + "enable_as_user_attribute": false + }, + "details": { + "attribute_name": "", + "attribute_value": "" + } + }, + "server_timeout": 0, + "cache_timeout": 0 +} + ''' + url_path = '/auth-source' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_auth_source_by_auth_source_id(self,auth_source_id=""): + ''' + Operation: Get an authentication source + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: auth_source_id, Description: Numeric ID of the authentication source + ''' + url_path = '/auth-source/{auth_source_id}' + dict_path={'auth_source_id': auth_source_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_auth_source_by_auth_source_id(self,auth_source_id="",body=({})): + ''' + Operation: Update some fields of an authentication source + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: auth_source_id, Description: Numeric ID of the authentication source + Required Body Parameters (body description)- AuthSourceUpdate {name (string, optional): Name of the auth source,description (string, optional): Description of the auth source,type (string, optional) = ['AD' or 'Ldap' or 'Sql' or 'HTTP' or 'Kerberos' or 'Local' or 'SHL' or 'TokenServer']: Type of the auth source,use_for_authorization (boolean, optional): Enable to use this Authentication Source,authorization_source_names (array[string], optional): additional auth-sources from which role-mapping attributes to be fetched,cppm_primary_auth_source_connection_details (AuthSourceConnectionDetailsUpdate, optional): details of Authentication source,auth_source_radius_attributes (AuthSourceRadiusAttributeDetailsUpdate, optional): details of authSourceRadiusAttributes,cppm_auth_source_connection_backups (AuthSourceBackupConnectionDetailsMetadataUpdate, optional): details of authentication source backups,auth_source_filters (AuthSourceFiltersDetailsUpdate, optional): details of auth_source_filters,server_timeout (integer, optional): Time out if the Authentication source fails to send a response to an authorization query,cache_timeout (integer, optional): Specify the duration in number of seconds for which the attributes are cached.}AuthSourceConnectionDetailsUpdate {host_name (string, optional): Host Name of Authentication Source,connection_security (string, optional) = ['None' or 'StartTLS' or 'AD_Over_SSL']: Connection Security of Authentication Source,connection_port (integer, optional): Connection port of Authentication Source,verify_server_certificate (boolean, optional): Boolean to verify Server Certificate for secure connection,trusted_certificate_id (integer, optional): Trusted certificate ID used during verification of server certificate,bind_DN (string, optional): Bind DN of Authentication Source,bind_password (string, optional): Bind Password of Authentication Source,net_BIOS_domain_name (string, optional): Net-BIOS-Domain-Name of Authentication Source,base_DN (string, optional): Base DN of Authentication Source,search_scope (string, optional) = ['Base_Object_Search' or 'One_Level_Search' or 'SubTree_Search']: Search Scope of Authentication Source,ldap_referrals (boolean, optional): Follow referrals for Authentication Source,bind_user (boolean, optional): Allow bind using user password,user_certificate (string, optional): User Certificate of Authentication Source,always_use_netBIOS_name (boolean, optional): Boolean to always use NetBIOS name instead of the domain part in username for authentication,replace_special_char (boolean, optional): Enable special character handling for LDAP query,password_attribute (string, optional): Password Attribute of Authentication Source,password_type (string, optional) = ['ClearText' or 'NT_Hash' or 'LM_Hash' or 'SHA1' or 'SHA256' or 'SHA512' or 'MD5' or 'SHA1_Base64' or 'SHA256_Base64' or 'SHA512_Base64']: Type of the Password,password_header (string, optional): Password Header of Authentication Source,server_name (string, optional): Server Name of Authentication Source,port (integer, optional): Port of SQL Server,database_name (string, optional): Name of the database,login_user_name (string, optional): User name to login to the Server,login_password (string, optional): Password to login to SQL Server,timeout (integer, optional): Timeout of the Connection,odbc_type (string, optional) = ['PostgreSQL' or 'Oracle_11g' or 'MariaDB' or 'MSSQL']: ODBC Type of SQL DB,base_URL (string, optional): Base URL of Authentication Source,realm (string, optional): Realm of Authentication Source,server_principal (string, optional): Server Principal of Authentication Source,server_principal_password (string, optional): Server Principal Password of Authentication Source,authorization_token (string, optional): Authorization Token of Authentication Source,protocol (string, optional): Protocol of Authentication Source,secret (string, optional): Secret key of Authentication Source,tenant_id (string, optional): Tenant ID of Authentication Source,client_id (string, optional): Client ID of Authentication Source,client_secret (string, optional): Client Secret of Authentication Source,static_host_lists (array[string], optional): Static Host Lists of Authentication Source,client_certificate (string, optional): Client Certificates id,status_server_messages (string, optional): Boolean to send status-server messages}AuthSourceRadiusAttributeDetailsUpdate {vendor_id (integer, optional): vendor ID of AuthSourceRadiusAttribute,attribute_id (integer, optional): attribute ID of AuthSourceRadiusAttribute,attribute_value (string, optional): attribute value of AuthSourceRadiusAttribute,attribute_operation (integer, optional): attribute operation of AuthSourceRadiusAttribute,attribute_display_value (string, optional): attribute display value of AuthSourceRadiusAttribute}AuthSourceBackupConnectionDetailsMetadataUpdate {order_no (integer, optional): Priority of the Authentication Source,cppm_auth_source_connection_details (undefined, optional): Connection Details of the Authentication source backup}AuthSourceFiltersDetailsUpdate {source_Id (integer, optional): SourceId of AuthSourceFilter,name (string, optional): Name of AuthSourceFilter,param_values (string, optional): Parameter Values of AuthSourceFilter,query (string, optional): Query of AuthSourceFilter,selected_Dn (string, optional): SelectedDn of AuthSourceFilter,attributes (AttributesMetadataUpdate, optional): Details of CppmAuthSourceFilterAttributes,details (DetailsMetadataUpdate, optional): Details of CppmAuthSourceFilterDetails}AttributesMetadataUpdate {attribute_name (string, optional): Attribute name of AuthSourceFilterAttributes,alias_name (string, optional): AliasName of AuthSourceFilterAttributes,attribute_type (string, optional): attribute_type of AuthSourceFilterAttributes,enable_as_role (boolean, optional): EnableAsRole of AuthSourceFilterAttributes,enable_as_user_attribute (boolean, optional): EnableAsUserAttr of AuthSourceFilterAttributes}DetailsMetadataUpdate {attribute_name (string, optional): Attribute name of AuthSourceFilterDetails,attribute_value (string, optional): Attribute Value of AuthSourceFilterDetails} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "use_for_authorization": false, + "authorization_source_names": [ + "" + ], + "cppm_primary_auth_source_connection_details": { + "host_name": "", + "connection_security": "", + "connection_port": 0, + "verify_server_certificate": false, + "trusted_certificate_id": 0, + "bind_DN": "", + "bind_password": "", + "net_BIOS_domain_name": "", + "base_DN": "", + "search_scope": "", + "ldap_referrals": false, + "bind_user": false, + "user_certificate": "", + "always_use_netBIOS_name": false, + "replace_special_char": false, + "password_attribute": "", + "password_type": "", + "password_header": "", + "server_name": "", + "port": 0, + "database_name": "", + "login_user_name": "", + "login_password": "", + "timeout": 0, + "odbc_type": "", + "base_URL": "", + "realm": "", + "server_principal": "", + "server_principal_password": "", + "authorization_token": "", + "protocol": "", + "secret": "", + "tenant_id": "", + "client_id": "", + "client_secret": "", + "static_host_lists": [ + "" + ], + "client_certificate": "", + "status_server_messages": "" + }, + "auth_source_radius_attributes": { + "vendor_id": 0, + "attribute_id": 0, + "attribute_value": "", + "attribute_operation": 0, + "attribute_display_value": "" + }, + "cppm_auth_source_connection_backups": { + "order_no": 0 + }, + "auth_source_filters": { + "source_Id": 0, + "name": "", + "param_values": "", + "query": "", + "selected_Dn": "", + "attributes": { + "attribute_name": "", + "alias_name": "", + "attribute_type": "", + "enable_as_role": false, + "enable_as_user_attribute": false + }, + "details": { + "attribute_name": "", + "attribute_value": "" + } + }, + "server_timeout": 0, + "cache_timeout": 0 +} + ''' + url_path = '/auth-source/{auth_source_id}' + dict_path={'auth_source_id': auth_source_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_auth_source_by_auth_source_id(self,auth_source_id="",body=({})): + ''' + Operation: Replace an authentication source + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: auth_source_id, Description: Numeric ID of the authentication source + Required Body Parameters (body description)- AuthSourceReplace {name (string): Name of the auth source,description (string, optional): Description of the auth source,type (string) = ['AD' or 'Ldap' or 'Sql' or 'HTTP' or 'Kerberos' or 'Local' or 'SHL' or 'TokenServer']: Type of the auth source,use_for_authorization (boolean, optional): Enable to use this Authentication Source,authorization_source_names (array[string], optional): additional auth-sources from which role-mapping attributes to be fetched,cppm_primary_auth_source_connection_details (AuthSourceConnectionDetailsMetadataReplace): details of Authentication source,auth_source_radius_attributes (AuthSourceRadiusAttributeDetailsReplace, optional): details of authSourceRadiusAttributes,cppm_auth_source_connection_backups (AuthSourceBackupConnectionDetailsMetadataReplace, optional): details of authentication source backups,auth_source_filters (AuthSourceFiltersDetailsReplace, optional): details of auth_source_filters,server_timeout (integer): Time out if the Authentication source fails to send a response to an authorization query,cache_timeout (integer): Specify the duration in number of seconds for which the attributes are cached.}AuthSourceConnectionDetailsMetadataReplace {host_name (string, optional): Host Name of Authentication Source,connection_security (string, optional) = ['None' or 'StartTLS' or 'AD_Over_SSL']: Connection Security of Authentication Source,connection_port (integer, optional): Connection port of Authentication Source,verify_server_certificate (boolean, optional): Boolean to verify Server Certificate for secure connection,trusted_certificate_id (integer, optional): Trusted certificate ID used during verification of server certificate,bind_DN (string, optional): Bind DN of Authentication Source,bind_password (string, optional): Bind Password of Authentication Source,net_BIOS_domain_name (string, optional): Net-BIOS-Domain-Name of Authentication Source,base_DN (string, optional): Base DN of Authentication Source,search_scope (string, optional) = ['Base_Object_Search' or 'One_Level_Search' or 'SubTree_Search']: Search Scope of Authentication Source,ldap_referrals (boolean, optional): Follow referrals for Authentication Source,bind_user (boolean, optional): Allow bind using user password,user_certificate (string, optional): User Certificate of Authentication Source,always_use_netBIOS_name (boolean, optional): Boolean to always use NetBIOS name instead of the domain part in username for authentication,replace_special_char (boolean, optional): Enable special character handling for LDAP query,password_attribute (string, optional): Password Attribute of Authentication Source,password_type (string, optional) = ['ClearText' or 'NT_Hash' or 'LM_Hash' or 'SHA1' or 'SHA256' or 'SHA512' or 'MD5' or 'SHA1_Base64' or 'SHA256_Base64' or 'SHA512_Base64']: Type of the Password,password_header (string, optional): Password Header of Authentication Source,server_name (string, optional): Server Name of Authentication Source,port (integer, optional): Port of SQL Server,database_name (string, optional): Name of the database,login_user_name (string, optional): User name to login to the Server,login_password (string, optional): Password to login to SQL Server,timeout (integer, optional): Timeout of the Connection,odbc_type (string, optional) = ['PostgreSQL' or 'Oracle_11g' or 'MariaDB' or 'MSSQL']: ODBC Type of SQL DB,base_URL (string, optional): Base URL of Authentication Source,realm (string, optional): Realm of Authentication Source,server_principal (string, optional): Server Principal of Authentication Source,server_principal_password (string, optional): Server Principal Password of Authentication Source,authorization_token (string, optional): Authorization Token of Authentication Source,protocol (string, optional): Protocol of Authentication Source,secret (string, optional): Secret key of Authentication Source,tenant_id (string, optional): Tenant ID of Authentication Source,client_id (string, optional): Client ID of Authentication Source,client_secret (string, optional): Client Secret of Authentication Source,static_host_lists (array[string], optional): Static Host Lists of Authentication Source,client_certificate (string, optional): Client Certificates id,status_server_messages (string, optional): Boolean to send status-server messages}AuthSourceRadiusAttributeDetailsReplace {vendor_id (integer, optional): vendor ID of AuthSourceRadiusAttribute,attribute_id (integer, optional): attribute ID of AuthSourceRadiusAttribute,attribute_value (string, optional): attribute value of AuthSourceRadiusAttribute,attribute_operation (integer, optional): attribute operation of AuthSourceRadiusAttribute,attribute_display_value (string, optional): attribute display value of AuthSourceRadiusAttribute}AuthSourceBackupConnectionDetailsMetadataReplace {order_no (integer, optional): Priority of the Authentication Source,cppm_auth_source_connection_details (undefined, optional): Connection Details of the Authentication source backup}AuthSourceFiltersDetailsReplace {source_Id (integer, optional): SourceId of AuthSourceFilter,name (string, optional): Name of AuthSourceFilter,param_values (string, optional): Parameter Values of AuthSourceFilter,query (string, optional): Query of AuthSourceFilter,selected_Dn (string, optional): SelectedDn of AuthSourceFilter,attributes (AttributesMetadataReplace, optional): Details of CppmAuthSourceFilterAttributes,details (DetailsMetadataReplace, optional): Details of CppmAuthSourceFilterDetails}AttributesMetadataReplace {attribute_name (string, optional): Attribute name of AuthSourceFilterAttributes,alias_name (string, optional): AliasName of AuthSourceFilterAttributes,attribute_type (string, optional): attribute_type of AuthSourceFilterAttributes,enable_as_role (boolean, optional): EnableAsRole of AuthSourceFilterAttributes,enable_as_user_attribute (boolean, optional): EnableAsUserAttr of AuthSourceFilterAttributes}DetailsMetadataReplace {attribute_name (string, optional): Attribute name of AuthSourceFilterDetails,attribute_value (string, optional): Attribute Value of AuthSourceFilterDetails} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "use_for_authorization": false, + "authorization_source_names": [ + "" + ], + "cppm_primary_auth_source_connection_details": { + "host_name": "", + "connection_security": "", + "connection_port": 0, + "verify_server_certificate": false, + "trusted_certificate_id": 0, + "bind_DN": "", + "bind_password": "", + "net_BIOS_domain_name": "", + "base_DN": "", + "search_scope": "", + "ldap_referrals": false, + "bind_user": false, + "user_certificate": "", + "always_use_netBIOS_name": false, + "replace_special_char": false, + "password_attribute": "", + "password_type": "", + "password_header": "", + "server_name": "", + "port": 0, + "database_name": "", + "login_user_name": "", + "login_password": "", + "timeout": 0, + "odbc_type": "", + "base_URL": "", + "realm": "", + "server_principal": "", + "server_principal_password": "", + "authorization_token": "", + "protocol": "", + "secret": "", + "tenant_id": "", + "client_id": "", + "client_secret": "", + "static_host_lists": [ + "" + ], + "client_certificate": "", + "status_server_messages": "" + }, + "auth_source_radius_attributes": { + "vendor_id": 0, + "attribute_id": 0, + "attribute_value": "", + "attribute_operation": 0, + "attribute_display_value": "" + }, + "cppm_auth_source_connection_backups": { + "order_no": 0 + }, + "auth_source_filters": { + "source_Id": 0, + "name": "", + "param_values": "", + "query": "", + "selected_Dn": "", + "attributes": { + "attribute_name": "", + "alias_name": "", + "attribute_type": "", + "enable_as_role": false, + "enable_as_user_attribute": false + }, + "details": { + "attribute_name": "", + "attribute_value": "" + } + }, + "server_timeout": 0, + "cache_timeout": 0 +} + ''' + url_path = '/auth-source/{auth_source_id}' + dict_path={'auth_source_id': auth_source_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_auth_source_by_auth_source_id(self,auth_source_id=""): + ''' + Operation: Delete an authentication source + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: auth_source_id, Description: Numeric ID of the authentication source + ''' + url_path = '/auth-source/{auth_source_id}' + dict_path={'auth_source_id': auth_source_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_auth_source_name_by_name(self,name=""): + ''' + Operation: Get an authentication source by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the authentication source + ''' + url_path = '/auth-source/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_auth_source_name_by_name(self,name="",body=({})): + ''' + Operation: Update some fields of an authentication source by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the authentication source + Required Body Parameters (body description)- AuthSourceUpdate {name (string, optional): Name of the auth source,description (string, optional): Description of the auth source,type (string, optional) = ['AD' or 'Ldap' or 'Sql' or 'HTTP' or 'Kerberos' or 'Local' or 'SHL' or 'TokenServer']: Type of the auth source,use_for_authorization (boolean, optional): Enable to use this Authentication Source,authorization_source_names (array[string], optional): additional auth-sources from which role-mapping attributes to be fetched,cppm_primary_auth_source_connection_details (AuthSourceConnectionDetailsUpdate, optional): details of Authentication source,auth_source_radius_attributes (AuthSourceRadiusAttributeDetailsUpdate, optional): details of authSourceRadiusAttributes,cppm_auth_source_connection_backups (AuthSourceBackupConnectionDetailsMetadataUpdate, optional): details of authentication source backups,auth_source_filters (AuthSourceFiltersDetailsUpdate, optional): details of auth_source_filters,server_timeout (integer, optional): Time out if the Authentication source fails to send a response to an authorization query,cache_timeout (integer, optional): Specify the duration in number of seconds for which the attributes are cached.}AuthSourceConnectionDetailsUpdate {host_name (string, optional): Host Name of Authentication Source,connection_security (string, optional) = ['None' or 'StartTLS' or 'AD_Over_SSL']: Connection Security of Authentication Source,connection_port (integer, optional): Connection port of Authentication Source,verify_server_certificate (boolean, optional): Boolean to verify Server Certificate for secure connection,trusted_certificate_id (integer, optional): Trusted certificate ID used during verification of server certificate,bind_DN (string, optional): Bind DN of Authentication Source,bind_password (string, optional): Bind Password of Authentication Source,net_BIOS_domain_name (string, optional): Net-BIOS-Domain-Name of Authentication Source,base_DN (string, optional): Base DN of Authentication Source,search_scope (string, optional) = ['Base_Object_Search' or 'One_Level_Search' or 'SubTree_Search']: Search Scope of Authentication Source,ldap_referrals (boolean, optional): Follow referrals for Authentication Source,bind_user (boolean, optional): Allow bind using user password,user_certificate (string, optional): User Certificate of Authentication Source,always_use_netBIOS_name (boolean, optional): Boolean to always use NetBIOS name instead of the domain part in username for authentication,replace_special_char (boolean, optional): Enable special character handling for LDAP query,password_attribute (string, optional): Password Attribute of Authentication Source,password_type (string, optional) = ['ClearText' or 'NT_Hash' or 'LM_Hash' or 'SHA1' or 'SHA256' or 'SHA512' or 'MD5' or 'SHA1_Base64' or 'SHA256_Base64' or 'SHA512_Base64']: Type of the Password,password_header (string, optional): Password Header of Authentication Source,server_name (string, optional): Server Name of Authentication Source,port (integer, optional): Port of SQL Server,database_name (string, optional): Name of the database,login_user_name (string, optional): User name to login to the Server,login_password (string, optional): Password to login to SQL Server,timeout (integer, optional): Timeout of the Connection,odbc_type (string, optional) = ['PostgreSQL' or 'Oracle_11g' or 'MariaDB' or 'MSSQL']: ODBC Type of SQL DB,base_URL (string, optional): Base URL of Authentication Source,realm (string, optional): Realm of Authentication Source,server_principal (string, optional): Server Principal of Authentication Source,server_principal_password (string, optional): Server Principal Password of Authentication Source,authorization_token (string, optional): Authorization Token of Authentication Source,protocol (string, optional): Protocol of Authentication Source,secret (string, optional): Secret key of Authentication Source,tenant_id (string, optional): Tenant ID of Authentication Source,client_id (string, optional): Client ID of Authentication Source,client_secret (string, optional): Client Secret of Authentication Source,static_host_lists (array[string], optional): Static Host Lists of Authentication Source,client_certificate (string, optional): Client Certificates id,status_server_messages (string, optional): Boolean to send status-server messages}AuthSourceRadiusAttributeDetailsUpdate {vendor_id (integer, optional): vendor ID of AuthSourceRadiusAttribute,attribute_id (integer, optional): attribute ID of AuthSourceRadiusAttribute,attribute_value (string, optional): attribute value of AuthSourceRadiusAttribute,attribute_operation (integer, optional): attribute operation of AuthSourceRadiusAttribute,attribute_display_value (string, optional): attribute display value of AuthSourceRadiusAttribute}AuthSourceBackupConnectionDetailsMetadataUpdate {order_no (integer, optional): Priority of the Authentication Source,cppm_auth_source_connection_details (undefined, optional): Connection Details of the Authentication source backup}AuthSourceFiltersDetailsUpdate {source_Id (integer, optional): SourceId of AuthSourceFilter,name (string, optional): Name of AuthSourceFilter,param_values (string, optional): Parameter Values of AuthSourceFilter,query (string, optional): Query of AuthSourceFilter,selected_Dn (string, optional): SelectedDn of AuthSourceFilter,attributes (AttributesMetadataUpdate, optional): Details of CppmAuthSourceFilterAttributes,details (DetailsMetadataUpdate, optional): Details of CppmAuthSourceFilterDetails}AttributesMetadataUpdate {attribute_name (string, optional): Attribute name of AuthSourceFilterAttributes,alias_name (string, optional): AliasName of AuthSourceFilterAttributes,attribute_type (string, optional): attribute_type of AuthSourceFilterAttributes,enable_as_role (boolean, optional): EnableAsRole of AuthSourceFilterAttributes,enable_as_user_attribute (boolean, optional): EnableAsUserAttr of AuthSourceFilterAttributes}DetailsMetadataUpdate {attribute_name (string, optional): Attribute name of AuthSourceFilterDetails,attribute_value (string, optional): Attribute Value of AuthSourceFilterDetails} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "use_for_authorization": false, + "authorization_source_names": [ + "" + ], + "cppm_primary_auth_source_connection_details": { + "host_name": "", + "connection_security": "", + "connection_port": 0, + "verify_server_certificate": false, + "trusted_certificate_id": 0, + "bind_DN": "", + "bind_password": "", + "net_BIOS_domain_name": "", + "base_DN": "", + "search_scope": "", + "ldap_referrals": false, + "bind_user": false, + "user_certificate": "", + "always_use_netBIOS_name": false, + "replace_special_char": false, + "password_attribute": "", + "password_type": "", + "password_header": "", + "server_name": "", + "port": 0, + "database_name": "", + "login_user_name": "", + "login_password": "", + "timeout": 0, + "odbc_type": "", + "base_URL": "", + "realm": "", + "server_principal": "", + "server_principal_password": "", + "authorization_token": "", + "protocol": "", + "secret": "", + "tenant_id": "", + "client_id": "", + "client_secret": "", + "static_host_lists": [ + "" + ], + "client_certificate": "", + "status_server_messages": "" + }, + "auth_source_radius_attributes": { + "vendor_id": 0, + "attribute_id": 0, + "attribute_value": "", + "attribute_operation": 0, + "attribute_display_value": "" + }, + "cppm_auth_source_connection_backups": { + "order_no": 0 + }, + "auth_source_filters": { + "source_Id": 0, + "name": "", + "param_values": "", + "query": "", + "selected_Dn": "", + "attributes": { + "attribute_name": "", + "alias_name": "", + "attribute_type": "", + "enable_as_role": false, + "enable_as_user_attribute": false + }, + "details": { + "attribute_name": "", + "attribute_value": "" + } + }, + "server_timeout": 0, + "cache_timeout": 0 +} + ''' + url_path = '/auth-source/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_auth_source_name_by_name(self,name="",body=({})): + ''' + Operation: Replace an authentication source by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the authentication source + Required Body Parameters (body description)- AuthSourceReplace {name (string): Name of the auth source,description (string, optional): Description of the auth source,type (string) = ['AD' or 'Ldap' or 'Sql' or 'HTTP' or 'Kerberos' or 'Local' or 'SHL' or 'TokenServer']: Type of the auth source,use_for_authorization (boolean, optional): Enable to use this Authentication Source,authorization_source_names (array[string], optional): additional auth-sources from which role-mapping attributes to be fetched,cppm_primary_auth_source_connection_details (AuthSourceConnectionDetailsMetadataReplace): details of Authentication source,auth_source_radius_attributes (AuthSourceRadiusAttributeDetailsReplace, optional): details of authSourceRadiusAttributes,cppm_auth_source_connection_backups (AuthSourceBackupConnectionDetailsMetadataReplace, optional): details of authentication source backups,auth_source_filters (AuthSourceFiltersDetailsReplace, optional): details of auth_source_filters,server_timeout (integer): Time out if the Authentication source fails to send a response to an authorization query,cache_timeout (integer): Specify the duration in number of seconds for which the attributes are cached.}AuthSourceConnectionDetailsMetadataReplace {host_name (string, optional): Host Name of Authentication Source,connection_security (string, optional) = ['None' or 'StartTLS' or 'AD_Over_SSL']: Connection Security of Authentication Source,connection_port (integer, optional): Connection port of Authentication Source,verify_server_certificate (boolean, optional): Boolean to verify Server Certificate for secure connection,trusted_certificate_id (integer, optional): Trusted certificate ID used during verification of server certificate,bind_DN (string, optional): Bind DN of Authentication Source,bind_password (string, optional): Bind Password of Authentication Source,net_BIOS_domain_name (string, optional): Net-BIOS-Domain-Name of Authentication Source,base_DN (string, optional): Base DN of Authentication Source,search_scope (string, optional) = ['Base_Object_Search' or 'One_Level_Search' or 'SubTree_Search']: Search Scope of Authentication Source,ldap_referrals (boolean, optional): Follow referrals for Authentication Source,bind_user (boolean, optional): Allow bind using user password,user_certificate (string, optional): User Certificate of Authentication Source,always_use_netBIOS_name (boolean, optional): Boolean to always use NetBIOS name instead of the domain part in username for authentication,replace_special_char (boolean, optional): Enable special character handling for LDAP query,password_attribute (string, optional): Password Attribute of Authentication Source,password_type (string, optional) = ['ClearText' or 'NT_Hash' or 'LM_Hash' or 'SHA1' or 'SHA256' or 'SHA512' or 'MD5' or 'SHA1_Base64' or 'SHA256_Base64' or 'SHA512_Base64']: Type of the Password,password_header (string, optional): Password Header of Authentication Source,server_name (string, optional): Server Name of Authentication Source,port (integer, optional): Port of SQL Server,database_name (string, optional): Name of the database,login_user_name (string, optional): User name to login to the Server,login_password (string, optional): Password to login to SQL Server,timeout (integer, optional): Timeout of the Connection,odbc_type (string, optional) = ['PostgreSQL' or 'Oracle_11g' or 'MariaDB' or 'MSSQL']: ODBC Type of SQL DB,base_URL (string, optional): Base URL of Authentication Source,realm (string, optional): Realm of Authentication Source,server_principal (string, optional): Server Principal of Authentication Source,server_principal_password (string, optional): Server Principal Password of Authentication Source,authorization_token (string, optional): Authorization Token of Authentication Source,protocol (string, optional): Protocol of Authentication Source,secret (string, optional): Secret key of Authentication Source,tenant_id (string, optional): Tenant ID of Authentication Source,client_id (string, optional): Client ID of Authentication Source,client_secret (string, optional): Client Secret of Authentication Source,static_host_lists (array[string], optional): Static Host Lists of Authentication Source,client_certificate (string, optional): Client Certificates id,status_server_messages (string, optional): Boolean to send status-server messages}AuthSourceRadiusAttributeDetailsReplace {vendor_id (integer, optional): vendor ID of AuthSourceRadiusAttribute,attribute_id (integer, optional): attribute ID of AuthSourceRadiusAttribute,attribute_value (string, optional): attribute value of AuthSourceRadiusAttribute,attribute_operation (integer, optional): attribute operation of AuthSourceRadiusAttribute,attribute_display_value (string, optional): attribute display value of AuthSourceRadiusAttribute}AuthSourceBackupConnectionDetailsMetadataReplace {order_no (integer, optional): Priority of the Authentication Source,cppm_auth_source_connection_details (undefined, optional): Connection Details of the Authentication source backup}AuthSourceFiltersDetailsReplace {source_Id (integer, optional): SourceId of AuthSourceFilter,name (string, optional): Name of AuthSourceFilter,param_values (string, optional): Parameter Values of AuthSourceFilter,query (string, optional): Query of AuthSourceFilter,selected_Dn (string, optional): SelectedDn of AuthSourceFilter,attributes (AttributesMetadataReplace, optional): Details of CppmAuthSourceFilterAttributes,details (DetailsMetadataReplace, optional): Details of CppmAuthSourceFilterDetails}AttributesMetadataReplace {attribute_name (string, optional): Attribute name of AuthSourceFilterAttributes,alias_name (string, optional): AliasName of AuthSourceFilterAttributes,attribute_type (string, optional): attribute_type of AuthSourceFilterAttributes,enable_as_role (boolean, optional): EnableAsRole of AuthSourceFilterAttributes,enable_as_user_attribute (boolean, optional): EnableAsUserAttr of AuthSourceFilterAttributes}DetailsMetadataReplace {attribute_name (string, optional): Attribute name of AuthSourceFilterDetails,attribute_value (string, optional): Attribute Value of AuthSourceFilterDetails} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "type": "", + "use_for_authorization": false, + "authorization_source_names": [ + "" + ], + "cppm_primary_auth_source_connection_details": { + "host_name": "", + "connection_security": "", + "connection_port": 0, + "verify_server_certificate": false, + "trusted_certificate_id": 0, + "bind_DN": "", + "bind_password": "", + "net_BIOS_domain_name": "", + "base_DN": "", + "search_scope": "", + "ldap_referrals": false, + "bind_user": false, + "user_certificate": "", + "always_use_netBIOS_name": false, + "replace_special_char": false, + "password_attribute": "", + "password_type": "", + "password_header": "", + "server_name": "", + "port": 0, + "database_name": "", + "login_user_name": "", + "login_password": "", + "timeout": 0, + "odbc_type": "", + "base_URL": "", + "realm": "", + "server_principal": "", + "server_principal_password": "", + "authorization_token": "", + "protocol": "", + "secret": "", + "tenant_id": "", + "client_id": "", + "client_secret": "", + "static_host_lists": [ + "" + ], + "client_certificate": "", + "status_server_messages": "" + }, + "auth_source_radius_attributes": { + "vendor_id": 0, + "attribute_id": 0, + "attribute_value": "", + "attribute_operation": 0, + "attribute_display_value": "" + }, + "cppm_auth_source_connection_backups": { + "order_no": 0 + }, + "auth_source_filters": { + "source_Id": 0, + "name": "", + "param_values": "", + "query": "", + "selected_Dn": "", + "attributes": { + "attribute_name": "", + "alias_name": "", + "attribute_type": "", + "enable_as_role": false, + "enable_as_user_attribute": false + }, + "details": { + "attribute_name": "", + "attribute_value": "" + } + }, + "server_timeout": 0, + "cache_timeout": 0 +} + ''' + url_path = '/auth-source/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_auth_source_name_by_name(self,name=""): + ''' + Operation: Delete an authentication source by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the authentication source + ''' + url_path = '/auth-source/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:EnforcementPolicy + #Function Section Description: Manage Enforcement Policies + + def get_enforcement_policy(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of enforcement policies + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/enforcement-policy' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_enforcement_policy(self,body=({})): + ''' + Operation: Create a new enforcement policy + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- EnforcementPolicyCreate {name (string): Name of the Enforcement Policy,description (string, optional): Description of the Enforcement Policy,enforcement_type (string) = ['RADIUS' or 'TACACS' or 'WEBAUTH' or 'Application' or 'Event']: Enforcement Type of the Enforcement Policy,default_enforcement_profile (string): Default Enforcement Profile for the Enforcement Policy,rule_eval_algo (string) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm of the Enforcement Policy rules,rules (RulesSettingsCreate): List of Rules for Enforcement Policy}RulesSettingsCreate {enforcement_profile_names (string): List of Enforcement Profile names for a rule,condition (RulesConditionSettingsCreate): Conditions of Enforcement Policy rules}RulesConditionSettingsCreate {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "enforcement_type": "", + "default_enforcement_profile": "", + "rule_eval_algo": "", + "rules": { + "enforcement_profile_names": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/enforcement-policy' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_enforcement_policy_by_enforcement_policy_id(self,enforcement_policy_id=""): + ''' + Operation: Get a enforcement policy + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: enforcement_policy_id, Description: Numeric ID of the enforcement policy + ''' + url_path = '/enforcement-policy/{enforcement_policy_id}' + dict_path={'enforcement_policy_id': enforcement_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_enforcement_policy_by_enforcement_policy_id(self,enforcement_policy_id="",body=({})): + ''' + Operation: Update a enforcement policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: enforcement_policy_id, Description: Numeric ID of the enforcement policy + Required Body Parameters (body description)- EnforcementPolicyUpdate {name (string, optional): Name of the Enforcement Policy,description (string, optional): Description of the Enforcement Policy,enforcement_type (string, optional) = ['RADIUS' or 'TACACS' or 'WEBAUTH' or 'Application' or 'Event']: Enforcement Type of the Enforcement Policy,default_enforcement_profile (string, optional): Default Enforcement Profile for the Enforcement Policy,rule_eval_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm of the Enforcement Policy rules,rules (RulesSettingsUpdate, optional): List of Rules for Enforcement Policy}RulesSettingsUpdate {enforcement_profile_names (string, optional): List of Enforcement Profile names for a rule,condition (RulesConditionSettingsUpdate, optional): Conditions of Enforcement Policy rules}RulesConditionSettingsUpdate {type (string, optional): Condition type,name (string, optional): Condition name,oper (string, optional): Condition operator,value (string, optional): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "enforcement_type": "", + "default_enforcement_profile": "", + "rule_eval_algo": "", + "rules": { + "enforcement_profile_names": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/enforcement-policy/{enforcement_policy_id}' + dict_path={'enforcement_policy_id': enforcement_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_enforcement_policy_by_enforcement_policy_id(self,enforcement_policy_id="",body=({})): + ''' + Operation: Replace a enforcement policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: enforcement_policy_id, Description: Numeric ID of the enforcement policy + Required Body Parameters (body description)- EnforcementPolicyReplace {name (string): Name of the Enforcement Policy,description (string, optional): Description of the Enforcement Policy,enforcement_type (string) = ['RADIUS' or 'TACACS' or 'WEBAUTH' or 'Application' or 'Event']: Enforcement Type of the Enforcement Policy,default_enforcement_profile (string): Default Enforcement Profile for the Enforcement Policy,rule_eval_algo (string) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm of the Enforcement Policy rules,rules (RulesSettingsReplace): List of Rules for Enforcement Policy}RulesSettingsReplace {enforcement_profile_names (string): List of Enforcement Profile names for a rule,condition (RulesConditionSettingsReplace): Conditions of Enforcement Policy rules}RulesConditionSettingsReplace {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "enforcement_type": "", + "default_enforcement_profile": "", + "rule_eval_algo": "", + "rules": { + "enforcement_profile_names": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/enforcement-policy/{enforcement_policy_id}' + dict_path={'enforcement_policy_id': enforcement_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_enforcement_policy_by_enforcement_policy_id(self,enforcement_policy_id=""): + ''' + Operation: Delete a enforcement policy + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: enforcement_policy_id, Description: Numeric ID of the enforcement policy + ''' + url_path = '/enforcement-policy/{enforcement_policy_id}' + dict_path={'enforcement_policy_id': enforcement_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_enforcement_policy_name_by_name(self,name=""): + ''' + Operation: Get a enforcement policy by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the enforcement policy + ''' + url_path = '/enforcement-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_enforcement_policy_name_by_name(self,name="",body=({})): + ''' + Operation: Update a enforcement policy by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the enforcement policy + Required Body Parameters (body description)- EnforcementPolicyUpdate {name (string, optional): Name of the Enforcement Policy,description (string, optional): Description of the Enforcement Policy,enforcement_type (string, optional) = ['RADIUS' or 'TACACS' or 'WEBAUTH' or 'Application' or 'Event']: Enforcement Type of the Enforcement Policy,default_enforcement_profile (string, optional): Default Enforcement Profile for the Enforcement Policy,rule_eval_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm of the Enforcement Policy rules,rules (RulesSettingsUpdate, optional): List of Rules for Enforcement Policy}RulesSettingsUpdate {enforcement_profile_names (string, optional): List of Enforcement Profile names for a rule,condition (RulesConditionSettingsUpdate, optional): Conditions of Enforcement Policy rules}RulesConditionSettingsUpdate {type (string, optional): Condition type,name (string, optional): Condition name,oper (string, optional): Condition operator,value (string, optional): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "enforcement_type": "", + "default_enforcement_profile": "", + "rule_eval_algo": "", + "rules": { + "enforcement_profile_names": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/enforcement-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_enforcement_policy_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a enforcement policy by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the enforcement policy + Required Body Parameters (body description)- EnforcementPolicyReplace {name (string): Name of the Enforcement Policy,description (string, optional): Description of the Enforcement Policy,enforcement_type (string) = ['RADIUS' or 'TACACS' or 'WEBAUTH' or 'Application' or 'Event']: Enforcement Type of the Enforcement Policy,default_enforcement_profile (string): Default Enforcement Profile for the Enforcement Policy,rule_eval_algo (string) = ['first-applicable' or 'evaluate-all']: Rule Evaluation Algorithm of the Enforcement Policy rules,rules (RulesSettingsReplace): List of Rules for Enforcement Policy}RulesSettingsReplace {enforcement_profile_names (string): List of Enforcement Profile names for a rule,condition (RulesConditionSettingsReplace): Conditions of Enforcement Policy rules}RulesConditionSettingsReplace {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "enforcement_type": "", + "default_enforcement_profile": "", + "rule_eval_algo": "", + "rules": { + "enforcement_profile_names": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/enforcement-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_enforcement_policy_name_by_name(self,name=""): + ''' + Operation: Delete a enforcement policy by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the enforcement policy + ''' + url_path = '/enforcement-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:NetworkDevice + #Function Section Description: Manage network devices + + def get_network_device(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of network devices + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/network-device' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_network_device(self,body=({})): + ''' + Operation: Create a new network device + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- NetworkDeviceCreate {description (string, optional): Description of the network device,nad_groups (array[string], optional): NAD groups,name (string): Name of the network device,ip_address (string): IP or Subnet Address of the network device,radius_secret (string, optional): RADIUS Shared Secret of the network device,tacacs_secret (string, optional): TACACS+ Shared Secret of the network device,vendor_name (string, optional): Vendor Name of the network device,vendor_id (integer, optional): Vendor Id of the network device,coa_capable (boolean, optional): Flag indicating if the network device is capable of CoA,coa_port (integer, optional): CoA port number of the network device,radsec_enabled (boolean, optional): Flag indicating if the network device is radSec enabled,snmp_read (SNMPReadSettings, optional): SNMP read settings of the network device,snmp_write (SNMPWriteSettings, optional): SNMP write settings of the network device,radsec_config (RadSecSettings, optional): RadSec settings of the network device,cli_config (CLISettings, optional): CLI Configuration details of the network device,onConnect_enforcement (OnConnectEnforcementSettings, optional): OnConnect Enforcement settings of the network device,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the network device}SNMPReadSettings {force_read (boolean, optional): This field is deprecated.,read_arp_info (boolean, optional): Enable to read ARP table from this device,zone_name (string, optional): Policy Manager Zone name to be associated with the network device,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}SNMPWriteSettings {default_vlan (integer, optional): Default VLAN for port when SNMP-enforced session expires,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}RadSecSettings {serial_number (string, optional): Serial Number of a Certificate,validate_cert (string, optional) = ['NONE' or 'CN_OR_SAN' or 'RFC']: Validating a Certificate, the valid inputs are NONE, CN, SAN or CN_OR_SAN.,subject_dn (string, optional): Issuer CA Certificates Subject DN,expiry_date (string, optional): Issuer CA Certificates Expiry Date,cn_regex (string, optional): Common Name Regular Expression String,san_regex (string, optional): Subject Alternate Name Regular Expression String,src_override_ip (string, optional): Source Override IP indicates the actual Source IP Address}CLISettings {type (string, optional) = ['SSH' or 'Telnet']: Access type of the network device,port (integer, optional): SSH/Telnet port number of the network device,username (string, optional): Username of the network device,password (string, optional): Password of the network device,username_prompt_regex (string, optional): Username prompt regex of the network device,password_prompt_regex (string, optional): Password prompt regex of the network device,command_prompt_regex (string, optional): Command prompt regex of the network device,enable_prompt_regex (string, optional): Enable prompt regex of the network device,enable_password (string, optional): Enable password of the network device}OnConnectEnforcementSettings {enabled (boolean, optional): Flag indicating if the network device is enabled with OnConnect Enforcement. SNMP read configuration and Policy Manager Zone is a must for this to work.,ports (string, optional): Port names used in OnConnect Enforcement in CSV format (e.g. FastEthernet 1/0/10). Use empty string to enable for all ports. Ports determined to be uplink or trunk ports will be ignored.} + Required Body Parameters (type(dict) body example)- { + "description": "", + "nad_groups": [ + "" + ], + "name": "", + "ip_address": "", + "radius_secret": "", + "tacacs_secret": "", + "vendor_name": "", + "vendor_id": 0, + "coa_capable": false, + "coa_port": 0, + "radsec_enabled": false, + "snmp_read": { + "force_read": false, + "read_arp_info": false, + "zone_name": "", + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "snmp_write": { + "default_vlan": 0, + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "radsec_config": { + "serial_number": "", + "validate_cert": "", + "subject_dn": "", + "expiry_date": "", + "cn_regex": "", + "san_regex": "", + "src_override_ip": "" + }, + "cli_config": { + "type": "", + "port": 0, + "username": "", + "password": "", + "username_prompt_regex": "", + "password_prompt_regex": "", + "command_prompt_regex": "", + "enable_prompt_regex": "", + "enable_password": "" + }, + "onConnect_enforcement": { + "enabled": false, + "ports": "" + }, + "attributes": "object" +} + ''' + url_path = '/network-device' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_network_device_by_network_device_id(self,network_device_id=""): + ''' + Operation: Get a network device + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: network_device_id, Description: Numeric ID of the network device + ''' + url_path = '/network-device/{network_device_id}' + dict_path={'network_device_id': network_device_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_network_device_by_network_device_id(self,network_device_id="",body=({})): + ''' + Operation: Update some fields of a network device + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: network_device_id, Description: Numeric ID of the network device + Required Body Parameters (body description)- NetworkDeviceUpdate {description (string, optional): Description of the network device,nad_groups (array[string], optional): NAD groups,name (string, optional): Name of the network device,ip_address (string, optional): IP or Subnet Address of the network device,radius_secret (string, optional): RADIUS Shared Secret of the network device,tacacs_secret (string, optional): TACACS+ Shared Secret of the network device,vendor_name (string, optional): Vendor Name of the network device,vendor_id (integer, optional): Vendor Id of the network device,coa_capable (boolean, optional): Flag indicating if the network device is capable of CoA,coa_port (integer, optional): CoA port number of the network device,radsec_enabled (boolean, optional): Flag indicating if the network device is radSec enabled,snmp_read (SNMPReadSettings, optional): SNMP read settings of the network device,snmp_write (SNMPWriteSettings, optional): SNMP write settings of the network device,radsec_config (RadSecSettings, optional): RadSec settings of the network device,cli_config (CLISettings, optional): CLI Configuration details of the network device,onConnect_enforcement (OnConnectEnforcementSettings, optional): OnConnect Enforcement settings of the network device,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the network device}SNMPReadSettings {force_read (boolean, optional): This field is deprecated.,read_arp_info (boolean, optional): Enable to read ARP table from this device,zone_name (string, optional): Policy Manager Zone name to be associated with the network device,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}SNMPWriteSettings {default_vlan (integer, optional): Default VLAN for port when SNMP-enforced session expires,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}RadSecSettings {serial_number (string, optional): Serial Number of a Certificate,validate_cert (string, optional) = ['NONE' or 'CN_OR_SAN' or 'RFC']: Validating a Certificate, the valid inputs are NONE, CN, SAN or CN_OR_SAN.,subject_dn (string, optional): Issuer CA Certificates Subject DN,expiry_date (string, optional): Issuer CA Certificates Expiry Date,cn_regex (string, optional): Common Name Regular Expression String,san_regex (string, optional): Subject Alternate Name Regular Expression String,src_override_ip (string, optional): Source Override IP indicates the actual Source IP Address}CLISettings {type (string, optional) = ['SSH' or 'Telnet']: Access type of the network device,port (integer, optional): SSH/Telnet port number of the network device,username (string, optional): Username of the network device,password (string, optional): Password of the network device,username_prompt_regex (string, optional): Username prompt regex of the network device,password_prompt_regex (string, optional): Password prompt regex of the network device,command_prompt_regex (string, optional): Command prompt regex of the network device,enable_prompt_regex (string, optional): Enable prompt regex of the network device,enable_password (string, optional): Enable password of the network device}OnConnectEnforcementSettings {enabled (boolean, optional): Flag indicating if the network device is enabled with OnConnect Enforcement. SNMP read configuration and Policy Manager Zone is a must for this to work.,ports (string, optional): Port names used in OnConnect Enforcement in CSV format (e.g. FastEthernet 1/0/10). Use empty string to enable for all ports. Ports determined to be uplink or trunk ports will be ignored.} + Required Body Parameters (type(dict) body example)- { + "description": "", + "nad_groups": [ + "" + ], + "name": "", + "ip_address": "", + "radius_secret": "", + "tacacs_secret": "", + "vendor_name": "", + "vendor_id": 0, + "coa_capable": false, + "coa_port": 0, + "radsec_enabled": false, + "snmp_read": { + "force_read": false, + "read_arp_info": false, + "zone_name": "", + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "snmp_write": { + "default_vlan": 0, + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "radsec_config": { + "serial_number": "", + "validate_cert": "", + "subject_dn": "", + "expiry_date": "", + "cn_regex": "", + "san_regex": "", + "src_override_ip": "" + }, + "cli_config": { + "type": "", + "port": 0, + "username": "", + "password": "", + "username_prompt_regex": "", + "password_prompt_regex": "", + "command_prompt_regex": "", + "enable_prompt_regex": "", + "enable_password": "" + }, + "onConnect_enforcement": { + "enabled": false, + "ports": "" + }, + "attributes": "object" +} + ''' + url_path = '/network-device/{network_device_id}' + dict_path={'network_device_id': network_device_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_network_device_by_network_device_id(self,network_device_id="",body=({})): + ''' + Operation: Replace a network device + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: network_device_id, Description: Numeric ID of the network device + Required Body Parameters (body description)- NetworkDeviceReplace {description (string, optional): Description of the network device,nad_groups (array[string], optional): NAD groups,name (string): Name of the network device,ip_address (string): IP or Subnet Address of the network device,radius_secret (string, optional): RADIUS Shared Secret of the network device,tacacs_secret (string, optional): TACACS+ Shared Secret of the network device,vendor_name (string, optional): Vendor Name of the network device,vendor_id (integer, optional): Vendor Id of the network device,coa_capable (boolean, optional): Flag indicating if the network device is capable of CoA,coa_port (integer, optional): CoA port number of the network device,radsec_enabled (boolean, optional): Flag indicating if the network device is radSec enabled,snmp_read (SNMPReadSettings, optional): SNMP read settings of the network device,snmp_write (SNMPWriteSettings, optional): SNMP write settings of the network device,radsec_config (RadSecSettings, optional): RadSec settings of the network device,cli_config (CLISettings, optional): CLI Configuration details of the network device,onConnect_enforcement (OnConnectEnforcementSettings, optional): OnConnect Enforcement settings of the network device,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the network device}SNMPReadSettings {force_read (boolean, optional): This field is deprecated.,read_arp_info (boolean, optional): Enable to read ARP table from this device,zone_name (string, optional): Policy Manager Zone name to be associated with the network device,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}SNMPWriteSettings {default_vlan (integer, optional): Default VLAN for port when SNMP-enforced session expires,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}RadSecSettings {serial_number (string, optional): Serial Number of a Certificate,validate_cert (string, optional) = ['NONE' or 'CN_OR_SAN' or 'RFC']: Validating a Certificate, the valid inputs are NONE, CN, SAN or CN_OR_SAN.,subject_dn (string, optional): Issuer CA Certificates Subject DN,expiry_date (string, optional): Issuer CA Certificates Expiry Date,cn_regex (string, optional): Common Name Regular Expression String,san_regex (string, optional): Subject Alternate Name Regular Expression String,src_override_ip (string, optional): Source Override IP indicates the actual Source IP Address}CLISettings {type (string, optional) = ['SSH' or 'Telnet']: Access type of the network device,port (integer, optional): SSH/Telnet port number of the network device,username (string, optional): Username of the network device,password (string, optional): Password of the network device,username_prompt_regex (string, optional): Username prompt regex of the network device,password_prompt_regex (string, optional): Password prompt regex of the network device,command_prompt_regex (string, optional): Command prompt regex of the network device,enable_prompt_regex (string, optional): Enable prompt regex of the network device,enable_password (string, optional): Enable password of the network device}OnConnectEnforcementSettings {enabled (boolean, optional): Flag indicating if the network device is enabled with OnConnect Enforcement. SNMP read configuration and Policy Manager Zone is a must for this to work.,ports (string, optional): Port names used in OnConnect Enforcement in CSV format (e.g. FastEthernet 1/0/10). Use empty string to enable for all ports. Ports determined to be uplink or trunk ports will be ignored.} + Required Body Parameters (type(dict) body example)- { + "description": "", + "nad_groups": [ + "" + ], + "name": "", + "ip_address": "", + "radius_secret": "", + "tacacs_secret": "", + "vendor_name": "", + "vendor_id": 0, + "coa_capable": false, + "coa_port": 0, + "radsec_enabled": false, + "snmp_read": { + "force_read": false, + "read_arp_info": false, + "zone_name": "", + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "snmp_write": { + "default_vlan": 0, + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "radsec_config": { + "serial_number": "", + "validate_cert": "", + "subject_dn": "", + "expiry_date": "", + "cn_regex": "", + "san_regex": "", + "src_override_ip": "" + }, + "cli_config": { + "type": "", + "port": 0, + "username": "", + "password": "", + "username_prompt_regex": "", + "password_prompt_regex": "", + "command_prompt_regex": "", + "enable_prompt_regex": "", + "enable_password": "" + }, + "onConnect_enforcement": { + "enabled": false, + "ports": "" + }, + "attributes": "object" +} + ''' + url_path = '/network-device/{network_device_id}' + dict_path={'network_device_id': network_device_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_network_device_by_network_device_id(self,network_device_id=""): + ''' + Operation: Delete a network device + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: network_device_id, Description: Numeric ID of the network device + ''' + url_path = '/network-device/{network_device_id}' + dict_path={'network_device_id': network_device_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_network_device_name_by_name(self,name=""): + ''' + Operation: Get a network device by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the network device + ''' + url_path = '/network-device/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_network_device_name_by_name(self,name="",body=({})): + ''' + Operation: Update some fields of a network device by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the network device + Required Body Parameters (body description)- NetworkDeviceUpdate {description (string, optional): Description of the network device,nad_groups (array[string], optional): NAD groups,name (string, optional): Name of the network device,ip_address (string, optional): IP or Subnet Address of the network device,radius_secret (string, optional): RADIUS Shared Secret of the network device,tacacs_secret (string, optional): TACACS+ Shared Secret of the network device,vendor_name (string, optional): Vendor Name of the network device,vendor_id (integer, optional): Vendor Id of the network device,coa_capable (boolean, optional): Flag indicating if the network device is capable of CoA,coa_port (integer, optional): CoA port number of the network device,radsec_enabled (boolean, optional): Flag indicating if the network device is radSec enabled,snmp_read (SNMPReadSettings, optional): SNMP read settings of the network device,snmp_write (SNMPWriteSettings, optional): SNMP write settings of the network device,radsec_config (RadSecSettings, optional): RadSec settings of the network device,cli_config (CLISettings, optional): CLI Configuration details of the network device,onConnect_enforcement (OnConnectEnforcementSettings, optional): OnConnect Enforcement settings of the network device,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the network device}SNMPReadSettings {force_read (boolean, optional): This field is deprecated.,read_arp_info (boolean, optional): Enable to read ARP table from this device,zone_name (string, optional): Policy Manager Zone name to be associated with the network device,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}SNMPWriteSettings {default_vlan (integer, optional): Default VLAN for port when SNMP-enforced session expires,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}RadSecSettings {serial_number (string, optional): Serial Number of a Certificate,validate_cert (string, optional) = ['NONE' or 'CN_OR_SAN' or 'RFC']: Validating a Certificate, the valid inputs are NONE, CN, SAN or CN_OR_SAN.,subject_dn (string, optional): Issuer CA Certificates Subject DN,expiry_date (string, optional): Issuer CA Certificates Expiry Date,cn_regex (string, optional): Common Name Regular Expression String,san_regex (string, optional): Subject Alternate Name Regular Expression String,src_override_ip (string, optional): Source Override IP indicates the actual Source IP Address}CLISettings {type (string, optional) = ['SSH' or 'Telnet']: Access type of the network device,port (integer, optional): SSH/Telnet port number of the network device,username (string, optional): Username of the network device,password (string, optional): Password of the network device,username_prompt_regex (string, optional): Username prompt regex of the network device,password_prompt_regex (string, optional): Password prompt regex of the network device,command_prompt_regex (string, optional): Command prompt regex of the network device,enable_prompt_regex (string, optional): Enable prompt regex of the network device,enable_password (string, optional): Enable password of the network device}OnConnectEnforcementSettings {enabled (boolean, optional): Flag indicating if the network device is enabled with OnConnect Enforcement. SNMP read configuration and Policy Manager Zone is a must for this to work.,ports (string, optional): Port names used in OnConnect Enforcement in CSV format (e.g. FastEthernet 1/0/10). Use empty string to enable for all ports. Ports determined to be uplink or trunk ports will be ignored.} + Required Body Parameters (type(dict) body example)- { + "description": "", + "nad_groups": [ + "" + ], + "name": "", + "ip_address": "", + "radius_secret": "", + "tacacs_secret": "", + "vendor_name": "", + "vendor_id": 0, + "coa_capable": false, + "coa_port": 0, + "radsec_enabled": false, + "snmp_read": { + "force_read": false, + "read_arp_info": false, + "zone_name": "", + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "snmp_write": { + "default_vlan": 0, + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "radsec_config": { + "serial_number": "", + "validate_cert": "", + "subject_dn": "", + "expiry_date": "", + "cn_regex": "", + "san_regex": "", + "src_override_ip": "" + }, + "cli_config": { + "type": "", + "port": 0, + "username": "", + "password": "", + "username_prompt_regex": "", + "password_prompt_regex": "", + "command_prompt_regex": "", + "enable_prompt_regex": "", + "enable_password": "" + }, + "onConnect_enforcement": { + "enabled": false, + "ports": "" + }, + "attributes": "object" +} + ''' + url_path = '/network-device/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_network_device_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a network device by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the network device + Required Body Parameters (body description)- NetworkDeviceReplace {description (string, optional): Description of the network device,nad_groups (array[string], optional): NAD groups,name (string): Name of the network device,ip_address (string): IP or Subnet Address of the network device,radius_secret (string, optional): RADIUS Shared Secret of the network device,tacacs_secret (string, optional): TACACS+ Shared Secret of the network device,vendor_name (string, optional): Vendor Name of the network device,vendor_id (integer, optional): Vendor Id of the network device,coa_capable (boolean, optional): Flag indicating if the network device is capable of CoA,coa_port (integer, optional): CoA port number of the network device,radsec_enabled (boolean, optional): Flag indicating if the network device is radSec enabled,snmp_read (SNMPReadSettings, optional): SNMP read settings of the network device,snmp_write (SNMPWriteSettings, optional): SNMP write settings of the network device,radsec_config (RadSecSettings, optional): RadSec settings of the network device,cli_config (CLISettings, optional): CLI Configuration details of the network device,onConnect_enforcement (OnConnectEnforcementSettings, optional): OnConnect Enforcement settings of the network device,attributes (object, optional): Additional attributes(key/value pairs) may be stored with the network device}SNMPReadSettings {force_read (boolean, optional): This field is deprecated.,read_arp_info (boolean, optional): Enable to read ARP table from this device,zone_name (string, optional): Policy Manager Zone name to be associated with the network device,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}SNMPWriteSettings {default_vlan (integer, optional): Default VLAN for port when SNMP-enforced session expires,snmp_version (string, optional) = ['V1' or 'V2C' or 'V3']: SNMP version of the network device,community_string (string, optional): Community string of the network device,security_level (string, optional) = ['NOAUTH_NOPRIV' or 'AUTH_NOPRIV' or 'AUTH_PRIV']: Security level of the network device,user (string, optional): Username of the network device,auth_protocol (string, optional) = ['MD5' or 'SHA']: Authentication protocol of the network device,auth_key (string, optional): Authentication key of the network device,privacy_protocol (string, optional) = ['DES_CBC' or 'AES_128']: Privacy protocol of the network device,privacy_key (string, optional): Privacy key of the network device}RadSecSettings {serial_number (string, optional): Serial Number of a Certificate,validate_cert (string, optional) = ['NONE' or 'CN_OR_SAN' or 'RFC']: Validating a Certificate, the valid inputs are NONE, CN, SAN or CN_OR_SAN.,subject_dn (string, optional): Issuer CA Certificates Subject DN,expiry_date (string, optional): Issuer CA Certificates Expiry Date,cn_regex (string, optional): Common Name Regular Expression String,san_regex (string, optional): Subject Alternate Name Regular Expression String,src_override_ip (string, optional): Source Override IP indicates the actual Source IP Address}CLISettings {type (string, optional) = ['SSH' or 'Telnet']: Access type of the network device,port (integer, optional): SSH/Telnet port number of the network device,username (string, optional): Username of the network device,password (string, optional): Password of the network device,username_prompt_regex (string, optional): Username prompt regex of the network device,password_prompt_regex (string, optional): Password prompt regex of the network device,command_prompt_regex (string, optional): Command prompt regex of the network device,enable_prompt_regex (string, optional): Enable prompt regex of the network device,enable_password (string, optional): Enable password of the network device}OnConnectEnforcementSettings {enabled (boolean, optional): Flag indicating if the network device is enabled with OnConnect Enforcement. SNMP read configuration and Policy Manager Zone is a must for this to work.,ports (string, optional): Port names used in OnConnect Enforcement in CSV format (e.g. FastEthernet 1/0/10). Use empty string to enable for all ports. Ports determined to be uplink or trunk ports will be ignored.} + Required Body Parameters (type(dict) body example)- { + "description": "", + "nad_groups": [ + "" + ], + "name": "", + "ip_address": "", + "radius_secret": "", + "tacacs_secret": "", + "vendor_name": "", + "vendor_id": 0, + "coa_capable": false, + "coa_port": 0, + "radsec_enabled": false, + "snmp_read": { + "force_read": false, + "read_arp_info": false, + "zone_name": "", + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "snmp_write": { + "default_vlan": 0, + "snmp_version": "", + "community_string": "", + "security_level": "", + "user": "", + "auth_protocol": "", + "auth_key": "", + "privacy_protocol": "", + "privacy_key": "" + }, + "radsec_config": { + "serial_number": "", + "validate_cert": "", + "subject_dn": "", + "expiry_date": "", + "cn_regex": "", + "san_regex": "", + "src_override_ip": "" + }, + "cli_config": { + "type": "", + "port": 0, + "username": "", + "password": "", + "username_prompt_regex": "", + "password_prompt_regex": "", + "command_prompt_regex": "", + "enable_prompt_regex": "", + "enable_password": "" + }, + "onConnect_enforcement": { + "enabled": false, + "ports": "" + }, + "attributes": "object" +} + ''' + url_path = '/network-device/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_network_device_name_by_name(self,name=""): + ''' + Operation: Delete a network device by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the network device + ''' + url_path = '/network-device/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:NetworkDeviceGroup + #Function Section Description: Manage network device groups + + def get_network_device_group(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of network device groups + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/network-device-group' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_network_device_group(self,body=({})): + ''' + Operation: Create a new network device group + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- NetworkDeviceGroupCreate {name (string): Name of the network device group,description (string, optional): Description of the network device group,group_format (string) = ['subnet' or 'regex' or 'list']: Format of the network devices,value (string): Network devices in the specified format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "group_format": "", + "value": "" +} + ''' + url_path = '/network-device-group' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_network_device_group_by_network_device_group_id(self,network_device_group_id=""): + ''' + Operation: Get a network device group + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: network_device_group_id, Description: Numeric ID of the network device group + ''' + url_path = '/network-device-group/{network_device_group_id}' + dict_path={'network_device_group_id': network_device_group_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_network_device_group_by_network_device_group_id(self,network_device_group_id="",body=({})): + ''' + Operation: Update some fields of a network device group + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: network_device_group_id, Description: Numeric ID of the network device group + Required Body Parameters (body description)- NetworkDeviceGroupUpdate {name (string, optional): Name of the network device group,description (string, optional): Description of the network device group,group_format (string, optional) = ['subnet' or 'regex' or 'list']: Format of the network devices,value (string, optional): Network devices in the specified format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "group_format": "", + "value": "" +} + ''' + url_path = '/network-device-group/{network_device_group_id}' + dict_path={'network_device_group_id': network_device_group_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_network_device_group_by_network_device_group_id(self,network_device_group_id="",body=({})): + ''' + Operation: Replace a network device group + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: network_device_group_id, Description: Numeric ID of the network device group + Required Body Parameters (body description)- NetworkDeviceGroupReplace {name (string): Name of the network device group,description (string, optional): Description of the network device group,group_format (string) = ['subnet' or 'regex' or 'list']: Format of the network devices,value (string): Network devices in the specified format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "group_format": "", + "value": "" +} + ''' + url_path = '/network-device-group/{network_device_group_id}' + dict_path={'network_device_group_id': network_device_group_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_network_device_group_by_network_device_group_id(self,network_device_group_id=""): + ''' + Operation: Delete a network device group + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: network_device_group_id, Description: Numeric ID of the network device group + ''' + url_path = '/network-device-group/{network_device_group_id}' + dict_path={'network_device_group_id': network_device_group_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_network_device_group_name_by_name(self,name=""): + ''' + Operation: Get a network device group by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the network device group + ''' + url_path = '/network-device-group/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_network_device_group_name_by_name(self,name="",body=({})): + ''' + Operation: Update some fields of a network device group by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the network device group + Required Body Parameters (body description)- NetworkDeviceGroupUpdate {name (string, optional): Name of the network device group,description (string, optional): Description of the network device group,group_format (string, optional) = ['subnet' or 'regex' or 'list']: Format of the network devices,value (string, optional): Network devices in the specified format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "group_format": "", + "value": "" +} + ''' + url_path = '/network-device-group/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_network_device_group_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a network device group by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the network device group + Required Body Parameters (body description)- NetworkDeviceGroupReplace {name (string): Name of the network device group,description (string, optional): Description of the network device group,group_format (string) = ['subnet' or 'regex' or 'list']: Format of the network devices,value (string): Network devices in the specified format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "group_format": "", + "value": "" +} + ''' + url_path = '/network-device-group/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_network_device_group_name_by_name(self,name=""): + ''' + Operation: Delete a network device group by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the network device group + ''' + url_path = '/network-device-group/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:PosturePolicy + #Function Section Description: Manage Posture Policies + + def get_posture_policy(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of Posture Policies + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/posture-policy' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_posture_policy(self,body=({})): + ''' + Operation: Create a new Posture Policy + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- PosturePolicyCreate {name (string): Posture Policy Name,description (string, optional): Description,posture_agent (string) = ['Supplicant' or 'WebAgent']: Posture Agent,host_os (string, optional) = ['Windows' or 'Linux' or 'macOS']: Host Operating System,plugin_version (string, optional): Plugin Version,roles (array[string], optional): Restrict by Roles,policy_xml (string): Posture Policy XML} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "posture_agent": "", + "host_os": "", + "plugin_version": "", + "roles": [ + "" + ], + "policy_xml": "" +} + ''' + url_path = '/posture-policy' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_posture_policy_by_posture_policy_id(self,posture_policy_id=""): + ''' + Operation: Get a Posture Policy + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: posture_policy_id, Description: Numeric ID of the Posture Policy + ''' + url_path = '/posture-policy/{posture_policy_id}' + dict_path={'posture_policy_id': posture_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_posture_policy_by_posture_policy_id(self,posture_policy_id="",body=({})): + ''' + Operation: Update a Posture Policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: posture_policy_id, Description: Numeric ID of the Posture Policy + Required Body Parameters (body description)- PosturePolicyUpdate {name (string, optional): Posture Policy Name,description (string, optional): Description,posture_agent (string, optional) = ['Supplicant' or 'WebAgent']: Posture Agent,host_os (string, optional) = ['Windows' or 'Linux' or 'macOS']: Host Operating System,plugin_version (string, optional): Plugin Version,roles (array[string], optional): Restrict by Roles,policy_xml (string, optional): Posture Policy XML} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "posture_agent": "", + "host_os": "", + "plugin_version": "", + "roles": [ + "" + ], + "policy_xml": "" +} + ''' + url_path = '/posture-policy/{posture_policy_id}' + dict_path={'posture_policy_id': posture_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_posture_policy_by_posture_policy_id(self,posture_policy_id="",body=({})): + ''' + Operation: Replace a Posture Policy + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: posture_policy_id, Description: Numeric ID of the Posture Policy + Required Body Parameters (body description)- PosturePolicyReplace {name (string): Posture Policy Name,description (string, optional): Description,posture_agent (string) = ['Supplicant' or 'WebAgent']: Posture Agent,host_os (string, optional) = ['Windows' or 'Linux' or 'macOS']: Host Operating System,plugin_version (string, optional): Plugin Version,roles (array[string], optional): Restrict by Roles,policy_xml (string): Posture Policy XML} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "posture_agent": "", + "host_os": "", + "plugin_version": "", + "roles": [ + "" + ], + "policy_xml": "" +} + ''' + url_path = '/posture-policy/{posture_policy_id}' + dict_path={'posture_policy_id': posture_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_posture_policy_by_posture_policy_id(self,posture_policy_id=""): + ''' + Operation: Delete a Posture Policy + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: posture_policy_id, Description: Numeric ID of the Posture Policy + ''' + url_path = '/posture-policy/{posture_policy_id}' + dict_path={'posture_policy_id': posture_policy_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_posture_policy_name_by_name(self,name=""): + ''' + Operation: Get a Posture Policy by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the Posture Policy + ''' + url_path = '/posture-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_posture_policy_name_by_name(self,name="",body=({})): + ''' + Operation: Update a Posture Policy by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the Posture Policy + Required Body Parameters (body description)- PosturePolicyUpdate {name (string, optional): Posture Policy Name,description (string, optional): Description,posture_agent (string, optional) = ['Supplicant' or 'WebAgent']: Posture Agent,host_os (string, optional) = ['Windows' or 'Linux' or 'macOS']: Host Operating System,plugin_version (string, optional): Plugin Version,roles (array[string], optional): Restrict by Roles,policy_xml (string, optional): Posture Policy XML} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "posture_agent": "", + "host_os": "", + "plugin_version": "", + "roles": [ + "" + ], + "policy_xml": "" +} + ''' + url_path = '/posture-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_posture_policy_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a Posture Policy by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the Posture Policy + Required Body Parameters (body description)- PosturePolicyReplace {name (string): Posture Policy Name,description (string, optional): Description,posture_agent (string) = ['Supplicant' or 'WebAgent']: Posture Agent,host_os (string, optional) = ['Windows' or 'Linux' or 'macOS']: Host Operating System,plugin_version (string, optional): Plugin Version,roles (array[string], optional): Restrict by Roles,policy_xml (string): Posture Policy XML} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "posture_agent": "", + "host_os": "", + "plugin_version": "", + "roles": [ + "" + ], + "policy_xml": "" +} + ''' + url_path = '/posture-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_posture_policy_name_by_name(self,name=""): + ''' + Operation: Delete a Posture Policy by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the Posture Policy + ''' + url_path = '/posture-policy/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:RADIUSDictionary + #Function Section Description: Manage RADIUS Dictionaries + + def get_radius_dictionary(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of RADIUS Dictionaries + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/radius-dictionary' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_radius_dictionary(self,body=({})): + ''' + Operation: Create a new RADIUS Dictionary + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RADIUSDictionaryCreate {vendor_id (integer): Vendor ID of RADIUS Dictionary,vendor_name (string): Vendor Name of RADIUS Dictionary,prefix (string): Vendor Prefix of RADIUS Dictionary,enabled (boolean, optional): Is RADIUS Dictionary enabled?,attributes (array[Attributes]): Attributes of RADIUS Dictionary}Attributes {attr_id (integer): RADIUS Dictionary Attribute ID,attr_name (string): RADIUS Dictionary Attribute Name,attr_type (string): RADIUS Dictionary Attribute Type,attr_profile (string): ["in" or "out" or "in out"] RADIUS Dictionary Attribute Profile,extra_data (string, optional): RADIUS Dictionary Attribute Extra Data,valid_values (array[ValidValue], optional): RADIUS Dictionary Attribute Valid Values}ValidValue {value_enum (integer): Value of RADIUS Dictionary Attribute Valid Value,value (string): Value Enum of RADIUS Dictionary Attribute Valid Value} + Required Body Parameters (type(dict) body example)- { + "vendor_id": 0, + "vendor_name": "", + "prefix": "", + "enabled": false, + "attributes": [ + { + "attr_id": 0, + "attr_name": "", + "attr_type": "", + "attr_profile": "", + "extra_data": "", + "valid_values": [ + { + "value_enum": 0, + "value": "" + } + ] + } + ] +} + ''' + url_path = '/radius-dictionary' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_radius_dictionary_by_radius_dictionary_id(self,radius_dictionary_id=""): + ''' + Operation: Get a RADIUS Dictionary + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: radius_dictionary_id, Description: Numeric ID of the RADIUS Dictionary + ''' + url_path = '/radius-dictionary/{radius_dictionary_id}' + dict_path={'radius_dictionary_id': radius_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_radius_dictionary_by_radius_dictionary_id(self,radius_dictionary_id="",body=({})): + ''' + Operation: Update a RADIUS Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: radius_dictionary_id, Description: Numeric ID of the RADIUS Dictionary + Required Body Parameters (body description)- RADIUSDictionaryUpdate {vendor_id (integer, optional): Vendor ID of RADIUS Dictionary,vendor_name (string, optional): Vendor Name of RADIUS Dictionary,prefix (string, optional): Vendor Prefix of RADIUS Dictionary,enabled (boolean, optional): Is RADIUS Dictionary enabled?,attributes (array[Attributes], optional): Attributes of RADIUS Dictionary}Attributes {attr_id (integer): RADIUS Dictionary Attribute ID,attr_name (string): RADIUS Dictionary Attribute Name,attr_type (string): RADIUS Dictionary Attribute Type,attr_profile (string): ["in" or "out" or "in out"] RADIUS Dictionary Attribute Profile,extra_data (string, optional): RADIUS Dictionary Attribute Extra Data,valid_values (array[ValidValue], optional): RADIUS Dictionary Attribute Valid Values}ValidValue {value_enum (integer): Value of RADIUS Dictionary Attribute Valid Value,value (string): Value Enum of RADIUS Dictionary Attribute Valid Value} + Required Body Parameters (type(dict) body example)- { + "vendor_id": 0, + "vendor_name": "", + "prefix": "", + "enabled": false, + "attributes": [ + { + "attr_id": 0, + "attr_name": "", + "attr_type": "", + "attr_profile": "", + "extra_data": "", + "valid_values": [ + { + "value_enum": 0, + "value": "" + } + ] + } + ] +} + ''' + url_path = '/radius-dictionary/{radius_dictionary_id}' + dict_path={'radius_dictionary_id': radius_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_radius_dictionary_by_radius_dictionary_id(self,radius_dictionary_id="",body=({})): + ''' + Operation: Replace a RADIUS Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: radius_dictionary_id, Description: Numeric ID of the RADIUS Dictionary + Required Body Parameters (body description)- RADIUSDictionaryReplace {vendor_id (integer): Vendor ID of RADIUS Dictionary,vendor_name (string): Vendor Name of RADIUS Dictionary,prefix (string): Vendor Prefix of RADIUS Dictionary,enabled (boolean, optional): Is RADIUS Dictionary enabled?,attributes (array[Attributes]): Attributes of RADIUS Dictionary}Attributes {attr_id (integer): RADIUS Dictionary Attribute ID,attr_name (string): RADIUS Dictionary Attribute Name,attr_type (string): RADIUS Dictionary Attribute Type,attr_profile (string): ["in" or "out" or "in out"] RADIUS Dictionary Attribute Profile,extra_data (string, optional): RADIUS Dictionary Attribute Extra Data,valid_values (array[ValidValue], optional): RADIUS Dictionary Attribute Valid Values}ValidValue {value_enum (integer): Value of RADIUS Dictionary Attribute Valid Value,value (string): Value Enum of RADIUS Dictionary Attribute Valid Value} + Required Body Parameters (type(dict) body example)- { + "vendor_id": 0, + "vendor_name": "", + "prefix": "", + "enabled": false, + "attributes": [ + { + "attr_id": 0, + "attr_name": "", + "attr_type": "", + "attr_profile": "", + "extra_data": "", + "valid_values": [ + { + "value_enum": 0, + "value": "" + } + ] + } + ] +} + ''' + url_path = '/radius-dictionary/{radius_dictionary_id}' + dict_path={'radius_dictionary_id': radius_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def get_radius_dictionary_name_by_name(self,name=""): + ''' + Operation: Get a RADIUS Dictionary by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the RADIUS Dictionary + ''' + url_path = '/radius-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_radius_dictionary_name_by_name(self,name="",body=({})): + ''' + Operation: Update a RADIUS Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the RADIUS Dictionary + Required Body Parameters (body description)- RADIUSDictionaryUpdate {vendor_id (integer, optional): Vendor ID of RADIUS Dictionary,vendor_name (string, optional): Vendor Name of RADIUS Dictionary,prefix (string, optional): Vendor Prefix of RADIUS Dictionary,enabled (boolean, optional): Is RADIUS Dictionary enabled?,attributes (array[Attributes], optional): Attributes of RADIUS Dictionary}Attributes {attr_id (integer): RADIUS Dictionary Attribute ID,attr_name (string): RADIUS Dictionary Attribute Name,attr_type (string): RADIUS Dictionary Attribute Type,attr_profile (string): ["in" or "out" or "in out"] RADIUS Dictionary Attribute Profile,extra_data (string, optional): RADIUS Dictionary Attribute Extra Data,valid_values (array[ValidValue], optional): RADIUS Dictionary Attribute Valid Values}ValidValue {value_enum (integer): Value of RADIUS Dictionary Attribute Valid Value,value (string): Value Enum of RADIUS Dictionary Attribute Valid Value} + Required Body Parameters (type(dict) body example)- { + "vendor_id": 0, + "vendor_name": "", + "prefix": "", + "enabled": false, + "attributes": [ + { + "attr_id": 0, + "attr_name": "", + "attr_type": "", + "attr_profile": "", + "extra_data": "", + "valid_values": [ + { + "value_enum": 0, + "value": "" + } + ] + } + ] +} + ''' + url_path = '/radius-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_radius_dictionary_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a RADIUS Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the RADIUS Dictionary + Required Body Parameters (body description)- RADIUSDictionaryReplace {vendor_id (integer): Vendor ID of RADIUS Dictionary,vendor_name (string): Vendor Name of RADIUS Dictionary,prefix (string): Vendor Prefix of RADIUS Dictionary,enabled (boolean, optional): Is RADIUS Dictionary enabled?,attributes (array[Attributes]): Attributes of RADIUS Dictionary}Attributes {attr_id (integer): RADIUS Dictionary Attribute ID,attr_name (string): RADIUS Dictionary Attribute Name,attr_type (string): RADIUS Dictionary Attribute Type,attr_profile (string): ["in" or "out" or "in out"] RADIUS Dictionary Attribute Profile,extra_data (string, optional): RADIUS Dictionary Attribute Extra Data,valid_values (array[ValidValue], optional): RADIUS Dictionary Attribute Valid Values}ValidValue {value_enum (integer): Value of RADIUS Dictionary Attribute Valid Value,value (string): Value Enum of RADIUS Dictionary Attribute Valid Value} + Required Body Parameters (type(dict) body example)- { + "vendor_id": 0, + "vendor_name": "", + "prefix": "", + "enabled": false, + "attributes": [ + { + "attr_id": 0, + "attr_name": "", + "attr_type": "", + "attr_profile": "", + "extra_data": "", + "valid_values": [ + { + "value_enum": 0, + "value": "" + } + ] + } + ] +} + ''' + url_path = '/radius-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def update_radius_dictionary_by_radius_dictionary_id_enable(self,radius_dictionary_id=""): + ''' + Operation: Enable a RADIUS Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: radius_dictionary_id, Description: Numeric ID of the RADIUS Dictionary + ''' + url_path = '/radius-dictionary/{radius_dictionary_id}/enable' + dict_path={'radius_dictionary_id': radius_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + def update_radius_dictionary_by_radius_dictionary_id_disable(self,radius_dictionary_id=""): + ''' + Operation: Disable a RADIUS Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: radius_dictionary_id, Description: Numeric ID of the RADIUS Dictionary + ''' + url_path = '/radius-dictionary/{radius_dictionary_id}/disable' + dict_path={'radius_dictionary_id': radius_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + def update_radius_dictionary_name_by_name_enable(self,name=""): + ''' + Operation: Enable a RADIUS Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the RADIUS Dictionary + ''' + url_path = '/radius-dictionary/name/{name}/enable' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + def update_radius_dictionary_name_by_name_disable(self,name=""): + ''' + Operation: Disable a RADIUS Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the RADIUS Dictionary + ''' + url_path = '/radius-dictionary/name/{name}/disable' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + + #Function Section Name:RADIUSDynamicAuthorizationTemplate + #Function Section Description: Manage RADIUS Dynamic Authorization Templates + + def get_radius_dynamic_authorization_template(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of RADIUS Dynamic Authorization Templates + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/radius-dynamic-authorization-template' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_radius_dynamic_authorization_template(self,body=({})): + ''' + Operation: Create a new RADIUS Dynamic Authorization Template + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RADIUSDynamicAuthorizationTemplateCreate {vendor_name (string): Vendor Name of RADIUS Dynamic Authorization Template,template_type (string): Template Type of RADIUS Dynamic Authorization Template,name (string): Name of RADIUS Dynamic Authorization Template,display_name (string): Display Name of RADIUS Dynamic Authorization Template,attributes (array[Attributes]): Attributes of RADIUS Dynamic Authorization Template}Attributes {input_required (string) = ['Not_Required' or 'Optional' or 'Required']: RADIUS Dynamic Authorization Template Attribute Input Required,value (string): RADIUS Dynamic Authorization Template Attribute Value,name (string): RADIUS Dynamic Authorization Template Attribute Name,type (string, optional): RADIUS Dynamic Authorization Template Attribute Type} + Required Body Parameters (type(dict) body example)- { + "vendor_name": "", + "template_type": "", + "name": "", + "display_name": "", + "attributes": [ + { + "input_required": "", + "value": "", + "name": "", + "type": "" + } + ] +} + ''' + url_path = '/radius-dynamic-authorization-template' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_radius_dynamic_authorization_template_by_radius_dynamic_authorization_template_id(self,radius_dynamic_authorization_template_id=""): + ''' + Operation: Get a RADIUS Dynamic Authorization Template + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: radius_dynamic_authorization_template_id, Description: Numeric ID of RADIUS Dynamic Authorization Template + ''' + url_path = '/radius-dynamic-authorization-template/{radius_dynamic_authorization_template_id}' + dict_path={'radius_dynamic_authorization_template_id': radius_dynamic_authorization_template_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_radius_dynamic_authorization_template_by_radius_dynamic_authorization_template_id(self,radius_dynamic_authorization_template_id="",body=({})): + ''' + Operation: Update a RADIUS Dynamic Authorization Template + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: radius_dynamic_authorization_template_id, Description: Numeric ID of RADIUS Dynamic Authorization Template + Required Body Parameters (body description)- RADIUSDynamicAuthorizationTemplateUpdate {vendor_name (string, optional): Vendor Name of RADIUS Dynamic Authorization Template,template_type (string, optional): Template Type of RADIUS Dynamic Authorization Template,name (string, optional): Name of RADIUS Dynamic Authorization Template,display_name (string, optional): Display Name of RADIUS Dynamic Authorization Template,attributes (array[Attributes], optional): Attributes of RADIUS Dynamic Authorization Template}Attributes {input_required (string) = ['Not_Required' or 'Optional' or 'Required']: RADIUS Dynamic Authorization Template Attribute Input Required,value (string): RADIUS Dynamic Authorization Template Attribute Value,name (string): RADIUS Dynamic Authorization Template Attribute Name,type (string, optional): RADIUS Dynamic Authorization Template Attribute Type} + Required Body Parameters (type(dict) body example)- { + "vendor_name": "", + "template_type": "", + "name": "", + "display_name": "", + "attributes": [ + { + "input_required": "", + "value": "", + "name": "", + "type": "" + } + ] +} + ''' + url_path = '/radius-dynamic-authorization-template/{radius_dynamic_authorization_template_id}' + dict_path={'radius_dynamic_authorization_template_id': radius_dynamic_authorization_template_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_radius_dynamic_authorization_template_by_radius_dynamic_authorization_template_id(self,radius_dynamic_authorization_template_id="",body=({})): + ''' + Operation: Replace a RADIUS Dynamic Authorization Template + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: radius_dynamic_authorization_template_id, Description: Numeric ID of RADIUS Dynamic Authorization Template + Required Body Parameters (body description)- RADIUSDynamicAuthorizationTemplateReplace {vendor_name (string): Vendor Name of RADIUS Dynamic Authorization Template,template_type (string): Template Type of RADIUS Dynamic Authorization Template,name (string): Name of RADIUS Dynamic Authorization Template,display_name (string): Display Name of RADIUS Dynamic Authorization Template,attributes (array[Attributes]): Attributes of RADIUS Dynamic Authorization Template}Attributes {input_required (string) = ['Not_Required' or 'Optional' or 'Required']: RADIUS Dynamic Authorization Template Attribute Input Required,value (string): RADIUS Dynamic Authorization Template Attribute Value,name (string): RADIUS Dynamic Authorization Template Attribute Name,type (string, optional): RADIUS Dynamic Authorization Template Attribute Type} + Required Body Parameters (type(dict) body example)- { + "vendor_name": "", + "template_type": "", + "name": "", + "display_name": "", + "attributes": [ + { + "input_required": "", + "value": "", + "name": "", + "type": "" + } + ] +} + ''' + url_path = '/radius-dynamic-authorization-template/{radius_dynamic_authorization_template_id}' + dict_path={'radius_dynamic_authorization_template_id': radius_dynamic_authorization_template_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_radius_dynamic_authorization_template_by_radius_dynamic_authorization_template_id(self,radius_dynamic_authorization_template_id=""): + ''' + Operation: Delete a RADIUS Dynamic Authorization Template + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: radius_dynamic_authorization_template_id, Description: Numeric ID of RADIUS Dynamic Authorization Template + ''' + url_path = '/radius-dynamic-authorization-template/{radius_dynamic_authorization_template_id}' + dict_path={'radius_dynamic_authorization_template_id': radius_dynamic_authorization_template_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_radius_dynamic_authorization_template_name_by_name(self,name=""): + ''' + Operation: Get a RADIUS Dynamic Authorization Template by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of RADIUS Dynamic Authorization Template + ''' + url_path = '/radius-dynamic-authorization-template/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_radius_dynamic_authorization_template_name_by_name(self,name="",body=({})): + ''' + Operation: Update a RADIUS Dynamic Authorization Template by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of RADIUS Dynamic Authorization Template + Required Body Parameters (body description)- RADIUSDynamicAuthorizationTemplateUpdate {vendor_name (string, optional): Vendor Name of RADIUS Dynamic Authorization Template,template_type (string, optional): Template Type of RADIUS Dynamic Authorization Template,name (string, optional): Name of RADIUS Dynamic Authorization Template,display_name (string, optional): Display Name of RADIUS Dynamic Authorization Template,attributes (array[Attributes], optional): Attributes of RADIUS Dynamic Authorization Template}Attributes {input_required (string) = ['Not_Required' or 'Optional' or 'Required']: RADIUS Dynamic Authorization Template Attribute Input Required,value (string): RADIUS Dynamic Authorization Template Attribute Value,name (string): RADIUS Dynamic Authorization Template Attribute Name,type (string, optional): RADIUS Dynamic Authorization Template Attribute Type} + Required Body Parameters (type(dict) body example)- { + "vendor_name": "", + "template_type": "", + "name": "", + "display_name": "", + "attributes": [ + { + "input_required": "", + "value": "", + "name": "", + "type": "" + } + ] +} + ''' + url_path = '/radius-dynamic-authorization-template/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_radius_dynamic_authorization_template_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a RADIUS Dynamic Authorization Template by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of RADIUS Dynamic Authorization Template + Required Body Parameters (body description)- RADIUSDynamicAuthorizationTemplateReplace {vendor_name (string): Vendor Name of RADIUS Dynamic Authorization Template,template_type (string): Template Type of RADIUS Dynamic Authorization Template,name (string): Name of RADIUS Dynamic Authorization Template,display_name (string): Display Name of RADIUS Dynamic Authorization Template,attributes (array[Attributes]): Attributes of RADIUS Dynamic Authorization Template}Attributes {input_required (string) = ['Not_Required' or 'Optional' or 'Required']: RADIUS Dynamic Authorization Template Attribute Input Required,value (string): RADIUS Dynamic Authorization Template Attribute Value,name (string): RADIUS Dynamic Authorization Template Attribute Name,type (string, optional): RADIUS Dynamic Authorization Template Attribute Type} + Required Body Parameters (type(dict) body example)- { + "vendor_name": "", + "template_type": "", + "name": "", + "display_name": "", + "attributes": [ + { + "input_required": "", + "value": "", + "name": "", + "type": "" + } + ] +} + ''' + url_path = '/radius-dynamic-authorization-template/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_radius_dynamic_authorization_template_name_by_name(self,name=""): + ''' + Operation: Delete a RADIUS Dynamic Authorization Template by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of RADIUS Dynamic Authorization Template + ''' + url_path = '/radius-dynamic-authorization-template/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:RADIUSProxyTarget + #Function Section Description: Manage proxy targets + + def get_proxy_target(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of proxy targets + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/proxy-target' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_proxy_target(self,body=({})): + ''' + Operation: Create a new proxy target + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RADIUSProxyTargetCreate {name (string): Name of the proxy target,host_name (string): Host name of the proxy target,description (string, optional): Description of the proxy target,authentication_port (integer, optional): Authentication port of the proxy target,proxy_type (string): The proxy type, either RADIUS or RadSec,accounting_port (integer, optional): Accounting port of the proxy target,secret (string, optional): Shared Secret of the proxy target,radsec_port (integer, optional): The RadSec proxy port number (Should be 2083),radsec_verify_cert (boolean, optional): Enable to verify the server certificate,cert_subject (string, optional): Client Certificate Subject,enable_status_server_msgs (boolean, optional): Enable to send the status-server message} + Required Body Parameters (type(dict) body example)- { + "name": "", + "host_name": "", + "description": "", + "authentication_port": 0, + "proxy_type": "", + "accounting_port": 0, + "secret": "", + "radsec_port": 0, + "radsec_verify_cert": false, + "cert_subject": "", + "enable_status_server_msgs": false +} + ''' + url_path = '/proxy-target' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_proxy_target_by_proxy_target_id(self,proxy_target_id=""): + ''' + Operation: Get a proxy target + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: proxy_target_id, Description: Numeric ID of the proxy target + ''' + url_path = '/proxy-target/{proxy_target_id}' + dict_path={'proxy_target_id': proxy_target_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_proxy_target_by_proxy_target_id(self,proxy_target_id="",body=({})): + ''' + Operation: Update some fields of a proxy target + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: proxy_target_id, Description: Numeric ID of the proxy target + Required Body Parameters (body description)- RADIUSProxyTargetUpdate {name (string, optional): Name of the proxy target,host_name (string, optional): Host name of the proxy target,description (string, optional): Description of the proxy target,authentication_port (integer, optional): Authentication port of the proxy target,proxy_type (string, optional): The proxy type, either RADIUS or RadSec,accounting_port (integer, optional): Accounting port of the proxy target,secret (string, optional): Shared Secret of the proxy target,radsec_port (integer, optional): The RadSec proxy port number (Should be 2083),radsec_verify_cert (boolean, optional): Enable to verify the server certificate,cert_subject (string, optional): Client Certificate Subject,enable_status_server_msgs (boolean, optional): Enable to send the status-server message} + Required Body Parameters (type(dict) body example)- { + "name": "", + "host_name": "", + "description": "", + "authentication_port": 0, + "proxy_type": "", + "accounting_port": 0, + "secret": "", + "radsec_port": 0, + "radsec_verify_cert": false, + "cert_subject": "", + "enable_status_server_msgs": false +} + ''' + url_path = '/proxy-target/{proxy_target_id}' + dict_path={'proxy_target_id': proxy_target_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_proxy_target_by_proxy_target_id(self,proxy_target_id="",body=({})): + ''' + Operation: Replace a proxy target + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: proxy_target_id, Description: Numeric ID of the proxy target + Required Body Parameters (body description)- RADIUSProxyTargetReplace {name (string): Name of the proxy target,host_name (string): Host name of the proxy target,description (string, optional): Description of the proxy target,authentication_port (integer, optional): Authentication port of the proxy target,proxy_type (string): The proxy type, either RADIUS or RadSec,accounting_port (integer, optional): Accounting port of the proxy target,secret (string, optional): Shared Secret of the proxy target,radsec_port (integer, optional): The RadSec proxy port number (Should be 2083),radsec_verify_cert (boolean, optional): Enable to verify the server certificate,cert_subject (string, optional): Client Certificate Subject,enable_status_server_msgs (boolean, optional): Enable to send the status-server message} + Required Body Parameters (type(dict) body example)- { + "name": "", + "host_name": "", + "description": "", + "authentication_port": 0, + "proxy_type": "", + "accounting_port": 0, + "secret": "", + "radsec_port": 0, + "radsec_verify_cert": false, + "cert_subject": "", + "enable_status_server_msgs": false +} + ''' + url_path = '/proxy-target/{proxy_target_id}' + dict_path={'proxy_target_id': proxy_target_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_proxy_target_by_proxy_target_id(self,proxy_target_id=""): + ''' + Operation: Delete a proxy target + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: proxy_target_id, Description: Numeric ID of the proxy target + ''' + url_path = '/proxy-target/{proxy_target_id}' + dict_path={'proxy_target_id': proxy_target_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_proxy_target_name_by_name(self,name=""): + ''' + Operation: Get a proxy target by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the proxy target + ''' + url_path = '/proxy-target/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_proxy_target_name_by_name(self,name="",body=({})): + ''' + Operation: Update some fields of a proxy target by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the proxy target + Required Body Parameters (body description)- RADIUSProxyTargetUpdate {name (string, optional): Name of the proxy target,host_name (string, optional): Host name of the proxy target,description (string, optional): Description of the proxy target,authentication_port (integer, optional): Authentication port of the proxy target,proxy_type (string, optional): The proxy type, either RADIUS or RadSec,accounting_port (integer, optional): Accounting port of the proxy target,secret (string, optional): Shared Secret of the proxy target,radsec_port (integer, optional): The RadSec proxy port number (Should be 2083),radsec_verify_cert (boolean, optional): Enable to verify the server certificate,cert_subject (string, optional): Client Certificate Subject,enable_status_server_msgs (boolean, optional): Enable to send the status-server message} + Required Body Parameters (type(dict) body example)- { + "name": "", + "host_name": "", + "description": "", + "authentication_port": 0, + "proxy_type": "", + "accounting_port": 0, + "secret": "", + "radsec_port": 0, + "radsec_verify_cert": false, + "cert_subject": "", + "enable_status_server_msgs": false +} + ''' + url_path = '/proxy-target/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_proxy_target_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a proxy target by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the proxy target + Required Body Parameters (body description)- RADIUSProxyTargetReplace {name (string): Name of the proxy target,host_name (string): Host name of the proxy target,description (string, optional): Description of the proxy target,authentication_port (integer, optional): Authentication port of the proxy target,proxy_type (string): The proxy type, either RADIUS or RadSec,accounting_port (integer, optional): Accounting port of the proxy target,secret (string, optional): Shared Secret of the proxy target,radsec_port (integer, optional): The RadSec proxy port number (Should be 2083),radsec_verify_cert (boolean, optional): Enable to verify the server certificate,cert_subject (string, optional): Client Certificate Subject,enable_status_server_msgs (boolean, optional): Enable to send the status-server message} + Required Body Parameters (type(dict) body example)- { + "name": "", + "host_name": "", + "description": "", + "authentication_port": 0, + "proxy_type": "", + "accounting_port": 0, + "secret": "", + "radsec_port": 0, + "radsec_verify_cert": false, + "cert_subject": "", + "enable_status_server_msgs": false +} + ''' + url_path = '/proxy-target/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_proxy_target_name_by_name(self,name=""): + ''' + Operation: Delete a proxy target by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the proxy target + ''' + url_path = '/proxy-target/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:Role + #Function Section Description: Manage roles + + def get_role(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of roles + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/role' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_role(self,body=({})): + ''' + Operation: Create a new role + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RoleCreate {name (string): Name of the role,description (string, optional): Description of the role} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "" +} + ''' + url_path = '/role' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_role_by_role_id(self,role_id=""): + ''' + Operation: Get a role + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: role_id, Description: Numeric ID of the role + ''' + url_path = '/role/{role_id}' + dict_path={'role_id': role_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_role_by_role_id(self,role_id="",body=({})): + ''' + Operation: Update some fields of a role + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: role_id, Description: Numeric ID of the role + Required Body Parameters (body description)- RoleUpdate {name (string, optional): Name of the role,description (string, optional): Description of the role} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "" +} + ''' + url_path = '/role/{role_id}' + dict_path={'role_id': role_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_role_by_role_id(self,role_id="",body=({})): + ''' + Operation: Replace a role + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: role_id, Description: Numeric ID of the role + Required Body Parameters (body description)- RoleReplace {name (string): Name of the role,description (string, optional): Description of the role} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "" +} + ''' + url_path = '/role/{role_id}' + dict_path={'role_id': role_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_role_by_role_id(self,role_id=""): + ''' + Operation: Delete a role + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: role_id, Description: Numeric ID of the role + ''' + url_path = '/role/{role_id}' + dict_path={'role_id': role_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_role_name_by_name(self,name=""): + ''' + Operation: Get a role by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the role + ''' + url_path = '/role/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_role_name_by_name(self,name="",body=({})): + ''' + Operation: Update some fields of a role by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the role + Required Body Parameters (body description)- RoleUpdate {name (string, optional): Name of the role,description (string, optional): Description of the role} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "" +} + ''' + url_path = '/role/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_role_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a role by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the role + Required Body Parameters (body description)- RoleReplace {name (string): Name of the role,description (string, optional): Description of the role} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "" +} + ''' + url_path = '/role/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_role_name_by_name(self,name=""): + ''' + Operation: Delete a role by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the role + ''' + url_path = '/role/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:RoleMapping + #Function Section Description: Manage Role Mappings + + def get_role_mapping(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of role mappings + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/role-mapping' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_role_mapping(self,body=({})): + ''' + Operation: Create a new role mapping + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RoleMappingCreate {name (string): Role mapping policy name,description (string, optional): Role mapping description,default_role_name (string): Role mapping default role name,rule_combine_algo (string) = ['first-applicable' or 'evaluate-all']: Role mapping rules evaluation algorithm,rules (RulesSettingsCreate): List of role mapping rules}RulesSettingsCreate {match_type (string) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,role_name (string): Role name,condition (RulesConditionSettingsCreate): Conditions of role mapping rules}RulesConditionSettingsCreate {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "default_role_name": "", + "rule_combine_algo": "", + "rules": { + "match_type": "", + "role_name": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/role-mapping' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_role_mapping_by_role_mapping_id(self,role_mapping_id=""): + ''' + Operation: Get a role mapping + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: role_mapping_id, Description: Numeric ID of the role mapping + ''' + url_path = '/role-mapping/{role_mapping_id}' + dict_path={'role_mapping_id': role_mapping_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_role_mapping_by_role_mapping_id(self,role_mapping_id="",body=({})): + ''' + Operation: Update a role mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: role_mapping_id, Description: Numeric ID of the role mapping + Required Body Parameters (body description)- RoleMappingUpdate {name (string, optional): Role mapping policy name,description (string, optional): Role mapping description,default_role_name (string, optional): Role mapping default role name,rule_combine_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Role mapping rules evaluation algorithm,rules (RulesSettingsUpdate, optional): List of role mapping rules}RulesSettingsUpdate {match_type (string, optional) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,role_name (string, optional): Role name,condition (RulesConditionSettingsUpdate, optional): Conditions of role mapping rules}RulesConditionSettingsUpdate {type (string, optional): Condition type,name (string, optional): Condition name,oper (string, optional): Condition operator,value (string, optional): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "default_role_name": "", + "rule_combine_algo": "", + "rules": { + "match_type": "", + "role_name": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/role-mapping/{role_mapping_id}' + dict_path={'role_mapping_id': role_mapping_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_role_mapping_by_role_mapping_id(self,role_mapping_id="",body=({})): + ''' + Operation: Replace a role mapping + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: role_mapping_id, Description: Numeric ID of the role mapping + Required Body Parameters (body description)- RoleMappingReplace {name (string): Role mapping policy name,description (string, optional): Role mapping description,default_role_name (string): Role mapping default role name,rule_combine_algo (string) = ['first-applicable' or 'evaluate-all']: Role mapping rules evaluation algorithm,rules (RulesSettingsReplace): List of role mapping rules}RulesSettingsReplace {match_type (string) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,role_name (string): Role name,condition (RulesConditionSettingsReplace): Conditions of role mapping rules}RulesConditionSettingsReplace {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "default_role_name": "", + "rule_combine_algo": "", + "rules": { + "match_type": "", + "role_name": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/role-mapping/{role_mapping_id}' + dict_path={'role_mapping_id': role_mapping_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_role_mapping_by_role_mapping_id(self,role_mapping_id=""): + ''' + Operation: Delete a role mapping + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: role_mapping_id, Description: Numeric ID of the role mapping + ''' + url_path = '/role-mapping/{role_mapping_id}' + dict_path={'role_mapping_id': role_mapping_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_role_mapping_name_by_name(self,name=""): + ''' + Operation: Get a role mapping by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the role mapping + ''' + url_path = '/role-mapping/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_role_mapping_name_by_name(self,name="",body=({})): + ''' + Operation: Update a role mapping by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the role mapping + Required Body Parameters (body description)- RoleMappingUpdate {name (string, optional): Role mapping policy name,description (string, optional): Role mapping description,default_role_name (string, optional): Role mapping default role name,rule_combine_algo (string, optional) = ['first-applicable' or 'evaluate-all']: Role mapping rules evaluation algorithm,rules (RulesSettingsUpdate, optional): List of role mapping rules}RulesSettingsUpdate {match_type (string, optional) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,role_name (string, optional): Role name,condition (RulesConditionSettingsUpdate, optional): Conditions of role mapping rules}RulesConditionSettingsUpdate {type (string, optional): Condition type,name (string, optional): Condition name,oper (string, optional): Condition operator,value (string, optional): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "default_role_name": "", + "rule_combine_algo": "", + "rules": { + "match_type": "", + "role_name": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/role-mapping/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_role_mapping_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a role mapping by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the role mapping + Required Body Parameters (body description)- RoleMappingReplace {name (string): Role mapping policy name,description (string, optional): Role mapping description,default_role_name (string): Role mapping default role name,rule_combine_algo (string) = ['first-applicable' or 'evaluate-all']: Role mapping rules evaluation algorithm,rules (RulesSettingsReplace): List of role mapping rules}RulesSettingsReplace {match_type (string) = ['AND' or 'OR']: Matches ANY/ALL the conditions specified in the rule,role_name (string): Role name,condition (RulesConditionSettingsReplace): Conditions of role mapping rules}RulesConditionSettingsReplace {type (string): Condition type,name (string): Condition name,oper (string): Condition operator,value (string): Condition value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "description": "", + "default_role_name": "", + "rule_combine_algo": "", + "rules": { + "match_type": "", + "role_name": "", + "condition": { + "type": "", + "name": "", + "oper": "", + "value": "" + } + } +} + ''' + url_path = '/role-mapping/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_role_mapping_name_by_name(self,name=""): + ''' + Operation: Delete a role mapping by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the role mapping + ''' + url_path = '/role-mapping/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + + #Function Section Name:Service + #Function Section Description: Manage Configuration Services + + def get_config_service(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of Services + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/config/service' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_config_service(self,body=({})): + ''' + Operation: Create a new Service + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ServiceCreate {name (string): Name of the Service,template (string) = ['Aruba 802.1X Wireless' or '802.1X Wireless' or '802.1X Wired' or 'MAC Authentication' or 'Web-based Authentication' or 'Web-based Health Check Only' or 'Web-based Open Network Access' or '802.1X Wireless - Identity Only' or '802.1X Wired - Identity Only' or 'RADIUS Enforcement ( Generic )' or 'RADIUS Proxy' or 'RADIUS Authorization' or 'TACACS+ Enforcement' or 'Aruba Application Authentication' or 'Aruba Application Authorization' or 'Cisco Web Authentication Proxy' or 'Event-based Enforcement' or 'ClearPass OnConnect Enforcement']: Template of the Service,enabled (boolean, optional): Is Service enabled?,order_no (integer, optional): Order number of the Service,description (string, optional): Description of the Service,monitor_mode (boolean, optional): Enable to monitor network access without enforcement,rules_match_type (string, optional) = ['MATCHES_ANY' or 'MATCHES_ALL']: Matches ANY/ALL of the rule conditions,rules_conditions (array[ServiceRules], optional): List of service rules conditions,auth_methods (array[string], optional): List of Authentication Method Names,auth_sources (array[string], optional): List of Authentication Source Names,strip_username (boolean, optional): Enable to specify a comma-separated list of rules to strip username prefixes or suffixes,strip_username_csv (string, optional): Strip Username Rule,service_cert_cn (string, optional): Subject DN of Service Certificate,service_cert_expiry_date (string, optional): Expiry Date of Service Certificate (Date Format - MMM dd, yyyy HH:mm:ss Z),role_mapping_policy (string, optional): Role Mapping Policy Name,enf_policy (string): Enforcement Policy Name,use_cached_policy_results (boolean, optional): Enable to use cached Roles and Posture attributes from previous sessions,authz_sources (array[string], optional): List of Additional authorization sources from which to fetch role-mapping attributes,posture_enabled (boolean, optional): Enable Posture Compliance,posture_policies (array[string], optional): List of Posture Policy Names,default_posture_token (string, optional) = ['HEALTHY' or 'CHECKUP' or 'TRANSITION' or 'QUARANTINE' or 'INFECTED' or 'UNKNOWN']: Default Posture Token,remediate_end_hosts (boolean, optional): Enable auto-remediation of non-compliant end-hosts,remediation_url (string, optional): Remediation URL,audit_enabled (boolean, optional): Enable Audit End-hosts,audit_server (string, optional): Audit Server Name,audit_trigger_condition (string, optional) = ['ALWAYS' or 'NO_POSTURE' or 'MAC_AUTH']: Audit Trigger Conditions,audit_mac_auth_client_type (string, optional) = ['KNOWN' or 'UNKNOWN' or 'BOTH']: Client Type For MAC authentication request Audit Trigger Condition,action_after_audit (string, optional) = ['NONE' or 'SNMP' or 'RADIUS']: Action after audit,audit_coa_acton (string, optional): RADIUS CoA Action to be triggered after audit,profiler_enabled (boolean, optional): Enable Profile Endpoints,profiler_endpoint_classification (array[string], optional): List of Endpoint classification(s) after which an action must be triggered,profiler_coa_action (string, optional): RADIUS CoA Action to be triggered by Profiler ,acct_proxy_enabled (boolean, optional): Enable Accounting Proxy Targets,acct_proxy_targets (array[string], optional): List Accounting Proxy Target names,acct_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be deleted for Accounting proxy,acct_proxy_attrs_to_add (array[AttributesToAdd], optional): RADIUS attributes to be added for Accounting proxy,radius_proxy_scheme (string, optional) = ['Load Balance' or 'Failover']: Proxying Scheme for RADIUS Proxy Service Type,radius_proxy_targets (array[string], optional): List of Proxy Targets for RADIUS Proxy Service Type,radius_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be removed from remote server (proxy target) reply,radius_proxy_enable_for_acct (boolean, optional): Enable proxy for accounting requests (Applicable only for RADIUS Proxy Service Type) }ServiceRules {type (string): Type,name (string): Name,operator (string): Operator,value (string, optional): Value}AttributesToDelete {type (string): Type,name (string): Name}AttributesToAdd {type (string): Type,name (string): Name,value (string): Value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "template": "", + "enabled": false, + "order_no": 0, + "description": "", + "monitor_mode": false, + "rules_match_type": "", + "rules_conditions": [ + { + "type": "", + "name": "", + "operator": "", + "value": "" + } + ], + "auth_methods": [ + "" + ], + "auth_sources": [ + "" + ], + "strip_username": false, + "strip_username_csv": "", + "service_cert_cn": "", + "service_cert_expiry_date": "", + "role_mapping_policy": "", + "enf_policy": "", + "use_cached_policy_results": false, + "authz_sources": [ + "" + ], + "posture_enabled": false, + "posture_policies": [ + "" + ], + "default_posture_token": "", + "remediate_end_hosts": false, + "remediation_url": "", + "audit_enabled": false, + "audit_server": "", + "audit_trigger_condition": "", + "audit_mac_auth_client_type": "", + "action_after_audit": "", + "audit_coa_acton": "", + "profiler_enabled": false, + "profiler_endpoint_classification": [ + "" + ], + "profiler_coa_action": "", + "acct_proxy_enabled": false, + "acct_proxy_targets": [ + "" + ], + "acct_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "acct_proxy_attrs_to_add": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "radius_proxy_scheme": "", + "radius_proxy_targets": [ + "" + ], + "radius_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "radius_proxy_enable_for_acct": false +} + ''' + url_path = '/config/service' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_config_service_by_services_id(self,services_id=""): + ''' + Operation: Get a Service + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: services_id, Description: Numeric ID of the service + ''' + url_path = '/config/service/{services_id}' + dict_path={'services_id': services_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_config_service_by_services_id(self,services_id="",body=({})): + ''' + Operation: Update some fields of a Service + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_id, Description: Numeric ID of the service + Required Body Parameters (body description)- ServiceUpdate {name (string, optional): Name of the Service,template (string, optional) = ['Aruba 802.1X Wireless' or '802.1X Wireless' or '802.1X Wired' or 'MAC Authentication' or 'Web-based Authentication' or 'Web-based Health Check Only' or 'Web-based Open Network Access' or '802.1X Wireless - Identity Only' or '802.1X Wired - Identity Only' or 'RADIUS Enforcement ( Generic )' or 'RADIUS Proxy' or 'RADIUS Authorization' or 'TACACS+ Enforcement' or 'Aruba Application Authentication' or 'Aruba Application Authorization' or 'Cisco Web Authentication Proxy' or 'Event-based Enforcement' or 'ClearPass OnConnect Enforcement']: Template of the Service,enabled (boolean, optional): Is Service enabled?,order_no (integer, optional): Order number of the Service,description (string, optional): Description of the Service,monitor_mode (boolean, optional): Enable to monitor network access without enforcement,rules_match_type (string, optional) = ['MATCHES_ANY' or 'MATCHES_ALL']: Matches ANY/ALL of the rule conditions,rules_conditions (array[ServiceRules], optional): List of service rules conditions,auth_methods (array[string], optional): List of Authentication Method Names,auth_sources (array[string], optional): List of Authentication Source Names,strip_username (boolean, optional): Enable to specify a comma-separated list of rules to strip username prefixes or suffixes,strip_username_csv (string, optional): Strip Username Rule,service_cert_cn (string, optional): Subject DN of Service Certificate,service_cert_expiry_date (string, optional): Expiry Date of Service Certificate (Date Format - MMM dd, yyyy HH:mm:ss Z),role_mapping_policy (string, optional): Role Mapping Policy Name,enf_policy (string, optional): Enforcement Policy Name,use_cached_policy_results (boolean, optional): Enable to use cached Roles and Posture attributes from previous sessions,authz_sources (array[string], optional): List of Additional authorization sources from which to fetch role-mapping attributes,posture_enabled (boolean, optional): Enable Posture Compliance,posture_policies (array[string], optional): List of Posture Policy Names,default_posture_token (string, optional) = ['HEALTHY' or 'CHECKUP' or 'TRANSITION' or 'QUARANTINE' or 'INFECTED' or 'UNKNOWN']: Default Posture Token,remediate_end_hosts (boolean, optional): Enable auto-remediation of non-compliant end-hosts,remediation_url (string, optional): Remediation URL,audit_enabled (boolean, optional): Enable Audit End-hosts,audit_server (string, optional): Audit Server Name,audit_trigger_condition (string, optional) = ['ALWAYS' or 'NO_POSTURE' or 'MAC_AUTH']: Audit Trigger Conditions,audit_mac_auth_client_type (string, optional) = ['KNOWN' or 'UNKNOWN' or 'BOTH']: Client Type For MAC authentication request Audit Trigger Condition,action_after_audit (string, optional) = ['NONE' or 'SNMP' or 'RADIUS']: Action after audit,audit_coa_acton (string, optional): RADIUS CoA Action to be triggered after audit,profiler_enabled (boolean, optional): Enable Profile Endpoints,profiler_endpoint_classification (array[string], optional): List of Endpoint classification(s) after which an action must be triggered,profiler_coa_action (string, optional): RADIUS CoA Action to be triggered by Profiler ,acct_proxy_enabled (boolean, optional): Enable Accounting Proxy Targets,acct_proxy_targets (array[string], optional): List Accounting Proxy Target names,acct_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be deleted for Accounting proxy,acct_proxy_attrs_to_add (array[AttributesToAdd], optional): RADIUS attributes to be added for Accounting proxy,radius_proxy_scheme (string, optional) = ['Load Balance' or 'Failover']: Proxying Scheme for RADIUS Proxy Service Type,radius_proxy_targets (array[string], optional): List of Proxy Targets for RADIUS Proxy Service Type,radius_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be removed from remote server (proxy target) reply,radius_proxy_enable_for_acct (boolean, optional): Enable proxy for accounting requests (Applicable only for RADIUS Proxy Service Type) }ServiceRules {type (string): Type,name (string): Name,operator (string): Operator,value (string, optional): Value}AttributesToDelete {type (string): Type,name (string): Name}AttributesToAdd {type (string): Type,name (string): Name,value (string): Value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "template": "", + "enabled": false, + "order_no": 0, + "description": "", + "monitor_mode": false, + "rules_match_type": "", + "rules_conditions": [ + { + "type": "", + "name": "", + "operator": "", + "value": "" + } + ], + "auth_methods": [ + "" + ], + "auth_sources": [ + "" + ], + "strip_username": false, + "strip_username_csv": "", + "service_cert_cn": "", + "service_cert_expiry_date": "", + "role_mapping_policy": "", + "enf_policy": "", + "use_cached_policy_results": false, + "authz_sources": [ + "" + ], + "posture_enabled": false, + "posture_policies": [ + "" + ], + "default_posture_token": "", + "remediate_end_hosts": false, + "remediation_url": "", + "audit_enabled": false, + "audit_server": "", + "audit_trigger_condition": "", + "audit_mac_auth_client_type": "", + "action_after_audit": "", + "audit_coa_acton": "", + "profiler_enabled": false, + "profiler_endpoint_classification": [ + "" + ], + "profiler_coa_action": "", + "acct_proxy_enabled": false, + "acct_proxy_targets": [ + "" + ], + "acct_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "acct_proxy_attrs_to_add": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "radius_proxy_scheme": "", + "radius_proxy_targets": [ + "" + ], + "radius_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "radius_proxy_enable_for_acct": false +} + ''' + url_path = '/config/service/{services_id}' + dict_path={'services_id': services_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_config_service_by_services_id(self,services_id="",body=({})): + ''' + Operation: Replace a Service + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_id, Description: Numeric ID of the service + Required Body Parameters (body description)- ServiceReplace {name (string): Name of the Service,template (string) = ['Aruba 802.1X Wireless' or '802.1X Wireless' or '802.1X Wired' or 'MAC Authentication' or 'Web-based Authentication' or 'Web-based Health Check Only' or 'Web-based Open Network Access' or '802.1X Wireless - Identity Only' or '802.1X Wired - Identity Only' or 'RADIUS Enforcement ( Generic )' or 'RADIUS Proxy' or 'RADIUS Authorization' or 'TACACS+ Enforcement' or 'Aruba Application Authentication' or 'Aruba Application Authorization' or 'Cisco Web Authentication Proxy' or 'Event-based Enforcement' or 'ClearPass OnConnect Enforcement']: Template of the Service,enabled (boolean, optional): Is Service enabled?,order_no (integer, optional): Order number of the Service,description (string, optional): Description of the Service,monitor_mode (boolean, optional): Enable to monitor network access without enforcement,rules_match_type (string, optional) = ['MATCHES_ANY' or 'MATCHES_ALL']: Matches ANY/ALL of the rule conditions,rules_conditions (array[ServiceRules], optional): List of service rules conditions,auth_methods (array[string], optional): List of Authentication Method Names,auth_sources (array[string], optional): List of Authentication Source Names,strip_username (boolean, optional): Enable to specify a comma-separated list of rules to strip username prefixes or suffixes,strip_username_csv (string, optional): Strip Username Rule,service_cert_cn (string, optional): Subject DN of Service Certificate,service_cert_expiry_date (string, optional): Expiry Date of Service Certificate (Date Format - MMM dd, yyyy HH:mm:ss Z),role_mapping_policy (string, optional): Role Mapping Policy Name,enf_policy (string): Enforcement Policy Name,use_cached_policy_results (boolean, optional): Enable to use cached Roles and Posture attributes from previous sessions,authz_sources (array[string], optional): List of Additional authorization sources from which to fetch role-mapping attributes,posture_enabled (boolean, optional): Enable Posture Compliance,posture_policies (array[string], optional): List of Posture Policy Names,default_posture_token (string, optional) = ['HEALTHY' or 'CHECKUP' or 'TRANSITION' or 'QUARANTINE' or 'INFECTED' or 'UNKNOWN']: Default Posture Token,remediate_end_hosts (boolean, optional): Enable auto-remediation of non-compliant end-hosts,remediation_url (string, optional): Remediation URL,audit_enabled (boolean, optional): Enable Audit End-hosts,audit_server (string, optional): Audit Server Name,audit_trigger_condition (string, optional) = ['ALWAYS' or 'NO_POSTURE' or 'MAC_AUTH']: Audit Trigger Conditions,audit_mac_auth_client_type (string, optional) = ['KNOWN' or 'UNKNOWN' or 'BOTH']: Client Type For MAC authentication request Audit Trigger Condition,action_after_audit (string, optional) = ['NONE' or 'SNMP' or 'RADIUS']: Action after audit,audit_coa_acton (string, optional): RADIUS CoA Action to be triggered after audit,profiler_enabled (boolean, optional): Enable Profile Endpoints,profiler_endpoint_classification (array[string], optional): List of Endpoint classification(s) after which an action must be triggered,profiler_coa_action (string, optional): RADIUS CoA Action to be triggered by Profiler ,acct_proxy_enabled (boolean, optional): Enable Accounting Proxy Targets,acct_proxy_targets (array[string], optional): List Accounting Proxy Target names,acct_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be deleted for Accounting proxy,acct_proxy_attrs_to_add (array[AttributesToAdd], optional): RADIUS attributes to be added for Accounting proxy,radius_proxy_scheme (string, optional) = ['Load Balance' or 'Failover']: Proxying Scheme for RADIUS Proxy Service Type,radius_proxy_targets (array[string], optional): List of Proxy Targets for RADIUS Proxy Service Type,radius_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be removed from remote server (proxy target) reply,radius_proxy_enable_for_acct (boolean, optional): Enable proxy for accounting requests (Applicable only for RADIUS Proxy Service Type) }ServiceRules {type (string): Type,name (string): Name,operator (string): Operator,value (string, optional): Value}AttributesToDelete {type (string): Type,name (string): Name}AttributesToAdd {type (string): Type,name (string): Name,value (string): Value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "template": "", + "enabled": false, + "order_no": 0, + "description": "", + "monitor_mode": false, + "rules_match_type": "", + "rules_conditions": [ + { + "type": "", + "name": "", + "operator": "", + "value": "" + } + ], + "auth_methods": [ + "" + ], + "auth_sources": [ + "" + ], + "strip_username": false, + "strip_username_csv": "", + "service_cert_cn": "", + "service_cert_expiry_date": "", + "role_mapping_policy": "", + "enf_policy": "", + "use_cached_policy_results": false, + "authz_sources": [ + "" + ], + "posture_enabled": false, + "posture_policies": [ + "" + ], + "default_posture_token": "", + "remediate_end_hosts": false, + "remediation_url": "", + "audit_enabled": false, + "audit_server": "", + "audit_trigger_condition": "", + "audit_mac_auth_client_type": "", + "action_after_audit": "", + "audit_coa_acton": "", + "profiler_enabled": false, + "profiler_endpoint_classification": [ + "" + ], + "profiler_coa_action": "", + "acct_proxy_enabled": false, + "acct_proxy_targets": [ + "" + ], + "acct_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "acct_proxy_attrs_to_add": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "radius_proxy_scheme": "", + "radius_proxy_targets": [ + "" + ], + "radius_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "radius_proxy_enable_for_acct": false +} + ''' + url_path = '/config/service/{services_id}' + dict_path={'services_id': services_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_config_service_by_services_id(self,services_id=""): + ''' + Operation: Delete a Service + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: services_id, Description: Numeric ID of the service + ''' + url_path = '/config/service/{services_id}' + dict_path={'services_id': services_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_config_service_name_by_services_name(self,services_name=""): + ''' + Operation: Get a Service by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: services_name, Description: Name of the Service + ''' + url_path = '/config/service/name/{services_name}' + dict_path={'services_name': services_name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_config_service_name_by_services_name(self,services_name="",body=({})): + ''' + Operation: Update some fields of a Service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_name, Description: Name of the Service + Required Body Parameters (body description)- ServiceUpdate {name (string, optional): Name of the Service,template (string, optional) = ['Aruba 802.1X Wireless' or '802.1X Wireless' or '802.1X Wired' or 'MAC Authentication' or 'Web-based Authentication' or 'Web-based Health Check Only' or 'Web-based Open Network Access' or '802.1X Wireless - Identity Only' or '802.1X Wired - Identity Only' or 'RADIUS Enforcement ( Generic )' or 'RADIUS Proxy' or 'RADIUS Authorization' or 'TACACS+ Enforcement' or 'Aruba Application Authentication' or 'Aruba Application Authorization' or 'Cisco Web Authentication Proxy' or 'Event-based Enforcement' or 'ClearPass OnConnect Enforcement']: Template of the Service,enabled (boolean, optional): Is Service enabled?,order_no (integer, optional): Order number of the Service,description (string, optional): Description of the Service,monitor_mode (boolean, optional): Enable to monitor network access without enforcement,rules_match_type (string, optional) = ['MATCHES_ANY' or 'MATCHES_ALL']: Matches ANY/ALL of the rule conditions,rules_conditions (array[ServiceRules], optional): List of service rules conditions,auth_methods (array[string], optional): List of Authentication Method Names,auth_sources (array[string], optional): List of Authentication Source Names,strip_username (boolean, optional): Enable to specify a comma-separated list of rules to strip username prefixes or suffixes,strip_username_csv (string, optional): Strip Username Rule,service_cert_cn (string, optional): Subject DN of Service Certificate,service_cert_expiry_date (string, optional): Expiry Date of Service Certificate (Date Format - MMM dd, yyyy HH:mm:ss Z),role_mapping_policy (string, optional): Role Mapping Policy Name,enf_policy (string, optional): Enforcement Policy Name,use_cached_policy_results (boolean, optional): Enable to use cached Roles and Posture attributes from previous sessions,authz_sources (array[string], optional): List of Additional authorization sources from which to fetch role-mapping attributes,posture_enabled (boolean, optional): Enable Posture Compliance,posture_policies (array[string], optional): List of Posture Policy Names,default_posture_token (string, optional) = ['HEALTHY' or 'CHECKUP' or 'TRANSITION' or 'QUARANTINE' or 'INFECTED' or 'UNKNOWN']: Default Posture Token,remediate_end_hosts (boolean, optional): Enable auto-remediation of non-compliant end-hosts,remediation_url (string, optional): Remediation URL,audit_enabled (boolean, optional): Enable Audit End-hosts,audit_server (string, optional): Audit Server Name,audit_trigger_condition (string, optional) = ['ALWAYS' or 'NO_POSTURE' or 'MAC_AUTH']: Audit Trigger Conditions,audit_mac_auth_client_type (string, optional) = ['KNOWN' or 'UNKNOWN' or 'BOTH']: Client Type For MAC authentication request Audit Trigger Condition,action_after_audit (string, optional) = ['NONE' or 'SNMP' or 'RADIUS']: Action after audit,audit_coa_acton (string, optional): RADIUS CoA Action to be triggered after audit,profiler_enabled (boolean, optional): Enable Profile Endpoints,profiler_endpoint_classification (array[string], optional): List of Endpoint classification(s) after which an action must be triggered,profiler_coa_action (string, optional): RADIUS CoA Action to be triggered by Profiler ,acct_proxy_enabled (boolean, optional): Enable Accounting Proxy Targets,acct_proxy_targets (array[string], optional): List Accounting Proxy Target names,acct_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be deleted for Accounting proxy,acct_proxy_attrs_to_add (array[AttributesToAdd], optional): RADIUS attributes to be added for Accounting proxy,radius_proxy_scheme (string, optional) = ['Load Balance' or 'Failover']: Proxying Scheme for RADIUS Proxy Service Type,radius_proxy_targets (array[string], optional): List of Proxy Targets for RADIUS Proxy Service Type,radius_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be removed from remote server (proxy target) reply,radius_proxy_enable_for_acct (boolean, optional): Enable proxy for accounting requests (Applicable only for RADIUS Proxy Service Type) }ServiceRules {type (string): Type,name (string): Name,operator (string): Operator,value (string, optional): Value}AttributesToDelete {type (string): Type,name (string): Name}AttributesToAdd {type (string): Type,name (string): Name,value (string): Value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "template": "", + "enabled": false, + "order_no": 0, + "description": "", + "monitor_mode": false, + "rules_match_type": "", + "rules_conditions": [ + { + "type": "", + "name": "", + "operator": "", + "value": "" + } + ], + "auth_methods": [ + "" + ], + "auth_sources": [ + "" + ], + "strip_username": false, + "strip_username_csv": "", + "service_cert_cn": "", + "service_cert_expiry_date": "", + "role_mapping_policy": "", + "enf_policy": "", + "use_cached_policy_results": false, + "authz_sources": [ + "" + ], + "posture_enabled": false, + "posture_policies": [ + "" + ], + "default_posture_token": "", + "remediate_end_hosts": false, + "remediation_url": "", + "audit_enabled": false, + "audit_server": "", + "audit_trigger_condition": "", + "audit_mac_auth_client_type": "", + "action_after_audit": "", + "audit_coa_acton": "", + "profiler_enabled": false, + "profiler_endpoint_classification": [ + "" + ], + "profiler_coa_action": "", + "acct_proxy_enabled": false, + "acct_proxy_targets": [ + "" + ], + "acct_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "acct_proxy_attrs_to_add": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "radius_proxy_scheme": "", + "radius_proxy_targets": [ + "" + ], + "radius_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "radius_proxy_enable_for_acct": false +} + ''' + url_path = '/config/service/name/{services_name}' + dict_path={'services_name': services_name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_config_service_name_by_services_name(self,services_name="",body=({})): + ''' + Operation: Replace a Service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_name, Description: Name of the Service + Required Body Parameters (body description)- ServiceReplace {name (string): Name of the Service,template (string) = ['Aruba 802.1X Wireless' or '802.1X Wireless' or '802.1X Wired' or 'MAC Authentication' or 'Web-based Authentication' or 'Web-based Health Check Only' or 'Web-based Open Network Access' or '802.1X Wireless - Identity Only' or '802.1X Wired - Identity Only' or 'RADIUS Enforcement ( Generic )' or 'RADIUS Proxy' or 'RADIUS Authorization' or 'TACACS+ Enforcement' or 'Aruba Application Authentication' or 'Aruba Application Authorization' or 'Cisco Web Authentication Proxy' or 'Event-based Enforcement' or 'ClearPass OnConnect Enforcement']: Template of the Service,enabled (boolean, optional): Is Service enabled?,order_no (integer, optional): Order number of the Service,description (string, optional): Description of the Service,monitor_mode (boolean, optional): Enable to monitor network access without enforcement,rules_match_type (string, optional) = ['MATCHES_ANY' or 'MATCHES_ALL']: Matches ANY/ALL of the rule conditions,rules_conditions (array[ServiceRules], optional): List of service rules conditions,auth_methods (array[string], optional): List of Authentication Method Names,auth_sources (array[string], optional): List of Authentication Source Names,strip_username (boolean, optional): Enable to specify a comma-separated list of rules to strip username prefixes or suffixes,strip_username_csv (string, optional): Strip Username Rule,service_cert_cn (string, optional): Subject DN of Service Certificate,service_cert_expiry_date (string, optional): Expiry Date of Service Certificate (Date Format - MMM dd, yyyy HH:mm:ss Z),role_mapping_policy (string, optional): Role Mapping Policy Name,enf_policy (string): Enforcement Policy Name,use_cached_policy_results (boolean, optional): Enable to use cached Roles and Posture attributes from previous sessions,authz_sources (array[string], optional): List of Additional authorization sources from which to fetch role-mapping attributes,posture_enabled (boolean, optional): Enable Posture Compliance,posture_policies (array[string], optional): List of Posture Policy Names,default_posture_token (string, optional) = ['HEALTHY' or 'CHECKUP' or 'TRANSITION' or 'QUARANTINE' or 'INFECTED' or 'UNKNOWN']: Default Posture Token,remediate_end_hosts (boolean, optional): Enable auto-remediation of non-compliant end-hosts,remediation_url (string, optional): Remediation URL,audit_enabled (boolean, optional): Enable Audit End-hosts,audit_server (string, optional): Audit Server Name,audit_trigger_condition (string, optional) = ['ALWAYS' or 'NO_POSTURE' or 'MAC_AUTH']: Audit Trigger Conditions,audit_mac_auth_client_type (string, optional) = ['KNOWN' or 'UNKNOWN' or 'BOTH']: Client Type For MAC authentication request Audit Trigger Condition,action_after_audit (string, optional) = ['NONE' or 'SNMP' or 'RADIUS']: Action after audit,audit_coa_acton (string, optional): RADIUS CoA Action to be triggered after audit,profiler_enabled (boolean, optional): Enable Profile Endpoints,profiler_endpoint_classification (array[string], optional): List of Endpoint classification(s) after which an action must be triggered,profiler_coa_action (string, optional): RADIUS CoA Action to be triggered by Profiler ,acct_proxy_enabled (boolean, optional): Enable Accounting Proxy Targets,acct_proxy_targets (array[string], optional): List Accounting Proxy Target names,acct_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be deleted for Accounting proxy,acct_proxy_attrs_to_add (array[AttributesToAdd], optional): RADIUS attributes to be added for Accounting proxy,radius_proxy_scheme (string, optional) = ['Load Balance' or 'Failover']: Proxying Scheme for RADIUS Proxy Service Type,radius_proxy_targets (array[string], optional): List of Proxy Targets for RADIUS Proxy Service Type,radius_proxy_attrs_to_delete (array[AttributesToDelete], optional): RADIUS attributes to be removed from remote server (proxy target) reply,radius_proxy_enable_for_acct (boolean, optional): Enable proxy for accounting requests (Applicable only for RADIUS Proxy Service Type) }ServiceRules {type (string): Type,name (string): Name,operator (string): Operator,value (string, optional): Value}AttributesToDelete {type (string): Type,name (string): Name}AttributesToAdd {type (string): Type,name (string): Name,value (string): Value} + Required Body Parameters (type(dict) body example)- { + "name": "", + "template": "", + "enabled": false, + "order_no": 0, + "description": "", + "monitor_mode": false, + "rules_match_type": "", + "rules_conditions": [ + { + "type": "", + "name": "", + "operator": "", + "value": "" + } + ], + "auth_methods": [ + "" + ], + "auth_sources": [ + "" + ], + "strip_username": false, + "strip_username_csv": "", + "service_cert_cn": "", + "service_cert_expiry_date": "", + "role_mapping_policy": "", + "enf_policy": "", + "use_cached_policy_results": false, + "authz_sources": [ + "" + ], + "posture_enabled": false, + "posture_policies": [ + "" + ], + "default_posture_token": "", + "remediate_end_hosts": false, + "remediation_url": "", + "audit_enabled": false, + "audit_server": "", + "audit_trigger_condition": "", + "audit_mac_auth_client_type": "", + "action_after_audit": "", + "audit_coa_acton": "", + "profiler_enabled": false, + "profiler_endpoint_classification": [ + "" + ], + "profiler_coa_action": "", + "acct_proxy_enabled": false, + "acct_proxy_targets": [ + "" + ], + "acct_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "acct_proxy_attrs_to_add": [ + { + "type": "", + "name": "", + "value": "" + } + ], + "radius_proxy_scheme": "", + "radius_proxy_targets": [ + "" + ], + "radius_proxy_attrs_to_delete": [ + { + "type": "", + "name": "" + } + ], + "radius_proxy_enable_for_acct": false +} + ''' + url_path = '/config/service/name/{services_name}' + dict_path={'services_name': services_name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_config_service_name_by_services_name(self,services_name=""): + ''' + Operation: Delete a Service by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: services_name, Description: Name of the Service + ''' + url_path = '/config/service/name/{services_name}' + dict_path={'services_name': services_name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def update_config_service_by_services_id_enable(self,services_id=""): + ''' + Operation: Enable a Service + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_id, Description: Numeric ID of the service + ''' + url_path = '/config/service/{services_id}/enable' + dict_path={'services_id': services_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + def update_config_service_name_by_services_name_enable(self,services_name=""): + ''' + Operation: Enable a Service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_name, Description: Name of the Service + ''' + url_path = '/config/service/name/{services_name}/enable' + dict_path={'services_name': services_name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + def update_config_service_by_services_id_disable(self,services_id=""): + ''' + Operation: Disable a Service + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_id, Description: Numeric ID of the service + ''' + url_path = '/config/service/{services_id}/disable' + dict_path={'services_id': services_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + def update_config_service_name_by_services_name_disable(self,services_name=""): + ''' + Operation: Disable a Service by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: services_name, Description: Name of the Service + ''' + url_path = '/config/service/name/{services_name}/disable' + dict_path={'services_name': services_name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='patch') + + + def update_config_service_reorder(self,body=({})): + ''' + Operation: Reorder Services + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- ServiceReorder {service_orders (array[ServiceOrders]): List of Service Orders to be updated}ServiceOrders {service_name (string): Name of the Service,order_no (integer): Order number of the Service} + Required Body Parameters (type(dict) body example)- { + "service_orders": [ + { + "service_name": "", + "order_no": 0 + } + ] +} + ''' + url_path = '/config/service/reorder' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + + #Function Section Name:TACACSServiceDictionary + #Function Section Description: Manage TACACS+ Service Dictionaries + + def get_tacacs_service_dictionary(self,filter="",sort="",offset="",limit="",calculate_count=""): + ''' + Operation: Get a list of TACACS+ Service Dictionaries + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default +id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + ''' + url_path = '/tacacs-service-dictionary' + dict_query={'filter': filter, 'sort': sort, 'offset': offset, 'limit': limit, 'calculate_count': calculate_count} + url_path = _generate_parameterised_url(parameters = dict_query,url = url_path) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def new_tacacs_service_dictionary(self,body=({})): + ''' + Operation: Create a new TACACS+ Service Dictionary + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- TACACSServiceDictionaryCreate {name (string): Name of TACACS+ Service Dictionary,display_name (string): Display Name of TACACS+ Service Dictionary,attributes (array[Attributes]): List of TACACS+ Service Dictionary Attributes}Attributes {attr_name (string): TACACS+ Service Dictionary Attribute Name,attr_display_name (string): TACACS+ Service Dictionary Attribute Display Name,attr_type (string): TACACS+ Service Dictionary Attribute Data Type,allowed_values (string, optional): Allowed Values for TACACS+ Service Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "display_name": "", + "attributes": [ + { + "attr_name": "", + "attr_display_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/tacacs-service-dictionary' + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='post',query = body) + def get_tacacs_service_dictionary_by_tacacs_service_dictionary_id(self,tacacs_service_dictionary_id=""): + ''' + Operation: Get a TACACS+ Service Dictionary + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: tacacs_service_dictionary_id, Description: Numeric ID of the TACACS+ Service Dictionary + ''' + url_path = '/tacacs-service-dictionary/{tacacs_service_dictionary_id}' + dict_path={'tacacs_service_dictionary_id': tacacs_service_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_tacacs_service_dictionary_by_tacacs_service_dictionary_id(self,tacacs_service_dictionary_id="",body=({})): + ''' + Operation: Update a TACACS+ Service Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: tacacs_service_dictionary_id, Description: Numeric ID of the TACACS+ Service Dictionary + Required Body Parameters (body description)- TACACSServiceDictionaryUpdate {name (string, optional): Name of TACACS+ Service Dictionary,display_name (string, optional): Display Name of TACACS+ Service Dictionary,attributes (array[Attributes], optional): List of TACACS+ Service Dictionary Attributes}Attributes {attr_name (string): TACACS+ Service Dictionary Attribute Name,attr_display_name (string): TACACS+ Service Dictionary Attribute Display Name,attr_type (string): TACACS+ Service Dictionary Attribute Data Type,allowed_values (string, optional): Allowed Values for TACACS+ Service Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "display_name": "", + "attributes": [ + { + "attr_name": "", + "attr_display_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/tacacs-service-dictionary/{tacacs_service_dictionary_id}' + dict_path={'tacacs_service_dictionary_id': tacacs_service_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_tacacs_service_dictionary_by_tacacs_service_dictionary_id(self,tacacs_service_dictionary_id="",body=({})): + ''' + Operation: Replace a TACACS+ Service Dictionary + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: tacacs_service_dictionary_id, Description: Numeric ID of the TACACS+ Service Dictionary + Required Body Parameters (body description)- TACACSServiceDictionaryReplace {name (string): Name of TACACS+ Service Dictionary,display_name (string): Display Name of TACACS+ Service Dictionary,attributes (array[Attributes]): List of TACACS+ Service Dictionary Attributes}Attributes {attr_name (string): TACACS+ Service Dictionary Attribute Name,attr_display_name (string): TACACS+ Service Dictionary Attribute Display Name,attr_type (string): TACACS+ Service Dictionary Attribute Data Type,allowed_values (string, optional): Allowed Values for TACACS+ Service Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "display_name": "", + "attributes": [ + { + "attr_name": "", + "attr_display_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/tacacs-service-dictionary/{tacacs_service_dictionary_id}' + dict_path={'tacacs_service_dictionary_id': tacacs_service_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_tacacs_service_dictionary_by_tacacs_service_dictionary_id(self,tacacs_service_dictionary_id=""): + ''' + Operation: Delete a TACACS+ Service Dictionary + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: tacacs_service_dictionary_id, Description: Numeric ID of the TACACS+ Service Dictionary + ''' + url_path = '/tacacs-service-dictionary/{tacacs_service_dictionary_id}' + dict_path={'tacacs_service_dictionary_id': tacacs_service_dictionary_id} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + + def get_tacacs_service_dictionary_name_by_name(self,name=""): + ''' + Operation: Get a TACACS+ Service Dictionary by name + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the TACACS+ Service Dictionary + ''' + url_path = '/tacacs-service-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='get') + + + def update_tacacs_service_dictionary_name_by_name(self,name="",body=({})): + ''' + Operation: Update a TACACS+ Service Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the TACACS+ Service Dictionary + Required Body Parameters (body description)- TACACSServiceDictionaryUpdate {name (string, optional): Name of TACACS+ Service Dictionary,display_name (string, optional): Display Name of TACACS+ Service Dictionary,attributes (array[Attributes], optional): List of TACACS+ Service Dictionary Attributes}Attributes {attr_name (string): TACACS+ Service Dictionary Attribute Name,attr_display_name (string): TACACS+ Service Dictionary Attribute Display Name,attr_type (string): TACACS+ Service Dictionary Attribute Data Type,allowed_values (string, optional): Allowed Values for TACACS+ Service Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "display_name": "", + "attributes": [ + { + "attr_name": "", + "attr_display_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/tacacs-service-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='patch',query = body) + def replace_tacacs_service_dictionary_name_by_name(self,name="",body=({})): + ''' + Operation: Replace a TACACS+ Service Dictionary by name + HTTP Status Response Codes: 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 204 No Content, 304 Not Modified, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: name, Description: Unique name of the TACACS+ Service Dictionary + Required Body Parameters (body description)- TACACSServiceDictionaryReplace {name (string): Name of TACACS+ Service Dictionary,display_name (string): Display Name of TACACS+ Service Dictionary,attributes (array[Attributes]): List of TACACS+ Service Dictionary Attributes}Attributes {attr_name (string): TACACS+ Service Dictionary Attribute Name,attr_display_name (string): TACACS+ Service Dictionary Attribute Display Name,attr_type (string): TACACS+ Service Dictionary Attribute Data Type,allowed_values (string, optional): Allowed Values for TACACS+ Service Dictionary Attributes in CSV format} + Required Body Parameters (type(dict) body example)- { + "name": "", + "display_name": "", + "attributes": [ + { + "attr_name": "", + "attr_display_name": "", + "attr_type": "", + "allowed_values": "" + } + ] +} + ''' + url_path = '/tacacs-service-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + body = _remove_empty_keys(keys = body) + return ClearPassAPILogin._send_request(self,url = url_path,method ='put',query = body) + def delete_tacacs_service_dictionary_name_by_name(self,name=""): + ''' + Operation: Delete a TACACS+ Service Dictionary by name + HTTP Status Response Codes: 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 204 No Content, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: name, Description: Unique name of the TACACS+ Service Dictionary + ''' + url_path = '/tacacs-service-dictionary/name/{name}' + dict_path={'name': name} + for item in dict_path: + url_path = url_path.replace('{'+item+'}',dict_path[item]) + return ClearPassAPILogin._send_request(self,url = url_path,method='delete') + + diff --git a/pyclearpass/api_explorer_sessioncontrol_v1.py b/pyclearpass/api_explorer_sessioncontrol_v1.py new file mode 100644 index 0000000..d86e7bd --- /dev/null +++ b/pyclearpass/api_explorer_sessioncontrol_v1.py @@ -0,0 +1,321 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_sessioncontrol_v1.py + + +class ApiSessionControl(ClearPassAPILogin): + # Function Section Name:ActiveSession + # Function Section Description: Manage active sessions + + def get_session(self, filter="", sort="", offset="", limit="", calculate_count=""): + """ + Operation: Get a list of active sessions + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Optional Query Parameter Name: filter, Description: JSON filter expression specifying the items to return + Optional Query Parameter Name: sort, Description: Sort ordering for returned items (default -id) + Optional Query Parameter Name: offset, Description: Zero based offset to start from + Optional Query Parameter Name: limit, Description: Maximum number of items to return (1 – 1000) + Optional Query Parameter Name: calculate_count, Description: Whether to calculate the total item count + """ + url_path = "/session" + dict_query = { + "filter": filter, + "sort": sort, + "offset": offset, + "limit": limit, + "calculate_count": calculate_count, + } + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def get_session_by_id(self, id=""): + """ + Operation: Get an active session + HTTP Status Response Codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: URL parameter id + """ + url_path = "/session/{id}" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + # Function Section Name:ActiveSessionDisconnect + # Function Section Description: Disconnect an active session + + def new_session_by_id_disconnect(self, id="", body=({})): + """ + Operation: Disconnect active session + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the session to disconnect + Required Body Parameters (body description)- ActiveSessionDisconnect {id (string): ID of the session to disconnect,confirm_disconnect (boolean): Flag to confirm disconnecting the active session} + Required Body Parameters (type(dict) body example)- { + "id": "", + "confirm_disconnect": false + } + """ + url_path = "/session/{id}/disconnect" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:ActiveSessionReauthorize + # Function Section Description: Reauthorize an active session + + def get_session_by_id_reauthorize(self, id="", template_type=""): + """ + Operation: Get reauthorization profile(s) for an active session + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: id, Description: ID of the session to reauthorize + Optional Query Parameter Name: template_type, Description: Reauthorize profile type (Disconnect/CoA) + """ + url_path = "/session/{id}/reauthorize" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"template_type": template_type} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") + + def new_session_by_id_reauthorize(self, id="", body=({})): + """ + Operation: Reauthorize active session + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Path Parameter Name: id, Description: ID of the session to reauthorize + Required Body Parameters (body description)- ActiveSessionReauthorize {confirm_reauthorize (boolean, optional): Flag to confirm the session reauthorization,reauthorize_profile (string, optional): Specify the name of the reauthorization profile to apply to the session} + Required Body Parameters (type(dict) body example)- { + "confirm_reauthorize": false, + "reauthorize_profile": "" + } + """ + url_path = "/session/{id}/reauthorize" + dict_path = {"id": id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:SessionAction + # Function Section Description: Manage Session Action Methods + + def new_session_action_disconnect(self, body=({}), async_=""): + """ + Operation: Performs active session disconnect with a synchronous or asynchronous action & filter by multiple fields. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + """ + url_path = "/session-action/disconnect" + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_session_action_disconnect_mac_by_mac_address( + self, body=({}), async_="", mac_address="" + ): + """ + Operation: Performs active session disconnect with a synchronous or asynchronous action & filter by mac-address. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + Required Path Parameter Name: mac_address, Description: filter by mac-address + """ + url_path = "/session-action/disconnect/mac/{mac_address}" + dict_path = {"mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_session_action_disconnect_username_by_username( + self, body=({}), async_="", username="" + ): + """ + Operation: Performs active session disconnect with a synchronous or asynchronous action & filter by username. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + Required Path Parameter Name: username, Description: filter by username + """ + url_path = "/session-action/disconnect/username/{username}" + dict_path = {"username": username} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_session_action_disconnect_ip_by_client_ip_address( + self, body=({}), async_="", client_ip_address="" + ): + """ + Operation: Performs active session disconnect with a synchronous or asynchronous action & filter by client-ip-address. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + Required Path Parameter Name: client_ip_address, Description: filter by client-ip-address + """ + url_path = "/session-action/disconnect/ip/{client_ip_address}" + dict_path = {"client_ip_address": client_ip_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_session_action_coa(self, body=({}), async_=""): + """ + Operation: Performs active session reauthorize with a synchronous or asynchronous action & filter by multiple fields. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + """ + url_path = "/session-action/coa" + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_session_action_coa_mac_by_mac_address( + self, body=({}), async_="", mac_address="" + ): + """ + Operation: Performs active session reauthorize with a synchronous or asynchronous action & filter by mac-address. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + Required Path Parameter Name: mac_address, Description: filter by mac-address + """ + url_path = "/session-action/coa/mac/{mac_address}" + dict_path = {"mac_address": mac_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_session_action_coa_username_by_username( + self, body=({}), async_="", username="" + ): + """ + Operation: Performs active session reauthorize with a synchronous or asynchronous action & filter by username. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + Required Path Parameter Name: username, Description: filter by username + """ + url_path = "/session-action/coa/username/{username}" + dict_path = {"username": username} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def new_session_action_coa_ip_by_client_ip_address( + self, body=({}), async_="", client_ip_address="" + ): + """ + Operation: Performs active session reauthorize with a synchronous or asynchronous action & filter by client-ip-address. + HTTP Status Response Codes: 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 202 Accepted, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SessionActionParams {filter (object, optional): JSON filter expression specifying the items to return, e.g. "filter":{"username":"admin", ...},enforcement_profile (object, optional): When performing CoA, the 'enforcement_profile' parameter MUST be provided, e.g. "enforcement_profile":["...", "...'"],sort (string, optional): Sorting the result set, e.g. "sort": "-id"} + Required Body Parameters (type(dict) body example)- { + "filter": "object", + "enforcement_profile": "object", + "sort": "" + } + Optional Query Parameter Name: async, Description: trigger asynchronous API calls + Required Path Parameter Name: client_ip_address, Description: filter by client-ip-address + """ + url_path = "/session-action/coa/ip/{client_ip_address}" + dict_path = {"client_ip_address": client_ip_address} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"async": async_} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + def get_session_action_by_action_id(self, action_id="", offset="", limit=""): + """ + Operation: Returns the current status of a disconnected or reauthorized active session by the action ID. + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type + Required Path Parameter Name: action_id, Description: request body + Optional Query Parameter Name: offset, Description: Starting point to return rows from a result set. i.e Default: 0 + Optional Query Parameter Name: limit, Description: Limit the number of rows returned from a result set. i.e Default: 25 + """ + url_path = "/session-action/{action_id}" + dict_path = {"action_id": action_id} + for item in dict_path: + url_path = url_path.replace("{" + item + "}", dict_path[item]) + dict_query = {"offset": offset, "limit": limit} + url_path = _generate_parameterised_url(parameters=dict_query, url=url_path) + return ClearPassAPILogin._send_request(self, url=url_path, method="get") diff --git a/pyclearpass/api_explorer_toolsandutilities_v1.py b/pyclearpass/api_explorer_toolsandutilities_v1.py new file mode 100644 index 0000000..4ef426f --- /dev/null +++ b/pyclearpass/api_explorer_toolsandutilities_v1.py @@ -0,0 +1,130 @@ +from pyclearpass.common import ( + _generate_parameterised_url, + _remove_empty_keys, + ClearPassAPILogin, +) + +# File Name: api_explorer_toolsandutilities_v1.py + + +class ApiToolsAndUtils(ClearPassAPILogin): + # Function Section Name:EmailSend + # Function Section Description: Operations for Email Send + + def new_email_send(self, body=({})): + """ + Operation: Send an Email + HTTP Status Response Codes: 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 201 Created, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- EmailSendCreate {to (object): List of Recipients Email Address (e.g., ["a@example.com", "b@example.com"]),subject (string, optional): Email Subject,message (string): Email Body,cc_recipients (object, optional): List of CC recipients Email Address (e.g., ["a@example.com", "b@example.com"]),bcc_recipients (object, optional): List of BCC recipients Email Address (e.g., ["a@example.com", "b@example.com"]),headers (object, optional): Email headers (e.g., {"Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding": "8bit"})} + Required Body Parameters (type(dict) body example)- { + "to": "object", + "subject": "", + "message": "", + "cc_recipients": "object", + "bcc_recipients": "object", + "headers": "object" + } + """ + url_path = "/email/send" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:RandomMpskGenerator + # Function Section Description: Generate a random MPSK + + def get_random_mpsk(self, body=({})): + """ + Operation: + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- EmailSendCreate {to (object): List of Recipients Email Address (e.g., ["a@example.com", "b@example.com"]),subject (string, optional): Email Subject,message (string): Email Body,cc_recipients (object, optional): List of CC recipients Email Address (e.g., ["a@example.com", "b@example.com"]),bcc_recipients (object, optional): List of BCC recipients Email Address (e.g., ["a@example.com", "b@example.com"]),headers (object, optional): Email headers (e.g., {"Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding": "8bit"})} + Required Body Parameters (type(dict) body example)- { + "to": "object", + "subject": "", + "message": "", + "cc_recipients": "object", + "bcc_recipients": "object", + "headers": "object" + } + """ + url_path = "/random-mpsk" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_random_mpsk(self, body=({})): + """ + Operation: + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RandomMpskGenerator {random_mpsk_method (string, optional): The random MPSK method. See the documentation for the allowed values.,random_mpsk_length (integer, optional): The desired length of the MPSK.,random_mpsk_picture (string, optional): The picture to be used for the ‘nwa_picture_password’ method. See the documentation for the valid syntax.} + Required Body Parameters (type(dict) body example)- { + "random_mpsk_method": "", + "random_mpsk_length": 0, + "random_mpsk_picture": "" + } + """ + url_path = "/random-mpsk" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:RandomPasswordGenerator + # Function Section Description: Generate a random password + + def get_random_password(self, body=({})): + """ + Operation: + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RandomMpskGenerator {random_mpsk_method (string, optional): The random MPSK method. See the documentation for the allowed values.,random_mpsk_length (integer, optional): The desired length of the MPSK.,random_mpsk_picture (string, optional): The picture to be used for the ‘nwa_picture_password’ method. See the documentation for the valid syntax.} + Required Body Parameters (type(dict) body example)- { + "random_mpsk_method": "", + "random_mpsk_length": 0, + "random_mpsk_picture": "" + } + """ + url_path = "/random-password" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="get", query=body + ) + + def new_random_password(self, body=({})): + """ + Operation: + HTTP Status Response Codes: 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- RandomPasswordGenerator {random_password_method (string, optional): The random password method. See the documentation for the allowed values.,random_password_length (integer, optional): The desired length of the password.,random_password_picture (string, optional): The picture to be used for the ‘nwa_picture_password’ method. See the documentation for the valid syntax.} + Required Body Parameters (type(dict) body example)- { + "random_password_method": "", + "random_password_length": 0, + "random_password_picture": "" + } + """ + url_path = "/random-password" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) + + # Function Section Name:SmsSend + # Function Section Description: Send SMS using Configuration -> SMS Services -> Send SMS + + def new_sms_send(self, body=({})): + """ + Operation: Send an SMS message + HTTP Status Response Codes: 200 OK, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity, 200 OK, 403 Forbidden, 404 Not Found, 406 Not Acceptable, 415 Unsupported Media Type, 422 Unprocessable Entity + Required Body Parameters (body description)- SmsSend {handler (integer, optional) = ['22']: Select the service to use when sending the message,recipient (string): Enter the mobile telephone number of the recipient in international format,carrier (string, optional) = ['' or '7-11 Speakout(GSM)' or 'Airtel (Andhra Pradesh, India)' or 'Airtel (Karnataka, India)' or 'Airtel Wireless' or 'Alaska Communications Systems' or 'Alltel Wireless' or 'aql' or 'AT&T Wireless' or 'AT&T Enterprise Paging' or 'BigRedGiant Mobile Solutions' or 'Bell Mobility & Solo Mobile' or 'Boost Mobile' or 'BPL Mobile' or 'Cellular One (Dobson)' or 'Cingular' or 'Centennial Wireless' or 'Cincinnati Bell' or 'Claro (Brasil)' or 'Claro (Nicaragua)' or 'Comcel' or 'Cricket' or 'CTI' or 'Emtel' or 'eOcean' or 'Esendex' or 'Fido' or 'General Communications Inc.' or 'Globalstar (satellite)' or 'Helio' or 'Illinois Valley Cellular' or 'Iridium (satellite)' or 'i wireless' or 'Koodo Mobile' or 'Mediaburst' or 'Meteor' or 'Mero Mobile' or 'MetroPCS' or 'Movicom' or 'Mobitel' or 'Movistar' or 'MTN' or 'MTS' or 'Nextel' or 'Nextel (Mexico)' or 'Nextel (Argentina)' or 'Orange Polska' or 'Personal' or 'Plateau Wireless' or 'Plus GSM' or 'President's Choice' or 'Qwest' or 'Rogers' or 'SL Interactive' or 'Sasktel' or 'Setar Mobile email (Aruba)' or 'Sprint (PCS)' or 'Sprint (Nextel)' or 'Suncom' or 'Sunrise' or 'T-Mobile' or 'T-Mobile Austria' or 'T-Mobile UK' or 'Telus Mobility' or 'Thumb Cellular' or 'Tigo (Formerly Ola)' or 'Tracfone (prepaid)' or 'Unicel' or 'US Cellular' or 'Verizon' or 'Vivo' or 'Virgin Mobile Canada' or 'Virgin Mobile' or 'Vodacom' or 'YCC' or 'MobiPCS' or 'SMSLink.ro']: The visitor’s mobile carrier,message (string): Enter the message to send (maximum 160 characters)} + Required Body Parameters (type(dict) body example)- { + "handler": 0, + "recipient": "", + "carrier": "", + "message": "" + } + """ + url_path = "/sms/send" + body = _remove_empty_keys(keys=body) + return ClearPassAPILogin._send_request( + self, url=url_path, method="post", query=body + ) diff --git a/pyclearpass/common.py b/pyclearpass/common.py new file mode 100644 index 0000000..a688daa --- /dev/null +++ b/pyclearpass/common.py @@ -0,0 +1,164 @@ +import json +import requests +import urllib.parse, urllib3 + +urllib3.disable_warnings() + + +class ClearPassAPILogin: + def __init__( + self, + granttype, + clientid, + clientsecret, + username="", + password="", + server="", + verify_ssl=False, + ): + """ + This is the class constructor for the ClearPassModule. + + This constructor is required to be created before any modules can be used and must contain the following function arguments: + + granttype (string) = ['client_credentials' or 'password' or 'refresh_token']: OAuth2 authentication method,client_id (string): Client ID defined in API Clients, + clientsecret (string, optional): Client secret, required if the API client is not a public client, + username (string, optional): Username for authentication, required for grant_type "password", + password (string, optional): Password for authentication, required for grant_type "password", + server (string): Website for ClearPass services example - https://clearpass.test.com:443/api + verify_ssl (boolean, optional): default value False. Allows use of an invalid SSL certificate. + } + + """ + self.granttype = granttype + self.clientid = clientid + self.clientsecret = clientsecret + self.username = username + self.password = password + self.server = server + self.api_token = "" + self.verify_ssl = False + + def _send_request(self, url, method, query=""): + """Sends a request to the ClearPass server + :query: must contain the json request if model required + :url: must contain the /url (e.g. /oauth) + :method: must contain the post or get request type of method + :api_token optional[]: must contain the api_token for the calls. + """ + full_url_path = self.server + url + + if len(self.api_token) == 0: + cred = _get_api_key(self) + try: + self.api_token = cred["access_token"] + except TypeError: + pass + + if len(self.api_token) != 0: + header = {"Authorization": "Bearer " + self.api_token} + if method == "post": + response = requests.post( + url=full_url_path, + json=query, + headers=header, + verify=self.verify_ssl, + ) + if method == "patch": + response = requests.patch( + url=full_url_path, + json=query, + headers=header, + verify=self.verify_ssl, + ) + if method == "put": + response = requests.put( + url=full_url_path, + json=query, + headers=header, + verify=self.verify_ssl, + ) + if method == "get": + response = requests.get( + url=full_url_path, + json=query, + headers=header, + verify=self.verify_ssl, + ) + if method == "delete": + response = requests.delete( + url=full_url_path, + json=query, + headers=header, + verify=self.verify_ssl, + ) + if method == "": + print( + "method needs to be supplied before sending a request to ClearPass" + ) + + try: + return json.loads(response.text) + except json.decoder.JSONDecodeError: + return response.text + else: + print("Problem logging into ClearPass") + return cred + + +def _get_api_key(self): + """ + Operation: Obtain an OAuth2 access token for making API calls + HTTP Status Response Codes: 200 OK, 400 Bad Request, 406 Not Acceptable, 415 Unsupported Media Type, 200 OK, 400 Bad Request, 406 Not Acceptable, 415 Unsupported Media Type + Required Body Parameters (body description)- TokenEndpoint {grant_type (string) = ['client_credentials' or 'password' or 'refresh_token']: OAuth2 authentication method,client_id (string): Client ID defined in API Clients,client_secret (string, optional): Client secret, required if the API client is not a public client,username (string, optional): Username for authentication, required for grant_type "password",password (string, optional): Password for authentication, required for grant_type "password",scope (string, optional): Scope of the access request,refresh_token (string, optional): Refresh token issued to the client, required for grant_type "refresh_token"} + Required Body Parameters (type(dict) body example)- { + "grant_type": "", + "client_id": "", + "client_secret": "", + "username": "", + "password": "", + "scope": "", + "refresh_token": "" + } + """ + model = { + "grant_type": self.granttype, + "client_id": self.clientid, + "client_secret": self.clientsecret, + "username": self.username, + "password": self.password, + } + + full_url_path = self.server + "/oauth" + response = requests.post(url=full_url_path, json=model, verify=self.verify_ssl) + + try: + response = json.loads(str(response.text)) + return response + + except json.decoder.JSONDecodeError: + return response + + +def _remove_empty_keys(keys): + remove_empty_values_from_dict = [] + for item in keys: + if keys[item] == "": + remove_empty_values_from_dict.append(item) + else: + # print(item,": ", keys[item]) + pass + for removal in remove_empty_values_from_dict: + del keys[removal] + return keys + + +def _generate_parameterised_url(url, parameters=""): + parameters = _remove_empty_keys(keys=parameters) + + if len(parameters) == 0: + return url + else: + encoded_url = urllib.parse.urlencode(parameters) + final_url = url + "?" + encoded_url + return final_url diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..17c51ad --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" +[project] +name = "pyclearpass" +version = "1.0.1" +authors = [{ name="Aruba Automation", email="aruba-automation@hpe.com" }] +dependencies = ["requests >=2.24","urllib3 >=1.25.10"] +description = "This package contains all of the API functions to work with the ClearPass API. This package has been built based on Aruba ClearPass v6.11" +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Intended Audience :: System Administrators", + "Topic :: System :: Networking", + "Development Status :: 4 - Beta" +] + +[project.urls] +"Homepage" = "https://github.com/aruba/pyclearpass" \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4b2e3ff --- /dev/null +++ b/setup.py @@ -0,0 +1,27 @@ +from setuptools import setup + +setup( + # Needed to silence warnings (and to be a worthwhile package) + name='pyclearpass', + url='https://github.com/aruba/pyclearpass', + author='Aruba Automation', + author_email='aruba-automation@hpe.com', + packages=['pyclearpass'], + install_requires=['requests >=2.24','urllib3 >=1.25.10'], + version='1.0.1', + license='MIT', + description='Aruba ClearPass SDK has been developed in Python v3.9 to utilise the full functionality of the Aruba ClearPass REST API environment. Each available REST API command is available for use in this module.', + long_description=open('README.md').read(), + classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Intended Audience :: System Administrators", + "Intended Audience :: Automation Experts", + "Intended Audience :: Deployment Engineers", + "Topic :: System :: Networking", + "Natural Language :: English",], + project_urls={"Source": "https://github.com/aruba/pyclearpass/"}, + keywords="Aruba, Aruba ClearPass, Aruba CPPM, CPPM, pyclearpass" + +) \ No newline at end of file