| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Copyright (c) 2021, Cisco Systems |
| 5 |
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 6 |
|
| 7 |
DOCUMENTATION = r""" |
| 8 |
module: organizations_saml_roles |
| 9 |
short_description: Resource module for organizations _samlroles |
| 10 |
description: |
| 11 |
- Manage operations create, update and delete of the resource organizations _samlroles. |
| 12 |
- Create a SAML role. |
| 13 |
- Remove a SAML role. |
| 14 |
- Update a SAML role. |
| 15 |
version_added: '1.0.0' |
| 16 |
extends_documentation_fragment: |
| 17 |
- cisco.meraki.module |
| 18 |
author: Francisco Munoz (@fmunoz) |
| 19 |
options: |
| 20 |
networks: |
| 21 |
description: The list of networks that the SAML administrator has privileges on. |
| 22 |
elements: dict |
| 23 |
suboptions: |
| 24 |
access: |
| 25 |
description: The privilege of the SAML administrator on the network. Can be |
| 26 |
one of 'full', 'read-only', 'guest-ambassador', 'monitor-only', 'ssid-admin' |
| 27 |
or 'port-tags' or a custom role in the format custom-role ID. |
| 28 |
type: str |
| 29 |
id: |
| 30 |
description: The network ID. |
| 31 |
type: str |
| 32 |
type: list |
| 33 |
orgAccess: |
| 34 |
description: The privilege of the SAML administrator on the organization. Can |
| 35 |
be one of 'none', 'read-only', 'full' or 'enterprise' or a custom role in the |
| 36 |
format custom-role ID NAME. |
| 37 |
type: str |
| 38 |
organizationId: |
| 39 |
description: OrganizationId path parameter. Organization ID. |
| 40 |
type: str |
| 41 |
role: |
| 42 |
description: The role of the SAML administrator. |
| 43 |
type: str |
| 44 |
samlRoleId: |
| 45 |
description: SamlRoleId path parameter. Saml role ID. |
| 46 |
type: str |
| 47 |
tags: |
| 48 |
description: The list of tags that the SAML administrator has privileges on. |
| 49 |
elements: dict |
| 50 |
suboptions: |
| 51 |
access: |
| 52 |
description: The privilege of the SAML administrator on the tag. Can be one |
| 53 |
of 'full', 'read-only', 'guest-ambassador' or 'monitor-only' or a custom |
| 54 |
role in the format custom-role ID. |
| 55 |
type: str |
| 56 |
tag: |
| 57 |
description: The name of the tag. |
| 58 |
type: str |
| 59 |
type: list |
| 60 |
requirements: |
| 61 |
- meraki >= 2.4.9 |
| 62 |
- python >= 3.5 |
| 63 |
seealso: |
| 64 |
- name: Cisco Meraki documentation for organizations createOrganizationSamlRole |
| 65 |
description: Complete reference of the createOrganizationSamlRole API. |
| 66 |
link: https://developer.cisco.com/meraki/api-v1/#!create-organization-saml-role |
| 67 |
- name: Cisco Meraki documentation for organizations deleteOrganizationSamlRole |
| 68 |
description: Complete reference of the deleteOrganizationSamlRole API. |
| 69 |
link: https://developer.cisco.com/meraki/api-v1/#!delete-organization-saml-role |
| 70 |
- name: Cisco Meraki documentation for organizations updateOrganizationSamlRole |
| 71 |
description: Complete reference of the updateOrganizationSamlRole API. |
| 72 |
link: https://developer.cisco.com/meraki/api-v1/#!update-organization-saml-role |
| 73 |
notes: |
| 74 |
- SDK Method used are |
| 75 |
organizations.Organizations.create_organization_saml_role, |
| 76 |
organizations.Organizations.delete_organization_saml_role, |
| 77 |
organizations.Organizations.update_organization_saml_role, |
| 78 |
- Paths used are |
| 79 |
post /organizations/{organizationId}/samlRoles, |
| 80 |
delete /organizations/{organizationId}/samlRoles/{samlRoleId}, |
| 81 |
put /organizations/{organizationId}/samlRoles/{samlRoleId}, |
| 82 |
""" |
| 83 |
|
| 84 |
EXAMPLES = r""" |
| 85 |
- name: Create |
| 86 |
cisco.meraki.organizations_saml_roles: |
| 87 |
meraki_api_key: "{{ meraki_api_key }}" |
| 88 |
meraki_base_url: "{{ meraki_base_url }}" |
| 89 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 90 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 91 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 92 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 93 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 94 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 95 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 96 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 97 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 98 |
meraki_output_log: "{{ meraki_output_log }}" |
| 99 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 100 |
meraki_log_path: "{{ meraki_log_path }}" |
| 101 |
meraki_print_console: "{{ meraki_print_console }}" |
| 102 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 103 |
meraki_simulate: "{{ meraki_simulate }}" |
| 104 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 105 |
meraki_caller: "{{ meraki_caller }}" |
| 106 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 107 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 108 |
state: present |
| 109 |
networks: |
| 110 |
- access: full |
| 111 |
id: N_24329156 |
| 112 |
orgAccess: none |
| 113 |
organizationId: string |
| 114 |
role: myrole |
| 115 |
tags: |
| 116 |
- access: read-only |
| 117 |
tag: west |
| 118 |
- name: Update by id |
| 119 |
cisco.meraki.organizations_saml_roles: |
| 120 |
meraki_api_key: "{{ meraki_api_key }}" |
| 121 |
meraki_base_url: "{{ meraki_base_url }}" |
| 122 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 123 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 124 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 125 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 126 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 127 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 128 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 129 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 130 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 131 |
meraki_output_log: "{{ meraki_output_log }}" |
| 132 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 133 |
meraki_log_path: "{{ meraki_log_path }}" |
| 134 |
meraki_print_console: "{{ meraki_print_console }}" |
| 135 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 136 |
meraki_simulate: "{{ meraki_simulate }}" |
| 137 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 138 |
meraki_caller: "{{ meraki_caller }}" |
| 139 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 140 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 141 |
state: present |
| 142 |
networks: |
| 143 |
- access: full |
| 144 |
id: N_24329156 |
| 145 |
orgAccess: none |
| 146 |
organizationId: string |
| 147 |
role: myrole |
| 148 |
samlRoleId: string |
| 149 |
tags: |
| 150 |
- access: read-only |
| 151 |
tag: west |
| 152 |
- name: Delete by id |
| 153 |
cisco.meraki.organizations_saml_roles: |
| 154 |
meraki_api_key: "{{ meraki_api_key }}" |
| 155 |
meraki_base_url: "{{ meraki_base_url }}" |
| 156 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 157 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 158 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 159 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 160 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 161 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 162 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 163 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 164 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 165 |
meraki_output_log: "{{ meraki_output_log }}" |
| 166 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 167 |
meraki_log_path: "{{ meraki_log_path }}" |
| 168 |
meraki_print_console: "{{ meraki_print_console }}" |
| 169 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 170 |
meraki_simulate: "{{ meraki_simulate }}" |
| 171 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 172 |
meraki_caller: "{{ meraki_caller }}" |
| 173 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 174 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 175 |
state: absent |
| 176 |
organizationId: string |
| 177 |
samlRoleId: string |
| 178 |
""" |
| 179 |
RETURN = r""" |
| 180 |
meraki_response: |
| 181 |
description: A dictionary or list with the response returned by the Cisco Meraki Python SDK |
| 182 |
returned: always |
| 183 |
type: dict |
| 184 |
sample: > |
| 185 |
{ |
| 186 |
"id": "string", |
| 187 |
"role": "string", |
| 188 |
"orgAccess": "string", |
| 189 |
"networks": [ |
| 190 |
{ |
| 191 |
"id": "string", |
| 192 |
"access": "string" |
| 193 |
} |
| 194 |
], |
| 195 |
"tags": [ |
| 196 |
{ |
| 197 |
"tag": "string", |
| 198 |
"access": "string" |
| 199 |
} |
| 200 |
], |
| 201 |
"camera": [ |
| 202 |
{ |
| 203 |
"orgWide": true, |
| 204 |
"access": "string" |
| 205 |
} |
| 206 |
] |
| 207 |
} |
| 208 |
""" |