From 66cec45960ce1d9c794e9399de15c138acb18aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 18:03:42 +0200 Subject: Adding upstream version 7.3.0+dfsg. Signed-off-by: Daniel Baumann --- ansible_collections/cisco/dnac/.DS_Store | Bin 0 -> 8196 bytes .../dnac/.github/ISSUE_TEMPLATE/bug_report.md | 31 + .../cisco/dnac/.github/ISSUE_TEMPLATE/config.yml | 1 + .../dnac/.github/ISSUE_TEMPLATE/feature_request.md | 20 + .../cisco/dnac/.github/workflows/docs.yml | 39 + .../cisco/dnac/.github/workflows/sanity_tests.yml | 39 + ansible_collections/cisco/dnac/.gitignore | 21 + .../cisco/dnac/.vscode/settings.json | 4 + ansible_collections/cisco/dnac/FILES.json | 5675 ++++++++++++++++++++ ansible_collections/cisco/dnac/LICENSE | 677 +++ ansible_collections/cisco/dnac/MANIFEST.json | 43 + ansible_collections/cisco/dnac/Makefile | 51 + ansible_collections/cisco/dnac/README.md | 211 + .../cisco/dnac/changelogs/changelog.yaml | 626 +++ ansible_collections/cisco/dnac/docs/Makefile | 20 + .../cisco/dnac/docs/_gh_include/footer.inc | 4 + .../cisco/dnac/docs/_gh_include/header.inc | 17 + ansible_collections/cisco/dnac/docs/conf.py | 154 + ansible_collections/cisco/dnac/docs/index.rst | 20 + .../cisco/dnac/docs/requirements.txt | 6 + ansible_collections/cisco/dnac/meta/runtime.yml | 2 + .../cisco/dnac/playbooks/application_set_info.yml | 20 + .../cisco/dnac/playbooks/application_sets.yml | 43 + .../cisco/dnac/playbooks/applications.yml | 72 + .../cisco/dnac/playbooks/authentication_import.yml | 20 + .../dnac/playbooks/command_runner_run_command.yml | 41 + .../configuration_template_version_create.yml | 44 + .../cisco/dnac/playbooks/credentials.template | 8 + .../cisco/dnac/playbooks/credentials.yml | 8 + .../cisco/dnac/playbooks/device_details.yml | 54 + .../cisco/dnac/playbooks/discovery.yml | 128 + .../download_device_cmd_runner_output.yml | 78 + .../cisco/dnac/playbooks/files/test.template | 35 + .../cisco/dnac/playbooks/global_credentials.yml | 36 + .../dnac/playbooks/global_credentials_info.yml | 40 + .../cisco/dnac/playbooks/global_pool.yml | 26 + ansible_collections/cisco/dnac/playbooks/hosts | 2 + .../cisco/dnac/playbooks/image_details.yml | 11 + .../cisco/dnac/playbooks/import_image_file.yml | 22 + .../network_device_custom_prompt_info.yml | 20 + .../cisco/dnac/playbooks/network_device_info.yml | 36 + .../dnac/playbooks/network_device_update_role.yml | 45 + .../cisco/dnac/playbooks/pnp_device.yml | 79 + .../dnac/playbooks/reports_executions_info.yml | 22 + .../cisco/dnac/playbooks/reserve_ip_subpool.yml | 48 + .../cisco/dnac/playbooks/sda_fabric.yml | 22 + .../cisco/dnac/playbooks/sda_fabric_site.yml | 37 + .../dnac/playbooks/sda_virtual_network_v2.yml | 33 + ansible_collections/cisco/dnac/playbooks/tag.yml | 131 + .../cisco/dnac/playbooks/template.yml | 22 + .../cisco/dnac/playbooks/template_pnp_intent.yml | 61 + .../cisco/dnac/playbooks/test_swim_module.yml | 41 + .../dnac/playbooks/wireless_enterprise_ssid.yml | 35 + ansible_collections/cisco/dnac/plugins/.DS_Store | Bin 0 -> 6148 bytes ansible_collections/cisco/dnac/plugins/README.md | 31 + ansible_collections/cisco/dnac/plugins/__init__.py | 0 .../dnac/plugins/action/app_policy_default_info.py | 87 + .../cisco/dnac/plugins/action/app_policy_info.py | 89 + .../plugins/action/app_policy_intent_create.py | 90 + .../plugins/action/app_policy_queuing_profile.py | 262 + .../app_policy_queuing_profile_count_info.py | 87 + .../action/app_policy_queuing_profile_info.py | 89 + .../cisco/dnac/plugins/action/application_sets.py | 226 + .../plugins/action/application_sets_count_info.py | 87 + .../dnac/plugins/action/application_sets_info.py | 93 + .../cisco/dnac/plugins/action/applications.py | 252 + .../dnac/plugins/action/applications_count_info.py | 87 + .../plugins/action/applications_health_info.py | 105 + .../cisco/dnac/plugins/action/applications_info.py | 93 + .../dnac/plugins/action/assign_device_to_site.py | 90 + .../action/associate_site_to_network_profile.py | 88 + .../action/authentication_import_certificate.py | 96 + .../authentication_import_certificate_p12.py | 93 + .../action/buildings_planned_access_points_info.py | 95 + .../business_sda_hostonboarding_ssid_ippool.py | 202 + ...business_sda_hostonboarding_ssid_ippool_info.py | 91 + .../business_sda_virtual_network_summary_info.py | 89 + .../business_sda_wireless_controller_create.py | 88 + .../business_sda_wireless_controller_delete.py | 85 + .../cisco/dnac/plugins/action/cli_credential.py | 239 + .../dnac/plugins/action/client_detail_info.py | 91 + .../action/client_enrichment_details_info.py | 87 + .../dnac/plugins/action/client_health_info.py | 89 + .../dnac/plugins/action/client_proximity_info.py | 93 + .../plugins/action/command_runner_run_command.py | 94 + .../dnac/plugins/action/compliance_check_run.py | 90 + .../plugins/action/compliance_device_by_id_info.py | 99 + .../action/compliance_device_details_count_info.py | 91 + .../action/compliance_device_details_info.py | 97 + .../dnac/plugins/action/compliance_device_info.py | 106 + .../action/compliance_device_status_count_info.py | 89 + .../dnac/plugins/action/configuration_template.py | 355 ++ .../plugins/action/configuration_template_clone.py | 90 + .../action/configuration_template_create.py | 137 + .../action/configuration_template_deploy.py | 96 + .../configuration_template_deploy_status_info.py | 98 + .../action/configuration_template_deploy_v2.py | 96 + .../configuration_template_export_project.py | 86 + .../configuration_template_export_template.py | 86 + .../configuration_template_import_project.py | 86 + .../configuration_template_import_template.py | 90 + .../plugins/action/configuration_template_info.py | 124 + .../action/configuration_template_project.py | 284 + .../action/configuration_template_project_info.py | 104 + .../configuration_template_version_create.py | 88 + .../action/configuration_template_version_info.py | 98 + .../plugins/action/device_configurations_export.py | 88 + .../plugins/action/device_credential_create.py | 86 + .../plugins/action/device_credential_delete.py | 85 + .../dnac/plugins/action/device_credential_info.py | 89 + .../plugins/action/device_credential_update.py | 86 + .../dnac/plugins/action/device_details_info.py | 93 + .../action/device_enrichment_details_info.py | 87 + .../device_family_identifiers_details_info.py | 87 + .../dnac/plugins/action/device_health_info.py | 101 + .../plugins/action/device_interface_by_ip_info.py | 98 + .../plugins/action/device_interface_count_info.py | 87 + .../dnac/plugins/action/device_interface_info.py | 104 + .../plugins/action/device_interface_isis_info.py | 87 + .../plugins/action/device_interface_ospf_info.py | 87 + .../dnac/plugins/action/device_replacement.py | 237 + .../action/device_replacement_count_info.py | 89 + .../plugins/action/device_replacement_deploy.py | 88 + .../dnac/plugins/action/device_replacement_info.py | 109 + .../action/disassociate_site_to_network_profile.py | 87 + ...disasterrecovery_system_operationstatus_info.py | 90 + .../action/disasterrecovery_system_status_info.py | 90 + .../cisco/dnac/plugins/action/discovery.py | 443 ++ .../dnac/plugins/action/discovery_count_info.py | 87 + .../plugins/action/discovery_device_count_info.py | 91 + .../dnac/plugins/action/discovery_device_info.py | 91 + .../plugins/action/discovery_device_range_info.py | 95 + .../cisco/dnac/plugins/action/discovery_info.py | 98 + .../dnac/plugins/action/discovery_job_info.py | 108 + .../dnac/plugins/action/discovery_range_delete.py | 87 + .../dnac/plugins/action/discovery_range_info.py | 91 + .../dnac/plugins/action/discovery_summary_info.py | 107 + .../action/dna_command_runner_keywords_info.py | 87 + .../dnacaap_management_execution_status_info.py | 98 + .../action/endpoint_analytics_profiling_rules.py | 332 ++ .../endpoint_analytics_profiling_rules_info.py | 115 + .../dnac/plugins/action/event_api_status_info.py | 98 + .../plugins/action/event_artifact_count_info.py | 87 + .../dnac/plugins/action/event_artifact_info.py | 101 + .../action/event_config_connector_types_info.py | 87 + .../cisco/dnac/plugins/action/event_count_info.py | 91 + .../plugins/action/event_email_config_create.py | 96 + .../plugins/action/event_email_config_update.py | 96 + .../cisco/dnac/plugins/action/event_info.py | 99 + .../plugins/action/event_series_audit_logs_info.py | 131 + .../event_series_audit_logs_parent_records_info.py | 129 + .../action/event_series_audit_logs_summary_info.py | 125 + .../dnac/plugins/action/event_series_count_info.py | 105 + .../cisco/dnac/plugins/action/event_series_info.py | 119 + .../dnac/plugins/action/event_subscription.py | 260 + .../action/event_subscription_count_info.py | 89 + .../event_subscription_details_email_info.py | 99 + .../action/event_subscription_details_rest_info.py | 99 + .../event_subscription_details_syslog_info.py | 99 + .../plugins/action/event_subscription_email.py | 223 + .../action/event_subscription_email_info.py | 107 + .../dnac/plugins/action/event_subscription_info.py | 97 + .../dnac/plugins/action/event_subscription_rest.py | 223 + .../plugins/action/event_subscription_rest_info.py | 107 + .../plugins/action/event_subscription_syslog.py | 223 + .../action/event_subscription_syslog_info.py | 107 + .../dnac/plugins/action/event_webhook_create.py | 98 + .../dnac/plugins/action/event_webhook_update.py | 98 + .../cisco/dnac/plugins/action/file_import.py | 88 + .../cisco/dnac/plugins/action/file_info.py | 110 + .../plugins/action/file_namespace_files_info.py | 98 + .../dnac/plugins/action/file_namespaces_info.py | 87 + .../plugins/action/global_credential_delete.py | 85 + .../dnac/plugins/action/global_credential_info.py | 106 + .../plugins/action/global_credential_update.py | 88 + .../cisco/dnac/plugins/action/global_pool.py | 277 + .../cisco/dnac/plugins/action/global_pool_info.py | 91 + .../dnac/plugins/action/golden_image_create.py | 92 + .../dnac/plugins/action/golden_tag_image_delete.py | 91 + .../action/golden_tag_image_details_info.py | 104 + .../dnac/plugins/action/http_read_credential.py | 244 + .../dnac/plugins/action/http_write_credential.py | 244 + .../cisco/dnac/plugins/action/interface_info.py | 89 + .../action/interface_network_device_detail_info.py | 91 + .../action/interface_network_device_info.py | 98 + .../action/interface_network_device_range_info.py | 93 + .../plugins/action/interface_operation_create.py | 92 + .../cisco/dnac/plugins/action/interface_update.py | 96 + .../action/issues_enrichment_details_info.py | 87 + .../cisco/dnac/plugins/action/issues_info.py | 103 + .../plugins/action/itsm_cmdb_sync_status_info.py | 91 + .../action/itsm_integration_events_failed_info.py | 89 + .../action/itsm_integration_events_retry.py | 86 + .../plugins/action/lan_automation_count_info.py | 87 + .../dnac/plugins/action/lan_automation_create.py | 86 + .../dnac/plugins/action/lan_automation_delete.py | 85 + .../dnac/plugins/action/lan_automation_log_info.py | 104 + .../plugins/action/lan_automation_status_info.py | 104 + .../plugins/action/license_device_count_info.py | 97 + .../action/license_device_deregistration.py | 86 + .../action/license_device_license_details_info.py | 89 + .../action/license_device_license_summary_info.py | 107 + .../plugins/action/license_device_registration.py | 88 + .../action/license_smart_account_details_info.py | 87 + .../plugins/action/license_term_details_info.py | 102 + .../plugins/action/license_usage_details_info.py | 102 + .../action/license_virtual_account_change.py | 90 + .../action/license_virtual_account_details_info.py | 89 + .../dnac/plugins/action/netconf_credential.py | 233 + .../cisco/dnac/plugins/action/network_create.py | 90 + .../cisco/dnac/plugins/action/network_device.py | 439 ++ .../plugins/action/network_device_by_ip_info.py | 98 + .../action/network_device_by_serial_number_info.py | 98 + .../action/network_device_chassis_details_info.py | 89 + .../action/network_device_config_count_info.py | 87 + .../plugins/action/network_device_config_info.py | 100 + .../plugins/action/network_device_count_info.py | 100 + .../plugins/action/network_device_custom_prompt.py | 88 + .../action/network_device_custom_prompt_info.py | 87 + .../action/network_device_equipment_info.py | 91 + .../dnac/plugins/action/network_device_export.py | 94 + .../network_device_functional_capability_info.py | 104 + .../network_device_global_polling_interval_info.py | 87 + .../dnac/plugins/action/network_device_info.py | 166 + .../network_device_interface_neighbor_info.py | 91 + .../action/network_device_interface_poe_info.py | 91 + ..._device_inventory_insight_link_mismatch_info.py | 99 + ...network_device_lexicographically_sorted_info.py | 131 + .../action/network_device_linecard_details_info.py | 89 + .../network_device_meraki_organization_info.py | 89 + .../action/network_device_module_count_info.py | 97 + .../plugins/action/network_device_module_info.py | 114 + .../dnac/plugins/action/network_device_poe_info.py | 89 + .../action/network_device_polling_interval_info.py | 89 + .../plugins/action/network_device_range_info.py | 91 + .../action/network_device_register_for_wsa_info.py | 91 + .../action/network_device_stack_details_info.py | 89 + .../plugins/action/network_device_summary_info.py | 89 + .../network_device_supervisor_card_details_info.py | 89 + .../dnac/plugins/action/network_device_sync.py | 88 + .../plugins/action/network_device_update_role.py | 90 + .../plugins/action/network_device_vlan_info.py | 91 + .../action/network_device_wireless_lan_info.py | 89 + .../action/network_device_with_snmp_v3_des_info.py | 97 + .../cisco/dnac/plugins/action/network_info.py | 89 + .../cisco/dnac/plugins/action/network_update.py | 88 + .../cisco/dnac/plugins/action/nfv_profile.py | 248 + .../cisco/dnac/plugins/action/nfv_profile_info.py | 104 + .../cisco/dnac/plugins/action/nfv_provision.py | 90 + .../plugins/action/nfv_provision_detail_info.py | 89 + .../dnac/plugins/action/nfv_provision_details.py | 88 + .../cisco/dnac/plugins/action/path_trace.py | 287 + .../cisco/dnac/plugins/action/path_trace_info.py | 130 + .../plugins/action/planned_access_points_info.py | 95 + .../platform_nodes_configuration_summary_info.py | 87 + .../action/platform_release_summary_info.py | 87 + .../cisco/dnac/plugins/action/pnp_device.py | 344 ++ .../dnac/plugins/action/pnp_device_authorize.py | 86 + .../cisco/dnac/plugins/action/pnp_device_claim.py | 102 + .../plugins/action/pnp_device_claim_to_site.py | 112 + .../plugins/action/pnp_device_config_preview.py | 90 + .../dnac/plugins/action/pnp_device_count_info.py | 115 + .../dnac/plugins/action/pnp_device_history_info.py | 93 + .../cisco/dnac/plugins/action/pnp_device_import.py | 86 + .../cisco/dnac/plugins/action/pnp_device_info.py | 142 + .../cisco/dnac/plugins/action/pnp_device_reset.py | 90 + .../dnac/plugins/action/pnp_device_unclaim.py | 86 + .../dnac/plugins/action/pnp_global_settings.py | 186 + .../plugins/action/pnp_global_settings_info.py | 87 + .../plugins/action/pnp_server_profile_update.py | 110 + .../action/pnp_smart_account_domains_info.py | 87 + .../dnac/plugins/action/pnp_virtual_account_add.py | 110 + .../action/pnp_virtual_account_deregister.py | 87 + .../action/pnp_virtual_account_devices_sync.py | 110 + .../action/pnp_virtual_account_sync_result_info.py | 91 + .../plugins/action/pnp_virtual_accounts_info.py | 89 + .../cisco/dnac/plugins/action/pnp_workflow.py | 351 ++ .../dnac/plugins/action/pnp_workflow_count_info.py | 89 + .../cisco/dnac/plugins/action/pnp_workflow_info.py | 112 + .../plugins/action/profiling_rules_count_info.py | 94 + .../action/profiling_rules_in_bulk_create.py | 89 + .../dnac/plugins/action/projects_details_info.py | 97 + .../dnac/plugins/action/qos_device_interface.py | 264 + .../plugins/action/qos_device_interface_info.py | 89 + .../action/qos_device_interface_info_count_info.py | 87 + .../cisco/dnac/plugins/action/reports.py | 259 + .../dnac/plugins/action/reports_executions_info.py | 114 + .../cisco/dnac/plugins/action/reports_info.py | 104 + .../dnac/plugins/action/reports_view_group_info.py | 100 + .../plugins/action/reports_view_group_view_info.py | 100 + .../dnac/plugins/action/reserve_ip_subpool.py | 358 ++ .../plugins/action/reserve_ip_subpool_create.py | 126 + .../plugins/action/reserve_ip_subpool_delete.py | 85 + .../dnac/plugins/action/reserve_ip_subpool_info.py | 93 + .../plugins/action/reserve_ip_subpool_update.py | 116 + .../cisco/dnac/plugins/action/sda_count_info.py | 90 + .../cisco/dnac/plugins/action/sda_device_info.py | 89 + .../dnac/plugins/action/sda_device_role_info.py | 89 + .../cisco/dnac/plugins/action/sda_fabric.py | 210 + .../action/sda_fabric_authentication_profile.py | 243 + .../sda_fabric_authentication_profile_info.py | 91 + .../plugins/action/sda_fabric_border_device.py | 224 + .../action/sda_fabric_border_device_info.py | 89 + .../action/sda_fabric_control_plane_device.py | 215 + .../action/sda_fabric_control_plane_device_info.py | 89 + .../dnac/plugins/action/sda_fabric_edge_device.py | 216 + .../plugins/action/sda_fabric_edge_device_info.py | 89 + .../cisco/dnac/plugins/action/sda_fabric_info.py | 92 + .../cisco/dnac/plugins/action/sda_fabric_site.py | 214 + .../dnac/plugins/action/sda_fabric_site_info.py | 89 + .../cisco/dnac/plugins/action/sda_multicast.py | 222 + .../dnac/plugins/action/sda_multicast_info.py | 89 + .../action/sda_port_assignment_for_access_point.py | 235 + .../sda_port_assignment_for_access_point_info.py | 91 + .../action/sda_port_assignment_for_user_device.py | 243 + .../sda_port_assignment_for_user_device_info.py | 91 + .../dnac/plugins/action/sda_provision_device.py | 234 + .../plugins/action/sda_provision_device_info.py | 89 + .../dnac/plugins/action/sda_virtual_network.py | 221 + .../plugins/action/sda_virtual_network_info.py | 91 + .../plugins/action/sda_virtual_network_ip_pool.py | 277 + .../action/sda_virtual_network_ip_pool_info.py | 93 + .../dnac/plugins/action/sda_virtual_network_v2.py | 239 + .../plugins/action/sda_virtual_network_v2_info.py | 89 + .../action/security_advisories_devices_info.py | 89 + .../security_advisories_ids_per_device_info.py | 98 + .../plugins/action/security_advisories_info.py | 87 + .../action/security_advisories_per_device_info.py | 89 + .../action/security_advisories_summary_info.py | 87 + .../cisco/dnac/plugins/action/sensor.py | 225 + .../cisco/dnac/plugins/action/sensor_info.py | 89 + .../cisco/dnac/plugins/action/sensor_test_run.py | 86 + .../action/sensor_test_template_duplicate.py | 88 + .../plugins/action/sensor_test_template_edit.py | 90 + .../dnac/plugins/action/service_provider_create.py | 86 + .../dnac/plugins/action/service_provider_info.py | 87 + .../action/service_provider_profile_delete.py | 85 + .../dnac/plugins/action/service_provider_update.py | 86 + .../dnac/plugins/action/site_assign_credential.py | 100 + .../dnac/plugins/action/site_assign_device.py | 93 + .../cisco/dnac/plugins/action/site_count_info.py | 89 + .../cisco/dnac/plugins/action/site_create.py | 90 + .../cisco/dnac/plugins/action/site_delete.py | 85 + .../dnac/plugins/action/site_design_floormap.py | 248 + .../plugins/action/site_design_floormap_info.py | 103 + .../cisco/dnac/plugins/action/site_health_info.py | 95 + .../cisco/dnac/plugins/action/site_info.py | 97 + .../dnac/plugins/action/site_membership_info.py | 106 + .../cisco/dnac/plugins/action/site_update.py | 92 + .../cisco/dnac/plugins/action/snmp_properties.py | 202 + .../dnac/plugins/action/snmp_properties_info.py | 87 + .../action/snmpv2_read_community_credential.py | 225 + .../action/snmpv2_write_community_credential.py | 225 + .../cisco/dnac/plugins/action/snmpv3_credential.py | 252 + .../dnac/plugins/action/swim_image_details_info.py | 123 + .../cisco/dnac/plugins/action/swim_import_local.py | 95 + .../dnac/plugins/action/swim_import_via_url.py | 92 + .../dnac/plugins/action/swim_trigger_activation.py | 90 + .../plugins/action/swim_trigger_distribution.py | 86 + .../dnac/plugins/action/syslog_config_create.py | 96 + .../dnac/plugins/action/syslog_config_update.py | 96 + .../plugins/action/system_health_count_info.py | 91 + .../dnac/plugins/action/system_health_info.py | 97 + .../action/system_performance_historical_info.py | 93 + .../dnac/plugins/action/system_performance_info.py | 95 + .../cisco/dnac/plugins/action/tag.py | 283 + .../cisco/dnac/plugins/action/tag_count_info.py | 99 + .../cisco/dnac/plugins/action/tag_info.py | 122 + .../cisco/dnac/plugins/action/tag_member.py | 225 + .../dnac/plugins/action/tag_member_count_info.py | 95 + .../cisco/dnac/plugins/action/tag_member_info.py | 99 + .../dnac/plugins/action/tag_member_type_info.py | 87 + .../cisco/dnac/plugins/action/tag_membership.py | 88 + .../cisco/dnac/plugins/action/task_count_info.py | 107 + .../cisco/dnac/plugins/action/task_info.py | 128 + .../dnac/plugins/action/task_operation_info.py | 102 + .../cisco/dnac/plugins/action/task_tree_info.py | 89 + .../cisco/dnac/plugins/action/template_preview.py | 92 + .../dnac/plugins/action/templates_details_info.py | 121 + .../cisco/dnac/plugins/action/threat_detail.py | 103 + .../dnac/plugins/action/threat_detail_count.py | 103 + .../cisco/dnac/plugins/action/threat_summary.py | 97 + .../dnac/plugins/action/topology_layer_2_info.py | 98 + .../dnac/plugins/action/topology_layer_3_info.py | 98 + .../plugins/action/topology_network_health_info.py | 89 + .../dnac/plugins/action/topology_physical_info.py | 89 + .../dnac/plugins/action/topology_site_info.py | 87 + .../plugins/action/topology_vlan_details_info.py | 87 + .../dnac/plugins/action/transit_peer_network.py | 211 + .../plugins/action/transit_peer_network_info.py | 89 + .../plugins/action/user_enrichment_details_info.py | 87 + .../plugins/action/wireless_dynamic_interface.py | 229 + .../action/wireless_dynamic_interface_info.py | 89 + .../plugins/action/wireless_enterprise_ssid.py | 347 ++ .../action/wireless_enterprise_ssid_info.py | 89 + .../cisco/dnac/plugins/action/wireless_profile.py | 248 + .../dnac/plugins/action/wireless_profile_info.py | 89 + .../action/wireless_provision_access_point.py | 88 + .../action/wireless_provision_device_create.py | 86 + .../action/wireless_provision_device_update.py | 88 + .../wireless_provision_ssid_create_provision.py | 96 + .../wireless_provision_ssid_delete_reprovision.py | 87 + .../dnac/plugins/action/wireless_psk_override.py | 86 + .../dnac/plugins/action/wireless_rf_profile.py | 263 + .../plugins/action/wireless_rf_profile_info.py | 89 + .../action/wireless_sensor_test_results_info.py | 95 + .../cisco/dnac/plugins/doc_fragments/__init__.py | 0 .../dnac/plugins/doc_fragments/intent_params.py | 66 + .../cisco/dnac/plugins/doc_fragments/module.py | 61 + .../dnac/plugins/doc_fragments/module_info.py | 61 + .../cisco/dnac/plugins/module_utils/__init__.py | 0 .../cisco/dnac/plugins/module_utils/dnac.py | 319 ++ .../cisco/dnac/plugins/module_utils/exceptions.py | 13 + .../cisco/dnac/plugins/modules/__init__.py | 0 .../plugins/modules/app_policy_default_info.py | 148 + .../cisco/dnac/plugins/modules/app_policy_info.py | 194 + .../plugins/modules/app_policy_intent_create.py | 331 ++ .../plugins/modules/app_policy_queuing_profile.py | 200 + .../app_policy_queuing_profile_count_info.py | 63 + .../modules/app_policy_queuing_profile_info.py | 154 + .../cisco/dnac/plugins/modules/application_sets.py | 90 + .../plugins/modules/application_sets_count_info.py | 63 + .../dnac/plugins/modules/application_sets_info.py | 85 + .../cisco/dnac/plugins/modules/applications.py | 272 + .../plugins/modules/applications_count_info.py | 63 + .../plugins/modules/applications_health_info.py | 151 + .../dnac/plugins/modules/applications_info.py | 125 + .../dnac/plugins/modules/assign_device_to_site.py | 77 + .../modules/associate_site_to_network_profile.py | 69 + .../modules/authentication_import_certificate.py | 78 + .../authentication_import_certificate_p12.py | 78 + .../buildings_planned_access_points_info.py | 129 + .../business_sda_hostonboarding_ssid_ippool.py | 102 + ...business_sda_hostonboarding_ssid_ippool_info.py | 78 + .../business_sda_virtual_network_summary_info.py | 72 + .../business_sda_wireless_controller_create.py | 68 + .../business_sda_wireless_controller_delete.py | 64 + .../cisco/dnac/plugins/modules/cli_credential.py | 124 + .../dnac/plugins/modules/client_detail_info.py | 196 + .../modules/client_enrichment_details_info.py | 230 + .../dnac/plugins/modules/client_health_info.py | 109 + .../dnac/plugins/modules/client_proximity_info.py | 87 + .../plugins/modules/command_runner_run_command.py | 85 + .../dnac/plugins/modules/compliance_check_run.py | 77 + .../modules/compliance_device_by_id_info.py | 143 + .../compliance_device_details_count_info.py | 77 + .../modules/compliance_device_details_info.py | 103 + .../dnac/plugins/modules/compliance_device_info.py | 111 + .../modules/compliance_device_status_count_info.py | 70 + .../dnac/plugins/modules/configuration_template.py | 734 +++ .../modules/configuration_template_clone.py | 75 + .../modules/configuration_template_create.py | 712 +++ .../modules/configuration_template_deploy.py | 134 + .../configuration_template_deploy_status_info.py | 90 + .../modules/configuration_template_deploy_v2.py | 115 + .../configuration_template_export_project.py | 67 + .../configuration_template_export_template.py | 67 + .../configuration_template_import_project.py | 68 + .../configuration_template_import_template.py | 730 +++ .../plugins/modules/configuration_template_info.py | 355 ++ .../modules/configuration_template_project.py | 958 ++++ .../modules/configuration_template_project_info.py | 319 ++ .../configuration_template_version_create.py | 69 + .../modules/configuration_template_version_info.py | 84 + .../modules/device_configurations_export.py | 71 + .../plugins/modules/device_credential_create.py | 192 + .../plugins/modules/device_credential_delete.py | 63 + .../dnac/plugins/modules/device_credential_info.py | 145 + .../plugins/modules/device_credential_update.py | 210 + .../dnac/plugins/modules/device_details_info.py | 120 + .../modules/device_enrichment_details_info.py | 143 + .../device_family_identifiers_details_info.py | 68 + .../dnac/plugins/modules/device_health_info.py | 149 + .../plugins/modules/device_interface_by_ip_info.py | 101 + .../plugins/modules/device_interface_count_info.py | 63 + .../dnac/plugins/modules/device_interface_info.py | 128 + .../plugins/modules/device_interface_isis_info.py | 96 + .../plugins/modules/device_interface_ospf_info.py | 96 + .../dnac/plugins/modules/device_replacement.py | 156 + .../modules/device_replacement_count_info.py | 71 + .../plugins/modules/device_replacement_deploy.py | 71 + .../plugins/modules/device_replacement_info.py | 142 + .../disassociate_site_to_network_profile.py | 69 + ...disasterrecovery_system_operationstatus_info.py | 90 + .../modules/disasterrecovery_system_status_info.py | 143 + .../cisco/dnac/plugins/modules/discovery.py | 405 ++ .../dnac/plugins/modules/discovery_count_info.py | 63 + .../plugins/modules/discovery_device_count_info.py | 75 + .../dnac/plugins/modules/discovery_device_info.py | 124 + .../plugins/modules/discovery_device_range_info.py | 134 + .../cisco/dnac/plugins/modules/discovery_info.py | 129 + .../dnac/plugins/modules/discovery_job_info.py | 131 + .../dnac/plugins/modules/discovery_range_delete.py | 69 + .../dnac/plugins/modules/discovery_range_info.py | 136 + .../dnac/plugins/modules/discovery_summary_info.py | 121 + .../modules/dna_command_runner_keywords_info.py | 65 + .../dnacaap_management_execution_status_info.py | 77 + .../modules/endpoint_analytics_profiling_rules.py | 244 + .../endpoint_analytics_profiling_rules_info.py | 162 + .../dnac/plugins/modules/event_api_status_info.py | 69 + .../plugins/modules/event_artifact_count_info.py | 62 + .../dnac/plugins/modules/event_artifact_info.py | 134 + .../modules/event_config_connector_types_info.py | 68 + .../cisco/dnac/plugins/modules/event_count_info.py | 72 + .../plugins/modules/event_email_config_create.py | 115 + .../plugins/modules/event_email_config_update.py | 115 + .../cisco/dnac/plugins/modules/event_info.py | 111 + .../modules/event_series_audit_logs_info.py | 219 + .../event_series_audit_logs_parent_records_info.py | 214 + .../event_series_audit_logs_summary_info.py | 172 + .../plugins/modules/event_series_count_info.py | 105 + .../dnac/plugins/modules/event_series_info.py | 163 + .../dnac/plugins/modules/event_subscription.py | 220 + .../modules/event_subscription_count_info.py | 67 + .../event_subscription_details_email_info.py | 103 + .../event_subscription_details_rest_info.py | 117 + .../event_subscription_details_syslog_info.py | 108 + .../plugins/modules/event_subscription_email.py | 227 + .../modules/event_subscription_email_info.py | 170 + .../plugins/modules/event_subscription_info.py | 161 + .../plugins/modules/event_subscription_rest.py | 199 + .../modules/event_subscription_rest_info.py | 186 + .../plugins/modules/event_subscription_syslog.py | 199 + .../modules/event_subscription_syslog_info.py | 172 + .../dnac/plugins/modules/event_webhook_create.py | 109 + .../dnac/plugins/modules/event_webhook_update.py | 109 + .../cisco/dnac/plugins/modules/file_import.py | 63 + .../cisco/dnac/plugins/modules/file_info.py | 85 + .../plugins/modules/file_namespace_files_info.py | 85 + .../dnac/plugins/modules/file_namespaces_info.py | 65 + .../plugins/modules/global_credential_delete.py | 65 + .../dnac/plugins/modules/global_credential_info.py | 104 + .../plugins/modules/global_credential_update.py | 71 + .../cisco/dnac/plugins/modules/global_pool.py | 144 + .../cisco/dnac/plugins/modules/global_pool_info.py | 107 + .../dnac/plugins/modules/golden_image_create.py | 78 + .../plugins/modules/golden_tag_image_delete.py | 80 + .../modules/golden_tag_image_details_info.py | 90 + .../dnac/plugins/modules/http_read_credential.py | 129 + .../dnac/plugins/modules/http_write_credential.py | 129 + .../cisco/dnac/plugins/modules/interface_info.py | 80 + .../interface_network_device_detail_info.py | 104 + .../modules/interface_network_device_info.py | 101 + .../modules/interface_network_device_range_info.py | 111 + .../plugins/modules/interface_operation_create.py | 81 + .../cisco/dnac/plugins/modules/interface_update.py | 99 + .../modules/issues_enrichment_details_info.py | 89 + .../cisco/dnac/plugins/modules/issues_info.py | 125 + .../plugins/modules/itsm_cmdb_sync_status_info.py | 91 + .../modules/itsm_integration_events_failed_info.py | 86 + .../modules/itsm_integration_events_retry.py | 68 + .../plugins/modules/lan_automation_count_info.py | 62 + .../dnac/plugins/modules/lan_automation_create.py | 122 + .../dnac/plugins/modules/lan_automation_delete.py | 66 + .../plugins/modules/lan_automation_log_info.py | 109 + .../plugins/modules/lan_automation_status_info.py | 128 + .../plugins/modules/license_device_count_info.py | 88 + .../modules/license_device_deregistration.py | 66 + .../modules/license_device_license_details_info.py | 123 + .../modules/license_device_license_summary_info.py | 149 + .../plugins/modules/license_device_registration.py | 70 + .../modules/license_smart_account_details_info.py | 70 + .../plugins/modules/license_term_details_info.py | 89 + .../plugins/modules/license_usage_details_info.py | 114 + .../modules/license_virtual_account_change.py | 74 + .../license_virtual_account_details_info.py | 74 + .../dnac/plugins/modules/netconf_credential.py | 115 + .../cisco/dnac/plugins/modules/network_create.py | 214 + .../cisco/dnac/plugins/modules/network_device.py | 259 + .../plugins/modules/network_device_by_ip_info.py | 108 + .../network_device_by_serial_number_info.py | 108 + .../modules/network_device_chassis_details_info.py | 85 + .../modules/network_device_config_count_info.py | 63 + .../plugins/modules/network_device_config_info.py | 87 + .../plugins/modules/network_device_count_info.py | 89 + .../modules/network_device_custom_prompt.py | 71 + .../modules/network_device_custom_prompt_info.py | 68 + .../modules/network_device_equipment_info.py | 83 + .../dnac/plugins/modules/network_device_export.py | 85 + .../network_device_functional_capability_info.py | 113 + .../network_device_global_polling_interval_info.py | 63 + .../dnac/plugins/modules/network_device_info.py | 325 ++ .../network_device_interface_neighbor_info.py | 79 + .../modules/network_device_interface_poe_info.py | 85 + ..._device_inventory_insight_link_mismatch_info.py | 127 + ...network_device_lexicographically_sorted_info.py | 175 + .../network_device_linecard_details_info.py | 75 + .../network_device_meraki_organization_info.py | 70 + .../modules/network_device_module_count_info.py | 92 + .../plugins/modules/network_device_module_info.py | 143 + .../plugins/modules/network_device_poe_info.py | 72 + .../network_device_polling_interval_info.py | 68 + .../plugins/modules/network_device_range_info.py | 115 + .../network_device_register_for_wsa_info.py | 79 + .../modules/network_device_stack_details_info.py | 132 + .../plugins/modules/network_device_summary_info.py | 72 + .../network_device_supervisor_card_details_info.py | 75 + .../dnac/plugins/modules/network_device_sync.py | 74 + .../plugins/modules/network_device_update_role.py | 73 + .../plugins/modules/network_device_vlan_info.py | 84 + .../modules/network_device_wireless_lan_info.py | 83 + .../network_device_with_snmp_v3_des_info.py | 101 + .../cisco/dnac/plugins/modules/network_info.py | 88 + .../cisco/dnac/plugins/modules/network_update.py | 208 + .../cisco/dnac/plugins/modules/nfv_profile.py | 292 + .../cisco/dnac/plugins/modules/nfv_profile_info.py | 144 + .../cisco/dnac/plugins/modules/nfv_provision.py | 521 ++ .../plugins/modules/nfv_provision_detail_info.py | 91 + .../dnac/plugins/modules/nfv_provision_details.py | 67 + .../cisco/dnac/plugins/modules/path_trace.py | 120 + .../cisco/dnac/plugins/modules/path_trace_info.py | 1076 ++++ .../plugins/modules/planned_access_points_info.py | 129 + .../platform_nodes_configuration_summary_info.py | 118 + .../modules/platform_release_summary_info.py | 79 + .../cisco/dnac/plugins/modules/pnp_device.py | 1747 ++++++ .../dnac/plugins/modules/pnp_device_authorize.py | 70 + .../cisco/dnac/plugins/modules/pnp_device_claim.py | 140 + .../plugins/modules/pnp_device_claim_to_site.py | 153 + .../plugins/modules/pnp_device_config_preview.py | 81 + .../dnac/plugins/modules/pnp_device_count_info.py | 145 + .../plugins/modules/pnp_device_history_info.py | 106 + .../dnac/plugins/modules/pnp_device_import.py | 1469 +++++ .../cisco/dnac/plugins/modules/pnp_device_info.py | 544 ++ .../cisco/dnac/plugins/modules/pnp_device_reset.py | 116 + .../dnac/plugins/modules/pnp_device_unclaim.py | 68 + .../dnac/plugins/modules/pnp_global_settings.py | 305 ++ .../plugins/modules/pnp_global_settings_info.py | 122 + .../cisco/dnac/plugins/modules/pnp_intent.py | 963 ++++ .../plugins/modules/pnp_server_profile_update.py | 196 + .../modules/pnp_smart_account_domains_info.py | 63 + .../plugins/modules/pnp_virtual_account_add.py | 197 + .../modules/pnp_virtual_account_deregister.py | 99 + .../modules/pnp_virtual_account_devices_sync.py | 196 + .../pnp_virtual_account_sync_result_info.py | 103 + .../plugins/modules/pnp_virtual_accounts_info.py | 68 + .../cisco/dnac/plugins/modules/pnp_workflow.py | 310 ++ .../plugins/modules/pnp_workflow_count_info.py | 68 + .../dnac/plugins/modules/pnp_workflow_info.py | 160 + .../plugins/modules/profiling_rules_count_info.py | 70 + .../modules/profiling_rules_in_bulk_create.py | 189 + .../dnac/plugins/modules/projects_details_info.py | 315 ++ .../dnac/plugins/modules/qos_device_interface.py | 176 + .../plugins/modules/qos_device_interface_info.py | 121 + .../qos_device_interface_info_count_info.py | 63 + .../cisco/dnac/plugins/modules/reports.py | 244 + .../plugins/modules/reports_executions_info.py | 109 + .../cisco/dnac/plugins/modules/reports_info.py | 155 + .../plugins/modules/reports_view_group_info.py | 95 + .../modules/reports_view_group_view_info.py | 138 + .../dnac/plugins/modules/reserve_ip_subpool.py | 215 + .../plugins/modules/reserve_ip_subpool_create.py | 155 + .../plugins/modules/reserve_ip_subpool_delete.py | 63 + .../plugins/modules/reserve_ip_subpool_info.py | 123 + .../plugins/modules/reserve_ip_subpool_update.py | 137 + .../cisco/dnac/plugins/modules/sda_count_info.py | 64 + .../cisco/dnac/plugins/modules/sda_device_info.py | 74 + .../dnac/plugins/modules/sda_device_role_info.py | 74 + .../cisco/dnac/plugins/modules/sda_fabric.py | 78 + .../modules/sda_fabric_authentication_profile.py | 123 + .../sda_fabric_authentication_profile_info.py | 75 + .../plugins/modules/sda_fabric_border_device.py | 203 + .../modules/sda_fabric_border_device_info.py | 239 + .../modules/sda_fabric_control_plane_device.py | 102 + .../sda_fabric_control_plane_device_info.py | 75 + .../dnac/plugins/modules/sda_fabric_edge_device.py | 100 + .../plugins/modules/sda_fabric_edge_device_info.py | 74 + .../cisco/dnac/plugins/modules/sda_fabric_info.py | 69 + .../cisco/dnac/plugins/modules/sda_fabric_site.py | 92 + .../dnac/plugins/modules/sda_fabric_site_info.py | 69 + .../cisco/dnac/plugins/modules/sda_multicast.py | 130 + .../dnac/plugins/modules/sda_multicast_info.py | 83 + .../sda_port_assignment_for_access_point.py | 111 + .../sda_port_assignment_for_access_point_info.py | 81 + .../modules/sda_port_assignment_for_user_device.py | 122 + .../sda_port_assignment_for_user_device_info.py | 80 + .../dnac/plugins/modules/sda_provision_device.py | 109 + .../plugins/modules/sda_provision_device_info.py | 73 + .../dnac/plugins/modules/sda_virtual_network.py | 102 + .../plugins/modules/sda_virtual_network_info.py | 79 + .../plugins/modules/sda_virtual_network_ip_pool.py | 159 + .../modules/sda_virtual_network_ip_pool_info.py | 87 + .../dnac/plugins/modules/sda_virtual_network_v2.py | 116 + .../plugins/modules/sda_virtual_network_v2_info.py | 76 + .../modules/security_advisories_devices_info.py | 70 + .../security_advisories_ids_per_device_info.py | 75 + .../plugins/modules/security_advisories_info.py | 77 + .../modules/security_advisories_per_device_info.py | 82 + .../modules/security_advisories_summary_info.py | 94 + .../cisco/dnac/plugins/modules/sensor.py | 262 + .../cisco/dnac/plugins/modules/sensor_info.py | 89 + .../cisco/dnac/plugins/modules/sensor_test_run.py | 59 + .../modules/sensor_test_template_duplicate.py | 191 + .../plugins/modules/sensor_test_template_edit.py | 268 + .../plugins/modules/service_provider_create.py | 82 + .../dnac/plugins/modules/service_provider_info.py | 82 + .../modules/service_provider_profile_delete.py | 63 + .../plugins/modules/service_provider_update.py | 86 + .../dnac/plugins/modules/site_assign_credential.py | 91 + .../dnac/plugins/modules/site_assign_device.py | 69 + .../cisco/dnac/plugins/modules/site_count_info.py | 68 + .../cisco/dnac/plugins/modules/site_create.py | 147 + .../cisco/dnac/plugins/modules/site_delete.py | 62 + .../dnac/plugins/modules/site_design_floormap.py | 88 + .../plugins/modules/site_design_floormap_info.py | 79 + .../cisco/dnac/plugins/modules/site_health_info.py | 144 + .../cisco/dnac/plugins/modules/site_info.py | 115 + .../cisco/dnac/plugins/modules/site_intent.py | 592 ++ .../dnac/plugins/modules/site_membership_info.py | 101 + .../cisco/dnac/plugins/modules/site_update.py | 154 + .../cisco/dnac/plugins/modules/snmp_properties.py | 88 + .../dnac/plugins/modules/snmp_properties_info.py | 71 + .../modules/snmpv2_read_community_credential.py | 103 + .../modules/snmpv2_write_community_credential.py | 103 + .../dnac/plugins/modules/snmpv3_credential.py | 139 + .../plugins/modules/swim_image_details_info.py | 198 + .../dnac/plugins/modules/swim_import_local.py | 84 + .../dnac/plugins/modules/swim_import_via_url.py | 102 + .../cisco/dnac/plugins/modules/swim_intent.py | 718 +++ .../plugins/modules/swim_trigger_activation.py | 104 + .../plugins/modules/swim_trigger_distribution.py | 77 + .../dnac/plugins/modules/syslog_config_create.py | 87 + .../dnac/plugins/modules/syslog_config_update.py | 87 + .../plugins/modules/system_health_count_info.py | 76 + .../dnac/plugins/modules/system_health_info.py | 108 + .../modules/system_performance_historical_info.py | 103 + .../plugins/modules/system_performance_info.py | 105 + .../cisco/dnac/plugins/modules/tag.py | 171 + .../cisco/dnac/plugins/modules/tag_count_info.py | 93 + .../cisco/dnac/plugins/modules/tag_info.py | 166 + .../cisco/dnac/plugins/modules/tag_member.py | 98 + .../dnac/plugins/modules/tag_member_count_info.py | 83 + .../cisco/dnac/plugins/modules/tag_member_info.py | 103 + .../dnac/plugins/modules/tag_member_type_info.py | 65 + .../cisco/dnac/plugins/modules/tag_membership.py | 80 + .../cisco/dnac/plugins/modules/task_count_info.py | 113 + .../cisco/dnac/plugins/modules/task_info.py | 176 + .../dnac/plugins/modules/task_operation_info.py | 101 + .../cisco/dnac/plugins/modules/task_tree_info.py | 89 + .../cisco/dnac/plugins/modules/template_intent.py | 1065 ++++ .../cisco/dnac/plugins/modules/template_preview.py | 78 + .../dnac/plugins/modules/templates_details_info.py | 372 ++ .../cisco/dnac/plugins/modules/threat_detail.py | 104 + .../dnac/plugins/modules/threat_detail_count.py | 92 + .../cisco/dnac/plugins/modules/threat_summary.py | 91 + .../dnac/plugins/modules/topology_layer_2_info.py | 128 + .../dnac/plugins/modules/topology_layer_3_info.py | 128 + .../modules/topology_network_health_info.py | 107 + .../dnac/plugins/modules/topology_physical_info.py | 128 + .../dnac/plugins/modules/topology_site_info.py | 78 + .../plugins/modules/topology_vlan_details_info.py | 65 + .../dnac/plugins/modules/transit_peer_network.py | 121 + .../plugins/modules/transit_peer_network_info.py | 80 + .../modules/user_enrichment_details_info.py | 174 + .../plugins/modules/wireless_dynamic_interface.py | 91 + .../modules/wireless_dynamic_interface_info.py | 73 + .../plugins/modules/wireless_enterprise_ssid.py | 197 + .../modules/wireless_enterprise_ssid_info.py | 96 + .../cisco/dnac/plugins/modules/wireless_profile.py | 162 + .../dnac/plugins/modules/wireless_profile_info.py | 87 + .../modules/wireless_provision_access_point.py | 99 + .../modules/wireless_provision_device_create.py | 116 + .../modules/wireless_provision_device_update.py | 116 + .../wireless_provision_ssid_create_provision.py | 140 + .../wireless_provision_ssid_delete_reprovision.py | 71 + .../dnac/plugins/modules/wireless_psk_override.py | 77 + .../dnac/plugins/modules/wireless_rf_profile.py | 225 + .../plugins/modules/wireless_rf_profile_info.py | 99 + .../modules/wireless_sensor_test_results_info.py | 148 + .../cisco/dnac/plugins/plugin_utils/__init__.py | 0 .../cisco/dnac/plugins/plugin_utils/dnac.py | 245 + .../cisco/dnac/plugins/plugin_utils/exceptions.py | 23 + ansible_collections/cisco/dnac/requirements.txt | 1 + .../cisco/dnac/tests/sanity/ignore-2.10.txt | 722 +++ .../cisco/dnac/tests/sanity/ignore-2.11.txt | 1073 ++++ .../cisco/dnac/tests/sanity/ignore-2.12.txt | 20 + .../cisco/dnac/tests/sanity/ignore-2.13.txt | 10 + .../cisco/dnac/tests/sanity/ignore-2.14.txt | 10 + .../cisco/dnac/tests/sanity/ignore-2.15.txt | 10 + .../cisco/dnac/tests/sanity/ignore-2.9.txt | 722 +++ .../cisco/dnac/tests/unit/modules/dnac/__init__.py | 0 .../dnac/tests/unit/modules/dnac/dnac_module.py | 140 + .../unit/modules/dnac/fixtures/pnp_intent.json | 166 + .../unit/modules/dnac/fixtures/site_intent.json | 186 + .../unit/modules/dnac/fixtures/swim_intent.json | 211 + .../modules/dnac/fixtures/template_intent.json | 244 + .../tests/unit/modules/dnac/test_pnp_intent.py | 303 ++ .../tests/unit/modules/dnac/test_site_intent.py | 251 + .../tests/unit/modules/dnac/test_swim_intent.py | 309 ++ .../unit/modules/dnac/test_template_intent.py | 244 + 789 files changed, 107981 insertions(+) create mode 100644 ansible_collections/cisco/dnac/.DS_Store create mode 100644 ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/config.yml create mode 100644 ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 ansible_collections/cisco/dnac/.github/workflows/docs.yml create mode 100644 ansible_collections/cisco/dnac/.github/workflows/sanity_tests.yml create mode 100644 ansible_collections/cisco/dnac/.gitignore create mode 100644 ansible_collections/cisco/dnac/.vscode/settings.json create mode 100644 ansible_collections/cisco/dnac/FILES.json create mode 100644 ansible_collections/cisco/dnac/LICENSE create mode 100644 ansible_collections/cisco/dnac/MANIFEST.json create mode 100644 ansible_collections/cisco/dnac/Makefile create mode 100644 ansible_collections/cisco/dnac/README.md create mode 100644 ansible_collections/cisco/dnac/changelogs/changelog.yaml create mode 100644 ansible_collections/cisco/dnac/docs/Makefile create mode 100644 ansible_collections/cisco/dnac/docs/_gh_include/footer.inc create mode 100644 ansible_collections/cisco/dnac/docs/_gh_include/header.inc create mode 100644 ansible_collections/cisco/dnac/docs/conf.py create mode 100644 ansible_collections/cisco/dnac/docs/index.rst create mode 100644 ansible_collections/cisco/dnac/docs/requirements.txt create mode 100644 ansible_collections/cisco/dnac/meta/runtime.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/application_set_info.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/application_sets.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/applications.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/authentication_import.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/command_runner_run_command.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/configuration_template_version_create.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/credentials.template create mode 100644 ansible_collections/cisco/dnac/playbooks/credentials.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/device_details.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/discovery.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/download_device_cmd_runner_output.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/files/test.template create mode 100644 ansible_collections/cisco/dnac/playbooks/global_credentials.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/global_credentials_info.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/global_pool.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/hosts create mode 100644 ansible_collections/cisco/dnac/playbooks/image_details.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/import_image_file.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/network_device_custom_prompt_info.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/network_device_info.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/network_device_update_role.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/pnp_device.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/reports_executions_info.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/reserve_ip_subpool.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/sda_fabric.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/sda_fabric_site.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/sda_virtual_network_v2.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/tag.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/template.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/template_pnp_intent.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/test_swim_module.yml create mode 100644 ansible_collections/cisco/dnac/playbooks/wireless_enterprise_ssid.yml create mode 100644 ansible_collections/cisco/dnac/plugins/.DS_Store create mode 100644 ansible_collections/cisco/dnac/plugins/README.md create mode 100644 ansible_collections/cisco/dnac/plugins/__init__.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/app_policy_default_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/app_policy_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/app_policy_intent_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/application_sets.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/application_sets_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/application_sets_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/applications.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/applications_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/applications_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/applications_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/assign_device_to_site.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/associate_site_to_network_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate_p12.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/buildings_planned_access_points_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/business_sda_virtual_network_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/cli_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/client_detail_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/client_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/client_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/client_proximity_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/command_runner_run_command.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/compliance_check_run.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/compliance_device_by_id_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/compliance_device_details_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/compliance_device_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/compliance_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/compliance_device_status_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_clone.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_v2.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_export_project.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_export_template.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_import_project.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_import_template.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_project.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_project_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_version_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/configuration_template_version_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_configurations_export.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_credential_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_credential_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_credential_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_credential_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_family_identifiers_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_interface_by_ip_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_interface_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_interface_isis_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_interface_ospf_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_replacement.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_replacement_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_replacement_deploy.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/device_replacement_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/disassociate_site_to_network_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_operationstatus_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_device_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_job_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_range_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/discovery_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/dna_command_runner_keywords_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/dnacaap_management_execution_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_api_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_artifact_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_artifact_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_config_connector_types_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_email_config_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_email_config_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_parent_records_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_series_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_series_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_details_email_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_details_rest_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_details_syslog_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_email.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_email_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_rest.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_rest_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_webhook_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/event_webhook_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/file_import.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/file_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/file_namespace_files_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/file_namespaces_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/global_credential_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/global_credential_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/global_credential_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/global_pool.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/global_pool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/golden_image_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/golden_tag_image_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/golden_tag_image_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/http_read_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/http_write_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/interface_network_device_detail_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/interface_network_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/interface_network_device_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/interface_operation_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/interface_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/issues_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/issues_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/itsm_cmdb_sync_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_failed_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_retry.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/lan_automation_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/lan_automation_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/lan_automation_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/lan_automation_log_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/lan_automation_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_device_deregistration.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_device_license_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_device_license_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_device_registration.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_smart_account_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_term_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_usage_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_virtual_account_change.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/license_virtual_account_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/netconf_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_by_ip_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_by_serial_number_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_chassis_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_config_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_config_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_equipment_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_export.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_functional_capability_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_global_polling_interval_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_interface_neighbor_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_interface_poe_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_inventory_insight_link_mismatch_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_lexicographically_sorted_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_linecard_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_meraki_organization_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_module_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_module_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_poe_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_polling_interval_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_register_for_wsa_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_stack_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_supervisor_card_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_sync.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_update_role.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_vlan_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_wireless_lan_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_device_with_snmp_v3_des_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/network_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/nfv_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/nfv_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/nfv_provision.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/nfv_provision_detail_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/nfv_provision_details.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/path_trace.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/path_trace_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/planned_access_points_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/platform_nodes_configuration_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/platform_release_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_authorize.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_claim.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_claim_to_site.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_config_preview.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_history_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_import.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_reset.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_device_unclaim.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_global_settings.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_global_settings_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_server_profile_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_smart_account_domains_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_add.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_deregister.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_devices_sync.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_sync_result_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_virtual_accounts_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_workflow.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_workflow_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/pnp_workflow_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/profiling_rules_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/profiling_rules_in_bulk_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/projects_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/qos_device_interface.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reports.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reports_executions_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reports_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reports_view_group_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reports_view_group_view_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_device_role_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_site.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_fabric_site_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_multicast.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_multicast_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_provision_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_provision_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_virtual_network.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/security_advisories_devices_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/security_advisories_ids_per_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/security_advisories_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/security_advisories_per_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/security_advisories_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sensor.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sensor_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sensor_test_run.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sensor_test_template_duplicate.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/sensor_test_template_edit.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/service_provider_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/service_provider_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/service_provider_profile_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/service_provider_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_assign_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_assign_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_design_floormap.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_design_floormap_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_membership_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/site_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/snmp_properties.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/snmp_properties_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/snmpv2_read_community_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/snmpv2_write_community_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/snmpv3_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/swim_image_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/swim_import_local.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/swim_import_via_url.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/swim_trigger_activation.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/swim_trigger_distribution.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/syslog_config_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/syslog_config_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/system_health_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/system_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/system_performance_historical_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/system_performance_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag_member.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag_member_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag_member_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag_member_type_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/tag_membership.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/task_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/task_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/task_operation_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/task_tree_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/template_preview.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/templates_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/threat_detail.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/threat_detail_count.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/threat_summary.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/topology_layer_2_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/topology_layer_3_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/topology_network_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/topology_physical_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/topology_site_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/topology_vlan_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/transit_peer_network.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/transit_peer_network_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/user_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_provision_access_point.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_create_provision.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_delete_reprovision.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_psk_override.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/action/wireless_sensor_test_results_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/doc_fragments/__init__.py create mode 100644 ansible_collections/cisco/dnac/plugins/doc_fragments/intent_params.py create mode 100644 ansible_collections/cisco/dnac/plugins/doc_fragments/module.py create mode 100644 ansible_collections/cisco/dnac/plugins/doc_fragments/module_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/module_utils/__init__.py create mode 100644 ansible_collections/cisco/dnac/plugins/module_utils/dnac.py create mode 100644 ansible_collections/cisco/dnac/plugins/module_utils/exceptions.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/__init__.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/app_policy_default_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/app_policy_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/app_policy_intent_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/application_sets.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/application_sets_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/application_sets_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/applications.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/applications_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/applications_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/applications_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/assign_device_to_site.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/associate_site_to_network_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate_p12.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/buildings_planned_access_points_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/business_sda_virtual_network_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/cli_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/client_detail_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/client_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/client_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/client_proximity_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/command_runner_run_command.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/compliance_check_run.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/compliance_device_by_id_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/compliance_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/compliance_device_status_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_clone.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_v2.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_project.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_template.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_project.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_template.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_project.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_project_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_configurations_export.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_credential_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_credential_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_credential_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_credential_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_family_identifiers_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_interface_by_ip_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_interface_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_interface_isis_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_interface_ospf_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_replacement.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_replacement_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_replacement_deploy.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/device_replacement_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/disassociate_site_to_network_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_operationstatus_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_device_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_job_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_range_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/discovery_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/dna_command_runner_keywords_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/dnacaap_management_execution_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_api_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_artifact_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_artifact_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_config_connector_types_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_email_config_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_email_config_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_parent_records_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_series_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_series_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_email_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_rest_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_syslog_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_email.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_email_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_webhook_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/event_webhook_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/file_import.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/file_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/file_namespace_files_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/file_namespaces_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/global_credential_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/global_credential_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/global_credential_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/global_pool.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/global_pool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/golden_image_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/http_read_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/http_write_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/interface_network_device_detail_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/interface_network_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/interface_network_device_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/interface_operation_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/interface_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/issues_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/issues_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/itsm_cmdb_sync_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_failed_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_retry.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/lan_automation_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/lan_automation_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/lan_automation_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/lan_automation_log_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/lan_automation_status_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_device_deregistration.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_device_license_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_device_license_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_device_registration.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_smart_account_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_term_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_usage_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_change.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/netconf_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_by_ip_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_by_serial_number_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_chassis_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_config_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_config_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_equipment_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_export.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_functional_capability_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_global_polling_interval_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_interface_neighbor_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_interface_poe_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_inventory_insight_link_mismatch_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_lexicographically_sorted_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_linecard_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_meraki_organization_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_module_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_module_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_poe_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_polling_interval_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_range_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_register_for_wsa_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_stack_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_supervisor_card_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_sync.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_update_role.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_vlan_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_wireless_lan_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_device_with_snmp_v3_des_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/network_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/nfv_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/nfv_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/nfv_provision.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/nfv_provision_detail_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/nfv_provision_details.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/path_trace.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/path_trace_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/planned_access_points_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/platform_nodes_configuration_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/platform_release_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_authorize.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim_to_site.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_config_preview.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_history_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_import.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_reset.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_device_unclaim.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_intent.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_server_profile_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_smart_account_domains_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_add.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_deregister.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_devices_sync.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_sync_result_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_accounts_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_workflow.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/profiling_rules_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/profiling_rules_in_bulk_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/projects_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/qos_device_interface.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reports.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reports_executions_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reports_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reports_view_group_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reports_view_group_view_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_device_role_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_multicast.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_multicast_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_provision_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_provision_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/security_advisories_devices_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/security_advisories_ids_per_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/security_advisories_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/security_advisories_per_device_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/security_advisories_summary_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sensor.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sensor_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sensor_test_run.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_duplicate.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_edit.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/service_provider_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/service_provider_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/service_provider_profile_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/service_provider_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_assign_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_assign_device.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_delete.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_design_floormap.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_design_floormap_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_intent.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_membership_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/site_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/snmp_properties.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/snmp_properties_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/snmpv2_read_community_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/snmpv2_write_community_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/snmpv3_credential.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/swim_image_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/swim_import_local.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/swim_import_via_url.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/swim_intent.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/swim_trigger_activation.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/swim_trigger_distribution.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/syslog_config_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/syslog_config_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/system_health_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/system_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/system_performance_historical_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/system_performance_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag_member.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag_member_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag_member_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag_member_type_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/tag_membership.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/task_count_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/task_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/task_operation_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/task_tree_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/template_intent.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/template_preview.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/templates_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/threat_detail.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/threat_detail_count.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/threat_summary.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/topology_layer_2_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/topology_layer_3_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/topology_network_health_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/topology_physical_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/topology_site_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/topology_vlan_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/transit_peer_network.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/transit_peer_network_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/user_enrichment_details_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_provision_access_point.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_create.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_update.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_create_provision.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_delete_reprovision.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_psk_override.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/modules/wireless_sensor_test_results_info.py create mode 100644 ansible_collections/cisco/dnac/plugins/plugin_utils/__init__.py create mode 100644 ansible_collections/cisco/dnac/plugins/plugin_utils/dnac.py create mode 100644 ansible_collections/cisco/dnac/plugins/plugin_utils/exceptions.py create mode 100644 ansible_collections/cisco/dnac/requirements.txt create mode 100644 ansible_collections/cisco/dnac/tests/sanity/ignore-2.10.txt create mode 100644 ansible_collections/cisco/dnac/tests/sanity/ignore-2.11.txt create mode 100644 ansible_collections/cisco/dnac/tests/sanity/ignore-2.12.txt create mode 100644 ansible_collections/cisco/dnac/tests/sanity/ignore-2.13.txt create mode 100644 ansible_collections/cisco/dnac/tests/sanity/ignore-2.14.txt create mode 100644 ansible_collections/cisco/dnac/tests/sanity/ignore-2.15.txt create mode 100644 ansible_collections/cisco/dnac/tests/sanity/ignore-2.9.txt create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/__init__.py create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/dnac_module.py create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/pnp_intent.json create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/site_intent.json create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/swim_intent.json create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/template_intent.json create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_pnp_intent.py create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_site_intent.py create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_swim_intent.py create mode 100644 ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_template_intent.py (limited to 'ansible_collections/cisco/dnac') diff --git a/ansible_collections/cisco/dnac/.DS_Store b/ansible_collections/cisco/dnac/.DS_Store new file mode 100644 index 00000000..fdb15c7c Binary files /dev/null and b/ansible_collections/cisco/dnac/.DS_Store differ diff --git a/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/bug_report.md b/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..de27959e --- /dev/null +++ b/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Prerequisites** +* [ ] Have you tested the operation in the API directly? +* [ ] Do you have the latest Ansible collection version? +* [ ] Review the [compatibility matrix](https://github.com/cisco-en-programmability/dnacenter-ansible/tree/main#compatibility-matrix) before opening an issue. + +**Describe the bug** +A clear and concise description of what the bug is. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +Please provide an screenshot of the successful API call with cuRL, Postman, etc. + +**Environment (please complete the following information):** +* Cisco DNA Center Version and patch: +* Ansible Version: +* Collection version: +* OS Version: + +**Additional context** +Add any other context about the problem here. diff --git a/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/config.yml b/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..3ba13e0c --- /dev/null +++ b/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/feature_request.md b/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/ansible_collections/cisco/dnac/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/ansible_collections/cisco/dnac/.github/workflows/docs.yml b/ansible_collections/cisco/dnac/.github/workflows/docs.yml new file mode 100644 index 00000000..1f69ba0d --- /dev/null +++ b/ansible_collections/cisco/dnac/.github/workflows/docs.yml @@ -0,0 +1,39 @@ +name: docs + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + branches: + - main + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: configure git + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@bots.github.com" + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + - name: Install dependencies + run: make doc-setup + - name: Build docs + run: make doc + - name: commit docs + run: | + git checkout gh-pages + rm -rf $(basename ${GITHUB_REF}) + mv docs/_build/html $(basename ${GITHUB_REF}) + git show origin/main:docs/_gh_include/header.inc > index.html + (echo main; dirname v*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '' >> index.html + git show origin/main:docs/_gh_include/footer.inc >> index.html + git add $(basename ${GITHUB_REF}) index.html + git commit -m "update docs for $(basename ${GITHUB_REF})" || true + - name: push docs + run: git push origin gh-pages \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/.github/workflows/sanity_tests.yml b/ansible_collections/cisco/dnac/.github/workflows/sanity_tests.yml new file mode 100644 index 00000000..2f07550b --- /dev/null +++ b/ansible_collections/cisco/dnac/.github/workflows/sanity_tests.yml @@ -0,0 +1,39 @@ +name: CI +on: + push: + branches: [ main ] + pull_request: + schedule: + - cron: '0 6 * * *' +env: + NAMESPACE: cisco + COLLECTION_NAME: dnac +jobs: + sanity: + name: Sanity (â’¶${{ matrix.ansible }}) + strategy: + matrix: + ansible: + - stable-2.12 + - stable-2.13 + - stable-2.14 + - devel + runs-on: ubuntu-20.04 + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + path: cisco-en-programmability/dnacenter-ansible + - name: Create directory + run: mkdir -p ./ansible_collections/${{env.NAMESPACE}} + - name: Move repository + run: mv ./cisco-en-programmability/dnacenter-ansible ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install ansible-base (${{ matrix.ansible }}) + run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check + - name: Run sanity tests + run: ansible-test sanity --docker -v --color + working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} diff --git a/ansible_collections/cisco/dnac/.gitignore b/ansible_collections/cisco/dnac/.gitignore new file mode 100644 index 00000000..19220624 --- /dev/null +++ b/ansible_collections/cisco/dnac/.gitignore @@ -0,0 +1,21 @@ +tmp/* +__pycache__/ +.vscode/ +.tmp +.cache +*.retry +tests/test_playbooks/vars/server.yml +__pycache__ +*.pyc +*.pyo +*.swp +*.tar.gz +.pytest_cache/ +.mypy_cache/ +venv/ +/build/ +docs/plugins/ +docs/_build/ +changelogs/.plugin-cache.yaml +playbooks/credentials.yml +.DS_Store \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/.vscode/settings.json b/ansible_collections/cisco/dnac/.vscode/settings.json new file mode 100644 index 00000000..eba2abd4 --- /dev/null +++ b/ansible_collections/cisco/dnac/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "esbonio.server.enabled": true, + "esbonio.sphinx.confDir": "" +} \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/FILES.json b/ansible_collections/cisco/dnac/FILES.json new file mode 100644 index 00000000..d9731e05 --- /dev/null +++ b/ansible_collections/cisco/dnac/FILES.json @@ -0,0 +1,5675 @@ +{ + "files": [ + { + "name": ".", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": ".DS_Store", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a48eafcecc92a1a48472fb3473d567db1bfd80c0fc3b53ed508cda764fcebbfe", + "format": 1 + }, + { + "name": "LICENSE", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cef0b2884a9f43663717328019888311de5b8a62e0d24f91fc0f36939e5e50e9", + "format": 1 + }, + { + "name": "requirements.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8fe247871a4740aa0b53ba32a77319dddb8c35c8c75688837c9b0f732a0cae0d", + "format": 1 + }, + { + "name": "plugins", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/.DS_Store", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5a5dbd3e00421918a6135acbcaee52604291a894f35f63256118d0d0a0d20325", + "format": 1 + }, + { + "name": "plugins/doc_fragments", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/doc_fragments/module_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7b943c8fca0be5aaf9dac9b7290b3b7de0e0ac5eea1bc2ca3a9b7d185a472990", + "format": 1 + }, + { + "name": "plugins/doc_fragments/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/doc_fragments/module.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5f967d0b01179a2daaee8061f7120bd9bf95c33947ceeca602307f6a9a7a244b", + "format": 1 + }, + { + "name": "plugins/doc_fragments/intent_params.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "07a9cf86b25669319b7c2876b33415a9f44e1f103927afdcca31064f21a23156", + "format": 1 + }, + { + "name": "plugins/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ce019c2fa0b74e9457b36287058bb0f80bde03324d1499da1a80cd4a9b7ae4e1", + "format": 1 + }, + { + "name": "plugins/action", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/action/tag_member.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3d27dab6d8a2b0b883879237b7ddd3cacccb0877fe57e4d31b56b34ec58ef13b", + "format": 1 + }, + { + "name": "plugins/action/disasterrecovery_system_operationstatus_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "396d0e2333033be14af043e4f2f43945238013ff6ecad56344e93b38fd8bd1e5", + "format": 1 + }, + { + "name": "plugins/action/network_device_by_serial_number_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7de65e6ba9c462e3955c771768d3f828edc821c99ec24b7c52e12667d9187883", + "format": 1 + }, + { + "name": "plugins/action/wireless_enterprise_ssid_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5042c27f1a39ee9cd90aad9a615c548c9992cf5d58d42cdabb1f452d14c8a50d", + "format": 1 + }, + { + "name": "plugins/action/sda_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e93f7f401bdfaffe8a3032ca9cf6f5f7c5404a4e5a996daaf6c25b3289d5c9f8", + "format": 1 + }, + { + "name": "plugins/action/network_device_custom_prompt.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c44b67d7bcfb65027aa62979c249f26f1941b367d0064e5210cf583cfc8d3792", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_deploy_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "900244523a6c7789e84042419ee4b1937edcdcc4913f108dc257ec5b46740d16", + "format": 1 + }, + { + "name": "plugins/action/file_namespaces_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "65c09154c8411838c47c2297c4d4dbc860bfc33983d8bb404cbe31b1544f7398", + "format": 1 + }, + { + "name": "plugins/action/syslog_config_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bbae571940060860c4a5d711dc0284f28d53f94e12b51bdd60d355ddb968a440", + "format": 1 + }, + { + "name": "plugins/action/buildings_planned_access_points_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "38c1e2d879a6abe346236147f60f263657c8dfae60f7e6e3a55b01df772c09bd", + "format": 1 + }, + { + "name": "plugins/action/reports_view_group_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8a325c0f5aeeeffb0e485e8846d30c8e717229f14987807d9cee81d7a0dbb437", + "format": 1 + }, + { + "name": "plugins/action/wireless_provision_ssid_create_provision.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ce5ae97f4c0ae1f22329c3291fd874aa6657de841f1555a93d1803c8071df127", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_claim.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "43c3fee49202d0664a07962d27ec649d537cb207f5c86d3e0a261eb02b559efe", + "format": 1 + }, + { + "name": "plugins/action/snmpv2_read_community_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7ede14a53420c8775bba0e65e8ab4b8d90806767eed06f53364aa4da2bbe0955", + "format": 1 + }, + { + "name": "plugins/action/snmp_properties.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e903e57978341f0779028c636c1537ecaf62fc9606719102601c4d60bdcec165", + "format": 1 + }, + { + "name": "plugins/action/wireless_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a487047edfb499f74180880b7f258b1aca977815eb1a29dd4b9bf761f2e55516", + "format": 1 + }, + { + "name": "plugins/action/network_device_config_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0897d5525167aa579f2f49d454ebf8e241749bee8d26830bc30fe67f2d5c6033", + "format": 1 + }, + { + "name": "plugins/action/tag_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "16da92dcac2048c1e68633896da6c99a003bf952f6a5d3f15a97ae245e572962", + "format": 1 + }, + { + "name": "plugins/action/site_assign_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4245b552fe01e78230d6c245c691935738eff879f61f4f6f2f86ea5d459da1d3", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_control_plane_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3995c873454db26b4c2f170a3990279a67278c5c177bfec945c17a6f20d6ccad", + "format": 1 + }, + { + "name": "plugins/action/profiling_rules_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "23b66e85b4941972f695c00e824434d150c24f10428e64ab4fc95437fa8b6792", + "format": 1 + }, + { + "name": "plugins/action/task_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e529d15343acf5348b1d63205ff41130231c659454cad468794c7e02b40642bb", + "format": 1 + }, + { + "name": "plugins/action/wireless_sensor_test_results_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a904e42c9f800997b73c8c8934aa94193bf8ed7f0eb6d97845ef4a7fa7a2c37b", + "format": 1 + }, + { + "name": "plugins/action/wireless_dynamic_interface.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7a4ee0fc872f5994b73cde2e13591dc98670496ce815720f2cd14f907a4b08ec", + "format": 1 + }, + { + "name": "plugins/action/nfv_provision_detail_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "68368a37cd271a47de91e9f5b229150cc61bd91edb760edc4df71455850fb04f", + "format": 1 + }, + { + "name": "plugins/action/interface_operation_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "220a5bc1521ea255c04f0334e8998b2d8d3fb0ac3b216ac7b363b0cf2a77b2b0", + "format": 1 + }, + { + "name": "plugins/action/tag_member_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "de1e6a70d75ba1b1208f81fc1401897f16945bb702e0abeccc79d3b090b35267", + "format": 1 + }, + { + "name": "plugins/action/lan_automation_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a5fe4fd076c7b8f73dbb693cf4cca143fc1042ba0c25123a9b6531126f9d05d5", + "format": 1 + }, + { + "name": "plugins/action/endpoint_analytics_profiling_rules.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "98c2afcc621016a761848cb853036d533498bc437160937d07e128a8bed5dd65", + "format": 1 + }, + { + "name": "plugins/action/business_sda_wireless_controller_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8c81b9dfcb414b0734472388fe874f93786fc4d1c7899aafac52256f67553e9a", + "format": 1 + }, + { + "name": "plugins/action/associate_site_to_network_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7bc94ba2885e8736e1fec8fa30d51d686556dedc4f5adb653643d9c963427bf7", + "format": 1 + }, + { + "name": "plugins/action/compliance_check_run.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "39c960885d52842cf4ec26364627048cc7668b778d066b8966740e4376103566", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_unclaim.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "32e8810329180beddd34661fb3bd0832119fb832775617d2f88bc9253346d0e3", + "format": 1 + }, + { + "name": "plugins/action/interface_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "92ee9dec0b92afdabade328f0e16903aa45ae10c2f8098a65d3187f4008d401c", + "format": 1 + }, + { + "name": "plugins/action/lan_automation_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "211b18e42769568a4900a9aec2c7dc0516bc7a595decbb25841873c63aa43903", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_authorize.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c4af732ced83cb878c6c45c866c59e34f958411447552cd9df3495f2b735684c", + "format": 1 + }, + { + "name": "plugins/action/task_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "101bc557df51dde0ba35f2a37b87beb96b1c87838b8d9f625d5857c1cf187c79", + "format": 1 + }, + { + "name": "plugins/action/app_policy_intent_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "365cefef5571c6c96e1defbcb27755f5d1b2a8446a11a1556706add6ec6f0874", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_import.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "655a3d810bf3f1248d25fa5772a1643d94fba3de4150a4c08e04e855cea0e1ac", + "format": 1 + }, + { + "name": "plugins/action/authentication_import_certificate_p12.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "519a664842bfec993a20228b88f07d68e147d2a640ee9333bb985b041e3e87ca", + "format": 1 + }, + { + "name": "plugins/action/topology_network_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "248750c93ab26cf710c212594b616128bba496a2f7ccc8a9f489cbf9472c7fdd", + "format": 1 + }, + { + "name": "plugins/action/wireless_provision_device_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a30e2001c132ed0444446e537620f142f729b8c76cc8d6d6825b8ff2a4e12f43", + "format": 1 + }, + { + "name": "plugins/action/discovery_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fcf22cf17e705eadafe60a27439776ddaebc72e76ceaeb9237d5ea4ddddf8190", + "format": 1 + }, + { + "name": "plugins/action/discovery_device_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "378cbcb8f8cf91c568e356224512de483cf23d8b1eb8dabcd0573e2e1b3bf5ae", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_email.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4d3f33f3e54b73ed9e759853ffa0a18b90879250859a27aa17306b538b0a8c59", + "format": 1 + }, + { + "name": "plugins/action/sensor.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bf4f5c9cbbad79b07e49256fe082e5d35f1b21096e9d0a0f63dcb64af315c364", + "format": 1 + }, + { + "name": "plugins/action/site_design_floormap.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6ddc4a5601df5b1911faf50f5016712f161d9d03f7c8d795e8a76fadb0547c41", + "format": 1 + }, + { + "name": "plugins/action/global_pool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9290800a874c3982220e588c6eab6dedb80e7eb007da1fec8a010820f5ddcc6f", + "format": 1 + }, + { + "name": "plugins/action/device_interface_by_ip_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1fffb1a05737defab84898b53613b6669f595f830be8e5405f6550c63b2fb2f6", + "format": 1 + }, + { + "name": "plugins/action/network_device_chassis_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "783b01488af68de8b75d9b19b2f1ea4ee0b60735ef335544a7405162e5b766cf", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_authentication_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5eec83405b1d12d7d3b08915ff927d5ce861d439910a02772c65867f94d7f54c", + "format": 1 + }, + { + "name": "plugins/action/client_detail_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fa28affa3883fe6a27022030e57804e9e99d057bdac4e13fe10d86a58d6dc5b5", + "format": 1 + }, + { + "name": "plugins/action/license_term_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b342ccab6662fab804db27f9a03090fb7175bba390c969f41b22a8db08d2decd", + "format": 1 + }, + { + "name": "plugins/action/license_device_deregistration.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9f98711a1a0ffad95d51644fa45f7ecb2bd23e98b7f9a761dcc7070e190fd585", + "format": 1 + }, + { + "name": "plugins/action/device_interface_ospf_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "51ea13ac1cb1b75d1d874b957e573e25ebbd519a9d0f1dccb4353ed72d46da34", + "format": 1 + }, + { + "name": "plugins/action/sda_virtual_network_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3279d7b1f47d5e4aed55dcd6955bc363a70c5aea6b73508e04aab2987c8a910b", + "format": 1 + }, + { + "name": "plugins/action/discovery_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "843ec3b3d15f0aba838c6a6dfbe3c85ebe6f65ff162b86f99b34e9a43f72ddbb", + "format": 1 + }, + { + "name": "plugins/action/business_sda_hostonboarding_ssid_ippool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ac291928c7065fde0f396d9507bda00f413232b90547d589f20f67f8129f9e94", + "format": 1 + }, + { + "name": "plugins/action/business_sda_wireless_controller_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fda77f6375b79e9c1a7fdfdb80f19ff0ce839b5add7116e69c9bf1402403d786", + "format": 1 + }, + { + "name": "plugins/action/wireless_provision_device_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fa1880059ce0219f4cf026f6680f742d10704826148d2ad0a03eef80f4995d7a", + "format": 1 + }, + { + "name": "plugins/action/network_device_sync.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "df9dedcba629d8f569c8ca6e1fe5b484bd2cb1cf1f91281f76acfd7a457b6446", + "format": 1 + }, + { + "name": "plugins/action/wireless_rf_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bb4d9a7e3d4d9f12030a0a15dd40ff3aa71e3b55b98179abb955260cf71df6e5", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_site_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "829b2e85be1e2c7af105e2565977036a8566c4525ba9dd84df4511046fda03eb", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_syslog_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "10439c8dd6fa1616c3e7278f89971e3732582fd5e8b7da85e0702bf473d89b7d", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_import_project.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cef157a5e7c05ab98d66813e16d626eda82ff608c99726b6b95d3693ea2b4829", + "format": 1 + }, + { + "name": "plugins/action/topology_vlan_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "aa2cf4497cd08bfef2a614118bf4485b3c6f04137064fd1b51256684e8b0a290", + "format": 1 + }, + { + "name": "plugins/action/site_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2f094d2d29329904b57ae0d9a7a5166f26296b87cb598319f3128f51e17e5954", + "format": 1 + }, + { + "name": "plugins/action/event_series_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6fd81a9f25f5c4a9c00244b74c3544b516a1c20779902e7ecee70ee6b82d5410", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_clone.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4c41101b0db0a2104b4bcbb6364fc531ce81c4a2ad1de759aec2d2cf20455812", + "format": 1 + }, + { + "name": "plugins/action/swim_image_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f4b380d06a479cb9624af131afef733a884c5877b35533f748c461f1f924f3d9", + "format": 1 + }, + { + "name": "plugins/action/sda_provision_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "608eb5680afa74cb016012cedeb254278529043e061b948ff8797d96ff4ff7ee", + "format": 1 + }, + { + "name": "plugins/action/system_performance_historical_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dd6801599f5621a66538b6034cb8430a204e1aa43299bf2bca24e70e0c6a715d", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_control_plane_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1843e4e2fca21b163a948a7e702879f156063b573f87d807b96d583a5f759c43", + "format": 1 + }, + { + "name": "plugins/action/threat_detail.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c51655dd0a90b6c55a74d91107149f91deab11d213efc5b343d7262c480a9cb2", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_version_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "609ed34bf187c357d1c69cd738626b36f679e8f6c72b367ba233d527af026df2", + "format": 1 + }, + { + "name": "plugins/action/syslog_config_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0c391f241e6b92db7030dac869881acffb3d5204f2832ca01e3fe8fc1dcf1522", + "format": 1 + }, + { + "name": "plugins/action/nfv_provision_details.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cf4acdb0c6468dc0ef90f1ec33bac23ec66510d1e822936141cbe53acb56b81e", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_details_rest_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8d201cb30c52241483abdd8f42cc208e15032def6b9c2f8a018f5ac17877955c", + "format": 1 + }, + { + "name": "plugins/action/discovery_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6d6df9569ea8e8991f7f4d52e86af3ac2b6c141b22bf00878d176c1ccd40b183", + "format": 1 + }, + { + "name": "plugins/action/site_design_floormap_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "80803791534b6d45e965ebfd619c42ed31c9fa2bcdc1b27fd45c470e5731debc", + "format": 1 + }, + { + "name": "plugins/action/discovery_job_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "59835ee2e162ea715c60b8eac3ab51e80a5269cd2890db007d42364d61f7f7bb", + "format": 1 + }, + { + "name": "plugins/action/global_pool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3de2ce01cc67436e6713497eedd5e9d8301489916a359e4b4c6e984afa897af", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a2c5d8a78ecbed92a5931a6b4f7a8e2ebc212a35add3fe323614314c727b190", + "format": 1 + }, + { + "name": "plugins/action/device_replacement.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5b0c0f6e37b25878be8b220dd9d7857e5ee62939152b2ef936258ad7aa464094", + "format": 1 + }, + { + "name": "plugins/action/sensor_test_template_duplicate.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2bacf940789281434e90e30b0e5e4f4b6e50ba51754b1d172fd009a65d436373", + "format": 1 + }, + { + "name": "plugins/action/wireless_dynamic_interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a45a930cd28f7d2285ee28440c5853ac1be47629f08b074f03bf58a42c7c9206", + "format": 1 + }, + { + "name": "plugins/action/discovery.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1a6eabc9e115f7a120adb9ca950b24373f2ded1977fb44e06d8a2dfa68a487db", + "format": 1 + }, + { + "name": "plugins/action/qos_device_interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4781316fad2efab3b259615df962c2b0e83334c589e21c7995e946de478d94ab", + "format": 1 + }, + { + "name": "plugins/action/pnp_workflow_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "76bc5c782c2e10be0e4a155e8b0b4209eb12246c56135798aa72ecdf8b682faa", + "format": 1 + }, + { + "name": "plugins/action/license_smart_account_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e03537ac1a2905aaa494e21738ff2b19179fd4cc4d8106644f1f0be8fa3332ce", + "format": 1 + }, + { + "name": "plugins/action/network_device_module_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "36e7f556f4941634ca75c1f16dc1e2062abc37c5d43177d80ed7809a4dcb73a2", + "format": 1 + }, + { + "name": "plugins/action/assign_device_to_site.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2de0099f6682d64b5d7409bf3642fe04ecf614e652adb0e10d08ce5a02533a11", + "format": 1 + }, + { + "name": "plugins/action/event_config_connector_types_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3f97745d6817b310372209d46ed5a8ba9b54528e7ef05954c07765dc02fb8b30", + "format": 1 + }, + { + "name": "plugins/action/network_device_inventory_insight_link_mismatch_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5116b2d38282acf4a06446791780dbb62c21f447274818a7dbfb7500e2a2633f", + "format": 1 + }, + { + "name": "plugins/action/task_operation_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f6444f44f2a5e8e76d57e735f3e0a4842932c2190ea771f98071ab416e48dc98", + "format": 1 + }, + { + "name": "plugins/action/site_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "88e2b84df89d0ff3fe912cfedf93351de7a3fcc85d73068fa7edf4ce6ffc188d", + "format": 1 + }, + { + "name": "plugins/action/sda_virtual_network_v2.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "082e6cc1ec36a739e09bfd173a8346e3fa8b15b0a04f5740c7507709c4376869", + "format": 1 + }, + { + "name": "plugins/action/network_device_by_ip_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "de46dbf0d5176bf1f0d9e573ab829d9d3729450e5ef31b726ef401485f4c093f", + "format": 1 + }, + { + "name": "plugins/action/network_device_lexicographically_sorted_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f89a6405c0e263fbf08e612e7184dac04a234f6cbfdb114737c11e11a980a581", + "format": 1 + }, + { + "name": "plugins/action/pnp_workflow.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "463a007fa834f97a436e6b645cf47f8ba4008528219dfb832c097dcabf51d83c", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2ab1a242deee5781cca942a4c8b3a3aa88f8279085f187428ed0d2d45a707f4c", + "format": 1 + }, + { + "name": "plugins/action/topology_layer_3_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "783d4b33d3cdeafad77238e9c144a2e1570c981da2dbc72bc5815089f0db6505", + "format": 1 + }, + { + "name": "plugins/action/device_credential_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e41419e89bb6e0768415967f42cf89dedd69603f55a6e5d3c96d77944234b420", + "format": 1 + }, + { + "name": "plugins/action/snmpv2_write_community_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9833fe35d6e3ebedc6467283ab3341d350c7056e222ca7c67462f7047bf736f9", + "format": 1 + }, + { + "name": "plugins/action/global_credential_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "49c7ba14110a8b8005970cb8f57d0333d7d062d86a665be49cbc1b320d087453", + "format": 1 + }, + { + "name": "plugins/action/wireless_rf_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "61ebfbc845588cf662e7acbabc999f13101c6cc7d7d752326ab4e570b9ff7fb7", + "format": 1 + }, + { + "name": "plugins/action/applications_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "71615f34ac265b0e9f50e3272025ac534c6118c3787dcd06f3f2c0f643994396", + "format": 1 + }, + { + "name": "plugins/action/sensor_test_template_edit.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bdd4bfd7d57a7f56c6594bfb1bc5c406d0d8762fb4ad252bf05242b25a167a1d", + "format": 1 + }, + { + "name": "plugins/action/network_device_stack_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2a40aafaab21e28f223cbefcb7f4502459f2b388dc851fc0588a215704783bca", + "format": 1 + }, + { + "name": "plugins/action/global_credential_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8375dfb2323b7f01ffc5691cba62a483466145b6b70c4d6ee283515f54f81a6", + "format": 1 + }, + { + "name": "plugins/action/sda_multicast.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c027de5c404105627474d9357da3ada5c34e796bfd99afea5fdb562c4ba2361a", + "format": 1 + }, + { + "name": "plugins/action/sda_device_role_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "64c746b5a150a2779d7d8343c7c6a69a065d7947b7ff805d000e95c76926641a", + "format": 1 + }, + { + "name": "plugins/action/pnp_virtual_account_devices_sync.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "64d9457494360d40e7e06be5243ea3a59561be1df16e89fa7a89a1a42e00e911", + "format": 1 + }, + { + "name": "plugins/action/applications.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6543f4175307162813ec97875ac7a144f6348f8e31c593b426c5843f5207a105", + "format": 1 + }, + { + "name": "plugins/action/itsm_integration_events_failed_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6d3649db5b6f827d23151d975e3c890cce0db5983a93baa0cde05ecbfef94935", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_export_project.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3915460a759feefce3004a3d4c7894094049ee1d5fd452f4217f605cb96ad5c", + "format": 1 + }, + { + "name": "plugins/action/reserve_ip_subpool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7ba29285b43ce2c85ef7d2b6efc21494a7fa332cf39d69373eda40cca7a99b07", + "format": 1 + }, + { + "name": "plugins/action/network_device_interface_neighbor_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6fbb914e2a4f752be6a243f9b54b76c69bab7418b8ad3e536b87a06c05a9540e", + "format": 1 + }, + { + "name": "plugins/action/network_device_polling_interval_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8a04d4a1343d78aec2360a5d04badeed17c1600f491daaa95e6b18f15e25af50", + "format": 1 + }, + { + "name": "plugins/action/tag_membership.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5baeadf354e21ecb0710f33f1739dd74db8af6663597425e0715eeabc548db56", + "format": 1 + }, + { + "name": "plugins/action/profiling_rules_in_bulk_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "19d50252c27a09fdcece980971602ce8192aa1295deefdc38a0b8ef7f4bbc5e5", + "format": 1 + }, + { + "name": "plugins/action/event_artifact_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "11e2e9db986b80200e83de82a1d6d590abb62b661cde9ba141a867c1aec5f4e7", + "format": 1 + }, + { + "name": "plugins/action/network_device_module_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bd0bd57fa6a05a9a054cef176b9056c4d38b3891d5e49ae9461a2d7ec6797e4c", + "format": 1 + }, + { + "name": "plugins/action/global_credential_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "264e78c0ce4d45191375ceb0d2b8a4e0bae847c07a5746edd44650c53e1155c5", + "format": 1 + }, + { + "name": "plugins/action/pnp_server_profile_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "71fa543e8ec9ce8aad48d65bbee0d979c007642fc2df7a19eba38d79e96a3aed", + "format": 1 + }, + { + "name": "plugins/action/projects_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "22e7a442921c5e86b7b8058063bcc89e8036ce25f2e9ec9c96ab65e20eda5b8c", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_claim_to_site.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ddd4b8ca6b6688aabb0b360eddbeed25177061ac49d87b85e460591f5274c57d", + "format": 1 + }, + { + "name": "plugins/action/applications_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0c856f54df96da2fbef0a5ff7ffb4f4a4a56cb4671007c297bc40bd566c9a25e", + "format": 1 + }, + { + "name": "plugins/action/network_device_wireless_lan_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3f90f673ce44bddb431e1355cf9a4a66d3f0b84c10c82801f91c2ba5b858b108", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_config_preview.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "230ca79eb09cb3eac767e7fb87182faf0365f7639856edf812af86318453e113", + "format": 1 + }, + { + "name": "plugins/action/path_trace.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3f42e21564d7f1d5aeaff6c7cd69466fb6358834b8c7837c5bc5b8e71bc90039", + "format": 1 + }, + { + "name": "plugins/action/device_replacement_deploy.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "880f873ab5b8048facf93cafd602f6d7bf0521e193f07475de03a61d7a20894f", + "format": 1 + }, + { + "name": "plugins/action/system_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4101703b248890baf3e71f2968ad965b7b350aa548aad35a745e4d42401b4a18", + "format": 1 + }, + { + "name": "plugins/action/app_policy_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8cfa0d772e07fbf9831caec6686c9fff96833f028353d3494dd9c50acf0592df", + "format": 1 + }, + { + "name": "plugins/action/event_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "015301427cc638ce841fc8689683f5596c686800f6f6f1978cd4bfb96b63e93c", + "format": 1 + }, + { + "name": "plugins/action/client_proximity_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "11a7dac1a69c44d5a0b56cce55ffc31ced8979707b0298d08ceba9e7e8b79e60", + "format": 1 + }, + { + "name": "plugins/action/tag_member_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a230a1ba7a6b4a938c5231b7a13d71d6d8e835ba8a550550b49485c5f3e1794a", + "format": 1 + }, + { + "name": "plugins/action/network_device_global_polling_interval_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "de5cd82f076a8b83f1bba9391908be01c9908ecb9d0207960c12c6b8cf2238a3", + "format": 1 + }, + { + "name": "plugins/action/application_sets_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cb48da1a41dc628b37642abb18881b00929c7f1ec3c37ee8057eb3555b1720ea", + "format": 1 + }, + { + "name": "plugins/action/wireless_provision_access_point.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "06e72f0fc70b3778dca18c35f9e08e373c8ef9a6f257ce3ae27934ee595aef40", + "format": 1 + }, + { + "name": "plugins/action/site_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "91da3f2d3e87772f24fd4d657880b7048adbd5fb1787b108b61a3e2eadd5621d", + "format": 1 + }, + { + "name": "plugins/action/pnp_global_settings_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1b4ddaed4aca4edc030b29cddc170d9b0490f4a16cd83b0b2f9949eccab37153", + "format": 1 + }, + { + "name": "plugins/action/planned_access_points_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b2fda31186f7a55adc70dda8f7604e72835fe682d181a71bd3e6e6aabf450eb7", + "format": 1 + }, + { + "name": "plugins/action/event_subscription.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "74ec91367e90c402d8af52429dd94d6956f707611684da181fbaba4b3f1c889a", + "format": 1 + }, + { + "name": "plugins/action/disassociate_site_to_network_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3a40e6575494b60004333caeea3c873deb9fab1f837877ace884ae9921b54ae5", + "format": 1 + }, + { + "name": "plugins/action/security_advisories_per_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b4c2fdbb41610acb30669079879a6a4c5804daa16b725242c8db87bbaa3e8a3", + "format": 1 + }, + { + "name": "plugins/action/wireless_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "55d8507ee75de192eb181469a176eb0b229b0adb35d16d173cc5c53dd5365e60", + "format": 1 + }, + { + "name": "plugins/action/authentication_import_certificate.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "37ac84a52518e08d6277bc71aa62932247555ea14e1f1eefef3310816c5ba782", + "format": 1 + }, + { + "name": "plugins/action/sda_port_assignment_for_user_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8d6ed0943fc0039916313f275619e8a6d5660c15d9c2af8819f715e8cb457a7", + "format": 1 + }, + { + "name": "plugins/action/site_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3ac66c8000f8259033f92f77c70fefd20cb781240151c05e05cab744f457877d", + "format": 1 + }, + { + "name": "plugins/action/nfv_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3214fe392b5cfff56e7ee2cda5b87840cb1517143cd8945d941a590c6581b50a", + "format": 1 + }, + { + "name": "plugins/action/network_device_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bbe0219a276fdb8c32bb16daa35470cf27c40da105ffd1a02de12c17c243b540", + "format": 1 + }, + { + "name": "plugins/action/network_device_custom_prompt_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "429258f9c348ec28b01abca5d968d2aa08b26db200ff7886630f466832ac7d80", + "format": 1 + }, + { + "name": "plugins/action/pnp_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9a687957ad40a293835888e71527df0e975d14ae9643538eb6bb9a2e76f9ff94", + "format": 1 + }, + { + "name": "plugins/action/license_virtual_account_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2dae0f69ef785cf301a423c485435082c9ff42a8c4a5d80133212da60a3479cc", + "format": 1 + }, + { + "name": "plugins/action/device_credential_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cf97d4089093680530105929d7ec8cac9a65d6ba3edb53f0c26dbdb619343c3d", + "format": 1 + }, + { + "name": "plugins/action/topology_layer_2_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2203c33916e8fddc1b23419f79bdb58a3917daf31b2148e153df3b1f0bfa3ad4", + "format": 1 + }, + { + "name": "plugins/action/threat_detail_count.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e613599bdc8d16fbf52be764c5064b008ab59bd1963e9b6482c24ba4f2daed03", + "format": 1 + }, + { + "name": "plugins/action/device_credential_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e7d224d877088ef2fa5213b18362c2d693c514a5f4c8e5c07750529d4182d40a", + "format": 1 + }, + { + "name": "plugins/action/site_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "66f1f96dc4827bb608902d4759f7048c701fdd947fca99a4d0a200ffb66b2a5a", + "format": 1 + }, + { + "name": "plugins/action/http_read_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "aca30deb8e5335cfd932fed68b30ef559ec2a66a3e9d8876cf86d533ef52856b", + "format": 1 + }, + { + "name": "plugins/action/compliance_device_details_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d9c808af749f3e83b105e5bc0f7d58ce3554c416ceeab0e32b90ce37c2f08e6b", + "format": 1 + }, + { + "name": "plugins/action/swim_import_local.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8dd1c5d02ff6dc70dff6724e4fa62f657faf4654660e9e8f487eefe7ed725976", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_export_template.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "be7908e142e2316544819564a6da0f0f9712e26cde0351332b7af0d3067421f2", + "format": 1 + }, + { + "name": "plugins/action/transit_peer_network_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c0c8491f7c3bbbd3a2f0f340cf4bee5844c45e6cf12e1220a3b460dd1a18aecc", + "format": 1 + }, + { + "name": "plugins/action/wireless_provision_ssid_delete_reprovision.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c5c47a6a9f3db9d685b3f9eff2a9a18553788c890d988eb5ecfaaa0a5c4300e2", + "format": 1 + }, + { + "name": "plugins/action/sda_virtual_network_v2_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1f23e505b674aebb2df0a250bc7426cdc58807b6f7ab9b2d4fbee4677abdb317", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ee183b977f3f13bf1a8af1dffafefaee95cceeebd40b4f0e36037c1f6cd9a26e", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_authentication_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4051100a3e87c63cf9cdfbd378017833adc1c8bc15973c12064afaa599b6d614", + "format": 1 + }, + { + "name": "plugins/action/command_runner_run_command.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3048f6e4a0dcd3a079ba22a16048d5d4b9440783d96b9efdaef6dadab4816a32", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_edge_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "36bd3070422d065562fbe290da62c292869faaeaadd25118b8fa27526f8818c6", + "format": 1 + }, + { + "name": "plugins/action/client_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8a96ef91cd760ce7dbedd5a44e10c08e8a83990112f5a4dd00574937b92ec2a5", + "format": 1 + }, + { + "name": "plugins/action/sda_provision_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "378f44f2aa948d1bcf15efd4ce4f53388e986dbc066f07e4b22fc7d8f50aae9b", + "format": 1 + }, + { + "name": "plugins/action/interface_network_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "161388676f2baa19e1e1fcdb0edbcaa3e385c75085e214f7bc5f26cd1cd9bb35", + "format": 1 + }, + { + "name": "plugins/action/reserve_ip_subpool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b642fdd94b41f01155ac2ace2fd1f9740dabe537a92a8518a8be4f0dbbf70e1e", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_version_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a28318ac1d64282d29117cc920e06d7893573eb1652d19d174f152daa611f5e", + "format": 1 + }, + { + "name": "plugins/action/dna_command_runner_keywords_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8e954b2a66203b5fd106db56bb32cf2acd8abd6a998ba010527dadc8a4d167a1", + "format": 1 + }, + { + "name": "plugins/action/tag_member_type_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ebb19ae490efda05659d1ba6e86a98b34f553c7b3e486f7a4be14309e96ed4f3", + "format": 1 + }, + { + "name": "plugins/action/cli_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "76be1e7004db40898fde05224984a13b1401d0a1f987713c0aabeb57b6a814b0", + "format": 1 + }, + { + "name": "plugins/action/event_webhook_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "24de6e919f6d5f8a1c677d9d3db0048ee1420db9c4fa091aa7908e76194a6871", + "format": 1 + }, + { + "name": "plugins/action/license_device_license_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "292f6ba68afd106777456232c4ad56c65bfeb00ddb59d0e9a788cf7cd1b61074", + "format": 1 + }, + { + "name": "plugins/action/device_interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7c24dea08e5472f4a15b62116a58fdf249a82e4813cbb5219b48632233c7aede", + "format": 1 + }, + { + "name": "plugins/action/disasterrecovery_system_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b54e57c5577f12358839d23d14216c48426c132a087f3b122c13f8ce4ee0abd", + "format": 1 + }, + { + "name": "plugins/action/device_replacement_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0bb253c54240578561b9b49c97090c5bb8624915027ed24233cbcc229c9662e1", + "format": 1 + }, + { + "name": "plugins/action/pnp_virtual_account_deregister.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e18133c1a4489ea734cc6df820c28e8d581f9a84435e6fdc57e8920c98eeccb9", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_import_template.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ffcaefa88be9cfe867616cd1f2f6e15755f8f7927dc9562c2edc8fb254c1606a", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dde49434e1a52a27e6e47a73d42d438a7bbb1de50ab1aaa27f05133b611d88a4", + "format": 1 + }, + { + "name": "plugins/action/event_series_audit_logs_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8320aa210b599d5e3bec0d58f940034af84ddf75db24f86a06e253741edf894d", + "format": 1 + }, + { + "name": "plugins/action/service_provider_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cd5f74a42bcba366369a6bb63454aaf397702ea782d274460704c5253a1fe0b5", + "format": 1 + }, + { + "name": "plugins/action/endpoint_analytics_profiling_rules_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2278f163b9da0d232f40c7e272f63c7bb4f5e5b32554e48d2b1f6ca7f378285c", + "format": 1 + }, + { + "name": "plugins/action/system_health_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3a1753cfb4daaa5ff0729420736a9057be928e2d0a233079621378b081bb2e83", + "format": 1 + }, + { + "name": "plugins/action/tag_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cb4e51af0d85a43ffad2384537df585b7e737d0d7dcd7b112de0877dec6e0671", + "format": 1 + }, + { + "name": "plugins/action/template_preview.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "977d508876e2ca26ed316145a19feaa44673aff21f64a669b163fe16128cfde5", + "format": 1 + }, + { + "name": "plugins/action/sda_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2743d540303922158767bfa6422f6559c231bd3739b3ec7ca8e829ea82b0956c", + "format": 1 + }, + { + "name": "plugins/action/network_device_equipment_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f9b7b922148b75ca971390fe1978ad4c411b21f6afd2572dc67b3ce13218f578", + "format": 1 + }, + { + "name": "plugins/action/sda_virtual_network_ip_pool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8de6973637134e8ffb55676061ab19d6aaeee9c3eee9dfff883bd75439b08ee0", + "format": 1 + }, + { + "name": "plugins/action/lan_automation_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a1f7a900eb098a16f03bd5ad1baa510b47ee53d6181cda9124cf699621467bc3", + "format": 1 + }, + { + "name": "plugins/action/app_policy_default_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cce25593565d7bb8fe302ea6524fbeb3ed36d1f98de8362ab59ca3dd44976ab2", + "format": 1 + }, + { + "name": "plugins/action/swim_import_via_url.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "70c195dc1189a6ab18ce241c1012891a662f159ca46d65362af69add4155865c", + "format": 1 + }, + { + "name": "plugins/action/business_sda_hostonboarding_ssid_ippool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "92679fd0ac37769faa2ad80b1fa3177130404e8f8e52c55bd12a83c7518c237e", + "format": 1 + }, + { + "name": "plugins/action/snmp_properties_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ae9e33d93941ef2ed1a5980e92c4934c6bb14c4d0a7f25e5e035ad964ccabf9a", + "format": 1 + }, + { + "name": "plugins/action/event_email_config_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ab119ab38b5461d51a89af6fa8ec422f1a9ee2187ed3231cad1ceb11a785e1a4", + "format": 1 + }, + { + "name": "plugins/action/swim_trigger_activation.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "25e88b22c280ab81df32f2c252edba4d4ea8ea8df23bb851b22c0c37ff40dd76", + "format": 1 + }, + { + "name": "plugins/action/event_artifact_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e842c6a103ac73287e9a971b7277f5a8c5eb4082688d9aa4850bacbff2306bdd", + "format": 1 + }, + { + "name": "plugins/action/discovery_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5cad31d799e07327956b5d1580127d3bb3b632a70c79f6e1da46d1a8ab37d619", + "format": 1 + }, + { + "name": "plugins/action/nfv_provision.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6c551d98bd72266e2b4d1381a2e4cc24ad6beefdd536b0fe547290e7d39c4aae", + "format": 1 + }, + { + "name": "plugins/action/wireless_psk_override.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0dcaa6b9471bba0cd0bb3a1334ab65dc41aff6b96627f5c2569b58ee967e8c45", + "format": 1 + }, + { + "name": "plugins/action/network_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b8c0136466839d1795867be6c97e1705a4ad79f24ccc3f6068b247532cc5d7fd", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_rest_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "77abd5371f55d2761ecfdca768f810e23edf05a31808ff4e2d1f782ac1698ee7", + "format": 1 + }, + { + "name": "plugins/action/reports_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "44e205257ff7fc004d3dbefc3e6b1f2c4b417eaf3fb056ab56df5fe86cdb6bdb", + "format": 1 + }, + { + "name": "plugins/action/lan_automation_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "986f07e8fc2fe44599d35ef4d54292f5e995b2189c5f45087841bf13776e851c", + "format": 1 + }, + { + "name": "plugins/action/http_write_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "877aea365a574924a1d120ac3ab63fdb0795d35e7edce33b431b3f45be7e6a6c", + "format": 1 + }, + { + "name": "plugins/action/device_interface_isis_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ab2720c4b7cea844240212a07fb6b75ec75fe85e8bcd374c1563c3e739626063", + "format": 1 + }, + { + "name": "plugins/action/sda_multicast_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "661345394e7f45ba5ce5e131868157131c4e819cbbab4f654a2507ff320cc269", + "format": 1 + }, + { + "name": "plugins/action/topology_physical_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4c33a948274609b0acec054d7bea93f4d903efa29375ebce55cca4e153907eec", + "format": 1 + }, + { + "name": "plugins/action/security_advisories_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6425f45d53b97023a136dd72112ddbbb8583e5083d950fb8e7f8f1cbaecc604f", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d885717cc417911e2d2a45b0f4f42a56434888f6df6fdef43d5dfdbf47baba3d", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_details_email_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "efdec21d7da566abd71ea9d01824ec4fdb6cf32e955e365204cef0f7a5e8503e", + "format": 1 + }, + { + "name": "plugins/action/lan_automation_log_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a015ecd679499ade59b5f0a4af3d1c3b0b6bb2a26736663202afcd3227732924", + "format": 1 + }, + { + "name": "plugins/action/network_device_supervisor_card_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6596fcae992aec40be5c1883c55a8336a900d059e9c8bd15188114fea8b6014f", + "format": 1 + }, + { + "name": "plugins/action/network_device_interface_poe_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a38b963a537281a4f41a3baf4f647f24c59323304d5c466fda7515e47ce07fba", + "format": 1 + }, + { + "name": "plugins/action/wireless_enterprise_ssid.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0816373a1a03a76cbccf6c1d7a0e0b6e6530e61850edf5a0dd7343b096fe15d2", + "format": 1 + }, + { + "name": "plugins/action/event_email_config_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "27cf519f868668948c9b25e6316f858e6ae7f5723c5698d7e7b7f6cb9e4c4889", + "format": 1 + }, + { + "name": "plugins/action/threat_summary.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "05cdec399002378527a05bb647694f91926f9ae402c24d8daaa788480d0ef19b", + "format": 1 + }, + { + "name": "plugins/action/network_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "36e94076b5f6ca38a4f9acfaf43a98b11de5eeabe5734e91d828f05692d3782e", + "format": 1 + }, + { + "name": "plugins/action/network_device_poe_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1b45f55c732ca3d846fe02e90b74cdb39279633d4e3964151863c11161b3c88d", + "format": 1 + }, + { + "name": "plugins/action/pnp_virtual_account_sync_result_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4bcfec6a3905c7294d5c555cb6c692893c71f6cd8c391525c05d1fc0237793aa", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_project.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "adc174e5fb49c6395a04cd438c55922773a8b4b7a2c1287ddcae41317fd471af", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "caf642ca32da089161db5158b4652a8eac1d1249b6244d02a10757cba5f4604c", + "format": 1 + }, + { + "name": "plugins/action/network_device_meraki_organization_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f7b4fe18316e7774643c9227da7db979f80362a4149034791b987921a0038631", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_email_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ef01b120c8cebaee14e4cf67e46e8023e9a6ebed7cb2921d24f14b79abb0ee61", + "format": 1 + }, + { + "name": "plugins/action/event_webhook_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "17d8c59c616c36113f771979592d5ee0a3341a1be22dcff36ae097df88b9e765", + "format": 1 + }, + { + "name": "plugins/action/discovery_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "10b676527917b1f46e4dac4bfd25f8c49af10ee74e9944b4fcce167bc8919bbd", + "format": 1 + }, + { + "name": "plugins/action/dnacaap_management_execution_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f609110db27fa69afa0282857637e6824f1f5f70f7789b65918f428084b6c7a7", + "format": 1 + }, + { + "name": "plugins/action/network_device_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f4513332944d33e6ecd45b734c915ebb383a068e75d0ab3ea6fe10ddf2842598", + "format": 1 + }, + { + "name": "plugins/action/reports.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "524f07a391c3579de6243907ba008ea53b66de0b3a9bfe12645326be5095a6a4", + "format": 1 + }, + { + "name": "plugins/action/reports_view_group_view_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "67d0b205c5e14cf155ce6a46274f5c347caf4e4057e2e25eaea48f86a07b331a", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_details_syslog_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cee3d0370cda496a3e94c0f4412e322c7746d8c233dc873375bd3d3d1e60ed75", + "format": 1 + }, + { + "name": "plugins/action/license_device_license_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fa7e049d81339a09964b824c113fa565865bd019ba83dc57a26d52229e9fddc8", + "format": 1 + }, + { + "name": "plugins/action/path_trace_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "aebaebf4a3f813f9fb0838df3c1322e5591ef6a6353c498d21eafe5b61cc7fc7", + "format": 1 + }, + { + "name": "plugins/action/site_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "59e9c68971933d4e9eca3c2f610f74a17832f10a9f5e8853a767d6f205183990", + "format": 1 + }, + { + "name": "plugins/action/site_membership_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b8081ae5d290e1b92468c7743227898824159e3aef0fc54ac8b97ba22507dcc7", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_border_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "caa36551cc9f9d90e1313ab3a232b40ff389672a9b2c9116fe2077f1a3ef394b", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_syslog.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3791605375a6848cbc56e381b1491aceca2c069578244d099090f9692ba0a740", + "format": 1 + }, + { + "name": "plugins/action/device_interface_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "87faa9f6d08de0f3f98abbd57b94d9bb9cd4c67be5c1a91310880cad1a87a6b0", + "format": 1 + }, + { + "name": "plugins/action/event_api_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eeb32f3d51b6917ba3be00f8e310eb7c13c836ea3a077efb8cb0f77762a60717", + "format": 1 + }, + { + "name": "plugins/action/event_series_audit_logs_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "46ce3fd077a4c0cb4f254bcfa1e713ce1900cf3965fb100c73058e7e22d51c4b", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_border_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "61e2ec0bbd1aa8b80aedd1d2940f6b19274c3f49cf4e2950a88ebddbcb7fdba0", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_site.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "10105d3a36148f40b80fccbaf4acd7645fde1097de03054b137914b7162fe5e3", + "format": 1 + }, + { + "name": "plugins/action/application_sets.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8f9473d1f81cde7ed3da76b2eb57b1b56e79cdea940b30121823bb86a6c9f963", + "format": 1 + }, + { + "name": "plugins/action/interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d648bdb4ccaee95afb4a11a4f338ba8001547268684d8770acd08f106bebe76b", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_deploy.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c0822e5b9b5aa549439c04c7b51190cc269882a25771c725ef837da1a2215b8d", + "format": 1 + }, + { + "name": "plugins/action/application_sets_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f78bd9b437edaadb9e59bba0989baa2db39a5765da444e1f9945a33335857020", + "format": 1 + }, + { + "name": "plugins/action/device_family_identifiers_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "528285564463de02c0fa9cb00efea245aa059d85db22e4310f28171eb5bb5b1a", + "format": 1 + }, + { + "name": "plugins/action/compliance_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f19ad1c56edfa95068f61ee1db5d5068152ae117783767d78ea7d2e2e290d7a4", + "format": 1 + }, + { + "name": "plugins/action/device_configurations_export.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2559650703e54a103a0d758b20b6abf73effd4de9c41ce3b75bc6ffd7a0e7201", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_reset.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a92a38d33a72e2099d2de32ba6df0b0f85e65e3afcb6d37aaf31d44487e5ba02", + "format": 1 + }, + { + "name": "plugins/action/pnp_device_history_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "707aceb3579431de7911b5450fc9ffb3fb5cea120a25cbe1ff4c8dbc70e73604", + "format": 1 + }, + { + "name": "plugins/action/task_tree_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5988c5f0a95f10e250376d7dc61fa7861732a4a7e3db22d8b6139b44382c27e1", + "format": 1 + }, + { + "name": "plugins/action/network_device_vlan_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bec46472a9cbdb2e168a11b23b5f70ecd01e6c2f6bdf803e5f088be5e1a2626d", + "format": 1 + }, + { + "name": "plugins/action/itsm_cmdb_sync_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8f6cae6ebfb1ad4a86dadb97408da760e1c91d69abf3a637fe85177bae9f21b9", + "format": 1 + }, + { + "name": "plugins/action/file_import.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9891a5a38a595aba988f5dbf57eb827298e4ae1347a15213575e7429a80dd00a", + "format": 1 + }, + { + "name": "plugins/action/app_policy_queuing_profile_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5583b34a00471154e34867ccaa3319ce4167d00aebbd16ddd2a33f1269ffc056", + "format": 1 + }, + { + "name": "plugins/action/license_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d684d40614dd91cae8487570525bb6f42287c28bef90ae9d8d9a989b0a89d098", + "format": 1 + }, + { + "name": "plugins/action/sda_port_assignment_for_access_point.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "83f486e424aa738864eb86f06a9efd411dbeffc91a88de3615730a0075df69bd", + "format": 1 + }, + { + "name": "plugins/action/nfv_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0c9755d8cb01c5fa72017b6972e81e1b78c53de6bd5a66b2f21540f327c071b9", + "format": 1 + }, + { + "name": "plugins/action/sensor_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fcee36596e9ca678a70ac575f85b7afeb5c45263bc42437e140e5dcfdffff181", + "format": 1 + }, + { + "name": "plugins/action/discovery_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8b54ae5d126151be73665f0174fe59ef8bf2084add786d8d548b139422555087", + "format": 1 + }, + { + "name": "plugins/action/reserve_ip_subpool_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e9a3bbd7c7ff26d4d018bf8dea5e9f8780bc5634bd17739bdbb8b49f89bee17e", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_edge_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "24d5d078b7bdb30028586ef57d83bba8af7d894e6cb5d2e14604c3d22e1228fa", + "format": 1 + }, + { + "name": "plugins/action/issues_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fc6486505eee136bf1c8cc6a371316bebdc5afb197f3b743bebc96d7b41a6d18", + "format": 1 + }, + { + "name": "plugins/action/reserve_ip_subpool_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c420dc63b8e3cff37f728f89aefa7f5270c009e73c6d7c889c1e414ef18f1936", + "format": 1 + }, + { + "name": "plugins/action/system_performance_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5926d765044f104dd3c54ab3a428cc67c734e79f4220a61dfe1bbadd9f2c9ad1", + "format": 1 + }, + { + "name": "plugins/action/pnp_virtual_accounts_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "943d7cbd065b1781c79d0d1f7093b27217d43ef783372076c46f010d2837eccf", + "format": 1 + }, + { + "name": "plugins/action/qos_device_interface.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e34f2cb3c26400a9c7a325939210cb624db62d6538e26f677d1cf6739c013715", + "format": 1 + }, + { + "name": "plugins/action/platform_nodes_configuration_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6c93fa48aad161899993b18eefaf5eac078652c6d371340b2e0b1e4f61b1c54a", + "format": 1 + }, + { + "name": "plugins/action/license_usage_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6b8d82f3a4e3d30c88f3470c2db0fa26543e1e379d440e02c00eef6e2c3cefcf", + "format": 1 + }, + { + "name": "plugins/action/swim_trigger_distribution.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5030a606dc52eb5bf7b854ef461bd866178945d5de57b76d44973c8045c98254", + "format": 1 + }, + { + "name": "plugins/action/network_device_config_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "93c11f9fb04345ce13b09f2c7d99aa7c7a03aabff07fcb88911026d2b654e59b", + "format": 1 + }, + { + "name": "plugins/action/golden_tag_image_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b9318db60069bc37a9ca6a1ba62c35175f2d016ce1af99e8952d9a62ef61f2a5", + "format": 1 + }, + { + "name": "plugins/action/app_policy_queuing_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d05bcf5ffc3aa2e139ff096da3585bb92e67874e6b185455ce381f417a7e7250", + "format": 1 + }, + { + "name": "plugins/action/device_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d17d63e407b8ef8f10427eec9c588400ce64d69472b663e680585ac8ff58ace9", + "format": 1 + }, + { + "name": "plugins/action/file_namespace_files_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c0ddb689365238d5a8944ae79135d4971d7b04cb0ce7869c0331c4c3abd45d4c", + "format": 1 + }, + { + "name": "plugins/action/service_provider_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "aa7553ee2d8360df2828a6c8abb6a18a3506f679464b8a1e7619c26eb9316f0b", + "format": 1 + }, + { + "name": "plugins/action/license_device_registration.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0774cd9e593ddde2390b5c948a1501771b78b1ff3e335530ed4080f9298cf4ee", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "68c82ebb2e3dccb54ee0f2175338002020dd0f6518ba0f5ef359bb7bb7ba171f", + "format": 1 + }, + { + "name": "plugins/action/topology_site_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "02c663d0aadd091254929da59a4d1b37ac87f4b6a4f16b31c4398a391b957c3e", + "format": 1 + }, + { + "name": "plugins/action/network_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "14f555e3a8faf7c4ac50f631b948e5857c19585aef22f7cd05da50ba25b098f4", + "format": 1 + }, + { + "name": "plugins/action/network_device_functional_capability_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "806b5b5addeab12aae752e74de3b133ba5493a3e51f3f31b4845080166a95626", + "format": 1 + }, + { + "name": "plugins/action/business_sda_virtual_network_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "722461eb0b3e5d01002e4cce9fbb80ee3ec36b73316f2f72dd4edda44ccf9e54", + "format": 1 + }, + { + "name": "plugins/action/sda_virtual_network_ip_pool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "77dee02a10e19beb9e7a76d1482a9dc6a8f6f6780369521576b78bfcda6e0671", + "format": 1 + }, + { + "name": "plugins/action/sda_port_assignment_for_access_point_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0c4e0c8b9bbf8c2d187a02c47da460706215770b35f50c25fc8b62871f2c7fb3", + "format": 1 + }, + { + "name": "plugins/action/snmpv3_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a066b234e198d4772b9c71b8c713c4eed01d1a977d6b7a11064d275eb46d4510", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_deploy_v2.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "27be488eeac1d42d452f034f881f3675da06764a1d7388532de40edb96818ea2", + "format": 1 + }, + { + "name": "plugins/action/applications_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "68e10c4a41939887e7f021632f381f065deac222d64ac57db2c0cf8318db0b78", + "format": 1 + }, + { + "name": "plugins/action/sda_virtual_network.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "46a5b18aa30a42266104bf7916226d43e0760a13014aa09651ede76e7af0304d", + "format": 1 + }, + { + "name": "plugins/action/interface_network_device_detail_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "66a0472de51bb80e0ab8fcb060b55b0b59a6cb8c0951a30908e0b33f8e8013a2", + "format": 1 + }, + { + "name": "plugins/action/security_advisories_ids_per_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b582766fd339f124044896e846019de0074fb73c4483722a2bed7e2f5cb6a845", + "format": 1 + }, + { + "name": "plugins/action/platform_release_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b16042ada164f4e0952b70d6eab6cb712d9f16492459cca43261380dec0c9d74", + "format": 1 + }, + { + "name": "plugins/action/network_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4323cd920063dc4e7a91a4a9477acb1899119ff08b34720ea103a302615775d1", + "format": 1 + }, + { + "name": "plugins/action/event_series_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c299e8c7292de04cb81550c5a339e42670f1ffafb43eade55f62eda077a29183", + "format": 1 + }, + { + "name": "plugins/action/app_policy_queuing_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7e79c70e74b02778ee287a4350344b9e86eb1e72fbb6cb3010fceed9f832ab5e", + "format": 1 + }, + { + "name": "plugins/action/service_provider_profile_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a6213d9f0c661cb73ffd8571bebc5511a5154cf27ff4956412e22259907d0843", + "format": 1 + }, + { + "name": "plugins/action/service_provider_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8ba9cb5f50393bb17e97e136558b485fae9e8a95bd27e07fe4de8aa6ea58be61", + "format": 1 + }, + { + "name": "plugins/action/network_device_update_role.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b1b73f677995bf5348a2b973d8f04c4e53840760143660ec6158a08b192f4b1", + "format": 1 + }, + { + "name": "plugins/action/sda_port_assignment_for_user_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "978faac34436908cb5d7ffbf5487c913fccd4afeba30a3a4dcf67160ec14b210", + "format": 1 + }, + { + "name": "plugins/action/transit_peer_network.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8a91d438bcab8d6380c6cedaabac617e298ec45f111691e78330b9c793fe6a7e", + "format": 1 + }, + { + "name": "plugins/action/device_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "31e7395e48abedd68fe6088eb0e6124f8f8932f67d58efcb4e6be9ac39aa3838", + "format": 1 + }, + { + "name": "plugins/action/device_replacement_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1ae809afeb15ddf46f21cc4b7180da90c4f0ce951fabc02008a83f5b44d0ef3e", + "format": 1 + }, + { + "name": "plugins/action/sensor_test_run.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f3d94a0c125d96fb3b3c9d527c2226b45d466846666d9dbdf11a9ea5ec6ccf01", + "format": 1 + }, + { + "name": "plugins/action/event_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f0735d2346337a51383eeea16ed5b49d2030287e2c7ebe0a95f18b68f4e879f7", + "format": 1 + }, + { + "name": "plugins/action/device_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "703f95da4ac9774a5cd5f14ff1eb6f3c5debbffe646537bb5a773a1a7af3c081", + "format": 1 + }, + { + "name": "plugins/action/netconf_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "763e64a1560811818413eec8559be314b00712433245a87535754944e75fa67f", + "format": 1 + }, + { + "name": "plugins/action/network_device_register_for_wsa_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "66ac9a096f34c8c6a2d0726ca454041166cbfe3bb59a26071394cc67ad9abf7f", + "format": 1 + }, + { + "name": "plugins/action/client_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a98020c492a68e8e21d5f59ab89e990c51461b408940d216523c57e2c919b433", + "format": 1 + }, + { + "name": "plugins/action/interface_network_device_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7078f4bd25af7a6d25af77d712ba3af5c711580073f25075b600bf4baec1cc44", + "format": 1 + }, + { + "name": "plugins/action/compliance_device_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a030137debb0fdb6cc405fabe7972a322d359466ef8fa2d7cfe7d63384552ec7", + "format": 1 + }, + { + "name": "plugins/action/discovery_range_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "950d647b1de7535c421b7537f3de6127b7d77b35765a1bec5650728ffbaa679a", + "format": 1 + }, + { + "name": "plugins/action/pnp_workflow_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "da23d2f863c9d177ce94afe0a9a9aefe8eb8f125de1ccb0a8605fe4a381911ad", + "format": 1 + }, + { + "name": "plugins/action/network_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3c3f48cd4d2491ef984d13058a677e1508636b5af1e6f1a3e8124a2c08795742", + "format": 1 + }, + { + "name": "plugins/action/network_device_export.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d04cc77305e6aa1927e2916f432cf00d3563dab2c9af932947fd73ed2ea4f3e8", + "format": 1 + }, + { + "name": "plugins/action/templates_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "60ad68ef614f306f5bb991408526ab3e1fd1aa414505ca3faa3e44407abe3164", + "format": 1 + }, + { + "name": "plugins/action/event_series_audit_logs_parent_records_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "87ad711cd866043b16fecb6e7c7f3b44d29b73ba803a93be3e0acd60563e3411", + "format": 1 + }, + { + "name": "plugins/action/network_device_with_snmp_v3_des_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "376fe4143343d09d649773abbe726f392a65086b360fad4246194c8cd7c4d129", + "format": 1 + }, + { + "name": "plugins/action/license_virtual_account_change.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "13c4cfe67e2820906a324b8f0270df23f05e75787271d25341911fa8fc6e0e01", + "format": 1 + }, + { + "name": "plugins/action/compliance_device_by_id_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "57ef8a4bbae876ea5b13556242c28f888b9c87374b9631dd9c2230d4538dd7ca", + "format": 1 + }, + { + "name": "plugins/action/pnp_virtual_account_add.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a7a8b5a4892c84f3552b55369f600b286a1dea120183f8c1a73fa1d9c8811b96", + "format": 1 + }, + { + "name": "plugins/action/tag.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4df1f490193eaa8263d2ec9009ec0fd0f012476de8efa61254ed6d82ec45360f", + "format": 1 + }, + { + "name": "plugins/action/reports_executions_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "beb80482b5391350a6cb26a07b3cdc863c4dced91e5dbe24100567575f3e8fc3", + "format": 1 + }, + { + "name": "plugins/action/sda_fabric_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bbee94e81318de941e1f3e4aa6cdb91e961714e8f99d77f0b27c5ff39e610e25", + "format": 1 + }, + { + "name": "plugins/action/device_credential_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "45079aa572393ad48bb64cd7d439276cbe6fd9e237015a1eb7de1d2b30bf70d1", + "format": 1 + }, + { + "name": "plugins/action/file_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0fa5cb9b0d1055a6cff2a86d4f4c5abfd1da47b0b8c0fd48686da5680b954b0f", + "format": 1 + }, + { + "name": "plugins/action/event_subscription_rest.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "572f1fc9a1eab49917831dee8eddcb7b0d29ffe74792b75899d839d200ddbe50", + "format": 1 + }, + { + "name": "plugins/action/security_advisories_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b6d1b0d629e61ed5ced4e0e346a2d26b53e83909188113c39b38b9a6d97c7d3d", + "format": 1 + }, + { + "name": "plugins/action/network_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a6dd560eac32565cadff62bb827e6637eb0631412fb3de8d8f327a56e8a26dde", + "format": 1 + }, + { + "name": "plugins/action/pnp_smart_account_domains_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e1bb9b4000b54bcd276e8918bb553e812f297b7d96e45c2440947cc5c793b092", + "format": 1 + }, + { + "name": "plugins/action/security_advisories_devices_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0d533c53edb9b6ac9055e9c315f8904631cb6b0249699edc42e4eaad1469a07b", + "format": 1 + }, + { + "name": "plugins/action/reserve_ip_subpool_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d6e62b4011500d0a4194d5354f5efd6812f0a8ea4605f874da6a8e1a9aca7652", + "format": 1 + }, + { + "name": "plugins/action/itsm_integration_events_retry.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2cba253bde29a8cff8dcc6976240e015faade8e2f22ae404958d0685f8a54d61", + "format": 1 + }, + { + "name": "plugins/action/user_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6712e495465d5ab87c7eee36f718f9d75210efe4624b1462734a8098454a4658", + "format": 1 + }, + { + "name": "plugins/action/site_assign_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "048f423425453499c02f396079d7f3cba0a13031ff5338e525aedc3645fbce6c", + "format": 1 + }, + { + "name": "plugins/action/golden_tag_image_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "43981e17e0e4365c19d9a6fb68112cc6481b7da93e26b5532ee580d53e7a1629", + "format": 1 + }, + { + "name": "plugins/action/network_device_linecard_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "18fe01c8cc9e0a162a53d0872029fc3482e9a46e9d425358947f7f35ab2b1a58", + "format": 1 + }, + { + "name": "plugins/action/issues_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6dc714f6947e9a91e4d35522b80b5641c7d36fd68eae3f1d40d7f34e2e78f740", + "format": 1 + }, + { + "name": "plugins/action/golden_image_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d89d5c9e58a149e2cd22ec2178fef7bfb0eb888dac1b3da8f7828d68afdb7ecd", + "format": 1 + }, + { + "name": "plugins/action/qos_device_interface_info_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e88f05de8cddfb51c0ec07e2a9be107579b08c916ad3a7c5774d5dc06abb802a", + "format": 1 + }, + { + "name": "plugins/action/compliance_device_status_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "82058a984c2a1054590e35614b30a18fe1cf415667d0bfbc01f66a6e2a370963", + "format": 1 + }, + { + "name": "plugins/action/configuration_template_project_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2a3346fad2e0afa51dac18b8510cbffbd633336be81c6545094b18f897909b4b", + "format": 1 + }, + { + "name": "plugins/action/pnp_global_settings.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "50092b2dd1478b73c5b3d20a51d38d402bdb860dfba0db14c6fe7443138597a7", + "format": 1 + }, + { + "name": "plugins/action/configuration_template.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "daee7ecf86686227e944fdf36f95025ad42c93b5ff8061200de93a0179368d58", + "format": 1 + }, + { + "name": "plugins/plugin_utils", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/plugin_utils/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/plugin_utils/exceptions.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b5bf87d6eabd64d78177d92d28a1a266014ec305ba584f6a56b38c082bf6b5a2", + "format": 1 + }, + { + "name": "plugins/plugin_utils/dnac.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2e6cdbd3c4ffad84a3e8587f47e20798f94074969df89d95d4f28a0659b0fc3c", + "format": 1 + }, + { + "name": "plugins/module_utils", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/module_utils/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/module_utils/exceptions.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4206c7cae7a2a593d0bfaff4cae2dd53e575f3b0d7938e7f6695192c73d9897f", + "format": 1 + }, + { + "name": "plugins/module_utils/dnac.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8af77930416fc8ef1210c5694a494aaac946fcd998aaaaa545b8425841424b40", + "format": 1 + }, + { + "name": "plugins/modules", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/modules/tag_member.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8a2bd82e30a7de013e92d449db152ebe63ea43cd1e9677539f97494f08a2d4f0", + "format": 1 + }, + { + "name": "plugins/modules/disasterrecovery_system_operationstatus_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8fd0409b787f6349566feccd41b6057a783983773111e4025e5b176af3d0777f", + "format": 1 + }, + { + "name": "plugins/modules/network_device_by_serial_number_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d53ad159302dd4507a836a774af682484b5edfd1c3f11e97b16c0c7810d19162", + "format": 1 + }, + { + "name": "plugins/modules/wireless_enterprise_ssid_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ae2bd335d1cddf0f6ef7bb3f0ca6bf26a7715eba4ae6adf3fec5f1bf9fe6bdae", + "format": 1 + }, + { + "name": "plugins/modules/sda_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "00ebefd335ac439a76575291a2b161c1cddad3b0e19f24c1cd09fa7ba7ce277b", + "format": 1 + }, + { + "name": "plugins/modules/network_device_custom_prompt.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6f4ffb70cfcad7ccda83fe1adbc105a687ff29f84158b2eafd310560404ba6cc", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_deploy_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bb7d0b67ea6d91f6e65a11b06df6b9ea0b3836814e6cb3d4ffa1e769deff4ffa", + "format": 1 + }, + { + "name": "plugins/modules/file_namespaces_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c317859717dac84425184ebf9b11f48f6cfec9d6104b8a5e09f7fa02d22d7b4f", + "format": 1 + }, + { + "name": "plugins/modules/syslog_config_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "252947ca52152d098f82596a66adaba99f8a26c96aa5f746eb07d42d99b11a1a", + "format": 1 + }, + { + "name": "plugins/modules/buildings_planned_access_points_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "904446f88544bfed37ab92855b5b3f05ab0dafad096689e6a45cbaea631d55c6", + "format": 1 + }, + { + "name": "plugins/modules/reports_view_group_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6d99b212f111603c01bcc4c7f1bff2ff589825f2e583c8e2559dad43055a0c85", + "format": 1 + }, + { + "name": "plugins/modules/wireless_provision_ssid_create_provision.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "83c88deb42ee6f9c87b88a2b54e493ea09d9cc2b8094d053859494690e380fd8", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_claim.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a6371657e6f9fe7e968d118d7a7f5e5bb1da056535daaef24e441b78d381bf16", + "format": 1 + }, + { + "name": "plugins/modules/snmpv2_read_community_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cbe2cebcfc426a79bb8ddf73979d1f089d4c09ce7fac9f98009d4ee9c17bfdca", + "format": 1 + }, + { + "name": "plugins/modules/snmp_properties.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "19254d3864bc2b7c3b902d500b9dea3c18b394ddcc751ed74f2e3f16fa176f8a", + "format": 1 + }, + { + "name": "plugins/modules/wireless_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "02d3c53adadf11257d89c1b9e1d616459358fbac84e6e476070984e9b7b466ee", + "format": 1 + }, + { + "name": "plugins/modules/network_device_config_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "05ada1ef97871761da405e8ce7582f2ad7fb743e0c0c6540421e94baa94c9d6a", + "format": 1 + }, + { + "name": "plugins/modules/tag_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "86cb776dfd0b8bc629c090d259f9641901a4d57abc8e9d724788c72e3dc402c0", + "format": 1 + }, + { + "name": "plugins/modules/site_assign_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f39f6844f0a2af76c65087d334609b125d4a04d48718829b2067b6deefe855c1", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_control_plane_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f757023470c6548a11c22357c8781d4a763a3fe6fa4714a8469eb30810f0c657", + "format": 1 + }, + { + "name": "plugins/modules/profiling_rules_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2be93c9d4ac5edde68eb30a7cfb3e7c70c2f5bd420dd6292151eb84e0acb8c51", + "format": 1 + }, + { + "name": "plugins/modules/task_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "304efd1fbf66a6251d545d86693bc40f4a6f50873a74ffc3695481c931f3ce55", + "format": 1 + }, + { + "name": "plugins/modules/wireless_sensor_test_results_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "453c901bb4c12bee21a750e0ef18fd8b031d15ab2c4d26d819c5a23ecf3b1f75", + "format": 1 + }, + { + "name": "plugins/modules/wireless_dynamic_interface.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7ac97da0757fbb935b66c8d2491affee82526fc690c3ef70d27603b3c830ca54", + "format": 1 + }, + { + "name": "plugins/modules/nfv_provision_detail_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fb031a00e038a41b28c3f79eb4ce5b15d00d45587342ae4b47b55b8ae6165027", + "format": 1 + }, + { + "name": "plugins/modules/interface_operation_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a6a58a9012fabb20547a7773a84cc4272b7528e870a77928949e13cc0699b50d", + "format": 1 + }, + { + "name": "plugins/modules/tag_member_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a191cc31927b7aeeddc64eaa65eee654178e1b04d52296e93deee41d4bfe7b06", + "format": 1 + }, + { + "name": "plugins/modules/lan_automation_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bce6f5a1b9fdc18439ad13ba1424c417b9cd5d5c62b095fc8ddf3ed4167eb24e", + "format": 1 + }, + { + "name": "plugins/modules/endpoint_analytics_profiling_rules.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5a497de69e6bc8e935dec07612aa223f9378b38be50ec1f4087a4eedb4ae99db", + "format": 1 + }, + { + "name": "plugins/modules/business_sda_wireless_controller_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "45c13c891a9435a7ed418d911a680dd67418de4bf4adfbeb80091b852897d8bd", + "format": 1 + }, + { + "name": "plugins/modules/associate_site_to_network_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c0678189c515d58820a676a89f138a0d114a598a8058da9d43808587fc2ad1d9", + "format": 1 + }, + { + "name": "plugins/modules/compliance_check_run.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c45f742ec63b5dccfc99b521fa209e5de0751bd3b31dad01112196b122f4912a", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_unclaim.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4ff71f21b9da847e293450033954de0ed0214c1bf81405dc8a84211e1a8b1941", + "format": 1 + }, + { + "name": "plugins/modules/interface_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "35c82cf9432cab406c0b2e9e775fb905c0f73315038290a643a4a8ae81c0283b", + "format": 1 + }, + { + "name": "plugins/modules/lan_automation_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f3f59906e42a06d33bb7f50a9ef71e42b8f9ebed3272d3c021e8cf9857ae7f20", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_authorize.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0e2b62b5ead00baef86df268bcff38b458e171e2835303261b80d9b8208fbe25", + "format": 1 + }, + { + "name": "plugins/modules/task_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d5ebbd9c4361b97087aa51846b2806e3122704818b96a6cf5fa2db3b9ff7a328", + "format": 1 + }, + { + "name": "plugins/modules/app_policy_intent_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "abb3f3e155c35a773565ea043a23a02e449c3b8d4f09bdd276173cb2721129ae", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_import.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "594bceec4ac985795f1e85c594ec8f7629a855a15e69f31b4dee3f1a7887a6a2", + "format": 1 + }, + { + "name": "plugins/modules/authentication_import_certificate_p12.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "be9370de13872b64e89aa4688f426207ad7cb36260c67ae838a6f8e0939188f8", + "format": 1 + }, + { + "name": "plugins/modules/topology_network_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bf2fb1801951e493fba7308a4274be2241b4df4cfb195753b88d1f2749f649ec", + "format": 1 + }, + { + "name": "plugins/modules/wireless_provision_device_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "19c1799fc23fbf3fd97a2f3a3ad749d6031931575136fc01637fa855b49b47e8", + "format": 1 + }, + { + "name": "plugins/modules/discovery_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "08b06425c4819419c08b077df7e8f66066357a54be2364c8888b25a3a06db5b2", + "format": 1 + }, + { + "name": "plugins/modules/discovery_device_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1f2f3fdb22c9cf5c909dbcdb1475d6b54f82a4a6ea233c3e3fb896e026a300df", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_email.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1b2d71eb95c5bb7161305eb06427fc780814251ff09ef7e3640155e04128ed79", + "format": 1 + }, + { + "name": "plugins/modules/sensor.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "92ebd09304b9d1a42d2e011fa9b4abfd9bad86382dd8945993bfa7d22d4d483d", + "format": 1 + }, + { + "name": "plugins/modules/site_design_floormap.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "659b886ffa40bcec0d6c574afb66e0a998d2709c04885f8b09e7ad39ea302709", + "format": 1 + }, + { + "name": "plugins/modules/global_pool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7d49cd0161314e7e14177fa026c94262dc23f43be0490272d7d1ee1e0ecba399", + "format": 1 + }, + { + "name": "plugins/modules/device_interface_by_ip_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "12100e56b2e3b321eed3abbd9da9a1b7b72bc382828de29a1b44a95e973e5272", + "format": 1 + }, + { + "name": "plugins/modules/network_device_chassis_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9022f3da91c1718d963b207de578bdc23e936e317d8e9c7d6b89e5ec8ff3bffd", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_authentication_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "af41c545bb3b5dc56cba5a42ba74ef2381fcd43c02583a5da4061c0c680411a6", + "format": 1 + }, + { + "name": "plugins/modules/client_detail_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "320a7bf8e3a24bf337c8fc251efefd1c46d86c01ec979eecde0f5ba7fdc2b4c3", + "format": 1 + }, + { + "name": "plugins/modules/license_term_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ac8072b5b41d28efc455fab50cea5bba6f11835a44134efea39359e737a973ca", + "format": 1 + }, + { + "name": "plugins/modules/license_device_deregistration.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5f4994cbb538700ba659f51eff410328979c640b883474836e38d64b728829ad", + "format": 1 + }, + { + "name": "plugins/modules/device_interface_ospf_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b0060a5eb9b34449bed92581966ea6aa8064594543280d845386250fbeaed033", + "format": 1 + }, + { + "name": "plugins/modules/sda_virtual_network_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1fa3ea2803d9d51e3eb729f764e8bf883374ea8f8acb86cccc4c0ba2b96c286c", + "format": 1 + }, + { + "name": "plugins/modules/discovery_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2b86177971e4457bb94184fcaa7f18c7f79eabd14f7874e25dfc32768ac910db", + "format": 1 + }, + { + "name": "plugins/modules/business_sda_hostonboarding_ssid_ippool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cf348fcaecb559dbca49ce5b5d9e540e48812b696f575c192676474c23b46da8", + "format": 1 + }, + { + "name": "plugins/modules/business_sda_wireless_controller_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "84f5b496f3795549f66eb8a40401e8151e0e0334b3a0ab81afe9833db612a216", + "format": 1 + }, + { + "name": "plugins/modules/wireless_provision_device_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "12136ddb30e224adc6d3291346817097d4446fba99bb5eb7e747d8a3d1585a92", + "format": 1 + }, + { + "name": "plugins/modules/network_device_sync.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "70d9cffd145e26f9506673554dcd917054d0514d5876d7e13307c88b290669d3", + "format": 1 + }, + { + "name": "plugins/modules/wireless_rf_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4327a68c352ee3a396e3dbf795daf7ed3be99c0b95101d2c0cfb06883c27344e", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_site_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "512570c0a02072cbf982bcca663c26d6e0e2598ce68e6f4659ad6152be5b4f52", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_syslog_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5f2046d3af15469c0175901508e6418405c410f7de26bc3f652defcb388ade53", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_import_project.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "84adb47b58a6d3a6783475832347ad2168d329157d34e3ca2be8ed20c8014a69", + "format": 1 + }, + { + "name": "plugins/modules/topology_vlan_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "db096d3fd5525976db78b3c4a91e7ca8b7d51f69413daadab850cd4ab7fa04c9", + "format": 1 + }, + { + "name": "plugins/modules/site_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4993391714d00efd42500ca81834ecce34a31b559fdee18ec149693528920dd1", + "format": 1 + }, + { + "name": "plugins/modules/event_series_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f7bff6806a626c0a80c6440ead86d4136386cac6a166015f145d6d1c1a762ee2", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_clone.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "476d838d47b3997dc18a371395ff3cb6cce7168726c025cd1c76dab8165f7352", + "format": 1 + }, + { + "name": "plugins/modules/swim_image_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cfca9340b6a13a2bd5a087ff3c6e14c4a23c766477e5d31a900deaf0791f882b", + "format": 1 + }, + { + "name": "plugins/modules/sda_provision_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ec679bfc2c99b73e223f4959fc4a0526d4efbf47fd9f33b4223fd83391719327", + "format": 1 + }, + { + "name": "plugins/modules/pnp_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f93db16aea9fcf84969798969948dd799505ddcbccac974b7b2e83374f56e79f", + "format": 1 + }, + { + "name": "plugins/modules/system_performance_historical_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "580525d7d40982c76a858fd37f62a9a17cb605eaab0b12f01a68ba007490bd6e", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_control_plane_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "db51ae66bb6ea7943c2ea027e22835f42cdcc29877a842598f008e77ebc02cbe", + "format": 1 + }, + { + "name": "plugins/modules/threat_detail.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f783a3b95044b92be75f0c152c4388f8dede23d80050ebbaaff8381eeb070075", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_version_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d187096538d665d3630c1ed3edae1adf425d093b552e9dc179050ea1f8a53414", + "format": 1 + }, + { + "name": "plugins/modules/syslog_config_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "31516b0a94c60248bb48e8521d6e3f11a52b9465fa4fb76212142d711cfcf6f1", + "format": 1 + }, + { + "name": "plugins/modules/nfv_provision_details.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fd9f58a5a78e6cf3b9ef4a18828bfd3d3c71bf9067bddeb0f21cbd6257d960e7", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_details_rest_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "12dc1a8fabe5dae7f1d74727d8c9bb9f0084c774d33131083b32a175c4eb6608", + "format": 1 + }, + { + "name": "plugins/modules/discovery_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8ba689381e0b1232ccf4d48f2635e19e96b2d217ec30f0d460f21becf1991b93", + "format": 1 + }, + { + "name": "plugins/modules/site_design_floormap_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6fdace45bec13e5e59cb888234e64693932748fb7d16b9d2da1ff03c767f0a92", + "format": 1 + }, + { + "name": "plugins/modules/discovery_job_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "74fa4b86bce115c77937388bf8c30dd1c212c51c9359bfb30a22ea347cbe228c", + "format": 1 + }, + { + "name": "plugins/modules/global_pool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4b2d7aa251db3d89f3c9520cb9d2d78787d485f3c5dc540bac38ec83609696f1", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f8f235117077b827547ba282ab803569826a3995bd54181520595f11dcdf0ccb", + "format": 1 + }, + { + "name": "plugins/modules/device_replacement.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c32f6b4a2041ea18f9c199868c982a5a5f4d9c0c857ab95b77ea044f9b925b49", + "format": 1 + }, + { + "name": "plugins/modules/sensor_test_template_duplicate.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "94b795d09e7eb4e147aa0d43def6667526f92ae82d09d0826242899df7573721", + "format": 1 + }, + { + "name": "plugins/modules/wireless_dynamic_interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "256ec24d864d6e46e1379dd40e292a558a509cc4abb3948af7730a5d01256365", + "format": 1 + }, + { + "name": "plugins/modules/discovery.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2f5200ccf2fe958bf6ea1b31e49ca942e561f763352a8b858a8e86a5058a7319", + "format": 1 + }, + { + "name": "plugins/modules/qos_device_interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7c8c372defb3175519a0ed18ab65de12f7cdb7d6c42a83096022a163ea1843e8", + "format": 1 + }, + { + "name": "plugins/modules/pnp_workflow_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "51b76732895b15f2c0b44f86a4e4779a7857003a67d61327c375e7c3217bfd97", + "format": 1 + }, + { + "name": "plugins/modules/license_smart_account_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3445ec738f2b098332069e43a52018612f20776e07fc7180d6a2756a4d67b6c0", + "format": 1 + }, + { + "name": "plugins/modules/network_device_module_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "67f61faf64ad4afcc94875aae3f900678ec43effbead16cdf5df5e43df02f941", + "format": 1 + }, + { + "name": "plugins/modules/assign_device_to_site.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "66692e2cf30951ef15947042093c7609a875642c8b31559d0653ec95c0834cfc", + "format": 1 + }, + { + "name": "plugins/modules/event_config_connector_types_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "534789a3e5be6ce3b9bdf8207b6f59fd2014db754d3a5e5941bd098b46d09f43", + "format": 1 + }, + { + "name": "plugins/modules/network_device_inventory_insight_link_mismatch_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7b800780b09ad6c8b6b6cb5dc366bef440af30b1b3364fa817eadb564ac256c7", + "format": 1 + }, + { + "name": "plugins/modules/task_operation_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c03bb12584fd9811458a83fb3ce3be39d604e5098fa0936e0173caa6f4a0b7ba", + "format": 1 + }, + { + "name": "plugins/modules/site_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "54ad0d4f3f891b4ebdf0f568834b356ce3fae3a977d8707fefae8b7ae9681338", + "format": 1 + }, + { + "name": "plugins/modules/sda_virtual_network_v2.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b68a5810eb4132b5dea8a106b39de1793c74b23edc6ec918595329ce4e8b34f3", + "format": 1 + }, + { + "name": "plugins/modules/network_device_by_ip_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9ac509acdc4c762cb3e857dfd580416711971ce107996a436319507b1c7cfa5d", + "format": 1 + }, + { + "name": "plugins/modules/network_device_lexicographically_sorted_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "94ef35daae89197a574ddc16ce3d40af9fee355571cb60c567d2d789615adb2e", + "format": 1 + }, + { + "name": "plugins/modules/pnp_workflow.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5f6d1953dfc0f6c6e9888e743d725a644936e5a1dbc104638aa7b407d9493767", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "38b483efd2cbf485c0e7cf897d00e2d7bed3301ae35b7e7f2fe4735eef9a088a", + "format": 1 + }, + { + "name": "plugins/modules/topology_layer_3_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3be4779df4aca09518d8964f4031591abfd39fdd700b8a01375a9f77f5385cb6", + "format": 1 + }, + { + "name": "plugins/modules/device_credential_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "88f138a794dc5a42197fc455246f35a747fc5733fdecfec34d510813274a6509", + "format": 1 + }, + { + "name": "plugins/modules/snmpv2_write_community_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "66d40b380a308d0c4d463e6c2afbd7e511401995c5ec6cbb8383c04850171174", + "format": 1 + }, + { + "name": "plugins/modules/global_credential_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5a29fab81c5dcc34942e0520555106d407c1d5be5ad2350ebe5bb2e3517246dc", + "format": 1 + }, + { + "name": "plugins/modules/wireless_rf_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "008c3081fa5cdfea7ec1c7c55005006cbd38ec279db7405d9e324fe4c50f3616", + "format": 1 + }, + { + "name": "plugins/modules/applications_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "daa4f710c924bb7cef9c5094f875555c9b805122f8897964e71fc4a685dd8630", + "format": 1 + }, + { + "name": "plugins/modules/sensor_test_template_edit.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c61fd70d849e2635aabe7ee0681de73480c563c156852e93e3d6e49706cfe94b", + "format": 1 + }, + { + "name": "plugins/modules/network_device_stack_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "28232e8cbfbc70dca83dd34983d61a61c07710425b037a846553e5102e3e1d03", + "format": 1 + }, + { + "name": "plugins/modules/global_credential_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5635804686b6c1dcbfdd600187002f55c99a6bb2ce33909b1b20754e773f0698", + "format": 1 + }, + { + "name": "plugins/modules/sda_multicast.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "098fab2963e0e91e41fabd79faaeb9cbf2f5f277fb2b234fe47fce0dd13fce9e", + "format": 1 + }, + { + "name": "plugins/modules/sda_device_role_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f181e587c723787107c7b28b62249b768c61c6b660095bf72e8de1b2b156126e", + "format": 1 + }, + { + "name": "plugins/modules/pnp_virtual_account_devices_sync.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "534814958e8c3ea6fc935dbd08d60571f10ee8ec64f234877a0c36334088b27f", + "format": 1 + }, + { + "name": "plugins/modules/applications.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3c687ea107d2c34cb1eed2256c3beaf1ec0bc93e9498b860b0260a2903bf4ff9", + "format": 1 + }, + { + "name": "plugins/modules/itsm_integration_events_failed_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f2236cbf493a04f2b417951e8fd6c9aa12221a42489679b7b8b6a7afd23458b2", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_export_project.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f077d02ea1cfd2971e35cc6b7e8338e5115f7f6ccaef66d001bdfcd701e0b645", + "format": 1 + }, + { + "name": "plugins/modules/reserve_ip_subpool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "40e4454daa55dc0975a3d1edb6192132274686870f7a30d4e3b78ed746920faf", + "format": 1 + }, + { + "name": "plugins/modules/network_device_interface_neighbor_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "859bee561489a592e76de54057ebbc7c566a6c8740051c442d8dd329b67e20f5", + "format": 1 + }, + { + "name": "plugins/modules/network_device_polling_interval_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2c1c47c56f5d792bd03e85ddde3e0a2538a01f31aba0814c34074438aee07255", + "format": 1 + }, + { + "name": "plugins/modules/tag_membership.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d5ec68b09e4009577498372d660f5d7b2e597cd0cad41017553061a1c2cf405", + "format": 1 + }, + { + "name": "plugins/modules/profiling_rules_in_bulk_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "15765a1dbec2fbcc86069e58aa04c38f1d1cf2ba517a9f1785ecc79bba8c9533", + "format": 1 + }, + { + "name": "plugins/modules/event_artifact_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b6c3f785d839db3db95af4cae1e5a5698bede3dccbb89d69ff9783a37f80121e", + "format": 1 + }, + { + "name": "plugins/modules/network_device_module_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d7ebf4dd462a77b11d973103227958da46700fae8d9617747297a65a8acc2af", + "format": 1 + }, + { + "name": "plugins/modules/global_credential_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a49f82933150a1a09572081a72c7d2325b29e195b71da8b89f843c83156c59ed", + "format": 1 + }, + { + "name": "plugins/modules/pnp_server_profile_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2da8840d0a28503a26353de3b410390f4d65fd6c8980d611dd45e491daa1b7b7", + "format": 1 + }, + { + "name": "plugins/modules/projects_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "831218ec9562e75540d4035c7f0a15ab275ef040c541f1eda77b731671f44d7e", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_claim_to_site.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5f1de882f7f19eb38cfa363b80868a8cb632c561cce886535ff5b6a9ebcf31b6", + "format": 1 + }, + { + "name": "plugins/modules/applications_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "48b9d8878343b80673ab59b4e95b98a6fd1cc79567f04b5e05c810f848746f4f", + "format": 1 + }, + { + "name": "plugins/modules/network_device_wireless_lan_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e68d7e70c4570b17440581639eea6b46945d54bef49deccf2edf881fb096838e", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_config_preview.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8e32fb6de985448dc5a125315550f0ee8d8fd2c08d3f9e232782e944d57a4b08", + "format": 1 + }, + { + "name": "plugins/modules/path_trace.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8028e4b64df8a9bc117643c9dd3052fb0a1b66f45b1b7faef38e74a51dfc1553", + "format": 1 + }, + { + "name": "plugins/modules/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/modules/device_replacement_deploy.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7d292b3e8eefaa09cc699f47c6d8dafbbd30ea35397a4b5f31a0ab5bc6cb9548", + "format": 1 + }, + { + "name": "plugins/modules/system_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8006a53552f482b3f3f97188885c6374861761702f5aaebecd8f1e317eeee1d8", + "format": 1 + }, + { + "name": "plugins/modules/app_policy_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3c208b9ec193ffe33c13897aec059032575aabb44c8760379a4896a420e7333e", + "format": 1 + }, + { + "name": "plugins/modules/event_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d2cf1e4bffddc28c9b92529804c9384b8e64fe4635ebdc7ca8dc4f98cab4d8a4", + "format": 1 + }, + { + "name": "plugins/modules/client_proximity_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "074df4c86da99d225d3ebd2d85347c57d9e9d27054d7de171c018cffa286c721", + "format": 1 + }, + { + "name": "plugins/modules/tag_member_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7906513bcf9e12ae42e8a036e4e7cbeafb95cef6912212f9d0a46aede30ffd21", + "format": 1 + }, + { + "name": "plugins/modules/network_device_global_polling_interval_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c2d226f1d292ef76f50bcdfa9d41b76f6c052df80eb4b8419f1264705a282f91", + "format": 1 + }, + { + "name": "plugins/modules/application_sets_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "87e9f963c750e336fad6c6044849fd70e2ff7657b154d0ea0023df9a3287c6ad", + "format": 1 + }, + { + "name": "plugins/modules/wireless_provision_access_point.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dc423a8048fc67ef9674f54dd9a79050852f2c6e77396fa2789d233ae2a72fa5", + "format": 1 + }, + { + "name": "plugins/modules/site_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "05468da524985907ca4d5ec2b92fdf69f69c690ba8051c8e489c46a5b9078e50", + "format": 1 + }, + { + "name": "plugins/modules/pnp_global_settings_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ab1409f92e774337e260796212688bddd73804a4f87da25ac5050cc5c15456ce", + "format": 1 + }, + { + "name": "plugins/modules/planned_access_points_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d8eeae0466c7d4abd531085860fcec1544dff0be9bf6707c2ce133081322d484", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ca27b7a6a525a197cbf24d682e839a372c988520297d2406093fa1b23269d993", + "format": 1 + }, + { + "name": "plugins/modules/disassociate_site_to_network_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a57099910d732a1081521b0586f14ba568f38b56f18cdf9f84d7726a25fc6b78", + "format": 1 + }, + { + "name": "plugins/modules/security_advisories_per_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "510a8d32961299a16d6901f64f7a0e4830efb08196d08cd633b1ae4d80595418", + "format": 1 + }, + { + "name": "plugins/modules/wireless_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fe5d9b0fb281f1f4e74b592d3afaa43f92a09b804a84953626226aa52e7fb25b", + "format": 1 + }, + { + "name": "plugins/modules/authentication_import_certificate.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "95ba72943a0e100576a8dca2f24b42024451108d1570e63a01a241274f6e88b8", + "format": 1 + }, + { + "name": "plugins/modules/sda_port_assignment_for_user_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f172c9b288ec4698f9a3db96e7034530f6e41a86b1c7271384a1d30bccd426c7", + "format": 1 + }, + { + "name": "plugins/modules/site_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fab44f99950a6bf987f4d154cde96319432ba0a66206ab861a4bb22b0a6c1f88", + "format": 1 + }, + { + "name": "plugins/modules/nfv_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "298fa9beb1afb05c465412ff8287d5902b17608768c777f48e95147e40b6466d", + "format": 1 + }, + { + "name": "plugins/modules/network_device_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "de3aed90d0e7a058c2b714f7af385a97463a28a688e3f1136d3dc39875b8c271", + "format": 1 + }, + { + "name": "plugins/modules/network_device_custom_prompt_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4e021d14d6b732f427fb2e929dcd160b5963e7495033a5cffad6f9cd61e9989d", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0315da3f9fc9553e61cd089e24427ca21a4571f93c6903dcdd7eca94de895a26", + "format": 1 + }, + { + "name": "plugins/modules/license_virtual_account_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3a012210e950edf8518d4968bc1df387b230030bff7a3f85f1ba36f9d8e7a4e9", + "format": 1 + }, + { + "name": "plugins/modules/device_credential_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e871368c6d1375f33f853132e5f5653d1d25ca48fdb7cb5d5580df72ce197a97", + "format": 1 + }, + { + "name": "plugins/modules/topology_layer_2_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f29d376c210c83aca735d11614f22ed9a4c9ca3fc97998d65b6b84fb95a1d4e7", + "format": 1 + }, + { + "name": "plugins/modules/threat_detail_count.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "398e231dd5f45adb3fa43840250f74340bea1357d98b6de55e76067fd1738ed3", + "format": 1 + }, + { + "name": "plugins/modules/device_credential_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bd2fb6aaee258088a4be03ce7b497590c53079a30d97897665a483001de952c3", + "format": 1 + }, + { + "name": "plugins/modules/site_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6613f1042cb7e1a7b38aef8bfee6b03cb02c635f6b7a8f249dba79f4fdc5bd82", + "format": 1 + }, + { + "name": "plugins/modules/site_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cf9f4548ec54b8edc18ae8adcf9922a0a9c637b53fa35e384632960e28d7b8eb", + "format": 1 + }, + { + "name": "plugins/modules/http_read_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6f974bce513629e3badc474d280670460b34b945815c1dfec75874846c72cec1", + "format": 1 + }, + { + "name": "plugins/modules/compliance_device_details_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8883b487fb7f4e894814db5c066ea8d62bcb9bab6eab77c1e65f8f41dcf59dad", + "format": 1 + }, + { + "name": "plugins/modules/swim_import_local.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8f56e87c5847d17450511876f9b1030e8cd0e389e4fcd26d8197531e649672ef", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_export_template.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e035fcfb51ca192b8d1e4b7658e78ee2c336371b02b7ec9f5011819bbb4b73dd", + "format": 1 + }, + { + "name": "plugins/modules/transit_peer_network_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b15a22ab63e241d5222edad9af20fa0b2908d259c6623df6c1dd4f329db990b7", + "format": 1 + }, + { + "name": "plugins/modules/wireless_provision_ssid_delete_reprovision.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a3fec6fc6428f9488499b493a82f5b511f608229c4d6bf744fd786764045ff8e", + "format": 1 + }, + { + "name": "plugins/modules/sda_virtual_network_v2_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "210ba7856af68fe0ab5c4c0a0c4fff311645d373e1ab3619ade7832c11c3db65", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c95073b01f53048d707f0eb22653bb52692d6dd33731bcb16ef51f46b0ba8046", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_authentication_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f369c0441b9669962ed4004da63dd8f917b39d17755d68c1a755d40f6fdc4246", + "format": 1 + }, + { + "name": "plugins/modules/command_runner_run_command.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6693edbedb0428d946372c9013ad5e347aed94992308d5617fa1a4cfcc76fb45", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_edge_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d1aec17fb70e84f51e3a5e18fbc26ce96cd9ab7c3dfc6df480f9c076eb13cf2c", + "format": 1 + }, + { + "name": "plugins/modules/client_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fa48ef333815f9c0d2c1cc17d98c980359463ea002eff33dcfa7858f6ded2329", + "format": 1 + }, + { + "name": "plugins/modules/sda_provision_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "285f1ddeca25ad12bf753ee7b7e3ba5ce8749e652da0549a87cc6477b148c8d7", + "format": 1 + }, + { + "name": "plugins/modules/interface_network_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ad46cfa858fb72bbd15702cc70ccf3d59c2960b601062e2cb1448d5c947d8d05", + "format": 1 + }, + { + "name": "plugins/modules/reserve_ip_subpool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7e5a004126fd764960d626affef39ffbd3e1e63ed87d3f601b29d8972abc52d2", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_version_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5c729bdf17c3f58fe8cb07c05abe38b6eb7212f54b780ef862a9613768ea52aa", + "format": 1 + }, + { + "name": "plugins/modules/dna_command_runner_keywords_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "43318675e447145e40a85a72914d396af2d0a28f50e973d04452fc7e74e91866", + "format": 1 + }, + { + "name": "plugins/modules/tag_member_type_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a27fd34a02e877fbcba7fd2391212254f28990401fdd87de10662b669ca6219d", + "format": 1 + }, + { + "name": "plugins/modules/cli_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "94eb8979f9fcb0bb622e23ee6d689f4dd067d70e5f92f369f79e5fb270845d98", + "format": 1 + }, + { + "name": "plugins/modules/event_webhook_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cf60d61cae706455b9af76ab05c54186e1dd50ae6f5e0e11f63d642e75179ffa", + "format": 1 + }, + { + "name": "plugins/modules/license_device_license_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5c4cb67543fb400d5e38e0187069963c5d3ee7729c221f410aa0508591dd4438", + "format": 1 + }, + { + "name": "plugins/modules/device_interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eaf9b9347ada93f0567ea5a6bd175279a5846caee551b69a4a1c716c86542ce4", + "format": 1 + }, + { + "name": "plugins/modules/disasterrecovery_system_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc01c9684c95ec5f274aaa5182feeb31990aa9f4927ca62d07de45008264d003", + "format": 1 + }, + { + "name": "plugins/modules/device_replacement_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "33735267f9937053587282f65594631dedfc3fd9fefcb36736d80f0495507f1c", + "format": 1 + }, + { + "name": "plugins/modules/pnp_virtual_account_deregister.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8a6700ff0d2530ea16147dc5e64040202f2ee8e66d953cd8ee05375a3b6e442", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_import_template.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7678c936795343aea0d480f69d50d9aea45d517739a2a7e2260c5ea80639ebfb", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ea228c564b4efc6c40fc9dccf20d8911ac984a954ffd9a6fb9f1d45da7693214", + "format": 1 + }, + { + "name": "plugins/modules/event_series_audit_logs_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3c9e1a8d9825781f9def1f39c11306f0f9ee54d6edcc9ec797f698ac276d2855", + "format": 1 + }, + { + "name": "plugins/modules/service_provider_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f621f61501f28d4445557ab75d70762b98c4d7aab426612475e92bf2af340bf2", + "format": 1 + }, + { + "name": "plugins/modules/endpoint_analytics_profiling_rules_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9eec6c9f2cd3bc40552b490dd35ee56617891c9ed320ba864ac94e7700f85181", + "format": 1 + }, + { + "name": "plugins/modules/system_health_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5fafcf66ef848c98360eae0deefb190fcfc26b65332e7285f11d6b31bfef862f", + "format": 1 + }, + { + "name": "plugins/modules/tag_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2b4ef16e18f7349df46dbf9d5ad0ddab34dcc3243d591021c19e363ce1fa45d3", + "format": 1 + }, + { + "name": "plugins/modules/template_preview.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6566b268065b758b1c68a6ecd29445a4cf074c57fcd06f7f36f135fcb7923942", + "format": 1 + }, + { + "name": "plugins/modules/sda_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a1863286578d1d7058c66030f5196c6d0d5c31da4b1a769b4c0d86fa6350fc93", + "format": 1 + }, + { + "name": "plugins/modules/network_device_equipment_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "18c6f19168b288f12abb9863bd52c193a9181df4f5b021ed69ae800fffbf6ee7", + "format": 1 + }, + { + "name": "plugins/modules/sda_virtual_network_ip_pool_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "06e5e7b4126e3f5ec10d5beafc32c625c57468272102dc7ace67fb658ec7e993", + "format": 1 + }, + { + "name": "plugins/modules/lan_automation_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6a83edfa781e5f0bcf66fd8ef3e253085acd7f14993599896749b97b6ad80f2b", + "format": 1 + }, + { + "name": "plugins/modules/app_policy_default_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7bf88c2b9746391d9e7f43dc96ad6dcc1d874426c718031d3eb97d6d97267d3e", + "format": 1 + }, + { + "name": "plugins/modules/swim_import_via_url.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d017455247056b195a47ea156a9d6cff5d37f9d77876109af39b64e9f56f2db1", + "format": 1 + }, + { + "name": "plugins/modules/business_sda_hostonboarding_ssid_ippool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "62be8bae14157d29d79e878a446d4e84b7be819ce48d2c8ba1c62cb8a1f40d95", + "format": 1 + }, + { + "name": "plugins/modules/snmp_properties_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "67fa7347d7fa944367c449e70a381b6b7985d70ebb1d6af1b4b9c04f750b1f23", + "format": 1 + }, + { + "name": "plugins/modules/event_email_config_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ddb249265a519600ff736f4aba950bcc74cb19d028a931003fd646a48f9b1f8e", + "format": 1 + }, + { + "name": "plugins/modules/swim_trigger_activation.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a73de0abe28f85f254f25b162a90bf6257ce1aad5919d0926c3ea4858bcf4b41", + "format": 1 + }, + { + "name": "plugins/modules/event_artifact_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b17b5412689f0ba4a9110408bf017008239bbbe59a79ec69090832d2808b1afe", + "format": 1 + }, + { + "name": "plugins/modules/discovery_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "29aa559fd96e7578de9db42769f08911f4c1efc84caf93e217b6572cf9bf7571", + "format": 1 + }, + { + "name": "plugins/modules/nfv_provision.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b175e23ebc0049879fa5359073468dea940d2a6a3489224346616af87daec898", + "format": 1 + }, + { + "name": "plugins/modules/wireless_psk_override.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0c58f8f00bd21e2c318f1b4e7ff5516166b621209674060a40bda47360097e33", + "format": 1 + }, + { + "name": "plugins/modules/network_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e20229353db79cb044670c74dc5ca1b2caa57cd51a45999009769943e3cf2ad7", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_rest_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7640fcdd8dbc80f6a930fdc146f9bd45deb3e972549b9089d587f2f386fa6f6c", + "format": 1 + }, + { + "name": "plugins/modules/reports_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "480d17d062b11d8f274124495b1ebf9b244ba521065b876a25ee402856649055", + "format": 1 + }, + { + "name": "plugins/modules/lan_automation_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f27c57978da70ffcdc86065d58d9ed2bac7a3ea195243d28997c321a459eb9bd", + "format": 1 + }, + { + "name": "plugins/modules/http_write_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bb124c888769059679d8464d8ff965d5252ee901c2d054508c9068358280b864", + "format": 1 + }, + { + "name": "plugins/modules/device_interface_isis_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "931764d35f07b5508e4be6fceb914e7b95fd920e14d7fb3a24aaa95a564563eb", + "format": 1 + }, + { + "name": "plugins/modules/sda_multicast_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bfa4fc7859982735fd88da30e180289759df13d60d207072ac4bf06573651ed8", + "format": 1 + }, + { + "name": "plugins/modules/topology_physical_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "95278a7cf5f0e98e9a4c0ad56e129f4b6703c06ed6fa42f09d51b692687694b0", + "format": 1 + }, + { + "name": "plugins/modules/security_advisories_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dd688ec7abba9d0d478735c0881f4939a616107a230993322e5e0037174635f2", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "07a63ba8d3af06310c4d02721ac5046e14835706764e5fe65fea9884a427f589", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_details_email_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5497dd36f9a56b8e55392e856e8f8ec26d6dd189e5d0b9668bef5920a1c1ee60", + "format": 1 + }, + { + "name": "plugins/modules/lan_automation_log_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f357efd439a62e5689e17b36a68e147c441e63084b7588e45b39c0336e87db94", + "format": 1 + }, + { + "name": "plugins/modules/network_device_supervisor_card_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9afaa51020eb5fa74db87da8d19d40112445afc0655a6f1246c23e9987307e69", + "format": 1 + }, + { + "name": "plugins/modules/network_device_interface_poe_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9114611840309a068f060a6c00005af4d0ce04b5e65b50b2ca1fddb5c1f3e4b9", + "format": 1 + }, + { + "name": "plugins/modules/wireless_enterprise_ssid.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e1fa4a975fe2bb4cfa7e150851a5daf7e4dddb3cec5bc47f07166d4471f492b6", + "format": 1 + }, + { + "name": "plugins/modules/event_email_config_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "aeff0928803c45a51f05d548da3ef7d1e8f90787451f548908ab83365eed8015", + "format": 1 + }, + { + "name": "plugins/modules/threat_summary.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ffccae9bc8e2ac2abb5d97564bd8f49b0d83861fc6a656f4f53658fd7c4aa499", + "format": 1 + }, + { + "name": "plugins/modules/network_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9da99a146cf9d0d90930a656afa2a30ac22e6707bbd08dcfb5b4ba38b9c6b4dd", + "format": 1 + }, + { + "name": "plugins/modules/network_device_poe_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "95b3e8a26f5cdb60290f3950c51b04388b818752b499dd96e6c2f79b63979091", + "format": 1 + }, + { + "name": "plugins/modules/pnp_virtual_account_sync_result_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3780c4c09e88efd6c4683ea5b1d04111c50174274a8e90c642cffbb987c05b69", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_project.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fcd9a13996f48b4feab768e13b2925575acf73280abf313581235bfa8527366e", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "308de7a07620eb1d3dddd76b86d6e37e3b02cb99504dd953ba06ee640cbcdb71", + "format": 1 + }, + { + "name": "plugins/modules/network_device_meraki_organization_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "40160dc893da16f8c56619f25dc0fa91e777160cef7a11afc42521ed1f004aba", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_email_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fb1c02841bffb25b95dddac13578bcff433f457fbb07763e1ce4704f72690136", + "format": 1 + }, + { + "name": "plugins/modules/event_webhook_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "47d4b730290b9e01588bdc9a62499d2b9e437b4f117d4ac1c52559f1d08ae548", + "format": 1 + }, + { + "name": "plugins/modules/discovery_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cd4c79c576ac4e75b87e664fa027d1771802246cfc18d8c0c06455f6ba09fd7c", + "format": 1 + }, + { + "name": "plugins/modules/dnacaap_management_execution_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7db3814a2dda68a74feaacf7002a854b1c27772745ae22c5fa4f206d35a61b41", + "format": 1 + }, + { + "name": "plugins/modules/network_device_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fa3aae8a6b2321f03a1b8f9e8baea70bcb43ba39533109e8c7dc3094237b1e34", + "format": 1 + }, + { + "name": "plugins/modules/reports.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "337408d4cec040a2addff74f30a07e69e606ddf58e2e909639b4c1843ab346d7", + "format": 1 + }, + { + "name": "plugins/modules/reports_view_group_view_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "752ebeabef80910863a3d0985b2a17b2aca65b3d7a5420087e8c841fb182aded", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_details_syslog_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "34a78d1be492cb4c226c40e73edc50f80f5e49882475210fa620c2cefb9ede18", + "format": 1 + }, + { + "name": "plugins/modules/license_device_license_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7e8a64bdb1274a57dbb2c55e38b0e452da3ab6814482105613ed0c66d379177d", + "format": 1 + }, + { + "name": "plugins/modules/path_trace_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5f20b9d6d414eb7c42f1ba22a7472fe9617cea8093c75541f22ae9e49cb332c8", + "format": 1 + }, + { + "name": "plugins/modules/site_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e678d7592b61991bf88589300a8296c0875e4fb4904b296958c885347a510781", + "format": 1 + }, + { + "name": "plugins/modules/site_membership_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0e1a5c49e9d699fddac3543310f80f10dc56a2ba34a1f419c508302aa3fc6573", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_border_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ae419fcf754093fc399ec8044392411ac06fe535a71219d279a15d3fc23bfc31", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_syslog.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6834ae5a13322cfecdcb7ca29c9b49923d1d2ac49b9d34c02b12b0ee7df97db6", + "format": 1 + }, + { + "name": "plugins/modules/device_interface_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "76da700b3f3e632bd6ca6eb0ab8e8cc371a430b1caf6807aeb2c4f8a5303d3d2", + "format": 1 + }, + { + "name": "plugins/modules/event_api_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d602f7466b50c0fd14d86d13018055ce549f2f362e88b1be736f1724378b1f45", + "format": 1 + }, + { + "name": "plugins/modules/event_series_audit_logs_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7dfde6593bc7b750abdd145838eca057fecad629f457dcebda76febaf5bfa192", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_border_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0de3b3ce607cf68f3ecea4ac7f3088bbf97f43969f20e452caaa4e326a390e3b", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_site.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3ed0c727980d58064779b4676b136468a725e3cd38df69b1a74c7c403536b504", + "format": 1 + }, + { + "name": "plugins/modules/application_sets.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "38d2b9077e0aa11c2909ad60982c3e8e98c7baf89889235c23b10adc7b468fa3", + "format": 1 + }, + { + "name": "plugins/modules/interface_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8dcf223d7831e9e7ab8040676a655ec2471d2e3cc984589dd4e73c33105b3de4", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_deploy.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d856907efa11180c43c3ac3c379714ad451183de87475e9f75fa05662a44cdc8", + "format": 1 + }, + { + "name": "plugins/modules/application_sets_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "98fc9a92f6d0c3c7e577566422b026881cfdaf6036d934e5270c5afdae983f18", + "format": 1 + }, + { + "name": "plugins/modules/device_family_identifiers_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "af0f77c84835c541f674fda8f5e5aec7870509f852f3762a890866fbb9c66969", + "format": 1 + }, + { + "name": "plugins/modules/compliance_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e5f5aa666609204c911a9185974570eb25291ad7885dc0b475bc83258f42512c", + "format": 1 + }, + { + "name": "plugins/modules/device_configurations_export.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "038af8d5122dee1aa0bcac5eb8fd3eea96d3a1e4da5a5c9fa18dafc8e9cbdc9e", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_reset.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b84251ad7277742f47d76491d0e97622ff4ff73cee04a6de7cdb6246671cec3b", + "format": 1 + }, + { + "name": "plugins/modules/pnp_device_history_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "63f4e90acc242174dce7f56ad2c47c552d979da967c9ecd23d07a2d7aee5db2c", + "format": 1 + }, + { + "name": "plugins/modules/task_tree_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6211a3d60cbf50d88033d72e71840da812111b698fc28207fcbe308270746a1e", + "format": 1 + }, + { + "name": "plugins/modules/network_device_vlan_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8765806aa1b2c2180cae25d4575938df40df8d3bb28d6f18d15cad1222fa699b", + "format": 1 + }, + { + "name": "plugins/modules/itsm_cmdb_sync_status_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "79ace219b614472c6a7d6fea59a45451fad0440136ee94b347f16bf267461fa1", + "format": 1 + }, + { + "name": "plugins/modules/file_import.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "60d334559e19014077c1548244ef0bcbf69b122fe53bdfca9682c061eeb67e68", + "format": 1 + }, + { + "name": "plugins/modules/app_policy_queuing_profile_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "89b90def6f4573f56b789007c885a93fb2e6cb0ee7195f586b0ed32549082053", + "format": 1 + }, + { + "name": "plugins/modules/license_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "260371a4081f9d4e8ef9ecc7ef39a14bcb856ab9c2d18ab1b8e6b89e64057a12", + "format": 1 + }, + { + "name": "plugins/modules/sda_port_assignment_for_access_point.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "63fdaa25b5ab63e4413c1429cc4dbd125cd011cdbff3d7ab1b91ce4310f58f39", + "format": 1 + }, + { + "name": "plugins/modules/nfv_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "17565c93dbecf0fb889b650c21e7d1fc8f5d858d51f0fcbc0a9ef2906b16fd43", + "format": 1 + }, + { + "name": "plugins/modules/sensor_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c27aa720f87ca297af307a213cda6c328fa7bbdde8603338c71471b0653d8c70", + "format": 1 + }, + { + "name": "plugins/modules/discovery_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ea537d263922e9274123283489d1900a22189508f0732745c50f77cc8b78c835", + "format": 1 + }, + { + "name": "plugins/modules/reserve_ip_subpool_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8d7eeca847a7f7aec15c40fa59359f38dbf117bc270a781ceea2a8fb40453d4", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_edge_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cfef146eb98bea19f7545d2b483f0cad125e641da41311d40a7d8ae2b81b143c", + "format": 1 + }, + { + "name": "plugins/modules/issues_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3552fe99cef7550c3b8e8f0a071eb0864fc63259c2126aeb89facf8cf86ccc94", + "format": 1 + }, + { + "name": "plugins/modules/reserve_ip_subpool_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "84d4aeebbf3ae99ad5704beb229edc2dcdd26013ba963c54edd4eb686efe94d4", + "format": 1 + }, + { + "name": "plugins/modules/system_performance_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ce0e3e28ad1703d22bd5bba859f83bbfe0160b0587fb9335f6688e4d2ce08675", + "format": 1 + }, + { + "name": "plugins/modules/pnp_virtual_accounts_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d3d000a260fa55c450387c04b85fb4f6f38e231b29797280a5323bf7c7edb913", + "format": 1 + }, + { + "name": "plugins/modules/qos_device_interface.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b1ed49412c7738a1f931e74444b0389393c63f046304fdd2eb165f25c12e286", + "format": 1 + }, + { + "name": "plugins/modules/platform_nodes_configuration_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dffe10b5ee55feb154d6cf7928d528a6973cc82a796f26b65587dedbb7a3aa53", + "format": 1 + }, + { + "name": "plugins/modules/license_usage_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ab5196b1931e8573190bbf1edf5ada965ec370e6e4bdd84526d01992e9210ebd", + "format": 1 + }, + { + "name": "plugins/modules/swim_trigger_distribution.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7a5653bebd2c34a0714a01f3d51b99b05410f365e1eede791c20d0cbef500689", + "format": 1 + }, + { + "name": "plugins/modules/network_device_config_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1bc10f975659b61c052672f75aa014afcee5d50527a77733aa7d65bf269d33d4", + "format": 1 + }, + { + "name": "plugins/modules/golden_tag_image_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "af30f6bb7ef5288c45378e2bf84c95083b6cc24c78b4a3cd4cb0d2927a260fe0", + "format": 1 + }, + { + "name": "plugins/modules/app_policy_queuing_profile_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5db47e0ca40ec28b5e44446ca95ae502b086663fe74e7f230280603ff5fb93d8", + "format": 1 + }, + { + "name": "plugins/modules/device_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d025fb5a1fac7cc308fea73147e225741f80872de1f8a3244431838a5f60ac36", + "format": 1 + }, + { + "name": "plugins/modules/file_namespace_files_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b56ee6140cf2f73c2f68c49c93c1271edbcf8483747c5932454a3cc995ec70f1", + "format": 1 + }, + { + "name": "plugins/modules/service_provider_update.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "367131c42c331a3d58c3c55c12acfb1b79381baa7151237d0e2d489bfce68e32", + "format": 1 + }, + { + "name": "plugins/modules/swim_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "edd538c5de05027c3a20c1fc4c69ba3bf838dd9390277dfd32fb90e4fdcd80c8", + "format": 1 + }, + { + "name": "plugins/modules/license_device_registration.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d1e899d4258d93cede92a61db3b245106721315c39fb23f561ea51f1c76d9865", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1d1671cf725fe57b7bbb58293e84061fc23dc13a7aa94c3d8d61f66ccfb8bc6c", + "format": 1 + }, + { + "name": "plugins/modules/topology_site_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "db630236845f02e3509240826214f5128dccf05d85e8973d09a4161b099119df", + "format": 1 + }, + { + "name": "plugins/modules/network_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fc87f5d7778a2fd653e5cab539eddcac1fb16c4b13c1c5df68cf3e75961ddc59", + "format": 1 + }, + { + "name": "plugins/modules/network_device_functional_capability_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "927c87255cacc9d32ffee2930f01925605380a47c0216a545190bfc59cbdf3fc", + "format": 1 + }, + { + "name": "plugins/modules/business_sda_virtual_network_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d6beee7d34eb0a01c99bf22de7cb3828132c39b99f305aff30a7b4cce7fb4c63", + "format": 1 + }, + { + "name": "plugins/modules/sda_virtual_network_ip_pool.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "65ec71aad3b7ab574243b21c37c313adf2ffb841b6d69b0dc69157897985da41", + "format": 1 + }, + { + "name": "plugins/modules/sda_port_assignment_for_access_point_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f756e843fb2f7626eb41a17caf18890c9b86c8810fbd2ff3ec4869a94a07b995", + "format": 1 + }, + { + "name": "plugins/modules/snmpv3_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a89b8c6e527f99286892d6da87131e4579e68fb056f4b64b1c1370995530394c", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_deploy_v2.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ea3ef4a7c5025fe8d6517d680a824cbf533a9a4b3676396b04ecd717ebf95d0e", + "format": 1 + }, + { + "name": "plugins/modules/applications_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "13ffffb6e7bfd438badf41dab65af8d3422f1bcbef8d826c7a9420b8e77ab63b", + "format": 1 + }, + { + "name": "plugins/modules/sda_virtual_network.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8a818b76e6ee0bb1ccd9f68fb6d05ed3bfc3932b2fded3b970865192d5ba7888", + "format": 1 + }, + { + "name": "plugins/modules/interface_network_device_detail_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "29dec8355faf383532a649f73821328951ccff1d10f779ba816130ed33baf308", + "format": 1 + }, + { + "name": "plugins/modules/security_advisories_ids_per_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5fb0cc73606fa28b9146277c1b89830a9b54abd125a6ae1c28d04e711679bf83", + "format": 1 + }, + { + "name": "plugins/modules/platform_release_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "58b717afbca97a58833054b8714e07b0aec0cf548146d3479664fb3ee6a985a7", + "format": 1 + }, + { + "name": "plugins/modules/network_device_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "982923a1bf449cd464aae865f0e9ec778c0fdf9c3f72020acf09ab39043cd81f", + "format": 1 + }, + { + "name": "plugins/modules/event_series_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9850fb6a1eae09f739e3c8f066e18c6dafc4b7d7690c79425a1367dbbe4f2ada", + "format": 1 + }, + { + "name": "plugins/modules/app_policy_queuing_profile.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a945521dc0a36557324ba8f735b5319a2362f2803616a6431680aaaf9410229e", + "format": 1 + }, + { + "name": "plugins/modules/service_provider_profile_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "050324e3c36ecc7efadddd29ef30647795e21d13d247b1c5849a95aaf371dcf0", + "format": 1 + }, + { + "name": "plugins/modules/service_provider_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bfbcbe776f3075ce312d2f24a9f41435180c60d1b53d48438f91833db05191fd", + "format": 1 + }, + { + "name": "plugins/modules/network_device_update_role.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eb6c54d7ba3e18879bb08fdf2bc5777f2542bdc880b05b9aeb3512c65cec193b", + "format": 1 + }, + { + "name": "plugins/modules/sda_port_assignment_for_user_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "943e70b6745a6ab45a025e0f46cbccc3d3d23dcfaad3f8fe1ee013d092f1a559", + "format": 1 + }, + { + "name": "plugins/modules/transit_peer_network.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b7d244b17c6c387309ba41609218b233d808ff5f4bdc76ddcddd0d610058c2c7", + "format": 1 + }, + { + "name": "plugins/modules/device_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "05ba1ddfe43be06e27d2e5c1b50bc0eba78d9af58183b2f1133df1143640e371", + "format": 1 + }, + { + "name": "plugins/modules/device_replacement_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5c58f1db9957c2bc925cebe668fdc10b4bfb2f12edf674910b886ea35f5f1dad", + "format": 1 + }, + { + "name": "plugins/modules/sensor_test_run.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d9ef6a8aecadeae78590a9e9a92d74a288d759617fa004f89a7b32e6cb192a0a", + "format": 1 + }, + { + "name": "plugins/modules/event_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e6c8fbfdf60b1cbf35e4ef163250b0ccd13f218ec7b4d35ef358334102ce0ca8", + "format": 1 + }, + { + "name": "plugins/modules/device_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "791677d81789ebbed706d0a781a8364f3c236a1a27879d76775e53ac6f11fe7e", + "format": 1 + }, + { + "name": "plugins/modules/netconf_credential.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3cc0b590cea4d7911d9f7a4c01c4a04dfcf56cfc52d12525d64cf3f8df8c6d04", + "format": 1 + }, + { + "name": "plugins/modules/network_device_register_for_wsa_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6578d445de80d4b309532ba0bc65e0d55519aa66bc44aa53b20c03f5fe74f299", + "format": 1 + }, + { + "name": "plugins/modules/client_health_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "857c1660250039a5c1741d22b4ade73cfd657eca042dbcf94af746e928ddf26f", + "format": 1 + }, + { + "name": "plugins/modules/interface_network_device_range_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "19b7c1e2995808459fafb6c690e3f8bc0a64d0bfae83f2e2ec6fa623ff730eed", + "format": 1 + }, + { + "name": "plugins/modules/compliance_device_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e96eab8b9416ceebad0a3114c4508ab97c466a3952b250f3f277bfe38be010f4", + "format": 1 + }, + { + "name": "plugins/modules/discovery_range_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ba13da77c7f892c1c399c6c958d1dc6af70093781b233bc76e1b129cf8366fdd", + "format": 1 + }, + { + "name": "plugins/modules/pnp_workflow_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "41f823ef28a342294d766f9522bff57ffe9211a741a62f18dc77681880451b66", + "format": 1 + }, + { + "name": "plugins/modules/network_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f02d1b6a2bc7d29c324751ee16f25f3c03738e7b331eb928808e4198299e61e6", + "format": 1 + }, + { + "name": "plugins/modules/network_device_export.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "39eb919e626e7499b8673e34a7f09cfef626a25b57b37b1dea12692375bc0c35", + "format": 1 + }, + { + "name": "plugins/modules/templates_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ad2da73fb9bc4504f269a190c491b51d80d0ec9acbc8011f4735e9c68f9b3916", + "format": 1 + }, + { + "name": "plugins/modules/event_series_audit_logs_parent_records_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "edbdf025bd5024854f9e0bbde8627df137e940af31bd2a34c16f73eb9b8ad53b", + "format": 1 + }, + { + "name": "plugins/modules/network_device_with_snmp_v3_des_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4029f28a1e8d717f45d2dbe4beae24574ef6ad877d4595761f757c09241b983c", + "format": 1 + }, + { + "name": "plugins/modules/license_virtual_account_change.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d1f478349e29fd04d5ecb1253f5fbc25bcc2a713f5f9d3dda90fca262fa6b862", + "format": 1 + }, + { + "name": "plugins/modules/compliance_device_by_id_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "919a6c4a24354c3dc7345ad61fdebb5c23543b7f1f8114df524ff7b78507b895", + "format": 1 + }, + { + "name": "plugins/modules/pnp_virtual_account_add.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b97f7bf0ed8a871c8abb93526c139f82a106537cabfa8690ebe05106555cd1", + "format": 1 + }, + { + "name": "plugins/modules/template_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7a045e9eddaeb61f4d1baf51b320a762e46e4e4da55fc253efefe93b4ff2c8cf", + "format": 1 + }, + { + "name": "plugins/modules/tag.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bbb6424a91586c74d9dab888fe173e30a508f98ebdfd897c63e5016eadee2ad4", + "format": 1 + }, + { + "name": "plugins/modules/reports_executions_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "49a10ab49f8b0a56e5e83749f6c828406d882fcf61f2cc74bda28ee879fe7bdc", + "format": 1 + }, + { + "name": "plugins/modules/sda_fabric_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eb439c5e9720a378729b549163fd024709252e3b8e90747d712d130d4e12f823", + "format": 1 + }, + { + "name": "plugins/modules/device_credential_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "19434098bb531f5645cc9dd7ec3ef060fc62eaf8505a4a1afaccb4e4f7a4cd56", + "format": 1 + }, + { + "name": "plugins/modules/file_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4cb5ac356f530f121a40f993997abbc4cb011c4fc6336577789315426f79b4f2", + "format": 1 + }, + { + "name": "plugins/modules/event_subscription_rest.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c947933ec1bc1405766e8a4d8dfef9d21343fdfd4ac6600c38b17335a8c4d34d", + "format": 1 + }, + { + "name": "plugins/modules/security_advisories_summary_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bc882aebe138607d0b303827e205b6697f05bd986071c0d7d49548781b32271a", + "format": 1 + }, + { + "name": "plugins/modules/network_device_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "572dadf002c013b3d9b528bbf1e24e94f29aadfb0eb33e0caf42712fd1f77260", + "format": 1 + }, + { + "name": "plugins/modules/pnp_smart_account_domains_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "894a1ce5ae2d4500837070af6d35bfbd0c7cb18ac709e9ff0f8726407bc37b0f", + "format": 1 + }, + { + "name": "plugins/modules/security_advisories_devices_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "09e0461d3ce4c1a16932b8c32bd0bbd387cec9e69e31a256032c2558b7d2338b", + "format": 1 + }, + { + "name": "plugins/modules/reserve_ip_subpool_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1c3ac587db4e5fed02cb076ffd58554834ad7077d8a0718d41985059b896469e", + "format": 1 + }, + { + "name": "plugins/modules/itsm_integration_events_retry.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2bf7e87de8923919e3b20a4752769ba67b4c74769acf40221405ad386e66c3da", + "format": 1 + }, + { + "name": "plugins/modules/user_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7638a42d626129b870405537665e64ee9f9d1215b087ffea389a58ce4b9e1aaa", + "format": 1 + }, + { + "name": "plugins/modules/site_assign_device.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "40508aa0e7cc27489f5a1ae7724a587082063de92d767be71bdf32b9cb76f724", + "format": 1 + }, + { + "name": "plugins/modules/golden_tag_image_delete.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b227ca6d6948a108ff4eaf9335ccc49b19a602f95f784b7dc6cb33fe09edab66", + "format": 1 + }, + { + "name": "plugins/modules/network_device_linecard_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b408a876eefa5939ca6c7b0a05d5aab4fbeab243aa0dff400083bb0e8612f7a6", + "format": 1 + }, + { + "name": "plugins/modules/issues_enrichment_details_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1a6d4e1e484ffdc78c6227b1f41ceefab0cefcf7ff214f2dfd59b33a1db3f022", + "format": 1 + }, + { + "name": "plugins/modules/golden_image_create.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b4c425e6a3760f8a0d1ef1e09a71d3bc1d9bbb549593ed358ebae02e70f0062a", + "format": 1 + }, + { + "name": "plugins/modules/qos_device_interface_info_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "68de3c82502965a33cb10bcf2b3dc71d0e120e8214ac5905f84ac66acc267e06", + "format": 1 + }, + { + "name": "plugins/modules/compliance_device_status_count_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "71ec2207cd2f09326400af3e3336313fff273a6d338a88fe1fe009228ecc2741", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template_project_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6b34aa01f68af0490bfecb97cd0c7c93f6646d9a900899b486a0fb9758a4b61d", + "format": 1 + }, + { + "name": "plugins/modules/pnp_global_settings.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5917ba9cf862f97b5973d06d69cfd0585f3a8d9504038a14575da30394c84833", + "format": 1 + }, + { + "name": "plugins/modules/configuration_template.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4e98af9262cc6a15dad127426eb6a946f11259849072775889f7182fd47fe085", + "format": 1 + }, + { + "name": "Makefile", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "61e14edc41aba4096e2d89fab66ae8795baeb4602b59ab197f4f2e15cd243e39", + "format": 1 + }, + { + "name": "tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/unit", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/unit/modules", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/unit/modules/dnac", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/dnac_module.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "53567555cf827e4b33225ff75bf0e9e28fe7cc538dd07a86db5e25f030ecd6f3", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/test_site_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "94061b3eb5eca434f97dd71fd0ee47eca1e5a0712d7db42d132bca1a434a744b", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/test_template_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a6f5990198e6cb545d4a88a1d31f8aebc7c79c266ac8671934f576dfcea4f386", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/test_swim_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6ccbd74f9614b8d7925737aad721d767121d3b6b26d51df841c128f367a4d91c", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/fixtures", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/fixtures/site_intent.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bca80d902eaa86a004df2d3f5b0a9082e6a09abcc270517cc2ce1069d00c1009", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/fixtures/pnp_intent.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d8b9edd308c0343cc78d4cd34f5f45e8897924f8a89dd099f7ae2ffd9b17eaa5", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/fixtures/template_intent.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "efb2f50fab1d57c434f2ef309195ece3a7691f4c6f52a947a8e06a9670819b1a", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/fixtures/swim_intent.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "964bd2e5312448c363f28f1f5a6262b1119422058f3434885f62d073f146f3d9", + "format": 1 + }, + { + "name": "tests/unit/modules/dnac/test_pnp_intent.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a174e1c0a7d64edec664aba49fd4ccd49db597aaa36280a3d91d305642597ff2", + "format": 1 + }, + { + "name": "tests/sanity", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/sanity/ignore-2.14.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b4d18e01e2f9751bea0b06b4767bea1020935e9a790d0e2d10ed0eb94ea95fd", + "format": 1 + }, + { + "name": "tests/sanity/ignore-2.15.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b4d18e01e2f9751bea0b06b4767bea1020935e9a790d0e2d10ed0eb94ea95fd", + "format": 1 + }, + { + "name": "tests/sanity/ignore-2.11.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6cf1d519778d972db4420a14be5e5711bd089185ffd2826e3edeb824d6eef1b0", + "format": 1 + }, + { + "name": "tests/sanity/ignore-2.10.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d4ab069bf1409c5942cb673812da6bbf6611578eefe410e4ad0561d8f42f6bba", + "format": 1 + }, + { + "name": "tests/sanity/ignore-2.12.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "413c41b8214cecc32374e4a2cddc8f2ee4a92bdbe3ed9fae886157fb665171b0", + "format": 1 + }, + { + "name": "tests/sanity/ignore-2.13.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b4d18e01e2f9751bea0b06b4767bea1020935e9a790d0e2d10ed0eb94ea95fd", + "format": 1 + }, + { + "name": "tests/sanity/ignore-2.9.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d4ab069bf1409c5942cb673812da6bbf6611578eefe410e4ad0561d8f42f6bba", + "format": 1 + }, + { + "name": "meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "meta/runtime.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "48a2f61c72296aaa190a3ad670b0a5759bd047262b59b3d870e986b05878d87d", + "format": 1 + }, + { + "name": "playbooks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "playbooks/applications.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "df26867589e307f27b211e952dec9496fcd3d51dbcd8f898da8eddedba6f4ea4", + "format": 1 + }, + { + "name": "playbooks/download_device_cmd_runner_output.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0c5e39826eca17f04f0ba8121ccccc80fe30af5460562b1f07ac62016076243d", + "format": 1 + }, + { + "name": "playbooks/template.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cd4f1a151c38a64899efe1bd41151c2996ac5e988f3187971f553f603b2a5620", + "format": 1 + }, + { + "name": "playbooks/pnp_device.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3e43e8e3c88d5a17009e572e30d999f41d712108a381a87c8c365a06d5ab454c", + "format": 1 + }, + { + "name": "playbooks/template_pnp_intent.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "97383920ef46aa7295f1207af197e8631a957b8f99c296e494b77a4bbba1b89e", + "format": 1 + }, + { + "name": "playbooks/reports_executions_info.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c06bc2f1646a9fedc0a5ceefd208d34c5f8541584c895f4749fcf2eb31d592be", + "format": 1 + }, + { + "name": "playbooks/wireless_enterprise_ssid.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bc68e457f25fe6272a9d1fb5421ea208d1fd31b3f60964034eec880e0dbfd6bb", + "format": 1 + }, + { + "name": "playbooks/discovery.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "10437949e7c63f902ba760727984f08f28752186dff7a73390fafd4a433f42d7", + "format": 1 + }, + { + "name": "playbooks/network_device_custom_prompt_info.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f7e83e610284ebcdd7ed977b74434ddf85e2194c2ab3611f890debffedbc78ae", + "format": 1 + }, + { + "name": "playbooks/device_details.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2391ea6223b5ff5f7f6402386a44318f78ea2cb0e170494b7f30e07eb59a8709", + "format": 1 + }, + { + "name": "playbooks/application_set_info.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6e92871b084c2cd03c100a8f345c46301db598b38b4b02315d6fa3600806eb0d", + "format": 1 + }, + { + "name": "playbooks/import_image_file.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0a49ab1d0605e2986b1991509e30dfaa624e4a90fcfdc4c248a93d7241be305f", + "format": 1 + }, + { + "name": "playbooks/sda_virtual_network_v2.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "95a308dfa4a20e8bcf7cc54de3508722385de94116658e7c5ffbe9ffa72f7d8c", + "format": 1 + }, + { + "name": "playbooks/network_device_update_role.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7db95d35c76d7872d9dcecdfe0244320cf6bb706059229bb653b77e1cacb40c4", + "format": 1 + }, + { + "name": "playbooks/application_sets.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "21423c6d1f16e4297a66504cb5e16285d6104199068444ffd770ebe5b182c277", + "format": 1 + }, + { + "name": "playbooks/credentials.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3e938535d0485f0c66e9228fbba8023b8f04bbc24b49a2accd32627f8047fd3f", + "format": 1 + }, + { + "name": "playbooks/command_runner_run_command.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e1704af4aa3fee0851ee0208f06c3b6582782ddac92861602049611f4ab366d8", + "format": 1 + }, + { + "name": "playbooks/tag.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cdb0b5530a5dceb949d46af7c66175bd5ff9d337355055b2cc536f44ef462658", + "format": 1 + }, + { + "name": "playbooks/image_details.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "241b46df6626dd44167e58ff503af0bcae2709328f9fde746e859abe001ba57a", + "format": 1 + }, + { + "name": "playbooks/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "playbooks/files/test.template", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2dde90ef2e6a78f7bb4a9676f1b1a24b8c53dccfd6d0238e6796b096f0f1a513", + "format": 1 + }, + { + "name": "playbooks/test_swim_module.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ad0c0bbbb67dea907091062e27e3a90587080cdeff126a4eafbdc34adc2e8748", + "format": 1 + }, + { + "name": "playbooks/hosts", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c95416f1926509e857978b8f7b79f79d8ade1e8bacbe8e60606bd0dbe0e6ed1c", + "format": 1 + }, + { + "name": "playbooks/network_device_info.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3db7a77ed666f5c9e92ec22fe9fef67aa002570e5ee150150b5cf66edce115cb", + "format": 1 + }, + { + "name": "playbooks/global_credentials_info.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2b0a86ba9dab6a6504d0bf7f78ba42e94ac4b006d0fafbfee2da3a39ef65e834", + "format": 1 + }, + { + "name": "playbooks/global_credentials.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6f500d4c375b20d3dc174cf6b1edd4fa529160c20922dc63ac8682da5d63d86a", + "format": 1 + }, + { + "name": "playbooks/configuration_template_version_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4c3d53686dd7826f02094fd5335cf7a7daa3842934f2320496c198fd5ec853d7", + "format": 1 + }, + { + "name": "playbooks/global_pool.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ea774782442371258214954d94589171c7a2716935a4bda18dffcd2d839d4e77", + "format": 1 + }, + { + "name": "playbooks/reserve_ip_subpool.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "448f19e59ed1c5871c3d8a8aa2bcf71c5dd7c03508922687e10df7e63df1011f", + "format": 1 + }, + { + "name": "playbooks/sda_fabric_site.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "47f67a07319d368a5db6f2621be49c616ce59cf1b7541d23ca57720fd4ae5db3", + "format": 1 + }, + { + "name": "playbooks/sda_fabric.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "db2e6e8d30734e083d8e1a3ad93665f3a296a1238764ece5b29348fe125e9aa5", + "format": 1 + }, + { + "name": "playbooks/credentials.template", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ca11e1ddb242e4264b410e819db646485a28300970595f91a44158d1db8b0190", + "format": 1 + }, + { + "name": "playbooks/authentication_import.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "80e01573ee569bdf23d9233355fb22c17fe00358d3ef52d8f106204527b33c9a", + "format": 1 + }, + { + "name": "docs", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "docs/index.rst", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "510209cdacfcaaca3edf61a64588fdc336720b845212546b06fd2169a7dbe20c", + "format": 1 + }, + { + "name": "docs/requirements.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bb6d818f16e97b11662f5d0dbd7d134c0b99841f0e812199cf984cf2dbaf4414", + "format": 1 + }, + { + "name": "docs/Makefile", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b756428772cb4aec9a3b2ea75d544263a542ac20e2a0dd94bb6567af3b6ff9e0", + "format": 1 + }, + { + "name": "docs/conf.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b6c313ffad284fc0213672820293016e95af2c92a0fe5d3e32641f84d56e5497", + "format": 1 + }, + { + "name": "docs/_gh_include", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "docs/_gh_include/footer.inc", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ec5a9f6b1f0975e1f4ce91a2ef16394f1f68f1898a96ed61c9c229801b0a9e11", + "format": 1 + }, + { + "name": "docs/_gh_include/header.inc", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6bdefd901ec20bc98a1d92c65347cce0f6899fc50f2d11e6f5070abffa914f50", + "format": 1 + }, + { + "name": "changelogs", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "changelogs/changelog.yaml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6dca1141cbdc0a49cce764f9d221a659ee6f38be23052fce1ac78db3d152cab7", + "format": 1 + }, + { + "name": "README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b3a4ef94b9a41f00dc720fc4963162832297915883f675f809f70379552ac938", + "format": 1 + }, + { + "name": ".gitignore", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d814d50e57d0fd49615568f9de9b71ddca4c2f84005ab8e75a38030baecbe205", + "format": 1 + }, + { + "name": ".github", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": ".github/workflows", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": ".github/workflows/sanity_tests.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ee7a36fc43cbe0b847c07915049ba841f43e40084daa6babbf518c7e8e203f68", + "format": 1 + }, + { + "name": ".github/workflows/docs.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d8611ee91073e25e678934a5f53609f26282966c77c50c38527065bc467eb344", + "format": 1 + }, + { + "name": ".github/ISSUE_TEMPLATE", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": ".github/ISSUE_TEMPLATE/feature_request.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1f48c52f209a971b8e7eae4120144d28fcf8ee38a7778a7b4d8cf1ab356617d2", + "format": 1 + }, + { + "name": ".github/ISSUE_TEMPLATE/bug_report.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c89c9a527a84224788c3e2109a8cd2c9226737d1905861828d6ed28e72a25351", + "format": 1 + }, + { + "name": ".github/ISSUE_TEMPLATE/config.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1f103c6a9dd07cd13a9a6f17ace6b813f47747eb9cb7e00488cb2073caaf91bb", + "format": 1 + }, + { + "name": ".vscode", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": ".vscode/settings.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ccc508f77af555279c715e9ca73dc77e9a7149f805d9d910fde47e22d0b7df53", + "format": 1 + } + ], + "format": 1 +} \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/LICENSE b/ansible_collections/cisco/dnac/LICENSE new file mode 100644 index 00000000..cfbe495a --- /dev/null +++ b/ansible_collections/cisco/dnac/LICENSE @@ -0,0 +1,677 @@ +Copyright (c) 2021, Cisco Systems +All rights reserved. + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/MANIFEST.json b/ansible_collections/cisco/dnac/MANIFEST.json new file mode 100644 index 00000000..255e9f29 --- /dev/null +++ b/ansible_collections/cisco/dnac/MANIFEST.json @@ -0,0 +1,43 @@ +{ + "collection_info": { + "namespace": "cisco", + "name": "dnac", + "version": "6.6.3", + "authors": [ + "Rafael Campos ", + "William Astorga ", + "Jose Bogarin ", + "Bryan Vargas ", + "Francisco Mu\u00f1oz ", + "Madhan Sankaranarayanan (@madhansansel)", + "Rishita Chowdhary (@rishitachowdhary)" + ], + "readme": "README.md", + "tags": [ + "cisco", + "dnac", + "cloud", + "collection", + "networking", + "sdn" + ], + "description": "Ansible Modules for Cisco DNA Center", + "license": [], + "license_file": "LICENSE", + "dependencies": { + "ansible.utils": ">=2.0.0,<3.0" + }, + "repository": "https://github.com/cisco-en-programmability/dnacenter-ansible", + "documentation": "https://cisco-en-programmability.github.io/dnacenter-ansible/", + "homepage": "https://github.com/cisco-en-programmability/dnacenter-ansible", + "issues": "https://github.com/cisco-en-programmability/dnacenter-ansible/issues" + }, + "file_manifest_file": { + "name": "FILES.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c115ad129df97943339018a8327a9094b3869b6df5a90dc811fee8c08d14b81e", + "format": 1 + }, + "format": 1 +} \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/Makefile b/ansible_collections/cisco/dnac/Makefile new file mode 100644 index 00000000..f66cb4d3 --- /dev/null +++ b/ansible_collections/cisco/dnac/Makefile @@ -0,0 +1,51 @@ +NAMESPACE := $(shell python -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["namespace"])') +NAME := $(shell python -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["name"])') +VERSION := $(shell python -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["version"])') +MANIFEST := build/collections/ansible_collections/$(NAMESPACE)/$(NAME)/MANIFEST.json + +PLUGIN_TYPES := $(filter-out __%,$(notdir $(wildcard plugins/*))) +METADATA := galaxy.yml LICENSE README.md meta/runtime.yml requirements.txt changelogs/changelog.yaml +$(foreach PLUGIN_TYPE,$(PLUGIN_TYPES),$(eval _$(PLUGIN_TYPE) := $(filter-out %__init__.py,$(wildcard plugins/$(PLUGIN_TYPE)/*.py)))) +DEPENDENCIES := $(METADATA) $(foreach PLUGIN_TYPE,$(PLUGIN_TYPES),$(_$(PLUGIN_TYPE))) $(foreach ROLE,$(ROLES),$(wildcard $(ROLE)/*/*)) $(foreach ROLE,$(ROLES),$(ROLE)/README.md) + +COLLECTION_COMMAND ?= ansible-galaxy +TEST = +FLAGS = + + +default: help +help: + @echo "Please use \`make ' where is one of:" + @echo " help to show this message" + @echo " info to show infos about the collection" + @echo " sanity to run santy tests" + @echo " setup to set up test, lint" + +setup: test-setup + +test-setup: | tests/test_playbooks/vars/server.yml + pip install --upgrade 'pip<20' + pip install --upgrade -r requirements-dev.txt + +tests/test_playbooks/vars/server.yml: + cp $@.example $@ + @echo "For recording, please adjust $@ to match your reference server." + +$(MANIFEST): + ansible-galaxy collection build --force + ansible-galaxy collection install cisco-dnac-* --force + +build/src/%: % + install -m 644 -DT $< $@ + +doc-setup: + pip install --upgrade -r docs/requirements.txt +doc: $(MANIFEST) + mkdir -p ./docs/plugins + antsibull-docs collection --use-current --squash-hierarchy --dest-dir ./docs/plugins $(NAMESPACE).$(NAME) + make -C docs html + + +FORCE: + +.PHONY: help dist lint sanity test test-crud test-check-mode test-other livetest setup test-setup doc-setup doc publish FORCE diff --git a/ansible_collections/cisco/dnac/README.md b/ansible_collections/cisco/dnac/README.md new file mode 100644 index 00000000..fa6d766b --- /dev/null +++ b/ansible_collections/cisco/dnac/README.md @@ -0,0 +1,211 @@ +# Ansible Collection - cisco.dnac + +## Ansible Modules for DNA Center + +The dnacenter-ansible project provides an Ansible collection for managing and automating your Cisco DNA Center environment. It consists of a set of modules and roles for performing tasks related to DNA Center. + +This collection has been tested and supports Cisco DNA Center 2.3.3.0. + +*Note: This collection is not compatible with versions of Ansible before v2.8.* + +Other versions of this collection have support for previous Cisco DNA Center versions. The recommended versions are listed below on the [Compatibility matrix](https://github.com/cisco-en-programmability/dnacenter-ansible#compatibility-matrix). + +## Compatibility matrix +The following table shows the supported versions. + +| Cisco DNA Center version | Ansible "cisco.dnac" version | Python "dnacentersdk" version | +|--------------------------|------------------------------|-------------------------------| +| 2.1.1 | 3.0.0 | 2.2.5 | +| 2.2.2.3 | 3.3.1 | 2.3.3 | +| 2.2.3.3 | 6.4.0 | 2.4.11 | +| 2.3.3.0 | 6.6.3 | 2.5.5 | + +If your Ansible collection is older please consider updating it first. + +*Notes*: + + +1. The "Python 'dnacentersdk' version" column has the minimum recommended version used when testing the Ansible collection. This means you could use later versions of the Python "dnacentersdk" than those listed. +2. The "Cisco DNA Center version" column has the value of the `dnac_version` you should use for the Ansible collection. + +## Installing according to Compatibility Matrix + +For example, for Cisco DNA Center 2.2.2.3, it is recommended to use Ansible "cisco.dnac" v3.3.1 and Python "dnacentersdk" v2.3.3. + +To get the Python DNA Center SDK v2.3.3 in a fresh development environment: +``` +sudo pip install dnacentersdk==2.3.3 +``` + +To get the Ansible collection v3.3.1 in a fresh development environment: +``` +ansible-galaxy collection install cisco.dnac:3.3.1 +``` + +## Requirements +- Ansible >= 2.9 +- [Python DNA Center SDK](https://github.com/cisco-en-programmability/dnacentersdk) v2.4.7 or newer +- Python >= 3.6, as the DNA Center SDK doesn't support Python version 2.x + +## Install +Ansible must be installed ([Install guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)) +``` +sudo pip install ansible +``` + +Python DNA Center SDK must be installed +``` +sudo pip install dnacentersdk +``` + +Install the collection ([Galaxy link](https://galaxy.ansible.com/cisco/dnac)) +``` +ansible-galaxy collection install cisco.dnac +``` +## Using this collection + +There are three ways to use it: +- [Using environment variables](#using-environment-variables) +- [Using vars_files](#using-vars_files) + +### Using environment variables +First, export the environment variables where you specify your DNA Center credentials as ansible variables: +``` +export DNAC_HOST= +export DNAC_PORT=443 # optional, defaults to 443 +export DNAC_USERNAME= +export DNAC_PASSWORD= +export DNAC_VERSION=2.3.3.0 # optional, defaults to 2.3.3.0. See the Compatibility matrix +export DNAC_VERIFY=False # optional, defaults to True +export DNAC_DEBUG=False # optional, defaults to False +``` + +Create a `hosts` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/hosts)) file that uses `[dnac_servers]` with your Cisco DNA Center Settings: +``` +[dnac_servers] +dnac_server +``` + +Then, create a playbook `myplaybook.yml` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/tag.yml)) referencing the variables in your credentials.yml file and specifying the full namespace path to the module, plugin and/or role: +``` +- hosts: dnac_servers + gather_facts: no + tasks: + - name: Create tag with name "MyNewTag" + cisco.dnac.tag: + state: present + description: My Tag + name: MyNewTag + register: result +``` + +Execute the playbook: +``` +ansible-playbook -i hosts myplaybook.yml +``` + +### Using vars_files + +First, define a `credentials.yml` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/credentials.template)) file where you specify your DNA Center credentials as Ansible variables: +``` +--- +dnac_host: +dnac_port: 443 # optional, defaults to 443 +dnac_username: +dnac_password: +dnac_version: 2.3.3.0 # optional, defaults to 2.3.3.0. See the Compatibility matrix +dnac_verify: False # optional, defaults to True +dnac_debug: False # optional, defaults to False +``` + +Create a `hosts` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/hosts)) file that uses `[dnac_servers]` with your Cisco DNA Center Settings: +``` +[dnac_servers] +dnac_server +``` + +Then, create a playbook `myplaybook.yml` ([example](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks/tag.yml)) referencing the variables in your credentials.yml file and specifying the full namespace path to the module, plugin and/or role: +``` +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: no + tasks: + - name: Create tag with name "MyNewTag" + cisco.dnac.tag: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + state: present + description: My Tag + name: MyNewTag + register: result +``` + +Execute the playbook: +``` +ansible-playbook -i hosts myplaybook.yml +``` +In the `playbooks` [directory](https://github.com/cisco-en-programmability/dnacenter-ansible/blob/main/playbooks) you can find more examples and use cases. + + +## Update +Getting the latest/nightly collection build + +Clone the dnacenter-ansible repository. +``` +git clone https://github.com/cisco-en-programmability/dnacenter-ansible.git +``` + +Go to the dnacenter-ansible directory +``` +cd dnacenter-ansible +``` + +Pull the latest master from the repo +``` +git pull origin master +``` + +Build and install a collection from source +``` +ansible-galaxy collection build --force +ansible-galaxy collection install cisco-dnac-* --force +``` + +### See Also: + +* [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details. + +## Attention macOS users + +If you're using macOS you may receive this error when running your playbook: + +``` +objc[34120]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. +objc[34120]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. +ERROR! A worker was found in a dead state +``` + +If that's the case try setting this environment variable: +``` +export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES +``` + +## Contributing to this collection + +Ongoing development efforts and contributions to this collection are tracked as issues in this repository. + +We welcome community contributions to this collection. If you find problems, need an enhancement or need a new module, please open an issue or create a PR against the [Cisco DNA Center Ansible collection repository](https://github.com/cisco-en-programmability/dnacenter-ansible/issues). + +## Code of Conduct +This collection follows the Ansible project's +[Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html). +Please read and familiarize yourself with this document. + +## Releasing, Versioning and Deprecation + +This collection follows [Semantic Versioning](https://semver.org/). More details on versioning can be found [in the Ansible docs](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#collection-versions). + +New minor and major releases as well as deprecations will follow new releases and deprecations of the Cisco DNA Center product, its REST API and the corresponding Python SDK, which this project relies on. diff --git a/ansible_collections/cisco/dnac/changelogs/changelog.yaml b/ansible_collections/cisco/dnac/changelogs/changelog.yaml new file mode 100644 index 00000000..71d52f42 --- /dev/null +++ b/ansible_collections/cisco/dnac/changelogs/changelog.yaml @@ -0,0 +1,626 @@ +releases: + 1.0.0: + release_date: "2020-12-02" + changes: + release_summary: This is the initial release of the collection. + 1.0.1: + release_date: "2021-03-22" + changes: + release_summary: Fixes a bug related to idempotent modules. + bugfixes: + - Fixes a bug in the 'site' and 'tag' modules, which are the only two idempotent modules. + 1.0.2: + release_date: "2021-03-22" + changes: + release_summary: Fixes a bug related to optional module parameters. + bugfixes: + - Improve the documentation. + - Fixes a bug that caused the task execution to fail if the optional parameters like port, dnac version and SSL verification were missing from the hosts.yml file. + 1.0.3: + release_date: "2021-03-29" + changes: + release_summary: Fixes several bugs and issues required to pass sanity checks + bugfixes: + - Adds code of conduct + - Adds missing boilerplate code + - Adds code specific to idempotent module definitions + - Adds entries to the sanity check ignore file + - Fixes pylint issues + - Fixes yamllint issues + - Fixes return syntax errors + - Removes the RETURN section from all modules + - Removes blank spaces from DOCUMENTATION + - Removes colon characters from DOCUMENTATION + - Removes duplicate keys from DOCUMENTATION + - Removes ANSIBLE_METADATA section from all modules + - Adds changelog + 1.0.4: + release_date: "2021-03-29" + changes: + release_summary: Fixes linting problems with the DOCUMENTATION and adds CI tests. + bugfixes: + - Fixes linting problems with the DOCUMENTATION. + 2.0.0: + release_date: "2021-04-05" + changes: + release_summary: Moves the module parameters out of the inventory and places them inside the tasks themselves. + major_changes: + - Moves the module parameters out of the inventory and places them inside the tasks themselves. + bugfixes: + - Adds policy about releasing, versioning and deprecation to the README. + - Documents the minimum version of Python supported by the collection. + - Documents the dependency on ansible.utils + - Documents the non-standard return values of all modules in the collection + 2.0.1: + release_date: "2021-04-05" + changes: + release_summary: Fixes linting problems with the DOCUMENTATION. + bugfixes: + - Fixes linting problems with the DOCUMENTATION. + 2.0.2: + release_date: "2021-04-06" + changes: + release_summary: Adds code to gracefully handle missing dependencies. + bugfixes: + - Adds try/except clauses to gracefully handle missing SDK and ansible.utils dependencies per ansible-core-2.11 requirements + 2.0.3: + release_date: "2021-04-06" + changes: + release_summary: Updates the README to reflect latest API changes. + bugfixes: + - Updates the README to reflect latest API changes. + 2.0.4: + release_date: "2021-04-12" + changes: + release_summary: Resolves an issue with overlapping params in some plugins as well as some documentation issues. + bugfixes: + - Fixes linting problems with the DOCUMENTATION. + - Fixes a problem with the overlapping 'state' param in four plugins. + 2.0.5: + release_date: "2021-04-12" + changes: + release_summary: This release introduces no changes. Exists just to be in sync with the Ansible Galaxy release number. + minor_changes: + - sync with Ansible Galaxy release number + 2.0.6: + release_date: "2021-04-13" + changes: + release_summary: Adds dnacentersdk to the requirements.txt file. Adds sanitiy checks for Ansible v2.9. + bugfixes: + - Adds dnacentersdk to requirements. + minor_changes: + - Adds sanity ignores for ansible-2.9. + 2.0.7: + release_date: "2021-04-14" + changes: + release_summary: Changes the minimum supported version of Ansible to v2.9. + minor_changes: + - Changes the minimum supported version from Ansible v.2.10.5 to v2.9.10. + 3.0.0: + release_date: "2021-08-05" + changes: + release_summary: Drop special `state` params. Adds info plugins and resources. + major_changes: + - Adds _info plugins to query information from database. + - Adds resources for modules to manage CRUD operations. + - Adds plugins without state that perform special operation on DNA Center. + - Adds plugins for resource's operations that have different structure in request/response bodies (ie. _create, _update, _delete plugins). + 3.1.0: + release_date: "2021-08-10" + changes: + release_summary: Updates to support DNA version 2.2.2.3 + major_changes: + - Adds new plugins related to DNA version 2.2.2.3. + - Updates previous plugins to follow DNA version 2.2.2.3 specification. + 3.1.1: + release_date: "2021-09-03" + changes: + release_summary: Adds headers parameter to info modules. + minor_changes: + - Adds ``headers`` parameter to info modules. + 3.1.2: + release_date: "2021-09-08" + changes: + release_summary: Updates the README to reflect latest API changes. + bugfixes: + - Updates the README to reflect latest API changes. + 3.1.3: + release_date: "2021-09-14" + changes: + release_summary: Fixes global credentials payload + bugfixes: + - It only accepts not None keys to dictionary item + - It changes payload from dict to list of dict + 3.1.4: + release_date: "2021-09-14" + changes: + release_summary: Updates module documentation & site_design_floormap + bugfixes: + - Adds param payload to site_design_floormap module + 3.1.5: + release_date: "2021-09-17" + changes: + release_summary: Fixes internal 'exists' comparison + bugfixes: + - Changes the comparison from value to keys + 3.1.6: + release_date: "2021-09-20" + changes: + release_summary: Fixes get_object_by_name issues + bugfixes: + - Add try catch/except to dnac execution + - Update get for wireless_dynamic_interface, change key that has name + - Update get for wireless_enterprise_ssid, obtain item.ssidDetails from items + 3.1.7: + release_date: "2021-10-12" + changes: + release_summary: Fixes delete/update mixups + bugfixes: + - Fixes *delete modules that were calling update operation + - Fixes *update modules that were calling delete operation + - Fixes *update modules that were calling create operation + 3.2.0: + release_date: "2021-10-22" + changes: + release_summary: Improves documentation and fixes check_mode behavior. + bugfixes: + - Improves the changelog. + - Improves the documentation of modules. + - Fixes check_mode behavior for non-info modules. + 3.2.1: + release_date: "2021-10-25" + changes: + release_summary: Fixes check_mode behavior + bugfixes: + - On regular modules additional comparison of check_mode was removed as Ansible already handles it. + - On info modules comparison was removed, because info modules should always run. + 3.2.2: + release_date: "2021-11-01" + changes: + release_summary: Fixes id required condition + bugfixes: + - global_pool - includes request param as an alternative to id + - network_device - includes request param as an alternative to id + - pnp_device - includes request param as an alternative to id + 3.2.3: + release_date: "2021-12-01" + changes: + release_summary: Fixes internal code and update test/sanity + bugfixes: + - Updated internal code for credential and discovery + minor_changes: + - Updated test/sanity and remove duplicates + 3.3.0: + release_date: "2022-02-07" + changes: + release_summary: Fixes update tag_membership + minor_changes: + - tag_membership - changes in memberToTags from list to object in the way the value is obtained. + 3.3.1: + release_date: "2022-02-13" + changes: + release_summary: Add early check of status for SDA modules + bugfixes: + - sda_fabric_authentication_profile - add early check of 'status' for module. + - sda_fabric_border_device - add early check of 'status' for module. + - sda_fabric_control_plane_device - add early check of 'status' for module. + - sda_fabric_edge_device - add early check of 'status' for module. + - sda_fabric_site - add early check of 'status' for module. + - sda_fabric - add early check of 'status' for module. + - sda_multicast - add early check of 'status' for module. + - sda_port_assignment_for_access_point - add early check of 'status' for module. + - sda_port_assignment_for_user_device - add early check of 'status' for module. + - sda_provision_device - add early check of 'status' for module. + - sda_virtual_network_ip_pool - add early check of 'status' for module. + - sda_virtual_network_v2 - add early check of 'status' for module. + - sda_virtual_network - add early check of 'status' for module. + 3.3.2: + release_date: "2022-02-13" + changes: + release_summary: Add early check of status for SDA modules + bugfixes: + - sda_fabric_authentication_profile - add early check of 'status' for module. + - sda_fabric_border_device - add early check of 'status' for module. + - sda_fabric_control_plane_device - add early check of 'status' for module. + - sda_fabric_edge_device - add early check of 'status' for module. + - sda_fabric_site - add early check of 'status' for module. + - sda_fabric - add early check of 'status' for module. + - sda_multicast - add early check of 'status' for module. + - sda_port_assignment_for_access_point - add early check of 'status' for module. + - sda_port_assignment_for_user_device - add early check of 'status' for module. + - sda_provision_device - add early check of 'status' for module. + - sda_virtual_network_ip_pool - add early check of 'status' for module. + - sda_virtual_network_v2 - add early check of 'status' for module. + - sda_virtual_network - add early check of 'status' for module. + 4.0.0: + release_date: "2021-12-01" + changes: + release_summary: Update to use DNAC v2.2.3.3 + minor_changes: + - app_policy_default_info - new module. + - app_policy_info - new module. + - app_policy_intent_create - new module. + - app_policy_queuing_profile - new module. + - app_policy_queuing_profile_count_info - new module. + - app_policy_queuing_profile_info - new module. + - associate_site_to_network_profile - new module. + - business_sda_hostonboarding_ssid_ippool - new module. + - business_sda_hostonboarding_ssid_ippool_info - new module. + - business_sda_wireless_controller_create - new module. + - business_sda_wireless_controller_delete - new module. + - device_family_identifiers_details_info - new module. + - disassociate_site_to_network_profile - new module. + - disasterrecovery_system_operationstatus_info - new module. + - disasterrecovery_system_status_info - new module. + - dnacaap_management_execution_status_info - new module. + - endpoint_analytics_profiling_rules - new module. + - endpoint_analytics_profiling_rules_info - new module. + - golden_image_create - new module. + - golden_tag_image_delete - new module. + - golden_tag_image_details_info - new module. + - profiling_rules_count_info - new module. + - profiling_rules_in_bulk_create - new module. + - projects_details_info - new module. + - qos_device_interface_info_count_info - new module. + - reserve_ip_subpool_create - new module. + - reserve_ip_subpool_delete - new module. + - reserve_ip_subpool_update - new module. + - templates_details_info - new module. + bugfixes: + - configuration_template - update module logic. + - configuration_template_project - update module logic. + - path_trace - update module logic. + - pnp_device - update module logic. + - reports - update module logic. + - wireless_profile - update module logic. + major_changes: + - applications_health_info - new `applicationName` parameter. + - network_device - change `isForceDelete` parameter to `cleanConfig` parameter. + - network_device - new `cleanConfig` parameter. + - network_device_lexicographically_sorted_info - change `offset` param type from str to int + - network_device_lexicographically_sorted_info - change `limit` param type from str to int + - reserve_ip_subpool - new `ipv4GateWay` parameter. + - sda_fabric - remove `payload` parameter. + - sda_fabric_authentication_profile_info - add `authenticateTemplateName` parameter. + - sda_fabric_authentication_profile - remove `payload` parameter. + - sda_fabric_authentication_profile - add `authenticateTemplateName` parameter. + - sda_fabric_authentication_profile - add `authenticationOrder` parameter. + - sda_fabric_authentication_profile - add `dot1xToMabFallbackTimeout` parameter. + - sda_fabric_authentication_profile - add `wakeOnLan` parameter. + - sda_fabric_authentication_profile - add `numberOfHosts` parameter. + - sda_device_info - change `deviceIPAddress` to `deviceManagementIpAddress` parameter. + - sda_fabric_border_device - change `deviceIPAddress` to `deviceManagementIpAddress` parameter. + - sda_fabric_border_device - remove `payload` parameter. + - sda_fabric_border_device - add `deviceManagementIpAddress` parameter. + - sda_fabric_border_device - add `siteNameHierarchy` parameter. + - sda_fabric_border_device - add `externalDomainRoutingProtocolName` parameter. + - sda_fabric_border_device - add `externalConnectivityIpPoolName` parameter. + - sda_fabric_border_device - add `internalAutonomouSystemNumber` parameter. + - sda_fabric_border_device - add `borderSessionType` parameter. + - sda_fabric_border_device - add `connectedToInternet` parameter. + - sda_fabric_border_device - add `externalConnectivitySettings` parameter. + - sda_fabric_border_device - add `interfaceName` parameter. + - sda_fabric_border_device - add `externalAutonomouSystemNumber` parameter. + - sda_fabric_border_device - add `l3Handoff` parameter. + - sda_fabric_border_device - add `virtualNetwork` parameter. + - sda_fabric_border_device - add `virtualNetworkName` parameter. + - sda_fabric_border_device - add `vlanId parameter.` + - sda_fabric_border_device_info - change `deviceIPAddress` to `deviceManagementIpAddress` parameter. + - sda_fabric_control_plane_device - change `deviceIPAddress` to `deviceManagementIpAddress` parameter. + - sda_fabric_control_plane_device - remove `payload` parameter. + - sda_fabric_control_plane_device - add `siteNameHierarchy` parameter. + - sda_fabric_control_plane_device_info - change `deviceIPAddress` to `deviceManagementIpAddress` parameter. + - sda_fabric_edge_device - change `deviceIPAddress` to `deviceManagementIpAddress` parameter. + - sda_fabric_edge_device - remove `payload` parameter. + - sda_fabric_edge_device - add `siteNameHierarchy` parameter. + - sda_fabric_edge_device_info - change `deviceIPAddress` to `deviceManagementIpAddress` parameter. + - sda_fabric_site - remove `payload` parameter. + - sda_fabric_site - add `fabricName` parameter. + - sda_multicast - change `fabricSiteNameHierarchy` to `siteNameHierarchy` parameter. + - sda_multicast_info - change `fabricSiteNameHierarchy` to `siteNameHierarchy` parameter. + - sda_port_assignment_for_access_point - remove `payload` parameter. + - sda_port_assignment_for_access_point - change `device_ip` to `deviceManagementIpAddress` parameter. + - sda_port_assignment_for_access_point - add `siteNameHierarchy` parameter. + - sda_port_assignment_for_access_point - add `deviceManagementIpAddress` parameter. + - sda_port_assignment_for_access_point - add `dataIpAddressPoolName` parameter. + - sda_port_assignment_for_access_point - add `authenticateTemplateName` parameter. + - sda_port_assignment_for_access_point - add `interfaceDescription` parameter. + - sda_port_assignment_for_access_point_info - change `device_ip` to `deviceManagementIpAddress` parameter. + - sda_port_assignment_for_user_device - remove `payload` parameter. + - sda_port_assignment_for_user_device - change `device_ip` to `deviceManagementIpAddress` parameter. + - sda_port_assignment_for_user_device - add `siteNameHierarchy` parameter. + - sda_port_assignment_for_user_device - add `voiceIpAddressPoolName` parameter. + - sda_port_assignment_for_user_device - add `dataIpAddressPoolName` parameter. + - sda_port_assignment_for_user_device - add `authenticateTemplateName` parameter. + - sda_port_assignment_for_user_device - add `scalableGroupName` parameter. + - sda_port_assignment_for_user_device - add `interfaceDescription` parameter. + - sda_port_assignment_for_user_device_info - change `device_ip` to `deviceManagementIpAddress` parameter. + - sda_virtual_network - remove `payload` parameter. + - snmpv2_read_community_credential - remove `id` and `instanceTenantId` parameter. + - snmpv2_write_community_credential - remove `id` and `instanceTenantId` parameter. + - site_health_info - add `siteType`, `offset`, `limit` parameters + - sda_virtual_network_ip_pool - remove `payload` and `ipPoolName` parameter. + - sda_virtual_network_ip_pool - add `siteNameHierarchy`, `ipPoolName`, `trafficType`, `authenticationPolicyName`, `scalableGroupName`, `isL2FloodingEnabled`, `isThisCriticalPool`, `poolType`, `vlanName`, `isWirelessPool` parameters. + 4.1.0: + release_date: "2021-12-14" + changes: + release_summary: Add qos_device_interface and fixes tag_member + minor_changes: + - qos_device_interface - new module. + - qos_device_interface_info - new module. + bugfixes: + - tag_member - change object param to use payload. + - tag_member - update module documentation. + 4.1.1: + release_date: "2022-01-12" + changes: + release_summary: Update module doc and fix issues 31 & 32 + bugfixes: + - Updates the README to map versions (dnacentersdk and Cisco DNA Center with the ansible collection) + - app_policy_queuing_profile - fix get_object_by_id (issue 32), which helps deletion. + - application_sets - fix get_object_by_id (issue 32), which helps deletion. + - applications - fix get_object_by_id (issue 32), which helps deletion. + - business_sda_hostonboarding_ssid_ippool - fix exists check (issue 31). + - business_sda_hostonboarding_ssid_ippool - fix get_object_by_id (issue 32), which helps deletion. + - device_replacement - fix get_object_by_id (issue 32), which helps deletion. + - event_subscription - fix get_object_by_id (issue 32), which helps deletion. + - event_subscription_email - fix get_object_by_id (issue 32), which helps deletion. + - event_subscription_rest - fix get_object_by_id (issue 32), which helps deletion. + - event_subscription_syslog - fix get_object_by_id (issue 32), which helps deletion. + - network_create - update module DOCUMENTATION block. + - network_device_lexicographically_sorted_info - update module RETURN block. + - network_update - update module DOCUMENTATION block. + - pnp_global_settings - fix get_object_by_id (issue 32), which helps deletion. + - qos_device_interface - fix get_object_by_id (issue 32), which helps deletion. + - reserve_ip_subpool - fix get_object_by_id (issue 32), which helps deletion. + - sda_fabric - fix get_object_by_id (issue 32), which helps deletion. + - sda_fabric_authentication_profile - fix exists check (issue 31). + - sda_fabric_authentication_profile - fix get_object_by_id (issue 32), which helps deletion. + - sda_fabric_border_device - fix exists check (issue 31). + - sda_fabric_border_device - fix get_object_by_id (issue 32), which helps deletion. + - sda_fabric_control_plane_device - fix exists check (issue 31). + - sda_fabric_control_plane_device - fix get_object_by_id (issue 32), which helps deletion. + - sda_fabric_edge_device - fix exists check (issue 31). + - sda_fabric_edge_device - fix get_object_by_id (issue 32), which helps deletion. + - sda_fabric_site - add playbook + - sda_fabric_site - fix exists check (issue 31). + - sda_fabric_site - fix get_object_by_id (issue 32), which helps deletion. + - sda_multicast - fix exists check (issue 31). + - sda_multicast - fix get_object_by_id (issue 32), which helps deletion. + - sda_port_assignment_for_access_point - fix exists check (issue 31). + - sda_port_assignment_for_access_point - fix get_object_by_id (issue 32), which helps deletion. + - sda_port_assignment_for_user_device - fix exists check (issue 31). + - sda_port_assignment_for_user_device - fix get_object_by_id (issue 32), which helps deletion. + - sda_provision_device - add 'update' capability to module. + - sda_provision_device - fix exists check (issue 31). + - sda_provision_device - fix get_object_by_id (issue 32), which helps deletion. + - sda_provision_device - update module description and EXAMPLES block. + - sda_virtual_network - add playbook + - sda_virtual_network - fix exists check (issue 31). + - sda_virtual_network - fix get_object_by_id (issue 32), which helps deletion. + - sda_virtual_network_ip_pool - fix exists check (issue 31). + - sda_virtual_network_ip_pool - fix get_object_by_id (issue 32), which helps deletion. + - sda_virtual_network_v2 - fix exists check (issue 31). + - sda_virtual_network_v2 - fix get_object_by_id (issue 32), which helps deletion. + - sensor - fix get_object_by_id (issue 32), which helps deletion. + - snmp_properties - fix get_object_by_id (issue 32), which helps deletion. + - wireless_dynamic_interface - fix get_object_by_id (issue 32), which helps deletion. + - wireless_enterprise_ssid - fix get_object_by_id (issue 32), which helps deletion. + - wireless_profile - fix get_object_by_id (issue 32), which helps deletion. + - wireless_rf_profile - fix get_object_by_id (issue 32), which helps deletion. + 4.1.2: + release_date: "2022-01-17" + changes: + release_summary: Update plugin module documentation, update site_design_floormap_info + bugfixes: + - plugin/modules/* - Update plugin module documentation + minor_changes: + - site_design_floormap_info - Add get_all to module + 4.1.3: + release_date: "2022-01-19" + changes: + release_summary: Update documentation link + minor_changes: + - update documentation link in galaxy + 4.2.0: + release_date: "2022-01-31" + changes: + release_summary: Parameters were added to pnp_device_claim_to_site + minor_changes: + - pnp_device_claim_to_site - Add hostname, imageInfo and configInfo parameters to module. + - Update dnacentersdk requirement from 2.4.0 to 2.4.4 + 5.0.0: + release_date: "2022-02-02" + changes: + release_summary: Parameters added and dropped for modules (service_provider_profile_delete, reserve_ip_subpool_update, network_device, business_sda_wireless_controller_create and business_sda_wireless_controller_delete) + major_changes: + - Update dnacentersdk requirement from 2.4.4 to 2.4.5 + - service_provider_profile_delete - Rename argument from 'sp_profile_name' to 'spProfileName'. + - reserve_ip_subpool_update - Removed 'type', 'ipv4GlobalPool', 'ipv4Prefix', 'ipv4PrefixLength', 'ipv4Subnet' and 'ipv4TotalHost' arguments. + - network_device - Removed 'managementIpAddress' arguments. + - business_sda_wireless_controller_create - Removed 'deviceIPAddress' arguments. + - business_sda_wireless_controller_delete - Removed 'deviceName' and 'siteNameHierarchy' arguments. + 5.1.0: + release_date: "2022-02-07" + changes: + release_summary: Fixes update tag_membership for Cisco DNA Center v2.2.3.3 + minor_changes: + - tag_membership - changes in memberToTags from list to object in the way the value is obtained. + - Update README + 5.1.1: + release_date: "2022-02-07" + changes: + release_summary: Fixes tag_membership module documentation + minor_changes: + - tag_membership - Fixes module documentation + 5.1.2: + release_date: "2022-02-13" + changes: + release_summary: Add early check of status for SDA modules + bugfixes: + - sda_fabric_authentication_profile - add early check of 'status' for module. + - sda_fabric_border_device - add early check of 'status' for module. + - sda_fabric_control_plane_device - add early check of 'status' for module. + - sda_fabric_edge_device - add early check of 'status' for module. + - sda_fabric_site - add early check of 'status' for module. + - sda_fabric - add early check of 'status' for module. + - sda_multicast - add early check of 'status' for module. + - sda_port_assignment_for_access_point - add early check of 'status' for module. + - sda_port_assignment_for_user_device - add early check of 'status' for module. + - sda_provision_device - add early check of 'status' for module. + - sda_virtual_network_ip_pool - add early check of 'status' for module. + - sda_virtual_network_v2 - add early check of 'status' for module. + - sda_virtual_network - add early check of 'status' for module. + 5.2.0: + release_date: "2022-02-24" + changes: + release_summary: Added siteNameHierarchy option to sda_virtual_network_ip_pool_info and sda_virtual_network_ip_pool + minor_changes: + - sda_virtual_network_ip_pool_info - add siteNameHierarchy option. + - sda_virtual_network_ip_pool - update example documentation to include siteNameHierarchy option. + bugfixes: + - sda_fabric - add early check of 'status' for module when state is absent. + - sda_fabric_authentication_profile - add early check of 'status' for module when state is absent. + - sda_fabric_border_device - add early check of 'status' for module when state is absent. + - sda_fabric_control_plane_device - add early check of 'status' for module when state is absent. + - sda_fabric_edge_device - add early check of 'status' for module when state is absent. + - sda_fabric_site - add early check of 'status' for module when state is absent. + - sda_multicast - add early check of 'status' for module when state is absent. + - sda_port_assignment_for_access_point - add early check of 'status' for module when state is absent. + - sda_port_assignment_for_user_device - add early check of 'status' for module when state is absent. + - sda_provision_device - add early check of 'status' for module when state is absent. + - sda_virtual_network - add early check of 'status' for module when state is absent. + - sda_virtual_network_ip_pool - add early check of 'status' for module when state is absent. + - sda_virtual_network_ip_pool_info - add early check of 'status' for module when state is absent. + - sda_virtual_network_v2 - add early check of 'status' for module when state is absent. + 6.0.0: + release_date: "2022-03-14" + changes: + release_summary: Fixes update sda_fabric_border_device for Cisco DNA Center v2.2.3.3 + major_changes: + - Update dnacentersdk requirement from 2.4.5 to 2.4.6 + - sda_fabric_border_device - changes in externalConnectivitySettings from object to list. + 6.1.0: + release_date: "2022-03-22" + changes: + release_summary: Add new param on pnp_device_claim_to_site request + minor_changes: + - Update dnacentersdk requirement from 2.4.6 to 2.4.7 + - pnp_device_claim_to_site - add parameter rfProfile. + bugfixes: + - Fixed module documentation to have elements. + - Fixed the type of dnac_port in the documentation from string to int. + 6.2.0: + release_date: "2022-03-24" + changes: + release_summary: Change download modules response to include file details + minor_changes: + - file_info - Instead of returning the data string, it now returns a dictionary. The dictionary has property data with the previous string value. + - file_info - add parameter filename. + - reports_executions_info - Instead of returning the data string, it now returns a dictionary. The dictionary has property data with the previous string value. + - reports_executions_info - add parameter filename. + 6.2.1: + release_date: "2022-03-24" + changes: + release_summary: Update README + bugfixes: + - Update README, update Compatibility matrix. + 6.3.0: + release_date: "2022-03-31" + changes: + release_summary: Adds headers parameter to wireless provision device update. + minor_changes: + - Adds ``headers`` parameter to wireless provision device update. + - reports - `tag` and `deliveries` now support empty format + 6.4.0: + release_date: "2022-04-20" + changes: + release_summary: Adds parameters to pnp_device_claim_to_site. + minor_changes: + - Adds following ``parameters`` to pnp_device_claim_to_site, gateway, imageId, ipInterfaceName, staticIP, subnetMask, vlanId + 6.5.0: + release_date: "2022-06-20" + changes: + release_summary: New Dna Center API version 2.3.3.0. + minor_changes: + - Update dnacentersdk requirement from 2.4.7 to 2.5.0 + - assign_device_to_site - new module. + - buildings_planned_access_points_info - new module. + - business_sda_virtual_network_summary_info - new module. + - event_config_connector_types_info - new module. + - event_email_config_create - new module. + - event_email_config_update - new module. + - event_webhook_create - new module. + - event_webhook_update - new module. + - file_import - new module. + - interface_info - new module. + - interface_operation_create - new module. + - interface_update - new module. + - lan_automation_count_info - new module. + - lan_automation_create - new module. + - lan_automation_delete - new module. + - lan_automation_log_info - new module. + - lan_automation_status_info - new module. + - network_device_custom_prompt_info - new module. + - network_device_custom_prompt - new module. + 6.5.1: + release_date: "2022-07-19" + changes: + release_summary: Added a status check, changed a required parameter and improved the doc. + bugfixes: + - sda_fabric_edge_device - Change required payload parameter to deviceManagementIpAddress + - transit_peer_network - Added status check + - file_info - Improve the module documentation. + 6.5.2: + release_date: "2022-07-20" + changes: + release_summary: Deletion function fixed in several modules. + bugfixes: + - application_sets - delete function fixed. + - applications - delete function fixed. + - event_subscription - delete function fixed. + - sda_fabric_authentication_profile - delete function fixed. + - sda_fabric_border_device - delete function fixed. + - sda_fabric_control_plane_device - delete function fixed. + - sda_fabric_edge_device - delete function fixed. + - sda_virtual_network - delete function fixed. + 6.5.3: + release_date: "2022-08-12" + changes: + release_summary: Added new function and fixed module + bugfixes: + - Update dnacentersdk requirement from 2.5.0 to 2.5.4 + - business_sda_hostonboarding_ssid_ippool - create function added. + - wireless_profile - create function fixed. + 6.6.0: + release_date: "2022-09-13" + changes: + release_summary: Added new intent modules + minor_changes: + - pnp_intent - new module. + - site_intent - new module. + - swim_intent - new module. + - template_intent - new module. + 6.6.1: + release_date: "2022-11-17" + changes: + release_summary: Added the ability to export DNA Center credentials as environment variables and rennamed some vars. + bugfixes: + - DNA Center credentials can now be exported and used as env vars. + - sda_virtual_network_ip_pool - Now pass the site_name_hierarchy correctly in get method. + 6.6.2: + release_date: "2022-12-19" + changes: + release_summary: + bugfixes: + - sda_fabric_border_device - fix Create example at EXAMPLES block + - site_intent - fix Case_1 return example at RETURN block + - swim_intent - fix functionality and tests + 6.6.3: + release_date: "2023-01-19" + changes: + release_summary: Fixes get_object_by_name issues. + bugfixes: + - netconf_credential - Removed to search by username. + - snmpv2_read_community_credential - Removed to search by username. + - snmpv2_write_community_credential - Removed to search by username. \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/docs/Makefile b/ansible_collections/cisco/dnac/docs/Makefile new file mode 100644 index 00000000..d2d43ade --- /dev/null +++ b/ansible_collections/cisco/dnac/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = DNACenterAnsibleActions +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/ansible_collections/cisco/dnac/docs/_gh_include/footer.inc b/ansible_collections/cisco/dnac/docs/_gh_include/footer.inc new file mode 100644 index 00000000..deddeb6c --- /dev/null +++ b/ansible_collections/cisco/dnac/docs/_gh_include/footer.inc @@ -0,0 +1,4 @@ + + + + diff --git a/ansible_collections/cisco/dnac/docs/_gh_include/header.inc b/ansible_collections/cisco/dnac/docs/_gh_include/header.inc new file mode 100644 index 00000000..7adca962 --- /dev/null +++ b/ansible_collections/cisco/dnac/docs/_gh_include/header.inc @@ -0,0 +1,17 @@ + + + + DNA Center Ansible Actions documentation index + + + + + + + + +

DNA Center Ansible Actions

+ +
+ +
diff --git a/ansible_collections/cisco/dnac/docs/conf.py b/ansible_collections/cisco/dnac/docs/conf.py new file mode 100644 index 00000000..477d524c --- /dev/null +++ b/ansible_collections/cisco/dnac/docs/conf.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import datetime +import os +import sys +sys.path.insert(0, os.path.abspath('../plugins/plugin_utils/')) +# sys.path.insert(0, os.path.abspath('.')) + +# -- Project information ----------------------------------------------------- + +project = 'DNACenterAnsibleActions' +copyright = u'Copyright (c) 2021 Cisco Systems' +author = u'' + +# The short X.Y version +version = '' +# The full version, including alpha/beta/rc tags +release = '' + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'recommonmark', + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'ansible_basic_sphinx_ext', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.tmp'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +highlight_language = 'YAML+Jinja' + +# -- Options for HTML output ------------------------------------------------- +html_theme_path = ['_themes'] +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +# html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = [] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'DNACenterAnsibleActionsdoc' + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = {} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'DNACenterAnsibleActions.tex', 'DNACenterAnsibleActions Documentation', + 'The DNA Center Project', 'manual'), +] + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'DNACenterAnsibleActions', 'DNACenterAnsibleActions Documentation', + [author], 1) +] + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'DNACenterAnsibleActions', 'DNACenterAnsibleActions Documentation', + author, 'DNACenterAnsibleActions', 'One line description of project.', + 'Miscellaneous'), +] + +# -- Extension configuration ------------------------------------------------- + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'python': ('https://docs.python.org/2', None), 'ansible': ('https://docs.ansible.com/ansible/latest/', None)} diff --git a/ansible_collections/cisco/dnac/docs/index.rst b/ansible_collections/cisco/dnac/docs/index.rst new file mode 100644 index 00000000..2c5c9730 --- /dev/null +++ b/ansible_collections/cisco/dnac/docs/index.rst @@ -0,0 +1,20 @@ +.. DNA Center Ansible Actions documentation main file, created by + sphinx-quickstart on Tue Dec 12 10:00:39 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to DNA Center Ansible Actions' documentation! +===================================================== + +.. toctree:: + :maxdepth: 2 + :caption: User documentation + + plugins/index + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` diff --git a/ansible_collections/cisco/dnac/docs/requirements.txt b/ansible_collections/cisco/dnac/docs/requirements.txt new file mode 100644 index 00000000..74fe21c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/docs/requirements.txt @@ -0,0 +1,6 @@ +PyYAML>=5.4.1 +antsibull>=0.17.0 +ansible-base>=2.10.0rc2 +sphinx-rtd-theme +git+https://github.com/felixfontein/ansible-basic-sphinx-ext +recommonmark diff --git a/ansible_collections/cisco/dnac/meta/runtime.yml b/ansible_collections/cisco/dnac/meta/runtime.yml new file mode 100644 index 00000000..1f18fd72 --- /dev/null +++ b/ansible_collections/cisco/dnac/meta/runtime.yml @@ -0,0 +1,2 @@ +--- +requires_ansible: '>=2.9.10' \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/playbooks/application_set_info.yml b/ansible_collections/cisco/dnac/playbooks/application_set_info.yml new file mode 100644 index 00000000..4cd4da0f --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/application_set_info.yml @@ -0,0 +1,20 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Get application sets local-services + cisco.dnac.application_sets_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + name: local-services + # limit: 3 + # offset: 2 + register: result + + - name: Show result + ansible.builtin.debug: + msg: "{{ result }}" diff --git a/ansible_collections/cisco/dnac/playbooks/application_sets.yml b/ansible_collections/cisco/dnac/playbooks/application_sets.yml new file mode 100644 index 00000000..ac489ece --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/application_sets.yml @@ -0,0 +1,43 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create an application set + cisco.dnac.application_sets: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + state: present + payload: + - name: AppSet1 + register: application_set_result + + - name: Get task info + cisco.dnac.task_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + taskId: "{{ application_set_result.dnac_response.response.taskId }}" + when: + - application_set_result.dnac_response is defined + - application_set_result.dnac_response.response is defined + - application_set_result.dnac_response.response.taskId is defined + register: task_result + + - name: Show new application_set + ansible.builtin.debug: + msg: "{{ application_set_result }}" + when: + - application_set_result is defined + + - name: Show retrieved task + ansible.builtin.debug: + msg: "{{ task_result.dnac_response.response }}" + when: + - task_result is defined + - task_result.dnac_response is defined diff --git a/ansible_collections/cisco/dnac/playbooks/applications.yml b/ansible_collections/cisco/dnac/playbooks/applications.yml new file mode 100644 index 00000000..a8d75233 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/applications.yml @@ -0,0 +1,72 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create an application + cisco.dnac.applications: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + state: present + payload: + - name: itunes-video + networkApplications: + - id: d4658954-ef8e-4eb9-a663-d53e3f4de325 + appProtocol: tcp + applicationSubType: NONE + applicationType: DEFAULT + categoryId: edc1f53c-d89d-4e8d-a23b-6148e3857504 + displayName: "12608" + engineId: "13" + helpString: iTunes video streaming + longDescription: >- + iTunes is a media player and media library application developed by Apple Inc. It is used to play, download, and organize digital + audio and video on personal computers running the OS X and Microsoft Windows operating systems. Through the iTunes Store, users + can purchase and + download music, music videos, television shows, audiobooks, podcasts, movies, etc. on their MAC/ Win PC/ iDevices running iTunes. + iTunes-video refers to all video streaming media services generated by iTunes such as: play movies, TV shows, videocasts, video, etc. + name: itunes-video + popularity: "10" + rank: "65535" + selectorId: "572" + trafficClass: MULTIMEDIA_STREAMING + networkIdentity: + - id: 4babbfcf-c5b7-4105-8954-1ee3a6097753 + displayName: "1461196" + lowerPort: "0" + ports: "80" + protocol: TCP + upperPort: "0" + applicationSet: + idRef: d31b81a3-a599-4d0c-bb6d-42bbdd0e7889 + register: application_result + + - name: Get task info + cisco.dnac.task_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + taskId: "{{ application_result.dnac_response.response.taskId }}" + when: + - application_result.dnac_response is defined + - application_result.dnac_response.response is defined + - application_result.dnac_response.response.taskId is defined + register: task_result + + - name: Show new application_set + ansible.builtin.debug: + msg: "{{ application_result }}" + when: + - application_result is defined + + - name: Show retrieved task + ansible.builtin.debug: + msg: "{{ task_result.dnac_response.response }}" + when: + - task_result is defined + - task_result.dnac_response is defined diff --git a/ansible_collections/cisco/dnac/playbooks/authentication_import.yml b/ansible_collections/cisco/dnac/playbooks/authentication_import.yml new file mode 100644 index 00000000..23d88906 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/authentication_import.yml @@ -0,0 +1,20 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Import certificate file + cisco.dnac.authentication_import_certificate: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + certFilePath: ./files/test.template + pkFilePath: ./files/test.template + register: result + + - name: Show result + ansible.builtin.debug: + msg: "{{ result }}" diff --git a/ansible_collections/cisco/dnac/playbooks/command_runner_run_command.yml b/ansible_collections/cisco/dnac/playbooks/command_runner_run_command.yml new file mode 100644 index 00000000..cf975ed6 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/command_runner_run_command.yml @@ -0,0 +1,41 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Run command + cisco.dnac.command_runner_run_command: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + commands: + - pwd + deviceUuids: + - a9b86e42-6573-4f5d-a0bf-a743e290f46a + register: result + + - name: Show result + ansible.builtin.debug: + msg: "{{ result }}" + + - name: Get task info + cisco.dnac.task_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + taskId: "{{ result.dnac_response.response.taskId }}" + when: + - result.dnac_response is defined + - result.dnac_response.response is defined + - result.dnac_response.response.taskId is defined + register: task_result + + - name: Show retrieved task + ansible.builtin.debug: + msg: "{{ task_result.dnac_response.response }}" + when: + - task_result is defined + - task_result.dnac_response is defined diff --git a/ansible_collections/cisco/dnac/playbooks/configuration_template_version_create.yml b/ansible_collections/cisco/dnac/playbooks/configuration_template_version_create.yml new file mode 100644 index 00000000..6b90000f --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/configuration_template_version_create.yml @@ -0,0 +1,44 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create Configuration Template Version + cisco.dnac.configuration_template_version_create: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + # comments: string + templateId: 2121f1d7-d9ea-4eea-8f83-45af2941f5f9 + register: configuration_template_version_create_result + + - name: Get task info + cisco.dnac.task_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + taskId: "{{ configuration_template_version_create_result.dnac_response.response.taskId }}" + when: + - configuration_template_version_create_result.dnac_response is defined + - configuration_template_version_create_result.dnac_response.response is defined + - configuration_template_version_create_result.dnac_response.response.taskId is defined + register: task_result + + - name: Show new configuration_template_version + ansible.builtin.debug: + msg: "{{ configuration_template_version_create_result }}" + when: + - configuration_template_version_create_result is defined + + - name: Show retrieved task + ansible.builtin.debug: + msg: "{{ task_result.dnac_response.response }}" + when: + - task_result is defined + - task_result.dnac_response is defined diff --git a/ansible_collections/cisco/dnac/playbooks/credentials.template b/ansible_collections/cisco/dnac/playbooks/credentials.template new file mode 100644 index 00000000..c4d33d0d --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/credentials.template @@ -0,0 +1,8 @@ +--- +dnac_host: +dnac_port: 443 +dnac_username: +dnac_password: +dnac_version: 2.3.3.0 +dnac_verify: False +dnac_debug: False \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/playbooks/credentials.yml b/ansible_collections/cisco/dnac/playbooks/credentials.yml new file mode 100644 index 00000000..f1c9535f --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/credentials.yml @@ -0,0 +1,8 @@ +--- +dnac_host: 192.168.196.2 +dnac_port: 443 +dnac_username: altus +dnac_password: Altus123 +dnac_version: 2.3.3.0 +dnac_verify: False +dnac_debug: True \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/playbooks/device_details.yml b/ansible_collections/cisco/dnac/playbooks/device_details.yml new file mode 100644 index 00000000..0c9dfdfe --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/device_details.yml @@ -0,0 +1,54 @@ +template_details: + - proj_name: "Onboarding Configuration" + device_config: "hostname cat9k-1\n" + language: "velocity" + family: "Switches and Hubs" + type: "IOS-XE" + variant: "XE" + temp_name: "temp_cat9k-1" + description: "Test Template 1" + - proj_name: "Onboarding Configuration" + device_config: "hostname cat9k-2\n" + language: "velocity" + family: "Switches and Hubs" + type: "IOS-XE" + variant: "XE" + temp_name: "temp_cat9k-2" + description: "Test Template 2" + - proj_name: "Onboarding Configuration" + device_config: "hostname cat9k-3\n" + language: "velocity" + family: "Switches and Hubs" + type: "IOS-XE" + variant: "XE" + temp_name: "temp_cat9k-3" + description: "Test Template 3" + +device_details: + - site_name: "Global/Chennai/Trill" + image_name: "cat9k_iosxe.17.04.01.SPA.bin" + proj_name: "Onboarding Configuration" + temp_name: "temp_cat9k-1" + device_version: "2" + device_number: "AB2425L8M7" + device_name: "Cat9k-1" + device_state: "Unclaimed" + device_id: "C9300-25UX" + - site_name: "Global/Chennai/Trill" + image_name: "cat9k_iosxe.17.04.01.SPA.bin" + proj_name: "Onboarding Configuration" + temp_name: "temp_cat9k-2" + device_version: "2" + device_number: "CD2425L8M7" + device_name: "Cat9k-2" + device_state: "Unclaimed" + device_id: "C9300-25UX" + - site_name: "Global/Chennai/Trill" + image_name: "cat9k_iosxe.17.04.01.SPA.bin" + proj_name: "Onboarding Configuration" + temp_name: "temp_cat9k-3" + device_version: "2" + device_number: "EF2425L8M7" + device_name: "Cat9k-3" + device_state: "Unclaimed" + device_id: "C9300-25UX" diff --git a/ansible_collections/cisco/dnac/playbooks/discovery.yml b/ansible_collections/cisco/dnac/playbooks/discovery.yml new file mode 100644 index 00000000..d05d201a --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/discovery.yml @@ -0,0 +1,128 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Find discovery + cisco.dnac.discovery_range_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + startIndex: 1 + recordsToReturn: 500 + register: discovery_range_result + + - name: Set fact of filtered discoveries + ansible.builtin.set_fact: + discoveries_filtered: "{{ discovery_range_result.dnac_response.response | selectattr('name', 'equalto', 'start_discovery_test2')}}" + when: + - discovery_range_result is defined + - discovery_range_result.dnac_response is defined + - discovery_range_result.dnac_response.response is defined + register: discovery_filtered_results + + - name: Set fact of filtered discovery + ansible.builtin.set_fact: + discovery_filtered: "{{ discovery_filtered_results.ansible_facts.discoveries_filtered|first }}" + when: + - discovery_filtered_results is defined + - discovery_filtered_results.ansible_facts is defined + - discovery_filtered_results.ansible_facts.discoveries_filtered is defined + - discovery_filtered_results.ansible_facts.discoveries_filtered|length > 0 + register: discovery_filtered_result + + - name: Set fact of filtered discovery id + ansible.builtin.set_fact: + discovery_filtered_id: "{{ discovery_filtered_result.ansible_facts.discovery_filtered.id }}" + when: + - discovery_filtered_result is defined + - discovery_filtered_result.ansible_facts is defined + - discovery_filtered_result.ansible_facts.discovery_filtered is defined + register: discovery_filtered_result_id + + - name: Create a discovery + cisco.dnac.discovery: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + validate_response_schema: false + state: present + cdpLevel: 16 + discoveryType: CDP + globalCredentialIdList: + - 90acbab8-03d5-4726-9c19-e1e51a40b3cd + - f979d842-f6fd-456a-8137-2cb5113cd2e8 + ipAddressList: 10.10.22.22 + name: start_discovery_test2 + protocolOrder: ssh + # id: "67" + # enablePasswordList: [""] + # userNameList: [""] + # passwordList: [""] + # ipFilterList: [""] + # httpReadCredential: + # port: 0 + # secure: false + # deviceIds: " " + # discoveryCondition: "In Progress" + # discoveryStatus: "Active" + # isAutoCdp: true + # preferredMgmtIPMethod: "None" + # retry: 3 + # timeout: 5 + # httpWriteCredential: + # port: 0 + # secure: false + register: discovery_result + when: + - discovery_filtered_result_id is not defined + + - name: Update a discovery + cisco.dnac.discovery: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + validate_response_schema: false + state: present + cdpLevel: 16 + discoveryType: CDP + globalCredentialIdList: + - 90acbab8-03d5-4726-9c19-e1e51a40b3cd, + - f979d842-f6fd-456a-8137-2cb5113cd2e8, + ipAddressList: 10.10.22.22 + name: start_discovery_test2 + protocolOrder: ssh + id: "{{ discovery_filtered_result_id.ansible_facts.discovery_filtered_id }}" + # enablePasswordList: [""] + # userNameList: [""] + # passwordList: [""] + # ipFilterList: [""] + # httpReadCredential: + # port: 0 + # secure: false + # deviceIds: " " + # discoveryCondition: "In Progress" + # discoveryStatus: "Active" + # isAutoCdp: true + # preferredMgmtIPMethod: "None" + # retry: 3 + # timeout: 5 + # httpWriteCredential: + # port: 0 + # secure: false + register: discovery_result + when: + - discovery_filtered_result_id is defined + + - name: Show discovery result + ansible.builtin.debug: + msg: "{{ discovery_result }}" + when: + - discovery_result is defined diff --git a/ansible_collections/cisco/dnac/playbooks/download_device_cmd_runner_output.yml b/ansible_collections/cisco/dnac/playbooks/download_device_cmd_runner_output.yml new file mode 100644 index 00000000..60643436 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/download_device_cmd_runner_output.yml @@ -0,0 +1,78 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + vars: + dnac_login: &dnac_login + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + gather_facts: false + tasks: + - name: Get Network Devices - Switches and Hubs + cisco.dnac.network_device_info: + <<: *dnac_login + family: Switches and Hubs + register: network_devices_result + + - name: Get device list ids + ansible.builtin.set_fact: + device_id_list: "{{ device_id_list | default([]) }} + ['{{ item.id }}']" + with_items: "{{ network_devices_result.dnac_response.response }}" + when: + - network_devices_result.dnac_response is defined + - network_devices_result.dnac_response.response is defined + + - name: Run show run command on device + cisco.dnac.command_runner_run_command: + <<: *dnac_login + commands: + - show run + deviceUuids: "{{ device_id_list }}" + when: + - device_id_list | length > 0 + register: command_result + + - name: Get task info + cisco.dnac.task_info: + <<: *dnac_login + taskId: "{{ command_result.dnac_response.response.taskId }}" + when: + - command_result is defined + - command_result.dnac_response is defined + - command_result.dnac_response.response is defined + - command_result.dnac_response.response.taskId is defined + register: task_result + until: task_result.dnac_response.response.progress != "CLI Runner request creation" + retries: 10 + delay: 1 + + - name: Get file id + ansible.builtin.set_fact: + file_response: "{{ task_result.dnac_response.response.progress | from_json }}" + when: "'fileId' in task_result.dnac_response.response.progress" + + - name: Download the file + cisco.dnac.file_info: + <<: *dnac_login + saveFile: true + fileId: "{{ file_response.fileId }}" + dirPath: /tmp/devices + when: + - file_response is defined + - file_response.fileId is defined + register: download_file + + - name: Show extract of data + ansible.builtin.debug: + msg: >- + Filename: {{ download_file.dnac_response.filename }} + Filepath: {{ download_file.dnac_response.path }} + Data extract: {{ download_file.dnac_response.data[:50]}}" + when: + - download_file is defined + - download_file.dnac_response is defined diff --git a/ansible_collections/cisco/dnac/playbooks/files/test.template b/ansible_collections/cisco/dnac/playbooks/files/test.template new file mode 100644 index 00000000..cb564170 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/files/test.template @@ -0,0 +1,35 @@ +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. +Dummy text. diff --git a/ansible_collections/cisco/dnac/playbooks/global_credentials.yml b/ansible_collections/cisco/dnac/playbooks/global_credentials.yml new file mode 100644 index 00000000..c485e5d2 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/global_credentials.yml @@ -0,0 +1,36 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create CLI Credential + cisco.dnac.cli_credential: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + validate_response_schema: false + enablePassword: C2sco456! + username: Test2 + password: C2sco456! + description: Test2 + + - name: Create SNMPV3 Credential + cisco.dnac.snmpv3_credential: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + validate_response_schema: false + username: user2 + snmpMode: NOAUTHNOPRIV + description: user2 cred diff --git a/ansible_collections/cisco/dnac/playbooks/global_credentials_info.yml b/ansible_collections/cisco/dnac/playbooks/global_credentials_info.yml new file mode 100644 index 00000000..d8ba864c --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/global_credentials_info.yml @@ -0,0 +1,40 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Get all Global Credential by SubType + cisco.dnac.global_credential_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + credentialSubType: HTTP_READ + # sortBy: + # order: + register: global_credentials_result + + - name: Show global_credentials + ansible.builtin.debug: + msg: "{{ global_credentials_result }}" + + - name: Get Global Credential by id + cisco.dnac.global_credential_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + id: babc42b9-0bdd-49ef-912e-66f533fb5d59 + credentialSubType: HTTP_READ + register: global_credential_result + + - name: Show global_credential + ansible.builtin.debug: + msg: "{{ global_credential_result }}" diff --git a/ansible_collections/cisco/dnac/playbooks/global_pool.yml b/ansible_collections/cisco/dnac/playbooks/global_pool.yml new file mode 100644 index 00000000..27aa6260 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/global_pool.yml @@ -0,0 +1,26 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Find discovery + cisco.dnac.global_pool: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + # id: 1bf5ecf3-be14-48fb-b724-df801bc61172 + settings: + ippool: + - IpAddressSpace: string + dhcpServerIps: [] + dnsServerIps: [] + gateway: "" + ipPoolCidr: 30.0.0.0/8 + ipPoolName: v4pool-test2 + type: Generic + register: discovery_range_result diff --git a/ansible_collections/cisco/dnac/playbooks/hosts b/ansible_collections/cisco/dnac/playbooks/hosts new file mode 100644 index 00000000..53af82de --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/hosts @@ -0,0 +1,2 @@ +[dnac_servers] +dnac_server \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/playbooks/image_details.yml b/ansible_collections/cisco/dnac/playbooks/image_details.yml new file mode 100644 index 00000000..4d787ade --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/image_details.yml @@ -0,0 +1,11 @@ +image_details: + - import_type: "url" + url_source: "http://10.104.118.10/swim/17.9/cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin" + device_role: "ALL" + device_family_name: "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1" + device_serial_number: "FXS2325Q01C" + - import_type: "url" + url_source: "http://10.104.118.10/swim/17.9/cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin" + device_role: "ALL" + device_family_name: "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1" + device_serial_number: "FXS5632Q01C" diff --git a/ansible_collections/cisco/dnac/playbooks/import_image_file.yml b/ansible_collections/cisco/dnac/playbooks/import_image_file.yml new file mode 100644 index 00000000..3ec66e09 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/import_image_file.yml @@ -0,0 +1,22 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Import image file + cisco.dnac.swim_import_local: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + filePath: fullpath/playbooks/files/test.template # string + isThirdParty: true # boolean + thirdPartyApplicationType: SomeValue # string + thirdPartyImageFamily: SomeValue # string + thirdPartyVendor: SomeValue # string + register: result + + - name: Show result + ansible.builtin.debug: + msg: "{{ result }}" diff --git a/ansible_collections/cisco/dnac/playbooks/network_device_custom_prompt_info.yml b/ansible_collections/cisco/dnac/playbooks/network_device_custom_prompt_info.yml new file mode 100644 index 00000000..2207bc05 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/network_device_custom_prompt_info.yml @@ -0,0 +1,20 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Get all Network Device Custom Prompt + cisco.dnac.network_device_custom_prompt_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + register: network_device_custom_prompt_result + + - name: Show all network_device_custom_prompt + ansible.builtin.debug: + msg: "{{ network_device_custom_prompt_result }}" \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/playbooks/network_device_info.yml b/ansible_collections/cisco/dnac/playbooks/network_device_info.yml new file mode 100644 index 00000000..d9e84b6a --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/network_device_info.yml @@ -0,0 +1,36 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Get Network Devices + cisco.dnac.network_device_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + register: network_devices_result + + - name: Show all network_devices + ansible.builtin.debug: + msg: "{{ network_devices_result }}" + + - name: Get Network Device by id + cisco.dnac.network_device_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + id: 0c4c83f7-1fce-46fe-a0a2-ac4b2e7dfbab + register: network_device_result + + - name: Show network_device + ansible.builtin.debug: + msg: "{{ network_device_result }}" diff --git a/ansible_collections/cisco/dnac/playbooks/network_device_update_role.yml b/ansible_collections/cisco/dnac/playbooks/network_device_update_role.yml new file mode 100644 index 00000000..6b9cb52f --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/network_device_update_role.yml @@ -0,0 +1,45 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Update Network Device Role + cisco.dnac.network_device_update_role: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + id: 0c4c83f7-1fce-46fe-a0a2-ac4b2e7dfbab + role: UNKNOWN + roleSource: AUTO + register: network_device_update_role_result + + - name: Get task info + cisco.dnac.task_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + taskId: "{{ network_device_update_role_result.dnac_response.response.taskId }}" + when: + - network_device_update_role_result.dnac_response is defined + - network_device_update_role_result.dnac_response.response is defined + - network_device_update_role_result.dnac_response.response.taskId is defined + register: task_result + + - name: Show updated network_device_update_role + ansible.builtin.debug: + msg: "{{ network_device_update_role_result }}" + when: + - network_device_update_role_result is defined + + - name: Show retrieved task + ansible.builtin.debug: + msg: "{{ task_result.dnac_response.response }}" + when: + - task_result is defined + - task_result.dnac_response is defined diff --git a/ansible_collections/cisco/dnac/playbooks/pnp_device.yml b/ansible_collections/cisco/dnac/playbooks/pnp_device.yml new file mode 100644 index 00000000..cfd8bc41 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/pnp_device.yml @@ -0,0 +1,79 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + # - name: Delete by id + # cisco.dnac.pnp_device: + # dnac_host: "{{ dnac_host }}" + # dnac_username: "{{ dnac_username }}" + # dnac_password: "{{ dnac_password }}" + # dnac_verify: "{{ dnac_verify }}" + # dnac_port: "{{ dnac_port }}" + # dnac_version: "{{ dnac_version }}" + # dnac_debug: "{{ dnac_debug }}" + # state: absent + # id: 5f96f83854ee220008a9c456 + # register: pnp_device_delete_result + + # - name: Show deleted pnp_device + # debug: + # msg: "{{ pnp_device_delete_result }}" + # when: + # - pnp_device_delete_result is defined + + - name: Adds or Updates a device to the PnP database + cisco.dnac.pnp_device: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + version: 2 + deviceInfo: + serialNumber: FOCTEST2 + name: FOCTEST2 + state: Unclaimed + # onbState: Not Contacted + # cmState: Not Contacted + location: {} + source: User + reloadRequested: false + aaaCredentials: + username: "" + password: "" + populateInventory: false + poeSupported: false + capwapBackOff: false + redirectionState: NONE + dayN: false + dayNClaimOperation: NO_OP + tlsState: NO_OP + reProvision: false + authOperation: AUTHORIZATION_NOT_REQUIRED + stack: false + sudiRequired: false + validActions: + editSUDI: true + editWfParams: true + delete: true + claim: true + unclaim: true + reset: false + authorize: false + resetMsg: This device is not in Error state. Only Error devices may be Reset. + authorizeMsg: This Device is not in PendingAuthorization state. + workflowParameters: {} + tenantId: 5cdc6c45a8405f00c80c6ba3 + id: 610ab95c07a77b0fbec39f22 + register: pnp_device_result + + - name: Show new pnp_device + ansible.builtin.debug: + msg: "{{ pnp_device_result }}" + when: + - pnp_device_result is defined diff --git a/ansible_collections/cisco/dnac/playbooks/reports_executions_info.yml b/ansible_collections/cisco/dnac/playbooks/reports_executions_info.yml new file mode 100644 index 00000000..4174b4ea --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/reports_executions_info.yml @@ -0,0 +1,22 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Download report content + cisco.dnac.reports_executions_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + reportId: be9d6d76-0bff-4c49-84a1-16adf58431c6 + executionId: 586da15e-5f50-4f65-8f3d-303f88dfdf18 + dirPath: /Users/wilhelm32/Downloads/dna + saveFile: true + register: result + + - name: Show result + ansible.builtin.debug: + msg: "{{ result.dnac_response }}" diff --git a/ansible_collections/cisco/dnac/playbooks/reserve_ip_subpool.yml b/ansible_collections/cisco/dnac/playbooks/reserve_ip_subpool.yml new file mode 100644 index 00000000..267ad676 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/reserve_ip_subpool.yml @@ -0,0 +1,48 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + vars: + site: bb25cdaf-3f5a-45b9-bdd6-0f63fdf6c83e + + tasks: + - name: Create reservation + cisco.dnac.reserve_ip_subpool: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + ipv4DhcpServers: + - 55.66.55.55 + ipv4DnsServers: + - 33.33.33.3 + ipv4GateWay: 10.0.10.1 + ipv4GlobalPool: 10.0.0.0/8 + ipv4Prefix: true + ipv4PrefixLength: 24 + ipv4Subnet: 10.0.10.0/24 + name: IP Pool 1 + siteId: "{{ site }}" + slaacSupport: true + type: LAN + + - name: Get Reservations + cisco.dnac.reserve_ip_subpool_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + siteId: "{{ site }}" + register: ip_pool + + - name: Print Reservations + ansible.builtin.debug: + var: ip_pool diff --git a/ansible_collections/cisco/dnac/playbooks/sda_fabric.yml b/ansible_collections/cisco/dnac/playbooks/sda_fabric.yml new file mode 100644 index 00000000..e53df274 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/sda_fabric.yml @@ -0,0 +1,22 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create an sda_fabric + cisco.dnac.sda_fabric: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + state: present + fabricName: MyFabricName3 + register: sda_fabric_result + + - name: Show new sda_fabric + ansible.builtin.debug: + msg: "{{ sda_fabric_result }}" + when: + - sda_fabric_result is defined diff --git a/ansible_collections/cisco/dnac/playbooks/sda_fabric_site.yml b/ansible_collections/cisco/dnac/playbooks/sda_fabric_site.yml new file mode 100644 index 00000000..2f24f6e0 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/sda_fabric_site.yml @@ -0,0 +1,37 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create + cisco.dnac.sda_fabric_site: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + fabricName: DNAC_Guide_Fabric + siteNameHierarchy: Global/San Francisco + + # - name: Delete all + # cisco.dnac.sda_fabric_site: + # dnac_host: "{{ dnac_host }}" + # dnac_username: "{{ dnac_username }}" + # dnac_password: "{{ dnac_password }}" + # dnac_verify: "{{ dnac_verify }}" + # dnac_port: "{{ dnac_port }}" + # dnac_version: "{{ dnac_version }}" + # dnac_debug: "{{ dnac_debug }}" + # state: absent + # siteNameHierarchy: Global/San Francisco + # register: result + + # - name: Show result + # debug: + # msg: "{{ result }}" + # when: + # - result is defined diff --git a/ansible_collections/cisco/dnac/playbooks/sda_virtual_network_v2.yml b/ansible_collections/cisco/dnac/playbooks/sda_virtual_network_v2.yml new file mode 100644 index 00000000..84914b57 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/sda_virtual_network_v2.yml @@ -0,0 +1,33 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create + cisco.dnac.sda_virtual_network_v2: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + isGuestVirtualNetwork: false + scalableGroupNames: + - Auditors + virtualNetworkName: GUEST_VN + virtualNetworkType: GUEST + + # - name: Delete all + # cisco.dnac.sda_virtual_network_v2: + # dnac_host: "{{ dnac_host }}" + # dnac_username: "{{ dnac_username }}" + # dnac_password: "{{ dnac_password }}" + # dnac_verify: "{{ dnac_verify }}" + # dnac_port: "{{ dnac_port }}" + # dnac_version: "{{ dnac_version }}" + # dnac_debug: "{{ dnac_debug }}" + # state: absent + # virtualNetworkName: GUEST_VN diff --git a/ansible_collections/cisco/dnac/playbooks/tag.yml b/ansible_collections/cisco/dnac/playbooks/tag.yml new file mode 100644 index 00000000..0e7ac8dc --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/tag.yml @@ -0,0 +1,131 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create tag with name "MyNewTag" + cisco.dnac.tag: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + state: present + description: My Tag + name: MyNewTag + register: result + + - name: Show result + ansible.builtin.debug: + msg: "{{ result }}" + + - name: Get task status + cisco.dnac.task_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + taskId: "{{ result.dnac_response.response.taskId }}" + when: + - result.dnac_response is defined + - result.dnac_response.response is defined + - result.dnac_response.response.taskId is defined + register: task_result + + - name: Show status of create tag operation + ansible.builtin.debug: + msg: "{{ task_result.dnac_response.response }}" + when: + - task_result is defined + - task_result.dnac_response is defined + + - name: Create the same tag + cisco.dnac.tag: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + state: present + description: My Tag 1 + name: MyNewTag + register: result + + - name: Get task status + cisco.dnac.task_tree_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + taskId: "{{ result.dnac_response.response.taskId }}" + when: + - result.dnac_response is defined + - result.dnac_response.response is defined + - result.dnac_response.response.taskId is defined + register: task_tree_result + + - name: Show status of update tag operation + ansible.builtin.debug: + msg: "{{ task_tree_result.dnac_response.response }}" + when: + - task_tree_result is defined + - task_tree_result.dnac_response is defined + + - name: Get tag with name "MyNewTag" + cisco.dnac.tag_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + name: MyNewTag + register: result + + - name: Show tags with name "MyNewTag" + ansible.builtin.debug: + msg: "{{ result }}" + + - name: Delete tag + cisco.dnac.tag: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + state: absent + name: MyNewTag + register: result + + - name: Show deleted tags with name "MyNewTag" + ansible.builtin.debug: + msg: "{{ result }}" + + # - name: Get task status + # cisco.dnac.task_info: + # dnac_host: "{{ dnac_host }}" + # dnac_username: "{{ dnac_username }}" + # dnac_password: "{{ dnac_password }}" + # dnac_verify: "{{ dnac_verify }}" + # taskId: "{{ result.dnac_response.response.taskId }}" + # when: + # - result.dnac_response is defined + # - result.dnac_response.response is defined + # - result.dnac_response.response.taskId is defined + # register: task_tree_result + + # - name: Show status of delete tag operation + # debug: + # msg: "{{ task_tree_result.dnac_response.response }}" + # when: + # - task_tree_result is defined + # - task_tree_result.dnac_response is defined + + - name: Get tag with name "MyNewTag" + cisco.dnac.tag_info: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + name: MyNewTag + register: result + + - name: Show tags with name "MyNewTag" + ansible.builtin.debug: + msg: "{{ result }}" diff --git a/ansible_collections/cisco/dnac/playbooks/template.yml b/ansible_collections/cisco/dnac/playbooks/template.yml new file mode 100644 index 00000000..6aa9b27b --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/template.yml @@ -0,0 +1,22 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create an configuration_template_project + cisco.dnac.configuration_template_project: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + state: present + name: Cloud Test Template 5 + register: configuration_template_project_result + + - name: Show new configuration_template_project + ansible.builtin.debug: + msg: "{{ configuration_template_project_result }}" + when: + - configuration_template_project_result is defined diff --git a/ansible_collections/cisco/dnac/playbooks/template_pnp_intent.yml b/ansible_collections/cisco/dnac/playbooks/template_pnp_intent.yml new file mode 100644 index 00000000..b6894d67 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/template_pnp_intent.yml @@ -0,0 +1,61 @@ +- hosts: dnac_servers + vars_files: + - credentials.yml + - device_details.yml + gather_facts: no + connection: local + tasks: +# +# Project Info Section +# + - name: Test project template + cisco.dnac.template_intent: + dnac_host: "{{ dnac_host }}" + dnac_port: "{{ dnac_port }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + dnac_log: True + state: "merged" + #ignore_errors: true #Enable this to continue execution even the task fails + config: + - projectName: "{{ item.proj_name }}" + templateContent: "{{ item.device_config }}" + language: "{{ item.language }}" + deviceTypes: + - productFamily: "{{ item.family }}" + softwareType: "{{ item.type }}" + softwareVariant: "{{ item.variant }}" + templateName: "{{ item.temp_name }}" + versionDescription: "{{ item.description }}" + register: template_result + with_items: '{{ template_details }}' + tags: + - template + + + - name: Create pnp + cisco.dnac.pnp_intent: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_debug: "{{dnac_debug}}" + dnac_log: True + config: + - site_name: "{{ item.site_name }}" + project_name: "{{ item.proj_name }}" + template_name: "{{ item.temp_name }}" + image_name: "{{ item.image_name }}" + device_version: "{{ item.device_version }}" + deviceInfo: + serialNumber: "{{ item.device_number }}" + hostname: "{{ item.device_name}}" + state: "{{ item.device_state }}" + pid: "{{ item.device_id }}" + register: pnp_result + with_items: '{{ device_details }}' + tags: + - pnp diff --git a/ansible_collections/cisco/dnac/playbooks/test_swim_module.yml b/ansible_collections/cisco/dnac/playbooks/test_swim_module.yml new file mode 100644 index 00000000..7861e637 --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/test_swim_module.yml @@ -0,0 +1,41 @@ +- hosts: dnac_servers + vars_files: + - credentials_245.yml + - image_details.yml #Contains image and device details + gather_facts: no + connection: local + tasks: +# +# Project Info Section +# + + - name: Import an image, tag it as golden and load it on device + cisco.dnac.swim_intent: + dnac_host: "{{ dnac_host }}" + dnac_port: "{{ dnac_port }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_debug: "{{ dnac_debug }}" + dnac_log: True + config: + - importImageDetails: + type: "{{ item.import_type }}" + urlDetails: + payload: + - sourceURL: "{{ item.url_source }}" + isThirdParty: false + taggingDetails: + deviceRole: "{{ item.device_role }}" + deviceFamilyName: "{{ item.device_family_name }}" + tagging: true + imageDistributionDetails: + deviceSerialNumber: "{{ item.device_serial_number }}" + imageActivationDetails: + scehduleValidate: false + activateLowerImageVersion: true + deviceSerialNumber: "{{ item.device_serial_number }}" + distributeIfNeeded: true + with_items: '{{ image_details }}' + tags: + - swim diff --git a/ansible_collections/cisco/dnac/playbooks/wireless_enterprise_ssid.yml b/ansible_collections/cisco/dnac/playbooks/wireless_enterprise_ssid.yml new file mode 100644 index 00000000..0d6efaaa --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/wireless_enterprise_ssid.yml @@ -0,0 +1,35 @@ +--- +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + tasks: + - name: Create Wirelesss Enterprise SSID + cisco.dnac.wireless_enterprise_ssid: + dnac_host: "{{ dnac_host }}" + dnac_username: "{{ dnac_username }}" + dnac_password: "{{ dnac_password }}" + dnac_verify: "{{ dnac_verify }}" + dnac_port: "{{ dnac_port }}" + dnac_version: "{{ dnac_version }}" + dnac_debug: "{{ dnac_debug }}" + state: present + validate_response_schema: false + basicServiceSetClientIdleTimeout: 00 + clientExclusionTimeout: 00 + enableBasicServiceSetMaxIdle: true + enableBroadcastSSID: true + enableClientExclusion: true + enableDirectedMulticastService: true + enableFastLane: true + enableMACFiltering: true + enableNeighborList: true + enableSessionTimeOut: true + fastTransition: Adaptive + mfpClientProtection: Optional + name: Test + passphrase: "" + radioPolicy: Dual band operation (2.4GHz and 5GHz) + securityLevel: WPA2_ENTERPRISE + sessionTimeOut: 00 + trafficType: voicedata diff --git a/ansible_collections/cisco/dnac/plugins/.DS_Store b/ansible_collections/cisco/dnac/plugins/.DS_Store new file mode 100644 index 00000000..ba92aa65 Binary files /dev/null and b/ansible_collections/cisco/dnac/plugins/.DS_Store differ diff --git a/ansible_collections/cisco/dnac/plugins/README.md b/ansible_collections/cisco/dnac/plugins/README.md new file mode 100644 index 00000000..448a4ba6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/README.md @@ -0,0 +1,31 @@ +# Collections Plugins Directory + +This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that +is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that +would contain module utils and modules respectively. + +Here is an example directory of the majority of plugins currently supported by Ansible: + +``` +└── plugins + ├── action + ├── become + ├── cache + ├── callback + ├── cliconf + ├── connection + ├── filter + ├── httpapi + ├── inventory + ├── lookup + ├── module_utils + ├── modules + ├── netconf + ├── shell + ├── strategy + ├── terminal + ├── test + └── vars +``` + +A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible/2.10/plugins/plugins.html). diff --git a/ansible_collections/cisco/dnac/plugins/__init__.py b/ansible_collections/cisco/dnac/plugins/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ansible_collections/cisco/dnac/plugins/action/app_policy_default_info.py b/ansible_collections/cisco/dnac/plugins/action/app_policy_default_info.py new file mode 100644 index 00000000..9e8665c8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/app_policy_default_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_application_policy_default', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/app_policy_info.py b/ansible_collections/cisco/dnac/plugins/action/app_policy_info.py new file mode 100644 index 00000000..4f0e145a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/app_policy_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + policyScope=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + policy_scope=params.get("policyScope"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_application_policy', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/app_policy_intent_create.py b/ansible_collections/cisco/dnac/plugins/action/app_policy_intent_create.py new file mode 100644 index 00000000..8b2e185c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/app_policy_intent_create.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + createList=dict(type="list"), + updateList=dict(type="list"), + deleteList=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + createList=params.get("createList"), + updateList=params.get("updateList"), + deleteList=params.get("deleteList"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='application_policy_intent', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile.py b/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile.py new file mode 100644 index 00000000..34b67d5e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id"], True), + ("state", "present", ["payload"], True), + ("state", "absent", ["id"], True), + ("state", "absent", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class AppPolicyQueuingProfile(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="application_policy", + function="get_application_policy_queuing_profile", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="application_policy", + function="get_application_policy_queuing_profile", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("id", "id"), + ("description", "description"), + ("name", "name"), + ("clause", "clause"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="application_policy", + function="create_application_policy_queuing_profile", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="application_policy", + function="update_application_policy_queuing_profile", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="application_policy", + function="delete_application_policy_queuing_profile", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = AppPolicyQueuingProfile(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_count_info.py b/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_count_info.py new file mode 100644 index 00000000..65558df4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_application_policy_queuing_profile_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_info.py b/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_info.py new file mode 100644 index 00000000..79cf3ad0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/app_policy_queuing_profile_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_application_policy_queuing_profile', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/application_sets.py b/ansible_collections/cisco/dnac/plugins/action/application_sets.py new file mode 100644 index 00000000..b1bc7f48 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/application_sets.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ApplicationSets(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="application_policy", + function="get_application_sets", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="application_policy", + function="get_application_sets", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("name", "name"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="application_policy", + function="create_application_set", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="application_policy", + function="delete_application_set", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = ApplicationSets(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/application_sets_count_info.py b/ansible_collections/cisco/dnac/plugins/action/application_sets_count_info.py new file mode 100644 index 00000000..afd2e7bf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/application_sets_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_application_sets_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/application_sets_info.py b/ansible_collections/cisco/dnac/plugins/action/application_sets_info.py new file mode 100644 index 00000000..9e388f1a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/application_sets_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="int"), + limit=dict(type="int"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_application_sets', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/applications.py b/ansible_collections/cisco/dnac/plugins/action/applications.py new file mode 100644 index 00000000..81c404e8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/applications.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Applications(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="application_policy", + function="get_applications", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="application_policy", + function="get_applications", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("id", "id"), + ("name", "name"), + ("networkApplications", "networkApplications"), + ("networkIdentity", "networkIdentity"), + ("applicationSet", "applicationSet"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="application_policy", + function="create_application", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="application_policy", + function="edit_application", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="application_policy", + function="delete_application", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Applications(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/applications_count_info.py b/ansible_collections/cisco/dnac/plugins/action/applications_count_info.py new file mode 100644 index 00000000..a7f89be1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/applications_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_applications_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/applications_health_info.py b/ansible_collections/cisco/dnac/plugins/action/applications_health_info.py new file mode 100644 index 00000000..31d101b2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/applications_health_info.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + deviceId=dict(type="str"), + macAddress=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + applicationHealth=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + applicationName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + device_id=params.get("deviceId"), + mac_address=params.get("macAddress"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + application_health=params.get("applicationHealth"), + offset=params.get("offset"), + limit=params.get("limit"), + application_name=params.get("applicationName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="applications", + function='applications', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/applications_info.py b/ansible_collections/cisco/dnac/plugins/action/applications_info.py new file mode 100644 index 00000000..8d127517 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/applications_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="int"), + limit=dict(type="int"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_applications', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/assign_device_to_site.py b/ansible_collections/cisco/dnac/plugins/action/assign_device_to_site.py new file mode 100644 index 00000000..342f660e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/assign_device_to_site.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device=dict(type="list"), + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device=params.get("device"), + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function='assign_devices_to_site', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/associate_site_to_network_profile.py b/ansible_collections/cisco/dnac/plugins/action/associate_site_to_network_profile.py new file mode 100644 index 00000000..d5de55cb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/associate_site_to_network_profile.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkProfileId=dict(type="str"), + siteId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + network_profile_id=params.get("networkProfileId"), + site_id=params.get("siteId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="site_design", + function='associate', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate.py b/ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate.py new file mode 100644 index 00000000..ae3eb2fe --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + pkPassword=dict(type="str", no_log=True), + listOfUsers=dict(type="list"), + certFilePath=dict(type="str"), + pkFilePath=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + pk_password=params.get("pkPassword"), + list_of_users=params.get("listOfUsers"), + cert_file_path=params.get("certFilePath"), + pk_file_path=params.get("pkFilePath"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="authentication_management", + function='import_certificate', + op_modifies=True, + params=self.get_object(self._task.args), + file_paths=[ + ('cert_file_path', 'certFileUpload'), + ('pk_file_path', 'pkFileUpload'), + ], + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate_p12.py b/ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate_p12.py new file mode 100644 index 00000000..96ea393d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/authentication_import_certificate_p12.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + p12Password=dict(type="str", no_log=True), + pkPassword=dict(type="str", no_log=True), + listOfUsers=dict(type="list"), + p12FilePath=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + p12_password=params.get("p12Password"), + pk_password=params.get("pkPassword"), + list_of_users=params.get("listOfUsers"), + p12_file_path=params.get("p12FilePath"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="authentication_management", + function='import_certificate_p12', + op_modifies=True, + params=self.get_object(self._task.args), + file_paths=[('p12_file_path', 'p12FileUpload')], + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/buildings_planned_access_points_info.py b/ansible_collections/cisco/dnac/plugins/action/buildings_planned_access_points_info.py new file mode 100644 index 00000000..16688732 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/buildings_planned_access_points_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + buildingId=dict(type="str"), + limit=dict(type="int"), + offset=dict(type="int"), + radios=dict(type="bool"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + building_id=params.get("buildingId"), + limit=params.get("limit"), + offset=params.get("offset"), + radios=params.get("radios"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_planned_access_points_for_building', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool.py b/ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool.py new file mode 100644 index 00000000..0b769874 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool.py @@ -0,0 +1,202 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + vlanName=dict(type="str"), + scalableGroupName=dict(type="str"), + ssidNames=dict(type="list"), + siteNameHierarchy=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class BusinessSdaHostonboardingSsidIppool(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + vlan_name=params.get("vlanName"), + site_name_hierarchy=params.get("siteNameHierarchy"), + vlanName=params.get("vlanName"), + scalableGroupName=params.get("scalableGroupName"), + ssidNames=params.get("ssidNames"), + siteNameHierarchy=params.get("siteNameHierarchy"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['vlan_name'] = self.new_object.get('vlanName') or \ + self.new_object.get('vlan_name') + new_object_params['site_name_hierarchy'] = self.new_object.get('siteNameHierarchy') or \ + self.new_object.get('site_name_hierarchy') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['vlanName'] = self.new_object.get('vlanName') + new_object_params['scalableGroupName'] = self.new_object.get('scalableGroupName') + new_object_params['ssidNames'] = self.new_object.get('ssidNames') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['vlanName'] = self.new_object.get('vlanName') + new_object_params['scalableGroupName'] = self.new_object.get('scalableGroupName') + new_object_params['ssidNames'] = self.new_object.get('ssidNames') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="fabric_wireless", + function="get_ssid_to_ip_pool_mapping", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and 'vlanName' in prev_obj + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("vlanName", "vlanName"), + ("scalableGroupName", "scalableGroupName"), + ("ssidNames", "ssidNames"), + ("siteNameHierarchy", "siteNameHierarchy"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="fabric_wireless", + function="add_ssid_to_ip_pool_mapping", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="fabric_wireless", + function="update_ssid_to_ip_pool_mapping2", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = BusinessSdaHostonboardingSsidIppool(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool_info.py b/ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool_info.py new file mode 100644 index 00000000..ea9f95ff --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/business_sda_hostonboarding_ssid_ippool_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + vlanName=dict(type="str"), + siteNameHierarchy=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + vlan_name=params.get("vlanName"), + site_name_hierarchy=params.get("siteNameHierarchy"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="fabric_wireless", + function='get_ssid_to_ip_pool_mapping', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/business_sda_virtual_network_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/business_sda_virtual_network_summary_info.py new file mode 100644 index 00000000..0852a2c0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/business_sda_virtual_network_summary_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteNameHierarchy=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_name_hierarchy=params.get("siteNameHierarchy"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_virtual_network_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_create.py b/ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_create.py new file mode 100644 index 00000000..cb3d48aa --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_create.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceName=dict(type="str"), + siteNameHierarchy=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceName=params.get("deviceName"), + siteNameHierarchy=params.get("siteNameHierarchy"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="fabric_wireless", + function='add_w_l_c_to_fabric_domain', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_delete.py b/ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_delete.py new file mode 100644 index 00000000..54ce6427 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/business_sda_wireless_controller_delete.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceIPAddress=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_ipaddress=params.get("deviceIPAddress"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="fabric_wireless", + function="remove_w_l_c_from_fabric_domain", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/cli_credential.py b/ansible_collections/cisco/dnac/plugins/action/cli_credential.py new file mode 100644 index 00000000..d10c9004 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/cli_credential.py @@ -0,0 +1,239 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + comments=dict(type="str"), + credentialType=dict(type="str"), + description=dict(type="str"), + enablePassword=dict(type="str", no_log=True), + id=dict(type="str"), + instanceTenantId=dict(type="str"), + instanceUuid=dict(type="str"), + password=dict(type="str", no_log=True), + username=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["description", "id", "username"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class CliCredential(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + comments=params.get("comments"), + credentialType=params.get("credentialType"), + description=params.get("description"), + enablePassword=params.get("enablePassword"), + id=params.get("id"), + instanceTenantId=params.get("instanceTenantId"), + instanceUuid=params.get("instanceUuid"), + password=params.get("password"), + username=params.get("username"), + ) + + def create_params(self): + new_object_params = {} + payload = {} + keys = ['comments', 'credentialType', 'description', 'enablePassword', 'id', + 'instanceTenantId', 'instanceUuid', 'password', 'username'] + for key in keys: + if self.new_object.get(key) is not None: + payload[key] = self.new_object.get(key) + new_object_params['payload'] = [payload] + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['comments'] = self.new_object.get('comments') + new_object_params['credentialType'] = self.new_object.get('credentialType') + new_object_params['description'] = self.new_object.get('description') + new_object_params['enablePassword'] = self.new_object.get('enablePassword') + new_object_params['id'] = self.new_object.get('id') + new_object_params['instanceTenantId'] = self.new_object.get('instanceTenantId') + new_object_params['instanceUuid'] = self.new_object.get('instanceUuid') + new_object_params['password'] = self.new_object.get('password') + new_object_params['username'] = self.new_object.get('username') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'CLI'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'description', name) or get_dict_result(items, 'username', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'CLI'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("description") or self.new_object.get("username") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + obj_params = [ + ("comments", "comments"), + ("credentialType", "credentialType"), + ("description", "description"), + ("id", "id"), + ("instanceTenantId", "instanceTenantId"), + ("instanceUuid", "instanceUuid"), + ("username", "username"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_cli_credentials", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_cli_credentials", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = CliCredential(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/client_detail_info.py b/ansible_collections/cisco/dnac/plugins/action/client_detail_info.py new file mode 100644 index 00000000..e09db53c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/client_detail_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + timestamp=dict(type="str"), + macAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + timestamp=params.get("timestamp"), + mac_address=params.get("macAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="clients", + function='get_client_detail', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/client_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/action/client_enrichment_details_info.py new file mode 100644 index 00000000..70e1dd73 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/client_enrichment_details_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="clients", + function='get_client_enrichment_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/client_health_info.py b/ansible_collections/cisco/dnac/plugins/action/client_health_info.py new file mode 100644 index 00000000..87275b03 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/client_health_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + timestamp=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + timestamp=params.get("timestamp"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="clients", + function='get_overall_client_health', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/client_proximity_info.py b/ansible_collections/cisco/dnac/plugins/action/client_proximity_info.py new file mode 100644 index 00000000..b9a41185 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/client_proximity_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + username=dict(type="str"), + number_days=dict(type="int"), + time_resolution=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + username=params.get("username"), + number_days=params.get("number_days"), + time_resolution=params.get("time_resolution"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="clients", + function='client_proximity', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/command_runner_run_command.py b/ansible_collections/cisco/dnac/plugins/action/command_runner_run_command.py new file mode 100644 index 00000000..bbae4f23 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/command_runner_run_command.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + commands=dict(type="list"), + description=dict(type="str"), + deviceUuids=dict(type="list"), + name=dict(type="str"), + timeout=dict(type="int"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + commands=params.get("commands"), + description=params.get("description"), + deviceUuids=params.get("deviceUuids"), + name=params.get("name"), + timeout=params.get("timeout"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="command_runner", + function='run_read_only_commands_on_devices', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/compliance_check_run.py b/ansible_collections/cisco/dnac/plugins/action/compliance_check_run.py new file mode 100644 index 00000000..4fbadc0c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/compliance_check_run.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + triggerFull=dict(type="bool"), + categories=dict(type="list"), + deviceUuids=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + triggerFull=params.get("triggerFull"), + categories=params.get("categories"), + deviceUuids=params.get("deviceUuids"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="compliance", + function='run_compliance', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/compliance_device_by_id_info.py b/ansible_collections/cisco/dnac/plugins/action/compliance_device_by_id_info.py new file mode 100644 index 00000000..e2c684bf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/compliance_device_by_id_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuid=dict(type="str"), + category=dict(type="str"), + complianceType=dict(type="str"), + diffList=dict(type="bool"), + key=dict(type="str"), + value=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("deviceUuid"), + category=params.get("category"), + compliance_type=params.get("complianceType"), + diff_list=params.get("diffList"), + key=params.get("key"), + value=params.get("value"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="compliance", + function='compliance_details_of_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/compliance_device_details_count_info.py b/ansible_collections/cisco/dnac/plugins/action/compliance_device_details_count_info.py new file mode 100644 index 00000000..92294538 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/compliance_device_details_count_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + complianceType=dict(type="str"), + complianceStatus=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + compliance_type=params.get("complianceType"), + compliance_status=params.get("complianceStatus"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="compliance", + function='get_compliance_detail_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/compliance_device_details_info.py b/ansible_collections/cisco/dnac/plugins/action/compliance_device_details_info.py new file mode 100644 index 00000000..7d18336f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/compliance_device_details_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + complianceType=dict(type="str"), + complianceStatus=dict(type="str"), + deviceUuid=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + compliance_type=params.get("complianceType"), + compliance_status=params.get("complianceStatus"), + device_uuid=params.get("deviceUuid"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="compliance", + function='get_compliance_detail', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/compliance_device_info.py b/ansible_collections/cisco/dnac/plugins/action/compliance_device_info.py new file mode 100644 index 00000000..25d2db9c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/compliance_device_info.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + complianceStatus=dict(type="str"), + deviceUuid=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + compliance_status=params.get("complianceStatus"), + device_uuid=params.get("deviceUuid"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("deviceUuid") + if id: + response = dnac.exec( + family="compliance", + function='device_compliance_status', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="compliance", + function='get_compliance_status', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/compliance_device_status_count_info.py b/ansible_collections/cisco/dnac/plugins/action/compliance_device_status_count_info.py new file mode 100644 index 00000000..1e3121f4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/compliance_device_status_count_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + complianceStatus=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + compliance_status=params.get("complianceStatus"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="compliance", + function='get_compliance_status_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template.py new file mode 100644 index 00000000..149e672a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template.py @@ -0,0 +1,355 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + tags=dict(type="list"), + author=dict(type="str"), + composite=dict(type="bool"), + containingTemplates=dict(type="list"), + createTime=dict(type="int"), + customParamsOrder=dict(type="bool"), + description=dict(type="str"), + deviceTypes=dict(type="list"), + failurePolicy=dict(type="str"), + id=dict(type="str"), + language=dict(type="str"), + lastUpdateTime=dict(type="int"), + latestVersionTime=dict(type="int"), + name=dict(type="str"), + parentTemplateId=dict(type="str"), + projectId=dict(type="str"), + projectName=dict(type="str"), + rollbackTemplateContent=dict(type="str"), + rollbackTemplateParams=dict(type="list"), + softwareType=dict(type="str"), + softwareVariant=dict(type="str"), + softwareVersion=dict(type="str"), + templateContent=dict(type="str"), + templateParams=dict(type="list"), + validationErrors=dict(type="dict"), + version=dict(type="str"), + templateId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "templateId"], True), + ("state", "absent", ["name", "templateId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ConfigurationTemplate(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + tags=params.get("tags"), + author=params.get("author"), + composite=params.get("composite"), + containingTemplates=params.get("containingTemplates"), + createTime=params.get("createTime"), + customParamsOrder=params.get("customParamsOrder"), + description=params.get("description"), + deviceTypes=params.get("deviceTypes"), + failurePolicy=params.get("failurePolicy"), + id=params.get("id"), + language=params.get("language"), + lastUpdateTime=params.get("lastUpdateTime"), + latestVersionTime=params.get("latestVersionTime"), + name=params.get("name"), + parentTemplateId=params.get("parentTemplateId"), + projectId=params.get("projectId"), + projectName=params.get("projectName"), + rollbackTemplateContent=params.get("rollbackTemplateContent"), + rollbackTemplateParams=params.get("rollbackTemplateParams"), + softwareType=params.get("softwareType"), + softwareVariant=params.get("softwareVariant"), + softwareVersion=params.get("softwareVersion"), + templateContent=params.get("templateContent"), + templateParams=params.get("templateParams"), + validationErrors=params.get("validationErrors"), + version=params.get("version"), + template_id=params.get("templateId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['project_id'] = self.new_object.get('projectId') or \ + self.new_object.get('project_id') + new_object_params['software_type'] = self.new_object.get('softwareType') or \ + self.new_object.get('software_type') + new_object_params['software_version'] = self.new_object.get('softwareVersion') or \ + self.new_object.get('software_version') + new_object_params['product_family'] = self.new_object.get('productFamily') or \ + self.new_object.get('product_family') + new_object_params['product_series'] = self.new_object.get('productSeries') or \ + self.new_object.get('product_series') + new_object_params['product_type'] = self.new_object.get('productType') or \ + self.new_object.get('product_type') + new_object_params['filter_conflicting_templates'] = self.new_object.get('filterConflictingTemplates') or \ + self.new_object.get('filter_conflicting_templates') + new_object_params['tags'] = self.new_object.get('tags') + new_object_params['project_names'] = self.new_object.get('projectName') or self.new_object.get('projectNames') or \ + self.new_object.get('project_names') + new_object_params['un_committed'] = self.new_object.get('unCommitted') or \ + self.new_object.get('un_committed') + new_object_params['sort_order'] = self.new_object.get('sortOrder') or \ + self.new_object.get('sort_order') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['template_id'] = self.new_object.get('template_id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['tags'] = self.new_object.get('tags') + new_object_params['author'] = self.new_object.get('author') + new_object_params['composite'] = self.new_object.get('composite') + new_object_params['containingTemplates'] = self.new_object.get('containingTemplates') + new_object_params['createTime'] = self.new_object.get('createTime') + new_object_params['customParamsOrder'] = self.new_object.get('customParamsOrder') + new_object_params['description'] = self.new_object.get('description') + new_object_params['deviceTypes'] = self.new_object.get('deviceTypes') + new_object_params['failurePolicy'] = self.new_object.get('failurePolicy') + new_object_params['id'] = self.new_object.get('id') + new_object_params['language'] = self.new_object.get('language') + new_object_params['lastUpdateTime'] = self.new_object.get('lastUpdateTime') + new_object_params['latestVersionTime'] = self.new_object.get('latestVersionTime') + new_object_params['name'] = self.new_object.get('name') + new_object_params['parentTemplateId'] = self.new_object.get('parentTemplateId') + new_object_params['projectId'] = self.new_object.get('projectId') + new_object_params['projectName'] = self.new_object.get('projectName') + new_object_params['rollbackTemplateContent'] = self.new_object.get('rollbackTemplateContent') + new_object_params['rollbackTemplateParams'] = self.new_object.get('rollbackTemplateParams') + new_object_params['softwareType'] = self.new_object.get('softwareType') + new_object_params['softwareVariant'] = self.new_object.get('softwareVariant') + new_object_params['softwareVersion'] = self.new_object.get('softwareVersion') + new_object_params['templateContent'] = self.new_object.get('templateContent') + new_object_params['templateParams'] = self.new_object.get('templateParams') + new_object_params['validationErrors'] = self.new_object.get('validationErrors') + new_object_params['version'] = self.new_object.get('version') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="configuration_templates", + function="gets_the_templates_available", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="configuration_templates", + function="get_template_details", + params={"template_id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("template_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("templateId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(template_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("tags", "tags"), + ("author", "author"), + ("composite", "composite"), + ("containingTemplates", "containingTemplates"), + ("createTime", "createTime"), + ("customParamsOrder", "customParamsOrder"), + ("description", "description"), + ("deviceTypes", "deviceTypes"), + ("failurePolicy", "failurePolicy"), + ("id", "id"), + ("language", "language"), + ("lastUpdateTime", "lastUpdateTime"), + ("latestVersionTime", "latestVersionTime"), + ("name", "name"), + ("parentTemplateId", "parentTemplateId"), + ("projectId", "projectId"), + ("projectName", "projectName"), + ("rollbackTemplateContent", "rollbackTemplateContent"), + ("rollbackTemplateParams", "rollbackTemplateParams"), + ("softwareType", "softwareType"), + ("softwareVariant", "softwareVariant"), + ("softwareVersion", "softwareVersion"), + ("templateContent", "templateContent"), + ("templateParams", "templateParams"), + ("validationErrors", "validationErrors"), + ("version", "version"), + ("templateId", "template_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="configuration_templates", + function="update_template", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("template_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("templateId") + if id_: + self.new_object.update(dict(template_id=id_)) + result = self.dnac.exec( + family="configuration_templates", + function="deletes_the_template", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = ConfigurationTemplate(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + dnac.fail_json("Object does not exists, plugin only has update") + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_clone.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_clone.py new file mode 100644 index 00000000..e0a8b0d3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_clone.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + templateId=dict(type="str"), + projectId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + template_id=params.get("templateId"), + project_id=params.get("projectId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='clone_given_template', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_create.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_create.py new file mode 100644 index 00000000..a2b45f26 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_create.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + tags=dict(type="list"), + author=dict(type="str"), + composite=dict(type="bool"), + containingTemplates=dict(type="list"), + createTime=dict(type="int"), + customParamsOrder=dict(type="bool"), + description=dict(type="str"), + deviceTypes=dict(type="list"), + failurePolicy=dict(type="str"), + id=dict(type="str"), + language=dict(type="str"), + lastUpdateTime=dict(type="int"), + latestVersionTime=dict(type="int"), + name=dict(type="str"), + parentTemplateId=dict(type="str"), + projectId=dict(type="str"), + projectName=dict(type="str"), + rollbackTemplateContent=dict(type="str"), + rollbackTemplateParams=dict(type="list"), + softwareType=dict(type="str"), + softwareVariant=dict(type="str"), + softwareVersion=dict(type="str"), + templateContent=dict(type="str"), + templateParams=dict(type="list"), + validationErrors=dict(type="dict"), + version=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + tags=params.get("tags"), + author=params.get("author"), + composite=params.get("composite"), + containingTemplates=params.get("containingTemplates"), + createTime=params.get("createTime"), + customParamsOrder=params.get("customParamsOrder"), + description=params.get("description"), + deviceTypes=params.get("deviceTypes"), + failurePolicy=params.get("failurePolicy"), + id=params.get("id"), + language=params.get("language"), + lastUpdateTime=params.get("lastUpdateTime"), + latestVersionTime=params.get("latestVersionTime"), + name=params.get("name"), + parentTemplateId=params.get("parentTemplateId"), + projectId=params.get("projectId"), + projectName=params.get("projectName"), + rollbackTemplateContent=params.get("rollbackTemplateContent"), + rollbackTemplateParams=params.get("rollbackTemplateParams"), + softwareType=params.get("softwareType"), + softwareVariant=params.get("softwareVariant"), + softwareVersion=params.get("softwareVersion"), + templateContent=params.get("templateContent"), + templateParams=params.get("templateParams"), + validationErrors=params.get("validationErrors"), + version=params.get("version"), + project_id=params.get("projectId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='create_template', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy.py new file mode 100644 index 00000000..48ccdcf3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + forcePushTemplate=dict(type="bool"), + isComposite=dict(type="bool"), + mainTemplateId=dict(type="str"), + memberTemplateDeploymentInfo=dict(type="list"), + targetInfo=dict(type="list"), + templateId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + forcePushTemplate=params.get("forcePushTemplate"), + isComposite=params.get("isComposite"), + mainTemplateId=params.get("mainTemplateId"), + memberTemplateDeploymentInfo=params.get("memberTemplateDeploymentInfo"), + targetInfo=params.get("targetInfo"), + templateId=params.get("templateId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='deploy_template', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_status_info.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_status_info.py new file mode 100644 index 00000000..735b5f93 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_status_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deploymentId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deployment_id=params.get("deploymentId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("deploymentId") + if id: + response = dnac.exec( + family="configuration_templates", + function='get_template_deployment_status', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_v2.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_v2.py new file mode 100644 index 00000000..fe1ec9b7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_deploy_v2.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + forcePushTemplate=dict(type="bool"), + isComposite=dict(type="bool"), + mainTemplateId=dict(type="str"), + memberTemplateDeploymentInfo=dict(type="list"), + targetInfo=dict(type="list"), + templateId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + forcePushTemplate=params.get("forcePushTemplate"), + isComposite=params.get("isComposite"), + mainTemplateId=params.get("mainTemplateId"), + memberTemplateDeploymentInfo=params.get("memberTemplateDeploymentInfo"), + targetInfo=params.get("targetInfo"), + templateId=params.get("templateId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='deploy_template_v2', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_export_project.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_export_project.py new file mode 100644 index 00000000..8b9d5925 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_export_project.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='export_projects', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_export_template.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_export_template.py new file mode 100644 index 00000000..cf5f70c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_export_template.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='export_templates', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_import_project.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_import_project.py new file mode 100644 index 00000000..1d75337e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_import_project.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + doVersion=dict(type="bool"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + do_version=params.get("doVersion"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='imports_the_projects_provided', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_import_template.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_import_template.py new file mode 100644 index 00000000..6ee6f6bb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_import_template.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), + projectName=dict(type="str"), + doVersion=dict(type="bool"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + project_name=params.get("projectName"), + do_version=params.get("doVersion"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='imports_the_templates_provided', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_info.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_info.py new file mode 100644 index 00000000..6d7ddab4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_info.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + projectId=dict(type="str"), + softwareType=dict(type="str"), + softwareVersion=dict(type="str"), + productFamily=dict(type="str"), + productSeries=dict(type="str"), + productType=dict(type="str"), + filterConflictingTemplates=dict(type="bool"), + tags=dict(type="list"), + projectNames=dict(type="list"), + unCommitted=dict(type="bool"), + sortOrder=dict(type="str"), + templateId=dict(type="str"), + latestVersion=dict(type="bool"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + project_id=params.get("projectId"), + software_type=params.get("softwareType"), + software_version=params.get("softwareVersion"), + product_family=params.get("productFamily"), + product_series=params.get("productSeries"), + product_type=params.get("productType"), + filter_conflicting_templates=params.get("filterConflictingTemplates"), + tags=params.get("tags"), + project_names=params.get("projectNames"), + un_committed=params.get("unCommitted"), + sort_order=params.get("sortOrder"), + template_id=params.get("templateId"), + latest_version=params.get("latestVersion"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("templateId") + if id: + response = dnac.exec( + family="configuration_templates", + function='get_template_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="configuration_templates", + function='gets_the_templates_available', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_project.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_project.py new file mode 100644 index 00000000..65017e94 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_project.py @@ -0,0 +1,284 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + tags=dict(type="list"), + createTime=dict(type="int"), + description=dict(type="str"), + id=dict(type="str"), + lastUpdateTime=dict(type="int"), + name=dict(type="str"), + templates=dict(type="list"), + projectId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "projectId"], True), + ("state", "absent", ["name", "projectId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ConfigurationTemplateProject(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + tags=params.get("tags"), + createTime=params.get("createTime"), + description=params.get("description"), + id=params.get("id"), + lastUpdateTime=params.get("lastUpdateTime"), + name=params.get("name"), + templates=params.get("templates"), + project_id=params.get("projectId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['name'] = name or self.new_object.get('name') + new_object_params['sort_order'] = self.new_object.get('sortOrder') or \ + self.new_object.get('sort_order') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['tags'] = self.new_object.get('tags') + new_object_params['createTime'] = self.new_object.get('createTime') + new_object_params['description'] = self.new_object.get('description') + new_object_params['id'] = self.new_object.get('id') + new_object_params['lastUpdateTime'] = self.new_object.get('lastUpdateTime') + new_object_params['name'] = self.new_object.get('name') + new_object_params['templates'] = self.new_object.get('templates') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['project_id'] = self.new_object.get('project_id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['tags'] = self.new_object.get('tags') + new_object_params['createTime'] = self.new_object.get('createTime') + new_object_params['description'] = self.new_object.get('description') + new_object_params['id'] = self.new_object.get('id') + new_object_params['lastUpdateTime'] = self.new_object.get('lastUpdateTime') + new_object_params['name'] = self.new_object.get('name') + new_object_params['templates'] = self.new_object.get('templates') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="configuration_templates", + function="get_projects", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="configuration_templates", + function="get_project_details", + params={"project_id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'projectId', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("project_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("projectId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(project_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("tags", "tags"), + ("createTime", "createTime"), + ("description", "description"), + ("id", "id"), + ("lastUpdateTime", "lastUpdateTime"), + ("name", "name"), + ("templates", "templates"), + ("projectId", "project_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="configuration_templates", + function="create_project", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="configuration_templates", + function="update_project", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("project_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("projectId") + if id_: + self.new_object.update(dict(project_id=id_)) + result = self.dnac.exec( + family="configuration_templates", + function="deletes_the_project", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = ConfigurationTemplateProject(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_project_info.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_project_info.py new file mode 100644 index 00000000..02aa0343 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_project_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + sortOrder=dict(type="str"), + projectId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + sort_order=params.get("sortOrder"), + project_id=params.get("projectId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("projectId") + if id: + response = dnac.exec( + family="configuration_templates", + function='get_project_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="configuration_templates", + function='get_projects', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_version_create.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_version_create.py new file mode 100644 index 00000000..5471dc5b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_version_create.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + comments=dict(type="str"), + templateId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + comments=params.get("comments"), + templateId=params.get("templateId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='version_template', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/configuration_template_version_info.py b/ansible_collections/cisco/dnac/plugins/action/configuration_template_version_info.py new file mode 100644 index 00000000..6b8de881 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/configuration_template_version_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + templateId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + template_id=params.get("templateId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("templateId") + if id: + response = dnac.exec( + family="configuration_templates", + function='get_template_versions', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_configurations_export.py b/ansible_collections/cisco/dnac/plugins/action/device_configurations_export.py new file mode 100644 index 00000000..20c129b9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_configurations_export.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="list"), + password=dict(type="str", no_log=True), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceId=params.get("deviceId"), + password=params.get("password"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_archive", + function='export_device_configurations', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_credential_create.py b/ansible_collections/cisco/dnac/plugins/action/device_credential_create.py new file mode 100644 index 00000000..37309e09 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_credential_create.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + settings=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + settings=params.get("settings"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='create_device_credentials', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_credential_delete.py b/ansible_collections/cisco/dnac/plugins/action/device_credential_delete.py new file mode 100644 index 00000000..1b565ad9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_credential_delete.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function="delete_device_credential", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_credential_info.py b/ansible_collections/cisco/dnac/plugins/action/device_credential_info.py new file mode 100644 index 00000000..5293cc3c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_credential_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='get_device_credential_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_credential_update.py b/ansible_collections/cisco/dnac/plugins/action/device_credential_update.py new file mode 100644 index 00000000..9af7a0b8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_credential_update.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + settings=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + settings=params.get("settings"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='update_device_credentials', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_details_info.py b/ansible_collections/cisco/dnac/plugins/action/device_details_info.py new file mode 100644 index 00000000..7a743804 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_details_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + timestamp=dict(type="str"), + searchBy=dict(type="str"), + identifier=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + timestamp=params.get("timestamp"), + search_by=params.get("searchBy"), + identifier=params.get("identifier"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_detail', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/action/device_enrichment_details_info.py new file mode 100644 index 00000000..89bf00ae --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_enrichment_details_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_enrichment_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_family_identifiers_details_info.py b/ansible_collections/cisco/dnac/plugins/action/device_family_identifiers_details_info.py new file mode 100644 index 00000000..5f40e7f3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_family_identifiers_details_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function='get_device_family_identifiers', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_health_info.py b/ansible_collections/cisco/dnac/plugins/action/device_health_info.py new file mode 100644 index 00000000..68bd65bf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_health_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceRole=dict(type="str"), + siteId=dict(type="str"), + health=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + limit=dict(type="int"), + offset=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_role=params.get("deviceRole"), + site_id=params.get("siteId"), + health=params.get("health"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + limit=params.get("limit"), + offset=params.get("offset"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='devices', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_interface_by_ip_info.py b/ansible_collections/cisco/dnac/plugins/action/device_interface_by_ip_info.py new file mode 100644 index 00000000..6c6faffc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_interface_by_ip_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ipAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + ip_address=params.get("ipAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("ipAddress") + if id: + response = dnac.exec( + family="devices", + function='get_interface_by_ip', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_interface_count_info.py b/ansible_collections/cisco/dnac/plugins/action/device_interface_count_info.py new file mode 100644 index 00000000..c10bffe7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_interface_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_interface_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_interface_info.py b/ansible_collections/cisco/dnac/plugins/action/device_interface_info.py new file mode 100644 index 00000000..d1923f51 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_interface_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="int"), + limit=dict(type="int"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="devices", + function='get_interface_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="devices", + function='get_all_interfaces', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_interface_isis_info.py b/ansible_collections/cisco/dnac/plugins/action/device_interface_isis_info.py new file mode 100644 index 00000000..b298a0eb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_interface_isis_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_isis_interfaces', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_interface_ospf_info.py b/ansible_collections/cisco/dnac/plugins/action/device_interface_ospf_info.py new file mode 100644 index 00000000..b27e0f89 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_interface_ospf_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_ospf_interfaces', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_replacement.py b/ansible_collections/cisco/dnac/plugins/action/device_replacement.py new file mode 100644 index 00000000..061e8336 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_replacement.py @@ -0,0 +1,237 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + payload=dict(type="list"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class DeviceReplacement(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['faulty_device_name'] = self.new_object.get('faultyDeviceName') or \ + self.new_object.get('faulty_device_name') + new_object_params['faulty_device_platform'] = self.new_object.get('faultyDevicePlatform') or \ + self.new_object.get('faulty_device_platform') + new_object_params['replacement_device_platform'] = self.new_object.get('replacementDevicePlatform') or \ + self.new_object.get('replacement_device_platform') + new_object_params['faulty_device_serial_number'] = self.new_object.get('faultyDeviceSerialNumber') or \ + self.new_object.get('faulty_device_serial_number') + new_object_params['replacement_device_serial_number'] = self.new_object.get('replacementDeviceSerialNumber') or \ + self.new_object.get('replacement_device_serial_number') + new_object_params['replacement_status'] = self.new_object.get('replacementStatus') or \ + self.new_object.get('replacement_status') + new_object_params['family'] = self.new_object.get('family') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + new_object_params['sort_order'] = self.new_object.get('sortOrder') or \ + self.new_object.get('sort_order') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="device_replacement", + function="return_replacement_devices_with_details", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("creationTime", "creationTime"), + ("family", "family"), + ("faultyDeviceId", "faultyDeviceId"), + ("faultyDeviceName", "faultyDeviceName"), + ("faultyDevicePlatform", "faultyDevicePlatform"), + ("faultyDeviceSerialNumber", "faultyDeviceSerialNumber"), + ("id", "id"), + ("neighbourDeviceId", "neighbourDeviceId"), + ("networkReadinessTaskId", "networkReadinessTaskId"), + ("replacementDevicePlatform", "replacementDevicePlatform"), + ("replacementDeviceSerialNumber", "replacementDeviceSerialNumber"), + ("replacementStatus", "replacementStatus"), + ("replacementTime", "replacementTime"), + ("workflowId", "workflowId"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="device_replacement", + function="mark_device_for_replacement", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="device_replacement", + function="unmark_device_for_replacement", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = DeviceReplacement(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_replacement_count_info.py b/ansible_collections/cisco/dnac/plugins/action/device_replacement_count_info.py new file mode 100644 index 00000000..51ca8396 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_replacement_count_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + replacementStatus=dict(type="list"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + replacement_status=params.get("replacementStatus"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_replacement", + function='return_replacement_devices_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_replacement_deploy.py b/ansible_collections/cisco/dnac/plugins/action/device_replacement_deploy.py new file mode 100644 index 00000000..c6776a3c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_replacement_deploy.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + faultyDeviceSerialNumber=dict(type="str"), + replacementDeviceSerialNumber=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + faultyDeviceSerialNumber=params.get("faultyDeviceSerialNumber"), + replacementDeviceSerialNumber=params.get("replacementDeviceSerialNumber"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_replacement", + function='deploy_device_replacement_workflow', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/device_replacement_info.py b/ansible_collections/cisco/dnac/plugins/action/device_replacement_info.py new file mode 100644 index 00000000..2a3ecf12 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/device_replacement_info.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + faultyDeviceName=dict(type="str"), + faultyDevicePlatform=dict(type="str"), + replacementDevicePlatform=dict(type="str"), + faultyDeviceSerialNumber=dict(type="str"), + replacementDeviceSerialNumber=dict(type="str"), + replacementStatus=dict(type="list"), + family=dict(type="list"), + sortBy=dict(type="str"), + sortOrder=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + faulty_device_name=params.get("faultyDeviceName"), + faulty_device_platform=params.get("faultyDevicePlatform"), + replacement_device_platform=params.get("replacementDevicePlatform"), + faulty_device_serial_number=params.get("faultyDeviceSerialNumber"), + replacement_device_serial_number=params.get("replacementDeviceSerialNumber"), + replacement_status=params.get("replacementStatus"), + family=params.get("family"), + sort_by=params.get("sortBy"), + sort_order=params.get("sortOrder"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_replacement", + function='return_replacement_devices_with_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/disassociate_site_to_network_profile.py b/ansible_collections/cisco/dnac/plugins/action/disassociate_site_to_network_profile.py new file mode 100644 index 00000000..8598531b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/disassociate_site_to_network_profile.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkProfileId=dict(type="str"), + siteId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + network_profile_id=params.get("networkProfileId"), + site_id=params.get("siteId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="site_design", + function="disassociate", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_operationstatus_info.py b/ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_operationstatus_info.py new file mode 100644 index 00000000..ad522bbc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_operationstatus_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="disaster_recovery", + function='disaster_recovery_operational_status', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_status_info.py b/ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_status_info.py new file mode 100644 index 00000000..aa57427d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/disasterrecovery_system_status_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="disaster_recovery", + function='disaster_recovery_status', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery.py b/ansible_collections/cisco/dnac/plugins/action/discovery.py new file mode 100644 index 00000000..b06a6a61 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery.py @@ -0,0 +1,443 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + cdpLevel=dict(type="int"), + discoveryType=dict(type="str"), + enablePasswordList=dict(type="list", no_log=True), + globalCredentialIdList=dict(type="list"), + httpReadCredential=dict(type="dict"), + httpWriteCredential=dict(type="dict"), + ipAddressList=dict(type="str"), + ipFilterList=dict(type="list"), + lldpLevel=dict(type="int"), + name=dict(type="str"), + netconfPort=dict(type="str"), + passwordList=dict(type="list", no_log=True), + preferredMgmtIPMethod=dict(type="str"), + protocolOrder=dict(type="str"), + retry=dict(type="int"), + snmpAuthPassphrase=dict(type="str"), + snmpAuthProtocol=dict(type="str"), + snmpMode=dict(type="str"), + snmpPrivPassphrase=dict(type="str"), + snmpPrivProtocol=dict(type="str"), + snmpROCommunity=dict(type="str"), + snmpROCommunityDesc=dict(type="str"), + snmpRWCommunity=dict(type="str"), + snmpRWCommunityDesc=dict(type="str"), + snmpUserName=dict(type="str"), + snmpVersion=dict(type="str"), + timeout=dict(type="int"), + userNameList=dict(type="list"), + id=dict(type="str"), + attributeInfo=dict(type="dict"), + deviceIds=dict(type="str"), + discoveryCondition=dict(type="str"), + discoveryStatus=dict(type="str"), + isAutoCdp=dict(type="bool"), + numDevices=dict(type="int"), + parentDiscoveryId=dict(type="str"), + retryCount=dict(type="int"), + snmpRoCommunity=dict(type="str"), + snmpRoCommunityDesc=dict(type="str"), + snmpRwCommunity=dict(type="str"), + snmpRwCommunityDesc=dict(type="str"), + timeOut=dict(type="int"), + updateMgmtIp=dict(type="bool"), +)) + +required_if = [ + ("state", "present", ["id", "name"], True), + ("state", "absent", ["id", "name"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Discovery(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + cdpLevel=params.get("cdpLevel"), + discoveryType=params.get("discoveryType"), + enablePasswordList=params.get("enablePasswordList"), + globalCredentialIdList=params.get("globalCredentialIdList"), + httpReadCredential=params.get("httpReadCredential"), + httpWriteCredential=params.get("httpWriteCredential"), + ipAddressList=params.get("ipAddressList"), + ipFilterList=params.get("ipFilterList"), + lldpLevel=params.get("lldpLevel"), + name=params.get("name"), + netconfPort=params.get("netconfPort"), + passwordList=params.get("passwordList"), + preferredMgmtIPMethod=params.get("preferredMgmtIPMethod"), + protocolOrder=params.get("protocolOrder"), + retry=params.get("retry"), + snmpAuthPassphrase=params.get("snmpAuthPassphrase"), + snmpAuthProtocol=params.get("snmpAuthProtocol"), + snmpMode=params.get("snmpMode"), + snmpPrivPassphrase=params.get("snmpPrivPassphrase"), + snmpPrivProtocol=params.get("snmpPrivProtocol"), + snmpROCommunity=params.get("snmpROCommunity"), + snmpROCommunityDesc=params.get("snmpROCommunityDesc"), + snmpRWCommunity=params.get("snmpRWCommunity"), + snmpRWCommunityDesc=params.get("snmpRWCommunityDesc"), + snmpUserName=params.get("snmpUserName"), + snmpVersion=params.get("snmpVersion"), + timeout=params.get("timeout"), + userNameList=params.get("userNameList"), + id=params.get("id"), + attributeInfo=params.get("attributeInfo"), + deviceIds=params.get("deviceIds"), + discoveryCondition=params.get("discoveryCondition"), + discoveryStatus=params.get("discoveryStatus"), + isAutoCdp=params.get("isAutoCdp"), + numDevices=params.get("numDevices"), + parentDiscoveryId=params.get("parentDiscoveryId"), + retryCount=params.get("retryCount"), + snmpRoCommunity=params.get("snmpRoCommunity"), + snmpRoCommunityDesc=params.get("snmpRoCommunityDesc"), + snmpRwCommunity=params.get("snmpRwCommunity"), + snmpRwCommunityDesc=params.get("snmpRwCommunityDesc"), + timeOut=params.get("timeOut"), + updateMgmtIp=params.get("updateMgmtIp"), + ) + + def create_params(self): + new_object_params = {} + new_object_params['cdpLevel'] = self.new_object.get('cdpLevel') + new_object_params['discoveryType'] = self.new_object.get('discoveryType') + new_object_params['enablePasswordList'] = self.new_object.get('enablePasswordList') + new_object_params['globalCredentialIdList'] = self.new_object.get('globalCredentialIdList') + new_object_params['httpReadCredential'] = self.new_object.get('httpReadCredential') + new_object_params['httpWriteCredential'] = self.new_object.get('httpWriteCredential') + new_object_params['ipAddressList'] = self.new_object.get('ipAddressList') + new_object_params['ipFilterList'] = self.new_object.get('ipFilterList') + new_object_params['lldpLevel'] = self.new_object.get('lldpLevel') + new_object_params['name'] = self.new_object.get('name') + new_object_params['netconfPort'] = self.new_object.get('netconfPort') + new_object_params['passwordList'] = self.new_object.get('passwordList') + new_object_params['preferredMgmtIPMethod'] = self.new_object.get('preferredMgmtIPMethod') + new_object_params['protocolOrder'] = self.new_object.get('protocolOrder') + new_object_params['retry'] = self.new_object.get('retry') + new_object_params['snmpAuthPassphrase'] = self.new_object.get('snmpAuthPassphrase') + new_object_params['snmpAuthProtocol'] = self.new_object.get('snmpAuthProtocol') + new_object_params['snmpMode'] = self.new_object.get('snmpMode') + new_object_params['snmpPrivPassphrase'] = self.new_object.get('snmpPrivPassphrase') + new_object_params['snmpPrivProtocol'] = self.new_object.get('snmpPrivProtocol') + new_object_params['snmpROCommunity'] = self.new_object.get('snmpROCommunity') + new_object_params['snmpROCommunityDesc'] = self.new_object.get('snmpROCommunityDesc') + new_object_params['snmpRWCommunity'] = self.new_object.get('snmpRWCommunity') + new_object_params['snmpRWCommunityDesc'] = self.new_object.get('snmpRWCommunityDesc') + new_object_params['snmpUserName'] = self.new_object.get('snmpUserName') + new_object_params['snmpVersion'] = self.new_object.get('snmpVersion') + new_object_params['timeout'] = self.new_object.get('timeout') + new_object_params['userNameList'] = self.new_object.get('userNameList') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def convert_list_string(self, pList): + if isinstance(pList, list): + if len(pList) > 0: + pList_str = list(map(str, pList)) + return ', '.join(pList_str) + else: + return '' + else: + return pList + + def update_all_params(self): + new_object_params = {} + new_object_params['attributeInfo'] = self.new_object.get('attributeInfo') + new_object_params['cdpLevel'] = self.new_object.get('cdpLevel') + new_object_params['deviceIds'] = self.new_object.get('deviceIds') + new_object_params['discoveryCondition'] = self.new_object.get('discoveryCondition') + new_object_params['discoveryStatus'] = self.new_object.get('discoveryStatus') + new_object_params['discoveryType'] = self.new_object.get('discoveryType') + new_object_params['enablePasswordList'] = self.convert_list_string( + self.new_object.get('enablePasswordList') + ) + new_object_params['globalCredentialIdList'] = self.new_object.get('globalCredentialIdList') + new_object_params['httpReadCredential'] = self.new_object.get('httpReadCredential') + new_object_params['httpWriteCredential'] = self.new_object.get('httpWriteCredential') + new_object_params['id'] = self.new_object.get('id') + new_object_params['ipAddressList'] = self.new_object.get('ipAddressList') + new_object_params['ipFilterList'] = self.convert_list_string( + self.new_object.get('ipFilterList') + ) + new_object_params['isAutoCdp'] = self.new_object.get('isAutoCdp') + new_object_params['lldpLevel'] = self.new_object.get('lldpLevel') + new_object_params['name'] = self.new_object.get('name') + new_object_params['netconfPort'] = self.new_object.get('netconfPort') + new_object_params['numDevices'] = self.new_object.get('numDevices') + new_object_params['parentDiscoveryId'] = self.new_object.get('parentDiscoveryId') + new_object_params['passwordList'] = self.convert_list_string( + self.new_object.get('passwordList') + ) + new_object_params['preferredMgmtIPMethod'] = self.new_object.get('preferredMgmtIPMethod') + new_object_params['protocolOrder'] = self.new_object.get('protocolOrder') + new_object_params['retryCount'] = self.new_object.get('retryCount') + new_object_params['snmpAuthPassphrase'] = self.new_object.get('snmpAuthPassphrase') + new_object_params['snmpAuthProtocol'] = self.new_object.get('snmpAuthProtocol') + new_object_params['snmpMode'] = self.new_object.get('snmpMode') + new_object_params['snmpPrivPassphrase'] = self.new_object.get('snmpPrivPassphrase') + new_object_params['snmpPrivProtocol'] = self.new_object.get('snmpPrivProtocol') + new_object_params['snmpRoCommunity'] = self.new_object.get('snmpRoCommunity') + new_object_params['snmpRoCommunityDesc'] = self.new_object.get('snmpRoCommunityDesc') + new_object_params['snmpRwCommunity'] = self.new_object.get('snmpRwCommunity') + new_object_params['snmpRwCommunityDesc'] = self.new_object.get('snmpRwCommunityDesc') + new_object_params['snmpUserName'] = self.new_object.get('snmpUserName') + new_object_params['timeOut'] = self.new_object.get('timeOut') + new_object_params['updateMgmtIp'] = self.new_object.get('updateMgmtIp') + new_object_params['userNameList'] = self.convert_list_string( + self.new_object.get('userNameList') + ) + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + # NOTE: Does not have get all + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_discovery_by_id", + params={"id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = dict(self.new_object) + + for key in requested_obj.keys(): + if key in ['ipFilterList', 'userNameList']: + requested_obj[key] = self.convert_list_string(requested_obj.get(key)) + + obj_params = [ + ("cdpLevel", "cdpLevel"), + ("discoveryType", "discoveryType"), + ("globalCredentialIdList", "globalCredentialIdList"), + ("httpReadCredential", "httpReadCredential"), + ("httpWriteCredential", "httpWriteCredential"), + ("ipAddressList", "ipAddressList"), + ("ipFilterList", "ipFilterList"), + ("lldpLevel", "lldpLevel"), + ("name", "name"), + ("netconfPort", "netconfPort"), + ("preferredMgmtIPMethod", "preferredMgmtIPMethod"), + ("protocolOrder", "protocolOrder"), + ("retry", "retry"), + ("snmpAuthPassphrase", "snmpAuthPassphrase"), + ("snmpAuthProtocol", "snmpAuthProtocol"), + ("snmpMode", "snmpMode"), + ("snmpPrivPassphrase", "snmpPrivPassphrase"), + ("snmpPrivProtocol", "snmpPrivProtocol"), + ("snmpROCommunity", "snmpROCommunity"), + ("snmpROCommunityDesc", "snmpROCommunityDesc"), + ("snmpRWCommunity", "snmpRWCommunity"), + ("snmpRWCommunityDesc", "snmpRWCommunityDesc"), + ("snmpUserName", "snmpUserName"), + ("snmpVersion", "snmpVersion"), + ("timeout", "timeout"), + ("userNameList", "userNameList"), + ("id", "id"), + ("attributeInfo", "attributeInfo"), + ("deviceIds", "deviceIds"), + ("discoveryCondition", "discoveryCondition"), + ("discoveryStatus", "discoveryStatus"), + ("isAutoCdp", "isAutoCdp"), + ("numDevices", "numDevices"), + ("parentDiscoveryId", "parentDiscoveryId"), + ("retryCount", "retryCount"), + ("snmpRoCommunity", "snmpRoCommunity"), + ("snmpRoCommunityDesc", "snmpRoCommunityDesc"), + ("snmpRwCommunity", "snmpRwCommunity"), + ("snmpRwCommunityDesc", "snmpRwCommunityDesc"), + ("timeOut", "timeOut"), + ("updateMgmtIp", "updateMgmtIp"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="start_discovery", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="discovery", + function="updates_discovery_by_id", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="discovery", + function="delete_discovery_by_id", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Discovery(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_count_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_count_info.py new file mode 100644 index 00000000..6332cb95 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_count_of_all_discovery_jobs', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_device_count_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_device_count_info.py new file mode 100644 index 00000000..cc72e889 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_device_count_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + taskId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + task_id=params.get("taskId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_devices_discovered_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_device_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_device_info.py new file mode 100644 index 00000000..ce466c5d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_device_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + taskId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + task_id=params.get("taskId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_discovered_network_devices_by_discovery_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_device_range_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_device_range_info.py new file mode 100644 index 00000000..fe566198 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_device_range_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + startIndex=dict(type="int"), + recordsToReturn=dict(type="int"), + taskId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + start_index=params.get("startIndex"), + records_to_return=params.get("recordsToReturn"), + task_id=params.get("taskId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_discovered_devices_by_range', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_info.py new file mode 100644 index 00000000..7ccd6be9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="discovery", + function='get_discovery_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_job_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_job_info.py new file mode 100644 index 00000000..d820a51e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_job_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="int"), + limit=dict(type="int"), + ipAddress=dict(type="str"), + name=dict(type="str"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + ip_address=params.get("ipAddress"), + name=params.get("name"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="discovery", + function='get_list_of_discoveries_by_discovery_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="discovery", + function='get_discovery_jobs_by_ip', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_range_delete.py b/ansible_collections/cisco/dnac/plugins/action/discovery_range_delete.py new file mode 100644 index 00000000..f9e3da00 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_range_delete.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + startIndex=dict(type="int"), + recordsToDelete=dict(type="int"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + start_index=params.get("startIndex"), + records_to_delete=params.get("recordsToDelete"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function="delete_discovery_by_specified_range", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_range_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_range_info.py new file mode 100644 index 00000000..b90f7cb1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_range_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + startIndex=dict(type="int"), + recordsToReturn=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + start_index=params.get("startIndex"), + records_to_return=params.get("recordsToReturn"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_discoveries_by_range', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/discovery_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/discovery_summary_info.py new file mode 100644 index 00000000..9b64187b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/discovery_summary_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + taskId=dict(type="str"), + sortBy=dict(type="str"), + sortOrder=dict(type="str"), + ipAddress=dict(type="list"), + pingStatus=dict(type="list"), + snmpStatus=dict(type="list"), + cliStatus=dict(type="list"), + netconfStatus=dict(type="list"), + httpStatus=dict(type="list"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + task_id=params.get("taskId"), + sort_by=params.get("sortBy"), + sort_order=params.get("sortOrder"), + ip_address=params.get("ipAddress"), + ping_status=params.get("pingStatus"), + snmp_status=params.get("snmpStatus"), + cli_status=params.get("cliStatus"), + netconf_status=params.get("netconfStatus"), + http_status=params.get("httpStatus"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_network_devices_from_discovery', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/dna_command_runner_keywords_info.py b/ansible_collections/cisco/dnac/plugins/action/dna_command_runner_keywords_info.py new file mode 100644 index 00000000..aa942f1b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/dna_command_runner_keywords_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="command_runner", + function='get_all_keywords_of_clis_accepted', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/dnacaap_management_execution_status_info.py b/ansible_collections/cisco/dnac/plugins/action/dnacaap_management_execution_status_info.py new file mode 100644 index 00000000..e416fc35 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/dnacaap_management_execution_status_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + executionId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + execution_id=params.get("executionId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("executionId") + if id: + response = dnac.exec( + family="task", + function='get_business_api_execution_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules.py b/ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules.py new file mode 100644 index 00000000..24204ba7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules.py @@ -0,0 +1,332 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + ruleId=dict(type="str"), + ruleName=dict(type="str"), + ruleType=dict(type="str"), + ruleVersion=dict(type="int"), + rulePriority=dict(type="int"), + sourcePriority=dict(type="int"), + isDeleted=dict(type="bool"), + lastModifiedBy=dict(type="str"), + lastModifiedOn=dict(type="int"), + pluginId=dict(type="str"), + clusterId=dict(type="str"), + rejected=dict(type="bool"), + result=dict(type="dict"), + conditionGroups=dict(type="dict"), + usedAttributes=dict(type="list"), +)) + +required_if = [ + ("state", "present", ["ruleId"], True), + ("state", "absent", ["ruleId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class EndpointAnalyticsProfilingRules(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + ruleId=params.get("ruleId"), + ruleName=params.get("ruleName"), + ruleType=params.get("ruleType"), + ruleVersion=params.get("ruleVersion"), + rulePriority=params.get("rulePriority"), + sourcePriority=params.get("sourcePriority"), + isDeleted=params.get("isDeleted"), + lastModifiedBy=params.get("lastModifiedBy"), + lastModifiedOn=params.get("lastModifiedOn"), + pluginId=params.get("pluginId"), + clusterId=params.get("clusterId"), + rejected=params.get("rejected"), + result=params.get("result"), + conditionGroups=params.get("conditionGroups"), + usedAttributes=params.get("usedAttributes"), + rule_id=params.get("ruleId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['rule_type'] = self.new_object.get('ruleType') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['ruleId'] = self.new_object.get('ruleId') + new_object_params['ruleName'] = self.new_object.get('ruleName') + new_object_params['ruleType'] = self.new_object.get('ruleType') + new_object_params['ruleVersion'] = self.new_object.get('ruleVersion') + new_object_params['rulePriority'] = self.new_object.get('rulePriority') + new_object_params['sourcePriority'] = self.new_object.get('sourcePriority') + new_object_params['isDeleted'] = self.new_object.get('isDeleted') + new_object_params['lastModifiedBy'] = self.new_object.get('lastModifiedBy') + new_object_params['lastModifiedOn'] = self.new_object.get('lastModifiedOn') + new_object_params['pluginId'] = self.new_object.get('pluginId') + new_object_params['clusterId'] = self.new_object.get('clusterId') + new_object_params['rejected'] = self.new_object.get('rejected') + new_object_params['result'] = self.new_object.get('result') + new_object_params['conditionGroups'] = self.new_object.get('conditionGroups') + new_object_params['usedAttributes'] = self.new_object.get('usedAttributes') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['rule_id'] = self.new_object.get('rule_id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['ruleId'] = self.new_object.get('ruleId') + new_object_params['ruleName'] = self.new_object.get('ruleName') + new_object_params['ruleType'] = self.new_object.get('ruleType') + new_object_params['ruleVersion'] = self.new_object.get('ruleVersion') + new_object_params['rulePriority'] = self.new_object.get('rulePriority') + new_object_params['sourcePriority'] = self.new_object.get('sourcePriority') + new_object_params['isDeleted'] = self.new_object.get('isDeleted') + new_object_params['lastModifiedBy'] = self.new_object.get('lastModifiedBy') + new_object_params['lastModifiedOn'] = self.new_object.get('lastModifiedOn') + new_object_params['pluginId'] = self.new_object.get('pluginId') + new_object_params['clusterId'] = self.new_object.get('clusterId') + new_object_params['rejected'] = self.new_object.get('rejected') + new_object_params['result'] = self.new_object.get('result') + new_object_params['conditionGroups'] = self.new_object.get('conditionGroups') + new_object_params['usedAttributes'] = self.new_object.get('usedAttributes') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTICE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="policy", + function="get_list_of_profiling_rules", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + items = items['profilingRules'] + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="policy", + function="get_details_of_a_single_profiling_rule", + params={"rule_id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'ruleId', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("rule_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("ruleId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(rule_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("ruleId", "ruleId"), + ("ruleName", "ruleName"), + ("ruleType", "ruleType"), + ("ruleVersion", "ruleVersion"), + ("rulePriority", "rulePriority"), + ("sourcePriority", "sourcePriority"), + ("isDeleted", "isDeleted"), + ("lastModifiedBy", "lastModifiedBy"), + ("lastModifiedOn", "lastModifiedOn"), + ("pluginId", "pluginId"), + ("clusterId", "clusterId"), + ("rejected", "rejected"), + ("result", "result"), + ("conditionGroups", "conditionGroups"), + ("usedAttributes", "usedAttributes"), + ("ruleId", "rule_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="policy", + function="create_a_profiling_rule", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + id = id or self.new_object.get("rule_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("ruleId") + if id_: + self.new_object.update(dict(rule_id=id_)) + result = self.dnac.exec( + family="policy", + function="update_an_existing_profiling_rule", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("rule_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("ruleId") + if id_: + self.new_object.update(dict(rule_id=id_)) + result = self.dnac.exec( + family="policy", + function="delete_an_existing_profiling_rule", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + dnac = DNACSDK(self._task.args) + obj = EndpointAnalyticsProfilingRules(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules_info.py b/ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules_info.py new file mode 100644 index 00000000..4874701e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/endpoint_analytics_profiling_rules_info.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ruleType=dict(type="str"), + includeDeleted=dict(type="bool"), + limit=dict(type="int"), + offset=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + ruleId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + rule_type=params.get("ruleType"), + include_deleted=params.get("includeDeleted"), + limit=params.get("limit"), + offset=params.get("offset"), + sort_by=params.get("sortBy"), + order=params.get("order"), + rule_id=params.get("ruleId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("ruleId") + if id: + response = dnac.exec( + family="policy", + function='get_details_of_a_single_profiling_rule', + params=self.get_object(self._task.args) + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="policy", + function='get_list_of_profiling_rules', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_api_status_info.py b/ansible_collections/cisco/dnac/plugins/action/event_api_status_info.py new file mode 100644 index 00000000..3d3ff3ca --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_api_status_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + executionId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + execution_id=params.get("executionId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("executionId") + if id: + response = dnac.exec( + family="event_management", + function='get_status_api_for_events', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_artifact_count_info.py b/ansible_collections/cisco/dnac/plugins/action/event_artifact_count_info.py new file mode 100644 index 00000000..61943ead --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_artifact_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='eventartifact_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_artifact_info.py b/ansible_collections/cisco/dnac/plugins/action/event_artifact_info.py new file mode 100644 index 00000000..4376fd4f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_artifact_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + tags=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + search=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + tags=params.get("tags"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + search=params.get("search"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_eventartifacts', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_config_connector_types_info.py b/ansible_collections/cisco/dnac/plugins/action/event_config_connector_types_info.py new file mode 100644 index 00000000..27199b87 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_config_connector_types_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_connector_types', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_count_info.py b/ansible_collections/cisco/dnac/plugins/action/event_count_info.py new file mode 100644 index 00000000..43df02cb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_count_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventId=dict(type="str"), + tags=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_id=params.get("eventId"), + tags=params.get("tags"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='count_of_events', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_email_config_create.py b/ansible_collections/cisco/dnac/plugins/action/event_email_config_create.py new file mode 100644 index 00000000..45eff9e1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_email_config_create.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + emailConfigId=dict(type="str"), + primarySMTPConfig=dict(type="dict"), + secondarySMTPConfig=dict(type="dict"), + fromEmail=dict(type="str"), + toEmail=dict(type="str"), + subject=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + emailConfigId=params.get("emailConfigId"), + primarySMTPConfig=params.get("primarySMTPConfig"), + secondarySMTPConfig=params.get("secondarySMTPConfig"), + fromEmail=params.get("fromEmail"), + toEmail=params.get("toEmail"), + subject=params.get("subject"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='create_email_destination', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_email_config_update.py b/ansible_collections/cisco/dnac/plugins/action/event_email_config_update.py new file mode 100644 index 00000000..34287838 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_email_config_update.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + emailConfigId=dict(type="str"), + primarySMTPConfig=dict(type="dict"), + secondarySMTPConfig=dict(type="dict"), + fromEmail=dict(type="str"), + toEmail=dict(type="str"), + subject=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + emailConfigId=params.get("emailConfigId"), + primarySMTPConfig=params.get("primarySMTPConfig"), + secondarySMTPConfig=params.get("secondarySMTPConfig"), + fromEmail=params.get("fromEmail"), + toEmail=params.get("toEmail"), + subject=params.get("subject"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='update_email_destination', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_info.py b/ansible_collections/cisco/dnac/plugins/action/event_info.py new file mode 100644 index 00000000..d22c13f3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventId=dict(type="str"), + tags=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_id=params.get("eventId"), + tags=params.get("tags"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_events', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_info.py b/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_info.py new file mode 100644 index 00000000..a2f85bac --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_info.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + parentInstanceId=dict(type="str"), + instanceId=dict(type="str"), + name=dict(type="str"), + eventId=dict(type="str"), + category=dict(type="str"), + severity=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + source=dict(type="str"), + userId=dict(type="str"), + context=dict(type="str"), + eventHierarchy=dict(type="str"), + siteId=dict(type="str"), + deviceId=dict(type="str"), + isSystemEvents=dict(type="bool"), + description=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + startTime=dict(type="int"), + endTime=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + parent_instance_id=params.get("parentInstanceId"), + instance_id=params.get("instanceId"), + name=params.get("name"), + event_id=params.get("eventId"), + category=params.get("category"), + severity=params.get("severity"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + source=params.get("source"), + user_id=params.get("userId"), + context=params.get("context"), + event_hierarchy=params.get("eventHierarchy"), + site_id=params.get("siteId"), + device_id=params.get("deviceId"), + is_system_events=params.get("isSystemEvents"), + description=params.get("description"), + offset=params.get("offset"), + limit=params.get("limit"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_auditlog_records', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_parent_records_info.py b/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_parent_records_info.py new file mode 100644 index 00000000..b9839c20 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_parent_records_info.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + instanceId=dict(type="str"), + name=dict(type="str"), + eventId=dict(type="str"), + category=dict(type="str"), + severity=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + source=dict(type="str"), + userId=dict(type="str"), + context=dict(type="str"), + eventHierarchy=dict(type="str"), + siteId=dict(type="str"), + deviceId=dict(type="str"), + isSystemEvents=dict(type="bool"), + description=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + startTime=dict(type="int"), + endTime=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + instance_id=params.get("instanceId"), + name=params.get("name"), + event_id=params.get("eventId"), + category=params.get("category"), + severity=params.get("severity"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + source=params.get("source"), + user_id=params.get("userId"), + context=params.get("context"), + event_hierarchy=params.get("eventHierarchy"), + site_id=params.get("siteId"), + device_id=params.get("deviceId"), + is_system_events=params.get("isSystemEvents"), + description=params.get("description"), + offset=params.get("offset"), + limit=params.get("limit"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_auditlog_parent_records', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_summary_info.py new file mode 100644 index 00000000..42d15ac7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_series_audit_logs_summary_info.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + parentInstanceId=dict(type="str"), + isParentOnly=dict(type="bool"), + instanceId=dict(type="str"), + name=dict(type="str"), + eventId=dict(type="str"), + category=dict(type="str"), + severity=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + source=dict(type="str"), + userId=dict(type="str"), + context=dict(type="str"), + eventHierarchy=dict(type="str"), + siteId=dict(type="str"), + deviceId=dict(type="str"), + isSystemEvents=dict(type="bool"), + description=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + parent_instance_id=params.get("parentInstanceId"), + is_parent_only=params.get("isParentOnly"), + instance_id=params.get("instanceId"), + name=params.get("name"), + event_id=params.get("eventId"), + category=params.get("category"), + severity=params.get("severity"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + source=params.get("source"), + user_id=params.get("userId"), + context=params.get("context"), + event_hierarchy=params.get("eventHierarchy"), + site_id=params.get("siteId"), + device_id=params.get("deviceId"), + is_system_events=params.get("isSystemEvents"), + description=params.get("description"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_auditlog_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_series_count_info.py b/ansible_collections/cisco/dnac/plugins/action/event_series_count_info.py new file mode 100644 index 00000000..8e6372c9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_series_count_info.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + category=dict(type="str"), + type=dict(type="str"), + severity=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + source=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + category=params.get("category"), + type=params.get("type"), + severity=params.get("severity"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + source=params.get("source"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='count_of_notifications', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_series_info.py b/ansible_collections/cisco/dnac/plugins/action/event_series_info.py new file mode 100644 index 00000000..8722bc05 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_series_info.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + category=dict(type="str"), + type=dict(type="str"), + severity=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + source=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + tags=dict(type="str"), + namespace=dict(type="str"), + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + category=params.get("category"), + type=params.get("type"), + severity=params.get("severity"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + source=params.get("source"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + tags=params.get("tags"), + namespace=params.get("namespace"), + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_notifications', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription.py new file mode 100644 index 00000000..52db4e8a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription.py @@ -0,0 +1,260 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + subscriptions=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class EventSubscription(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + subscriptions=params.get("subscriptions"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['event_ids'] = self.new_object.get('eventIds') or \ + self.new_object.get('event_ids') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + new_object_params['order'] = self.new_object.get('order') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['subscriptions'] = self.new_object.get('subscriptions') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="event_management", + function="get_event_subscriptions", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="event_management", + function="get_event_subscriptions", + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if 'subscriptionEndpoints' in items: + tmp_result = items.get('subscriptionEndpoints') + tmp_result = get_dict_result(tmp_result, 'id', id) + if tmp_result: + result = items + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("subscriptionId", "subscriptionId"), + ("version", "version"), + ("name", "name"), + ("description", "description"), + ("subscriptionEndpoints", "subscriptionEndpoints"), + ("filter", "filter"), + ("subscriptions", "subscriptions"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="event_management", + function="create_event_subscriptions", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="event_management", + function="update_event_subscriptions", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="event_management", + function="delete_event_subscriptions", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = EventSubscription(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_count_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_count_info.py new file mode 100644 index 00000000..d581aa04 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_count_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='count_of_event_subscriptions', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_email_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_email_info.py new file mode 100644 index 00000000..2ece6f95 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_email_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + instanceId=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + instance_id=params.get("instanceId"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_email_subscription_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_rest_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_rest_info.py new file mode 100644 index 00000000..9c732131 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_rest_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + instanceId=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + instance_id=params.get("instanceId"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_rest_webhook_subscription_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_syslog_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_syslog_info.py new file mode 100644 index 00000000..fbec9c6a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_details_syslog_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + instanceId=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + instance_id=params.get("instanceId"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_syslog_subscription_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_email.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_email.py new file mode 100644 index 00000000..103a871b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_email.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + payload=dict(type="list"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class EventSubscriptionEmail(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['event_ids'] = self.new_object.get('eventIds') or \ + self.new_object.get('event_ids') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + new_object_params['order'] = self.new_object.get('order') + new_object_params['domain'] = self.new_object.get('domain') + new_object_params['sub_domain'] = self.new_object.get('subDomain') or \ + self.new_object.get('sub_domain') + new_object_params['category'] = self.new_object.get('category') + new_object_params['type'] = self.new_object.get('type') + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="event_management", + function="get_email_event_subscriptions", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("subscriptionId", "subscriptionId"), + ("version", "version"), + ("name", "name"), + ("description", "description"), + ("subscriptionEndpoints", "subscriptionEndpoints"), + ("filter", "filter"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="event_management", + function="create_email_event_subscription", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="event_management", + function="update_email_event_subscription", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = EventSubscriptionEmail(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_email_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_email_info.py new file mode 100644 index 00000000..9e5f5286 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_email_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + category=dict(type="str"), + type=dict(type="str"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + category=params.get("category"), + type=params.get("type"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_email_event_subscriptions', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_info.py new file mode 100644 index 00000000..c5dc8d6f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_event_subscriptions', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_rest.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_rest.py new file mode 100644 index 00000000..e806fd03 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_rest.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + payload=dict(type="list"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class EventSubscriptionRest(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['event_ids'] = self.new_object.get('eventIds') or \ + self.new_object.get('event_ids') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + new_object_params['order'] = self.new_object.get('order') + new_object_params['domain'] = self.new_object.get('domain') + new_object_params['sub_domain'] = self.new_object.get('subDomain') or \ + self.new_object.get('sub_domain') + new_object_params['category'] = self.new_object.get('category') + new_object_params['type'] = self.new_object.get('type') + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="event_management", + function="get_rest_webhook_event_subscriptions", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("subscriptionId", "subscriptionId"), + ("version", "version"), + ("name", "name"), + ("description", "description"), + ("subscriptionEndpoints", "subscriptionEndpoints"), + ("filter", "filter"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="event_management", + function="create_rest_webhook_event_subscription", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="event_management", + function="update_rest_webhook_event_subscription", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = EventSubscriptionRest(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_rest_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_rest_info.py new file mode 100644 index 00000000..04663926 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_rest_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + category=dict(type="str"), + type=dict(type="str"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + category=params.get("category"), + type=params.get("type"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_rest_webhook_event_subscriptions', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog.py new file mode 100644 index 00000000..e1c5fd11 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + payload=dict(type="list"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class EventSubscriptionSyslog(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['event_ids'] = self.new_object.get('eventIds') or \ + self.new_object.get('event_ids') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + new_object_params['order'] = self.new_object.get('order') + new_object_params['domain'] = self.new_object.get('domain') + new_object_params['sub_domain'] = self.new_object.get('subDomain') or \ + self.new_object.get('sub_domain') + new_object_params['category'] = self.new_object.get('category') + new_object_params['type'] = self.new_object.get('type') + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="event_management", + function="get_syslog_event_subscriptions", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("subscriptionId", "subscriptionId"), + ("version", "version"), + ("name", "name"), + ("description", "description"), + ("subscriptionEndpoints", "subscriptionEndpoints"), + ("filter", "filter"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="event_management", + function="create_syslog_event_subscription", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="event_management", + function="update_syslog_event_subscription", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = EventSubscriptionSyslog(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog_info.py b/ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog_info.py new file mode 100644 index 00000000..d79db095 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_subscription_syslog_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + eventIds=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + domain=dict(type="str"), + subDomain=dict(type="str"), + category=dict(type="str"), + type=dict(type="str"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + event_ids=params.get("eventIds"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + domain=params.get("domain"), + sub_domain=params.get("subDomain"), + category=params.get("category"), + type=params.get("type"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_syslog_event_subscriptions', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_webhook_create.py b/ansible_collections/cisco/dnac/plugins/action/event_webhook_create.py new file mode 100644 index 00000000..de2b9251 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_webhook_create.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + webhookId=dict(type="str"), + name=dict(type="str"), + description=dict(type="str"), + url=dict(type="str"), + method=dict(type="str"), + trustCert=dict(type="bool"), + headers=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + webhookId=params.get("webhookId"), + name=params.get("name"), + description=params.get("description"), + url=params.get("url"), + method=params.get("method"), + trustCert=params.get("trustCert"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='create_webhook_destination', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/event_webhook_update.py b/ansible_collections/cisco/dnac/plugins/action/event_webhook_update.py new file mode 100644 index 00000000..d11bc98a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/event_webhook_update.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + webhookId=dict(type="str"), + name=dict(type="str"), + description=dict(type="str"), + url=dict(type="str"), + method=dict(type="str"), + trustCert=dict(type="bool"), + headers=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + webhookId=params.get("webhookId"), + name=params.get("name"), + description=params.get("description"), + url=params.get("url"), + method=params.get("method"), + trustCert=params.get("trustCert"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='update_webhook_destination', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/file_import.py b/ansible_collections/cisco/dnac/plugins/action/file_import.py new file mode 100644 index 00000000..d27c9ef1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/file_import.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + nameSpace=dict(type="str"), + filePath=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name_space=params.get("nameSpace"), + file_path=params.get("filePath"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="file", + function='upload_file', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/file_info.py b/ansible_collections/cisco/dnac/plugins/action/file_info.py new file mode 100644 index 00000000..a251ba10 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/file_info.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + fileId=dict(type="str"), + dirPath=dict(type="str"), + saveFile=dict(type="bool"), + filename=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + file_id=params.get("fileId"), + dirpath=params.get("dirPath"), + save_file=params.get("saveFile"), + filename=params.get("filename"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("fileId") + if id: + download_response = dnac.exec( + family="file", + function='download_a_file_by_fileid', + params=self.get_object(self._task.args), + ) + response = dict( + data=download_response.data.decode(encoding='utf-8'), + filename=download_response.filename, + dirpath=download_response.dirpath, + path=download_response.path, + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/file_namespace_files_info.py b/ansible_collections/cisco/dnac/plugins/action/file_namespace_files_info.py new file mode 100644 index 00000000..1d62e6e3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/file_namespace_files_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + nameSpace=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name_space=params.get("nameSpace"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + name = self._task.args.get("nameSpace") + if name: + response = dnac.exec( + family="file", + function='get_list_of_files', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not name: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/file_namespaces_info.py b/ansible_collections/cisco/dnac/plugins/action/file_namespaces_info.py new file mode 100644 index 00000000..f84b2c87 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/file_namespaces_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="file", + function='get_list_of_available_namespaces', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/global_credential_delete.py b/ansible_collections/cisco/dnac/plugins/action/global_credential_delete.py new file mode 100644 index 00000000..6f15dc9b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/global_credential_delete.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + globalCredentialId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + global_credential_id=params.get("globalCredentialId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function="delete_global_credentials_by_id", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/global_credential_info.py b/ansible_collections/cisco/dnac/plugins/action/global_credential_info.py new file mode 100644 index 00000000..af9f2ae3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/global_credential_info.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + credentialSubType=dict(type="str"), + sortBy=dict(type="str"), + order=dict(type="str"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + credential_sub_type=params.get("credentialSubType"), + sort_by=params.get("sortBy"), + order=params.get("order"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="discovery", + function='get_credential_sub_type_by_credential_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="discovery", + function='get_global_credentials', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/global_credential_update.py b/ansible_collections/cisco/dnac/plugins/action/global_credential_update.py new file mode 100644 index 00000000..b2f9504f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/global_credential_update.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteUuids=dict(type="list"), + globalCredentialId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + siteUuids=params.get("siteUuids"), + global_credential_id=params.get("globalCredentialId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='update_global_credentials', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/global_pool.py b/ansible_collections/cisco/dnac/plugins/action/global_pool.py new file mode 100644 index 00000000..1e7a5417 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/global_pool.py @@ -0,0 +1,277 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + settings=dict(type="dict"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id", "settings"], True), + ("state", "absent", ["id", "settings"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class GlobalPool(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + settings=params.get("settings"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['settings'] = self.new_object.get('settings') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['settings'] = self.new_object.get('settings') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="network_settings", + function="get_global_pool", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if 'settings' in items: + items = items.get('settings') + if 'ippool' in items: + items = items.get('ippool') + settings = self.new_object.get('settings') + if settings and isinstance(settings, dict) and settings.get('ippool'): + settings = settings.get('ippool') + if settings and isinstance(settings, dict) and settings.get('ipPoolName'): + name = settings.get('ipPoolName') + elif settings and isinstance(settings, list) and len(settings) > 0: + if settings[0].get('ipPoolName'): + name = settings[0].get('ipPoolName') + result = get_dict_result(items, 'ipPoolName', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="network_settings", + function="get_global_pool", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + settings = self.new_object.get('settings') + if settings and isinstance(settings, dict) and settings.get('ippool'): + settings = settings.get('ippool') + if settings and isinstance(settings, dict) and settings.get('ipPoolName'): + name = name or settings.get('ipPoolName') + elif settings and isinstance(settings, list) and len(settings) > 0: + if settings[0].get('ipPoolName'): + name = settings[0].get('ipPoolName') + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("settings", "settings"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="network_settings", + function="create_global_pool", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + settings = self.new_object.get('settings') + if settings and isinstance(settings, dict) and settings.get('ippool'): + settings = settings.get('ippool') + if settings and isinstance(settings, dict) and settings.get('ipPoolName'): + name = name or settings.get('ipPoolName') + result = self.dnac.exec( + family="network_settings", + function="update_global_pool", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + settings = self.new_object.get('settings') + if settings and isinstance(settings, dict) and settings.get('ippool'): + settings = settings.get('ippool') + if settings and isinstance(settings, dict) and settings.get('ipPoolName'): + name = name or settings.get('ipPoolName') + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="network_settings", + function="delete_global_ip_pool", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = GlobalPool(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/global_pool_info.py b/ansible_collections/cisco/dnac/plugins/action/global_pool_info.py new file mode 100644 index 00000000..74742e47 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/global_pool_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="str"), + limit=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='get_global_pool', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/golden_image_create.py b/ansible_collections/cisco/dnac/plugins/action/golden_image_create.py new file mode 100644 index 00000000..ecfacb06 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/golden_image_create.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + imageId=dict(type="str"), + siteId=dict(type="str"), + deviceRole=dict(type="str"), + deviceFamilyIdentifier=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + imageId=params.get("imageId"), + siteId=params.get("siteId"), + deviceRole=params.get("deviceRole"), + deviceFamilyIdentifier=params.get("deviceFamilyIdentifier"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function='tag_as_golden_image', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/golden_tag_image_delete.py b/ansible_collections/cisco/dnac/plugins/action/golden_tag_image_delete.py new file mode 100644 index 00000000..1150d623 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/golden_tag_image_delete.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + deviceFamilyIdentifier=dict(type="str"), + deviceRole=dict(type="str"), + imageId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + device_family_identifier=params.get("deviceFamilyIdentifier"), + device_role=params.get("deviceRole"), + image_id=params.get("imageId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function="remove_golden_tag_for_image", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/golden_tag_image_details_info.py b/ansible_collections/cisco/dnac/plugins/action/golden_tag_image_details_info.py new file mode 100644 index 00000000..6b9241f0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/golden_tag_image_details_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + deviceFamilyIdentifier=dict(type="str"), + deviceRole=dict(type="str"), + imageId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + device_family_identifier=params.get("deviceFamilyIdentifier"), + device_role=params.get("deviceRole"), + image_id=params.get("imageId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("siteId") + if id: + response = dnac.exec( + family="software_image_management_swim", + function='get_golden_tag_status_of_an_image', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/http_read_credential.py b/ansible_collections/cisco/dnac/plugins/action/http_read_credential.py new file mode 100644 index 00000000..1d1ac0ac --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/http_read_credential.py @@ -0,0 +1,244 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + comments=dict(type="str"), + credentialType=dict(type="str"), + description=dict(type="str"), + id=dict(type="str"), + instanceTenantId=dict(type="str"), + instanceUuid=dict(type="str"), + password=dict(type="str", no_log=True), + port=dict(type="int"), + secure=dict(type="bool"), + username=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["description", "id", "username"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class HttpReadCredential(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + comments=params.get("comments"), + credentialType=params.get("credentialType"), + description=params.get("description"), + id=params.get("id"), + instanceTenantId=params.get("instanceTenantId"), + instanceUuid=params.get("instanceUuid"), + password=params.get("password"), + port=params.get("port"), + secure=params.get("secure"), + username=params.get("username"), + ) + + def create_params(self): + new_object_params = {} + payload = {} + keys = ['comments', 'credentialType', 'description', 'id', 'instanceTenantId', + 'instanceUuid', 'password', 'port', 'secure', 'username'] + for key in keys: + if self.new_object.get(key) is not None: + payload[key] = self.new_object.get(key) + new_object_params['payload'] = [payload] + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['comments'] = self.new_object.get('comments') + new_object_params['credentialType'] = self.new_object.get('credentialType') + new_object_params['description'] = self.new_object.get('description') + new_object_params['id'] = self.new_object.get('id') + new_object_params['instanceTenantId'] = self.new_object.get('instanceTenantId') + new_object_params['instanceUuid'] = self.new_object.get('instanceUuid') + new_object_params['password'] = self.new_object.get('password') + new_object_params['port'] = self.new_object.get('port') + new_object_params['secure'] = self.new_object.get('secure') + new_object_params['username'] = self.new_object.get('username') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'HTTP_READ'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'description', name) or get_dict_result(items, 'username', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'HTTP_READ'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("description") or self.new_object.get("username") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + obj_params = [ + ("comments", "comments"), + ("credentialType", "credentialType"), + ("description", "description"), + ("id", "id"), + ("instanceTenantId", "instanceTenantId"), + ("instanceUuid", "instanceUuid"), + ("port", "port"), + ("secure", "secure"), + ("username", "username"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_http_read_credentials", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_http_read_credential", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = HttpReadCredential(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/http_write_credential.py b/ansible_collections/cisco/dnac/plugins/action/http_write_credential.py new file mode 100644 index 00000000..5a63c0d5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/http_write_credential.py @@ -0,0 +1,244 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + comments=dict(type="str"), + credentialType=dict(type="str"), + description=dict(type="str"), + id=dict(type="str"), + instanceTenantId=dict(type="str"), + instanceUuid=dict(type="str"), + password=dict(type="str", no_log=True), + port=dict(type="int"), + secure=dict(type="bool"), + username=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["description", "id", "username"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class HttpWriteCredential(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + comments=params.get("comments"), + credentialType=params.get("credentialType"), + description=params.get("description"), + id=params.get("id"), + instanceTenantId=params.get("instanceTenantId"), + instanceUuid=params.get("instanceUuid"), + password=params.get("password"), + port=params.get("port"), + secure=params.get("secure"), + username=params.get("username"), + ) + + def create_params(self): + new_object_params = {} + payload = {} + keys = ['comments', 'credentialType', 'description', 'id', 'instanceTenantId', + 'instanceUuid', 'password', 'port', 'secure', 'username'] + for key in keys: + if self.new_object.get(key) is not None: + payload[key] = self.new_object.get(key) + new_object_params['payload'] = [payload] + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['comments'] = self.new_object.get('comments') + new_object_params['credentialType'] = self.new_object.get('credentialType') + new_object_params['description'] = self.new_object.get('description') + new_object_params['id'] = self.new_object.get('id') + new_object_params['instanceTenantId'] = self.new_object.get('instanceTenantId') + new_object_params['instanceUuid'] = self.new_object.get('instanceUuid') + new_object_params['password'] = self.new_object.get('password') + new_object_params['port'] = self.new_object.get('port') + new_object_params['secure'] = self.new_object.get('secure') + new_object_params['username'] = self.new_object.get('username') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'HTTP_WRITE'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'description', name) or get_dict_result(items, 'username', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'HTTP_WRITE'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("description") or self.new_object.get("username") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + obj_params = [ + ("comments", "comments"), + ("credentialType", "credentialType"), + ("description", "description"), + ("id", "id"), + ("instanceTenantId", "instanceTenantId"), + ("instanceUuid", "instanceUuid"), + ("port", "port"), + ("secure", "secure"), + ("username", "username"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_http_write_credentials", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_http_write_credentials", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = HttpWriteCredential(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/interface_info.py b/ansible_collections/cisco/dnac/plugins/action/interface_info.py new file mode 100644 index 00000000..2477866e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/interface_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + interfaceUuid=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + interface_uuid=params.get("interfaceUuid"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='legit_operations_for_interface', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/interface_network_device_detail_info.py b/ansible_collections/cisco/dnac/plugins/action/interface_network_device_detail_info.py new file mode 100644 index 00000000..3907e2ae --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/interface_network_device_detail_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_interface_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/interface_network_device_info.py b/ansible_collections/cisco/dnac/plugins/action/interface_network_device_info.py new file mode 100644 index 00000000..fdaadea3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/interface_network_device_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("deviceId") + if id: + response = dnac.exec( + family="devices", + function='get_interface_info_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/interface_network_device_range_info.py b/ansible_collections/cisco/dnac/plugins/action/interface_network_device_range_info.py new file mode 100644 index 00000000..fc7f3ef3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/interface_network_device_range_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + startIndex=dict(type="int"), + recordsToReturn=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + start_index=params.get("startIndex"), + records_to_return=params.get("recordsToReturn"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_interfaces_by_specified_range', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/interface_operation_create.py b/ansible_collections/cisco/dnac/plugins/action/interface_operation_create.py new file mode 100644 index 00000000..3aa36148 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/interface_operation_create.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + operation=dict(type="str"), + payload=dict(type="dict"), + interfaceUuid=dict(type="str"), + deploymentMode=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + operation=params.get("operation"), + payload=params.get("payload"), + interface_uuid=params.get("interfaceUuid"), + deployment_mode=params.get("deploymentMode"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='clear_mac_address_table', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/interface_update.py b/ansible_collections/cisco/dnac/plugins/action/interface_update.py new file mode 100644 index 00000000..c84c549f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/interface_update.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + description=dict(type="str"), + adminStatus=dict(type="str"), + vlanId=dict(type="int"), + voiceVlanId=dict(type="int"), + interfaceUuid=dict(type="str"), + deploymentMode=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + description=params.get("description"), + adminStatus=params.get("adminStatus"), + vlanId=params.get("vlanId"), + voiceVlanId=params.get("voiceVlanId"), + interface_uuid=params.get("interfaceUuid"), + deployment_mode=params.get("deploymentMode"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='update_interface_details', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/issues_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/action/issues_enrichment_details_info.py new file mode 100644 index 00000000..c31c79cc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/issues_enrichment_details_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="issues", + function='get_issue_enrichment_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/issues_info.py b/ansible_collections/cisco/dnac/plugins/action/issues_info.py new file mode 100644 index 00000000..ab158f9e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/issues_info.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + startTime=dict(type="int"), + endTime=dict(type="int"), + siteId=dict(type="str"), + deviceId=dict(type="str"), + macAddress=dict(type="str"), + priority=dict(type="str"), + aiDriven=dict(type="str"), + issueStatus=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + start_time=params.get("startTime"), + end_time=params.get("endTime"), + site_id=params.get("siteId"), + device_id=params.get("deviceId"), + mac_address=params.get("macAddress"), + priority=params.get("priority"), + ai_driven=params.get("aiDriven"), + issue_status=params.get("issueStatus"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="issues", + function='issues', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/itsm_cmdb_sync_status_info.py b/ansible_collections/cisco/dnac/plugins/action/itsm_cmdb_sync_status_info.py new file mode 100644 index 00000000..4ef0fb56 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/itsm_cmdb_sync_status_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + status=dict(type="str"), + date=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + status=params.get("status"), + date=params.get("date"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="itsm", + function='get_cmdb_sync_status', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_failed_info.py b/ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_failed_info.py new file mode 100644 index 00000000..12d09b7d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_failed_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + instanceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + instance_id=params.get("instanceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="itsm", + function='get_failed_itsm_events', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_retry.py b/ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_retry.py new file mode 100644 index 00000000..67c7d987 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/itsm_integration_events_retry.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="itsm", + function='retry_integration_events', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/lan_automation_count_info.py b/ansible_collections/cisco/dnac/plugins/action/lan_automation_count_info.py new file mode 100644 index 00000000..0fa796d6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/lan_automation_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="lan_automation", + function='lan_automation_session_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/lan_automation_create.py b/ansible_collections/cisco/dnac/plugins/action/lan_automation_create.py new file mode 100644 index 00000000..db28ee88 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/lan_automation_create.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="lan_automation", + function='lan_automation2', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/lan_automation_delete.py b/ansible_collections/cisco/dnac/plugins/action/lan_automation_delete.py new file mode 100644 index 00000000..99ace58a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/lan_automation_delete.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="lan_automation", + function="lan_automation", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/lan_automation_log_info.py b/ansible_collections/cisco/dnac/plugins/action/lan_automation_log_info.py new file mode 100644 index 00000000..0d7d1b5c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/lan_automation_log_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="str"), + limit=dict(type="str"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="lan_automation", + function='lan_automation_log_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="lan_automation", + function='lan_automation_log', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/lan_automation_status_info.py b/ansible_collections/cisco/dnac/plugins/action/lan_automation_status_info.py new file mode 100644 index 00000000..880864a8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/lan_automation_status_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="str"), + limit=dict(type="str"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="lan_automation", + function='lan_automation_status_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="lan_automation", + function='lan_automation_status', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_device_count_info.py b/ansible_collections/cisco/dnac/plugins/action/license_device_count_info.py new file mode 100644 index 00000000..efe972b3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_device_count_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device_type=dict(type="str"), + registration_status=dict(type="str"), + dna_level=dict(type="str"), + virtual_account_name=dict(type="str"), + smart_account_id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_type=params.get("device_type"), + registration_status=params.get("registration_status"), + dna_level=params.get("dna_level"), + virtual_account_name=params.get("virtual_account_name"), + smart_account_id=params.get("smart_account_id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='device_count_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_device_deregistration.py b/ansible_collections/cisco/dnac/plugins/action/license_device_deregistration.py new file mode 100644 index 00000000..cfed9823 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_device_deregistration.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device_uuids=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuids=params.get("device_uuids"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='device_deregistration', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_device_license_details_info.py b/ansible_collections/cisco/dnac/plugins/action/license_device_license_details_info.py new file mode 100644 index 00000000..81633b36 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_device_license_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device_uuid=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("device_uuid"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='device_license_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_device_license_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/license_device_license_summary_info.py new file mode 100644 index 00000000..ff8875c0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_device_license_summary_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + page_number=dict(type="int"), + order=dict(type="str"), + sort_by=dict(type="str"), + dna_level=dict(type="str"), + device_type=dict(type="str"), + limit=dict(type="int"), + registration_status=dict(type="str"), + virtual_account_name=dict(type="str"), + smart_account_id=dict(type="int"), + device_uuid=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + page_number=params.get("page_number"), + order=params.get("order"), + sort_by=params.get("sort_by"), + dna_level=params.get("dna_level"), + device_type=params.get("device_type"), + limit=params.get("limit"), + registration_status=params.get("registration_status"), + virtual_account_name=params.get("virtual_account_name"), + smart_account_id=params.get("smart_account_id"), + device_uuid=params.get("device_uuid"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='device_license_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_device_registration.py b/ansible_collections/cisco/dnac/plugins/action/license_device_registration.py new file mode 100644 index 00000000..512de843 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_device_registration.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device_uuids=dict(type="list"), + virtual_account_name=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuids=params.get("device_uuids"), + virtual_account_name=params.get("virtual_account_name"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='device_registration', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_smart_account_details_info.py b/ansible_collections/cisco/dnac/plugins/action/license_smart_account_details_info.py new file mode 100644 index 00000000..a031e1c2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_smart_account_details_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='smart_account_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_term_details_info.py b/ansible_collections/cisco/dnac/plugins/action/license_term_details_info.py new file mode 100644 index 00000000..6f342d10 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_term_details_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + smart_account_id=dict(type="str"), + virtual_account_name=dict(type="str"), + device_type=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + smart_account_id=params.get("smart_account_id"), + virtual_account_name=params.get("virtual_account_name"), + device_type=params.get("device_type"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + name = self._task.args.get("virtual_account_name") + if name: + response = dnac.exec( + family="licenses", + function='license_term_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not name: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_usage_details_info.py b/ansible_collections/cisco/dnac/plugins/action/license_usage_details_info.py new file mode 100644 index 00000000..e9d8e4ae --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_usage_details_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + smart_account_id=dict(type="str"), + virtual_account_name=dict(type="str"), + device_type=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + smart_account_id=params.get("smart_account_id"), + virtual_account_name=params.get("virtual_account_name"), + device_type=params.get("device_type"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + name = self._task.args.get("virtual_account_name") + if name: + response = dnac.exec( + family="licenses", + function='license_usage_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not name: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_virtual_account_change.py b/ansible_collections/cisco/dnac/plugins/action/license_virtual_account_change.py new file mode 100644 index 00000000..0c85ea78 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_virtual_account_change.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device_uuids=dict(type="list"), + smart_account_id=dict(type="str"), + virtual_account_name=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuids=params.get("device_uuids"), + smart_account_id=params.get("smart_account_id"), + virtual_account_name=params.get("virtual_account_name"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='change_virtual_account', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/license_virtual_account_details_info.py b/ansible_collections/cisco/dnac/plugins/action/license_virtual_account_details_info.py new file mode 100644 index 00000000..8632418f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/license_virtual_account_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + smart_account_id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + smart_account_id=params.get("smart_account_id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="licenses", + function='virtual_account_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/netconf_credential.py b/ansible_collections/cisco/dnac/plugins/action/netconf_credential.py new file mode 100644 index 00000000..08aa9d19 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/netconf_credential.py @@ -0,0 +1,233 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + comments=dict(type="str"), + credentialType=dict(type="str"), + description=dict(type="str"), + id=dict(type="str"), + instanceTenantId=dict(type="str"), + instanceUuid=dict(type="str"), + netconfPort=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["description", "id"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NetconfCredential(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + comments=params.get("comments"), + credentialType=params.get("credentialType"), + description=params.get("description"), + id=params.get("id"), + instanceTenantId=params.get("instanceTenantId"), + instanceUuid=params.get("instanceUuid"), + netconfPort=params.get("netconfPort"), + ) + + def create_params(self): + new_object_params = {} + payload = {} + keys = ['comments', 'credentialType', 'description', 'id', 'instanceTenantId', + 'instanceUuid', 'netconfPort'] + for key in keys: + if self.new_object.get(key) is not None: + payload[key] = self.new_object.get(key) + new_object_params['payload'] = [payload] + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['comments'] = self.new_object.get('comments') + new_object_params['credentialType'] = self.new_object.get('credentialType') + new_object_params['description'] = self.new_object.get('description') + new_object_params['id'] = self.new_object.get('id') + new_object_params['instanceTenantId'] = self.new_object.get('instanceTenantId') + new_object_params['instanceUuid'] = self.new_object.get('instanceUuid') + new_object_params['netconfPort'] = self.new_object.get('netconfPort') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'NETCONF'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'description', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'NETCONF'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("description") or self.new_object.get("username") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + obj_params = [ + ("comments", "comments"), + ("credentialType", "credentialType"), + ("description", "description"), + ("id", "id"), + ("instanceTenantId", "instanceTenantId"), + ("instanceUuid", "instanceUuid"), + ("netconfPort", "netconfPort"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_netconf_credentials", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_netconf_credentials", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = NetconfCredential(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_create.py b/ansible_collections/cisco/dnac/plugins/action/network_create.py new file mode 100644 index 00000000..5fe4bd37 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_create.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + settings=dict(type="dict"), + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + settings=params.get("settings"), + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='create_network', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device.py b/ansible_collections/cisco/dnac/plugins/action/network_device.py new file mode 100644 index 00000000..51fa76a1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device.py @@ -0,0 +1,439 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + cliTransport=dict(type="str"), + computeDevice=dict(type="bool"), + enablePassword=dict(type="str", no_log=True), + extendedDiscoveryInfo=dict(type="str"), + httpPassword=dict(type="str"), + httpPort=dict(type="str"), + httpSecure=dict(type="bool"), + httpUserName=dict(type="str"), + ipAddress=dict(type="list"), + merakiOrgId=dict(type="list"), + netconfPort=dict(type="str"), + password=dict(type="str", no_log=True), + serialNumber=dict(type="str"), + snmpAuthPassphrase=dict(type="str"), + snmpAuthProtocol=dict(type="str"), + snmpMode=dict(type="str"), + snmpPrivPassphrase=dict(type="str"), + snmpPrivProtocol=dict(type="str"), + snmpROCommunity=dict(type="str"), + snmpRWCommunity=dict(type="str"), + snmpRetry=dict(type="int"), + snmpTimeout=dict(type="int"), + snmpUserName=dict(type="str"), + snmpVersion=dict(type="str"), + type=dict(type="str"), + updateMgmtIPaddressList=dict(type="list"), + userName=dict(type="str"), + id=dict(type="str"), + cleanConfig=dict(type="bool"), +)) + +required_if = [ + ("state", "present", ["id", "ipAddress"], True), + ("state", "absent", ["id", "ipAddress"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NetworkDevice(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + cliTransport=params.get("cliTransport"), + computeDevice=params.get("computeDevice"), + enablePassword=params.get("enablePassword"), + extendedDiscoveryInfo=params.get("extendedDiscoveryInfo"), + httpPassword=params.get("httpPassword"), + httpPort=params.get("httpPort"), + httpSecure=params.get("httpSecure"), + httpUserName=params.get("httpUserName"), + ipAddress=params.get("ipAddress"), + merakiOrgId=params.get("merakiOrgId"), + netconfPort=params.get("netconfPort"), + password=params.get("password"), + serialNumber=params.get("serialNumber"), + snmpAuthPassphrase=params.get("snmpAuthPassphrase"), + snmpAuthProtocol=params.get("snmpAuthProtocol"), + snmpMode=params.get("snmpMode"), + snmpPrivPassphrase=params.get("snmpPrivPassphrase"), + snmpPrivProtocol=params.get("snmpPrivProtocol"), + snmpROCommunity=params.get("snmpROCommunity"), + snmpRWCommunity=params.get("snmpRWCommunity"), + snmpRetry=params.get("snmpRetry"), + snmpTimeout=params.get("snmpTimeout"), + snmpUserName=params.get("snmpUserName"), + snmpVersion=params.get("snmpVersion"), + type=params.get("type"), + updateMgmtIPaddressList=params.get("updateMgmtIPaddressList"), + userName=params.get("userName"), + id=params.get("id"), + clean_config=params.get("cleanConfig"), + managementIpAddress=params.get("managementIpAddress"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['hostname'] = self.new_object.get('hostname') + new_object_params['management_ip_address'] = self.new_object.get('management_ip_address') or \ + self.new_object.get('ipAddress') + new_object_params['mac_address'] = self.new_object.get('macAddress') or \ + self.new_object.get('mac_address') + new_object_params['location_name'] = self.new_object.get('locationName') or \ + self.new_object.get('location_name') + new_object_params['serial_number'] = self.new_object.get('serialNumber') or \ + self.new_object.get('serial_number') + new_object_params['location'] = self.new_object.get('location') + new_object_params['family'] = self.new_object.get('family') + # new_object_params['type'] = self.new_object.get('type') + new_object_params['series'] = self.new_object.get('series') + new_object_params['collection_status'] = self.new_object.get('collectionStatus') or \ + self.new_object.get('collection_status') + new_object_params['collection_interval'] = self.new_object.get('collectionInterval') or \ + self.new_object.get('collection_interval') + new_object_params['not_synced_for_minutes'] = self.new_object.get('notSyncedForMinutes') or \ + self.new_object.get('not_synced_for_minutes') + new_object_params['error_code'] = self.new_object.get('errorCode') or \ + self.new_object.get('error_code') + new_object_params['error_description'] = self.new_object.get('errorDescription') or \ + self.new_object.get('error_description') + new_object_params['software_version'] = self.new_object.get('softwareVersion') or \ + self.new_object.get('software_version') + new_object_params['software_type'] = self.new_object.get('softwareType') or \ + self.new_object.get('software_type') + new_object_params['platform_id'] = self.new_object.get('platformId') or \ + self.new_object.get('platform_id') + new_object_params['role'] = self.new_object.get('role') + new_object_params['reachability_status'] = self.new_object.get('reachabilityStatus') or \ + self.new_object.get('reachability_status') + new_object_params['up_time'] = self.new_object.get('upTime') or \ + self.new_object.get('up_time') + new_object_params['associated_wlc_ip'] = self.new_object.get('associatedWlcIp') or \ + self.new_object.get('associated_wlc_ip') + new_object_params['license_name'] = self.new_object.get('license_name') + new_object_params['license_type'] = self.new_object.get('license_type') + new_object_params['license_status'] = self.new_object.get('license_status') + new_object_params['module_name'] = self.new_object.get('module_name') + new_object_params['module_equpimenttype'] = self.new_object.get('module_equpimenttype') + new_object_params['module_servicestate'] = self.new_object.get('module_servicestate') + new_object_params['module_vendorequipmenttype'] = self.new_object.get('module_vendorequipmenttype') + new_object_params['module_partnumber'] = self.new_object.get('module_partnumber') + new_object_params['module_operationstatecode'] = self.new_object.get('module_operationstatecode') + new_object_params['id'] = id or self.new_object.get('id') + new_object_params['device_support_level'] = self.new_object.get('deviceSupportLevel') or \ + self.new_object.get('device_support_level') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['cliTransport'] = self.new_object.get('cliTransport') + new_object_params['computeDevice'] = self.new_object.get('computeDevice') + new_object_params['enablePassword'] = self.new_object.get('enablePassword') + new_object_params['extendedDiscoveryInfo'] = self.new_object.get('extendedDiscoveryInfo') + new_object_params['httpPassword'] = self.new_object.get('httpPassword') + new_object_params['httpPort'] = self.new_object.get('httpPort') + new_object_params['httpSecure'] = self.new_object.get('httpSecure') + new_object_params['httpUserName'] = self.new_object.get('httpUserName') + new_object_params['ipAddress'] = self.new_object.get('ipAddress') + new_object_params['merakiOrgId'] = self.new_object.get('merakiOrgId') + new_object_params['netconfPort'] = self.new_object.get('netconfPort') + new_object_params['password'] = self.new_object.get('password') + new_object_params['serialNumber'] = self.new_object.get('serialNumber') + new_object_params['snmpAuthPassphrase'] = self.new_object.get('snmpAuthPassphrase') + new_object_params['snmpAuthProtocol'] = self.new_object.get('snmpAuthProtocol') + new_object_params['snmpMode'] = self.new_object.get('snmpMode') + new_object_params['snmpPrivPassphrase'] = self.new_object.get('snmpPrivPassphrase') + new_object_params['snmpPrivProtocol'] = self.new_object.get('snmpPrivProtocol') + new_object_params['snmpROCommunity'] = self.new_object.get('snmpROCommunity') + new_object_params['snmpRWCommunity'] = self.new_object.get('snmpRWCommunity') + new_object_params['snmpRetry'] = self.new_object.get('snmpRetry') + new_object_params['snmpTimeout'] = self.new_object.get('snmpTimeout') + new_object_params['snmpUserName'] = self.new_object.get('snmpUserName') + new_object_params['snmpVersion'] = self.new_object.get('snmpVersion') + new_object_params['type'] = self.new_object.get('type') + new_object_params['updateMgmtIPaddressList'] = self.new_object.get('updateMgmtIPaddressList') + new_object_params['userName'] = self.new_object.get('userName') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['clean_config'] = self.new_object.get('clean_config') + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['cliTransport'] = self.new_object.get('cliTransport') + new_object_params['computeDevice'] = self.new_object.get('computeDevice') + new_object_params['enablePassword'] = self.new_object.get('enablePassword') + new_object_params['extendedDiscoveryInfo'] = self.new_object.get('extendedDiscoveryInfo') + new_object_params['httpPassword'] = self.new_object.get('httpPassword') + new_object_params['httpPort'] = self.new_object.get('httpPort') + new_object_params['httpSecure'] = self.new_object.get('httpSecure') + new_object_params['httpUserName'] = self.new_object.get('httpUserName') + new_object_params['ipAddress'] = self.new_object.get('ipAddress') + new_object_params['merakiOrgId'] = self.new_object.get('merakiOrgId') + new_object_params['netconfPort'] = self.new_object.get('netconfPort') + new_object_params['password'] = self.new_object.get('password') + new_object_params['serialNumber'] = self.new_object.get('serialNumber') + new_object_params['snmpAuthPassphrase'] = self.new_object.get('snmpAuthPassphrase') + new_object_params['snmpAuthProtocol'] = self.new_object.get('snmpAuthProtocol') + new_object_params['snmpMode'] = self.new_object.get('snmpMode') + new_object_params['snmpPrivPassphrase'] = self.new_object.get('snmpPrivPassphrase') + new_object_params['snmpPrivProtocol'] = self.new_object.get('snmpPrivProtocol') + new_object_params['snmpROCommunity'] = self.new_object.get('snmpROCommunity') + new_object_params['snmpRWCommunity'] = self.new_object.get('snmpRWCommunity') + new_object_params['snmpRetry'] = self.new_object.get('snmpRetry') + new_object_params['snmpTimeout'] = self.new_object.get('snmpTimeout') + new_object_params['snmpUserName'] = self.new_object.get('snmpUserName') + new_object_params['snmpVersion'] = self.new_object.get('snmpVersion') + new_object_params['type'] = self.new_object.get('type') + new_object_params['updateMgmtIPaddressList'] = self.new_object.get('updateMgmtIPaddressList') + new_object_params['userName'] = self.new_object.get('userName') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="devices", + function="get_device_list", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="devices", + function="get_device_by_id", + params={"id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") or \ + self.new_object.get('ipAddress') + if isinstance(name, list) and len(name) > 0: + name = name[0] + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("cliTransport", "cliTransport"), + ("computeDevice", "computeDevice"), + ("enablePassword", "enablePassword"), + ("extendedDiscoveryInfo", "extendedDiscoveryInfo"), + ("httpPassword", "httpPassword"), + ("httpPort", "httpPort"), + ("httpSecure", "httpSecure"), + ("httpUserName", "httpUserName"), + ("ipAddress", "ipAddress"), + ("merakiOrgId", "merakiOrgId"), + ("netconfPort", "netconfPort"), + ("serialNumber", "serialNumber"), + ("snmpAuthPassphrase", "snmpAuthPassphrase"), + ("snmpAuthProtocol", "snmpAuthProtocol"), + ("snmpMode", "snmpMode"), + ("snmpPrivPassphrase", "snmpPrivPassphrase"), + ("snmpPrivProtocol", "snmpPrivProtocol"), + ("snmpROCommunity", "snmpROCommunity"), + ("snmpRWCommunity", "snmpRWCommunity"), + ("snmpRetry", "snmpRetry"), + ("snmpTimeout", "snmpTimeout"), + ("snmpUserName", "snmpUserName"), + ("snmpVersion", "snmpVersion"), + ("type", "type"), + ("updateMgmtIPaddressList", "updateMgmtIPaddressList"), + ("userName", "userName"), + ("id", "id"), + ("cleanConfig", "clean_config"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="devices", + function="add_device", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") or \ + self.new_object.get('ipAddress') + if isinstance(name, list) and len(name) > 0: + name = name[0] + result = None + result = self.dnac.exec( + family="devices", + function="sync_devices", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") or \ + self.new_object.get('ipAddress') + if isinstance(name, list) and len(name) > 0: + name = name[0] + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="devices", + function="delete_device_by_id", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = NetworkDevice(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_by_ip_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_by_ip_info.py new file mode 100644 index 00000000..a766c17d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_by_ip_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ipAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + ip_address=params.get("ipAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("ipAddress") + if id: + response = dnac.exec( + family="devices", + function='get_network_device_by_ip', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_by_serial_number_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_by_serial_number_info.py new file mode 100644 index 00000000..68dfbe93 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_by_serial_number_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + serialNumber=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + serial_number=params.get("serialNumber"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("serialNumber") + if id: + response = dnac.exec( + family="devices", + function='get_device_by_serial_number', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_chassis_details_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_chassis_details_info.py new file mode 100644 index 00000000..a38175d5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_chassis_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_chassis_details_for_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_config_count_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_config_count_info.py new file mode 100644 index 00000000..9c0e4ad8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_config_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_config_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_config_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_config_info.py new file mode 100644 index 00000000..9b91c910 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_config_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkDeviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + network_device_id=params.get("networkDeviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("networkDeviceId") + if id: + response = dnac.exec( + family="devices", + function='get_device_config_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="devices", + function='get_device_config_for_all_devices', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_count_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_count_info.py new file mode 100644 index 00000000..b2e2ad36 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_count_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("deviceId") + if id: + response = dnac.exec( + family="devices", + function='get_device_interface_count_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="devices", + function='get_device_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt.py b/ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt.py new file mode 100644 index 00000000..9d7140d9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + usernamePrompt=dict(type="str"), + passwordPrompt=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + usernamePrompt=params.get("usernamePrompt"), + passwordPrompt=params.get("passwordPrompt"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="system_settings", + function='custom_prompt_post_api', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt_info.py new file mode 100644 index 00000000..20e425c8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_custom_prompt_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="system_settings", + function='custom_prompt_support_get_api', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_equipment_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_equipment_info.py new file mode 100644 index 00000000..2365b8a1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_equipment_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuid=dict(type="str"), + type=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("deviceUuid"), + type=params.get("type"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='return_power_supply_fan_details_for_the_given_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_export.py b/ansible_collections/cisco/dnac/plugins/action/network_device_export.py new file mode 100644 index 00000000..ed7447ee --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_export.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuids=dict(type="list"), + id=dict(type="str"), + operationEnum=dict(type="str"), + parameters=dict(type="list"), + password=dict(type="str", no_log=True), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceUuids=params.get("deviceUuids"), + id=params.get("id"), + operationEnum=params.get("operationEnum"), + parameters=params.get("parameters"), + password=params.get("password"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='export_device_list', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_functional_capability_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_functional_capability_info.py new file mode 100644 index 00000000..fb00725a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_functional_capability_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + functionName=dict(type="list"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + function_name=params.get("functionName"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="devices", + function='get_functional_capability_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="devices", + function='get_functional_capability_for_devices', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_global_polling_interval_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_global_polling_interval_info.py new file mode 100644 index 00000000..83b40880 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_global_polling_interval_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_polling_interval_for_all_devices', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_info.py new file mode 100644 index 00000000..4fc22382 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_info.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + hostname=dict(type="list"), + managementIpAddress=dict(type="list"), + macAddress=dict(type="list"), + locationName=dict(type="list"), + serialNumber=dict(type="list"), + location=dict(type="list"), + family=dict(type="list"), + type=dict(type="list"), + series=dict(type="list"), + collectionStatus=dict(type="list"), + collectionInterval=dict(type="list"), + notSyncedForMinutes=dict(type="list"), + errorCode=dict(type="list"), + errorDescription=dict(type="list"), + softwareVersion=dict(type="list"), + softwareType=dict(type="list"), + platformId=dict(type="list"), + role=dict(type="list"), + reachabilityStatus=dict(type="list"), + upTime=dict(type="list"), + associatedWlcIp=dict(type="list"), + license_name=dict(type="list"), + license_type=dict(type="list"), + license_status=dict(type="list"), + module_name=dict(type="list"), + module_equpimenttype=dict(type="list"), + module_servicestate=dict(type="list"), + module_vendorequipmenttype=dict(type="list"), + module_partnumber=dict(type="list"), + module_operationstatecode=dict(type="list"), + id=dict(type="str"), + deviceSupportLevel=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + hostname=params.get("hostname"), + management_ip_address=params.get("managementIpAddress"), + mac_address=params.get("macAddress"), + location_name=params.get("locationName"), + serial_number=params.get("serialNumber"), + location=params.get("location"), + family=params.get("family"), + type=params.get("type"), + series=params.get("series"), + collection_status=params.get("collectionStatus"), + collection_interval=params.get("collectionInterval"), + not_synced_for_minutes=params.get("notSyncedForMinutes"), + error_code=params.get("errorCode"), + error_description=params.get("errorDescription"), + software_version=params.get("softwareVersion"), + software_type=params.get("softwareType"), + platform_id=params.get("platformId"), + role=params.get("role"), + reachability_status=params.get("reachabilityStatus"), + up_time=params.get("upTime"), + associated_wlc_ip=params.get("associatedWlcIp"), + license_name=params.get("license_name"), + license_type=params.get("license_type"), + license_status=params.get("license_status"), + module_name=params.get("module_name"), + module_equpimenttype=params.get("module_equpimenttype"), + module_servicestate=params.get("module_servicestate"), + module_vendorequipmenttype=params.get("module_vendorequipmenttype"), + module_partnumber=params.get("module_partnumber"), + module_operationstatecode=params.get("module_operationstatecode"), + id=params.get("id"), + device_support_level=params.get("deviceSupportLevel"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="devices", + function='get_device_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="devices", + function='get_device_list', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_interface_neighbor_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_interface_neighbor_info.py new file mode 100644 index 00000000..2272d543 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_interface_neighbor_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuid=dict(type="str"), + interfaceUuid=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("deviceUuid"), + interface_uuid=params.get("interfaceUuid"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_connected_device_detail', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_interface_poe_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_interface_poe_info.py new file mode 100644 index 00000000..d9a64e91 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_interface_poe_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuid=dict(type="str"), + interfaceNameList=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("deviceUuid"), + interface_name_list=params.get("interfaceNameList"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='poe_interface_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_inventory_insight_link_mismatch_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_inventory_insight_link_mismatch_info.py new file mode 100644 index 00000000..773e9597 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_inventory_insight_link_mismatch_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + category=dict(type="str"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + offset=params.get("offset"), + limit=params.get("limit"), + category=params.get("category"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='inventory_insight_device_link_mismatch', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_lexicographically_sorted_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_lexicographically_sorted_info.py new file mode 100644 index 00000000..297750c1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_lexicographically_sorted_info.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + vrfName=dict(type="str"), + managementIpAddress=dict(type="str"), + hostname=dict(type="str"), + macAddress=dict(type="str"), + family=dict(type="str"), + collectionStatus=dict(type="str"), + collectionInterval=dict(type="str"), + softwareVersion=dict(type="str"), + softwareType=dict(type="str"), + reachabilityStatus=dict(type="str"), + reachabilityFailureReason=dict(type="str"), + errorCode=dict(type="str"), + platformId=dict(type="str"), + series=dict(type="str"), + type=dict(type="str"), + serialNumber=dict(type="str"), + upTime=dict(type="str"), + role=dict(type="str"), + roleSource=dict(type="str"), + associatedWlcIp=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + vrf_name=params.get("vrfName"), + management_ip_address=params.get("managementIpAddress"), + hostname=params.get("hostname"), + mac_address=params.get("macAddress"), + family=params.get("family"), + collection_status=params.get("collectionStatus"), + collection_interval=params.get("collectionInterval"), + software_version=params.get("softwareVersion"), + software_type=params.get("softwareType"), + reachability_status=params.get("reachabilityStatus"), + reachability_failure_reason=params.get("reachabilityFailureReason"), + error_code=params.get("errorCode"), + platform_id=params.get("platformId"), + series=params.get("series"), + type=params.get("type"), + serial_number=params.get("serialNumber"), + up_time=params.get("upTime"), + role=params.get("role"), + role_source=params.get("roleSource"), + associated_wlc_ip=params.get("associatedWlcIp"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_values_that_match_fully_or_partially_an_attribute', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_linecard_details_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_linecard_details_info.py new file mode 100644 index 00000000..70cb7054 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_linecard_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuid=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("deviceUuid"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_linecard_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_meraki_organization_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_meraki_organization_info.py new file mode 100644 index 00000000..37c9f072 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_meraki_organization_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_organization_list_for_meraki', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_module_count_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_module_count_info.py new file mode 100644 index 00000000..10cd5608 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_module_count_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + nameList=dict(type="list"), + vendorEquipmentTypeList=dict(type="list"), + partNumberList=dict(type="list"), + operationalStateCodeList=dict(type="list"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + name_list=params.get("nameList"), + vendor_equipment_type_list=params.get("vendorEquipmentTypeList"), + part_number_list=params.get("partNumberList"), + operational_state_code_list=params.get("operationalStateCodeList"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_module_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_module_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_module_info.py new file mode 100644 index 00000000..1333497b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_module_info.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + limit=dict(type="str"), + offset=dict(type="str"), + nameList=dict(type="list"), + vendorEquipmentTypeList=dict(type="list"), + partNumberList=dict(type="list"), + operationalStateCodeList=dict(type="list"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + limit=params.get("limit"), + offset=params.get("offset"), + name_list=params.get("nameList"), + vendor_equipment_type_list=params.get("vendorEquipmentTypeList"), + part_number_list=params.get("partNumberList"), + operational_state_code_list=params.get("operationalStateCodeList"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="devices", + function='get_module_info_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="devices", + function='get_modules', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_poe_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_poe_info.py new file mode 100644 index 00000000..9ba708f6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_poe_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuid=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("deviceUuid"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='poe_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_polling_interval_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_polling_interval_info.py new file mode 100644 index 00000000..2e9bb7e4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_polling_interval_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_polling_interval_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_range_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_range_info.py new file mode 100644 index 00000000..4fa406d1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_range_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + startIndex=dict(type="int"), + recordsToReturn=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + start_index=params.get("startIndex"), + records_to_return=params.get("recordsToReturn"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_network_device_by_pagination_range', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_register_for_wsa_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_register_for_wsa_info.py new file mode 100644 index 00000000..f5871af3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_register_for_wsa_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + serialNumber=dict(type="str"), + macaddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + serial_number=params.get("serialNumber"), + macaddress=params.get("macaddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='register_device_for_wsa', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_stack_details_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_stack_details_info.py new file mode 100644 index 00000000..500e44ab --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_stack_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_stack_details_for_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_summary_info.py new file mode 100644 index 00000000..00b4930b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_summary_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_supervisor_card_details_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_supervisor_card_details_info.py new file mode 100644 index 00000000..409446f6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_supervisor_card_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceUuid=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_uuid=params.get("deviceUuid"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_supervisor_card_detail', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_sync.py b/ansible_collections/cisco/dnac/plugins/action/network_device_sync.py new file mode 100644 index 00000000..dcfcfb17 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_sync.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), + forceSync=dict(type="bool"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + force_sync=params.get("forceSync"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='sync_devices_using_forcesync', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_update_role.py b/ansible_collections/cisco/dnac/plugins/action/network_device_update_role.py new file mode 100644 index 00000000..8a59a619 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_update_role.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + role=dict(type="str"), + roleSource=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + role=params.get("role"), + roleSource=params.get("roleSource"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='update_device_role', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_vlan_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_vlan_info.py new file mode 100644 index 00000000..7acbd4c1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_vlan_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + interfaceType=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + interface_type=params.get("interfaceType"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_device_interface_vlans', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_wireless_lan_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_wireless_lan_info.py new file mode 100644 index 00000000..313be4cc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_wireless_lan_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_wireless_lan_controller_details_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_device_with_snmp_v3_des_info.py b/ansible_collections/cisco/dnac/plugins/action/network_device_with_snmp_v3_des_info.py new file mode 100644 index 00000000..a4acc669 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_device_with_snmp_v3_des_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_devices_with_snmpv3_des', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_info.py b/ansible_collections/cisco/dnac/plugins/action/network_info.py new file mode 100644 index 00000000..f4b75fdf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='get_network', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/network_update.py b/ansible_collections/cisco/dnac/plugins/action/network_update.py new file mode 100644 index 00000000..24f83aba --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/network_update.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + settings=dict(type="dict"), + siteId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + settings=params.get("settings"), + site_id=params.get("siteId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='update_network', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/nfv_profile.py b/ansible_collections/cisco/dnac/plugins/action/nfv_profile.py new file mode 100644 index 00000000..233762ca --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/nfv_profile.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + profileName=dict(type="str"), + device=dict(type="list"), + id=dict(type="str"), + name=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id"], True), + ("state", "absent", ["id"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NfvProfile(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + profileName=params.get("profileName"), + device=params.get("device"), + id=params.get("id"), + name=params.get("name"), + ) + + def create_params(self): + new_object_params = {} + new_object_params['profileName'] = self.new_object.get('profileName') + new_object_params['device'] = self.new_object.get('device') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['device'] = self.new_object.get('device') + new_object_params['name'] = self.new_object.get('name') + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + # NOTE: Does not have get all + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="site_design", + function="get_nfv_profile", + params={"id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("profileName", "profileName"), + ("device", "device"), + ("id", "id"), + ("name", "name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="site_design", + function="create_nfv_profile", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="site_design", + function="update_nfv_profile", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="site_design", + function="delete_nfv_profile", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = NfvProfile(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/nfv_profile_info.py b/ansible_collections/cisco/dnac/plugins/action/nfv_profile_info.py new file mode 100644 index 00000000..0ab5fec8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/nfv_profile_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + offset=params.get("offset"), + limit=params.get("limit"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="site_design", + function='get_nfv_profile', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/nfv_provision.py b/ansible_collections/cisco/dnac/plugins/action/nfv_provision.py new file mode 100644 index 00000000..9d4609a6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/nfv_provision.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteProfile=dict(type="list"), + provisioning=dict(type="list"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + siteProfile=params.get("siteProfile"), + provisioning=params.get("provisioning"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="site_design", + function='provision_nfv', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/nfv_provision_detail_info.py b/ansible_collections/cisco/dnac/plugins/action/nfv_provision_detail_info.py new file mode 100644 index 00000000..c2f2a8d6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/nfv_provision_detail_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceIp=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_ip=params.get("deviceIp"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="site_design", + function='get_device_details_by_ip', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/nfv_provision_details.py b/ansible_collections/cisco/dnac/plugins/action/nfv_provision_details.py new file mode 100644 index 00000000..5bc7aff1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/nfv_provision_details.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device_ip=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_ip=params.get("device_ip"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="site_design", + function='nfv_provisioning_detail', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/path_trace.py b/ansible_collections/cisco/dnac/plugins/action/path_trace.py new file mode 100644 index 00000000..ddcd81f1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/path_trace.py @@ -0,0 +1,287 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + controlPath=dict(type="bool"), + destIP=dict(type="str"), + destPort=dict(type="str"), + inclusions=dict(type="list"), + periodicRefresh=dict(type="bool"), + protocol=dict(type="str"), + sourceIP=dict(type="str"), + sourcePort=dict(type="str"), + flowAnalysisId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["flowAnalysisId"], True), + ("state", "absent", ["flowAnalysisId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class PathTrace(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + controlPath=params.get("controlPath"), + destIP=params.get("destIP"), + destPort=params.get("destPort"), + inclusions=params.get("inclusions"), + periodicRefresh=params.get("periodicRefresh"), + protocol=params.get("protocol"), + sourceIP=params.get("sourceIP"), + sourcePort=params.get("sourcePort"), + flow_analysis_id=params.get("flowAnalysisId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['periodic_refresh'] = self.new_object.get('periodicRefresh') or \ + self.new_object.get('periodic_refresh') + new_object_params['source_ip'] = self.new_object.get('sourceIP') or \ + self.new_object.get('source_ip') + new_object_params['dest_ip'] = self.new_object.get('destIP') or \ + self.new_object.get('dest_ip') + new_object_params['source_port'] = self.new_object.get('sourcePort') or \ + self.new_object.get('source_port') + new_object_params['dest_port'] = self.new_object.get('destPort') or \ + self.new_object.get('dest_port') + new_object_params['gt_create_time'] = self.new_object.get('gtCreateTime') or \ + self.new_object.get('gt_create_time') + new_object_params['lt_create_time'] = self.new_object.get('ltCreateTime') or \ + self.new_object.get('lt_create_time') + new_object_params['protocol'] = self.new_object.get('protocol') + new_object_params['status'] = self.new_object.get('status') + new_object_params['task_id'] = self.new_object.get('taskId') or \ + self.new_object.get('task_id') + new_object_params['last_update_time'] = self.new_object.get('lastUpdateTime') or \ + self.new_object.get('last_update_time') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['order'] = self.new_object.get('order') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['controlPath'] = self.new_object.get('controlPath') + new_object_params['destIP'] = self.new_object.get('destIP') + new_object_params['destPort'] = self.new_object.get('destPort') + new_object_params['inclusions'] = self.new_object.get('inclusions') + new_object_params['periodicRefresh'] = self.new_object.get('periodicRefresh') + new_object_params['protocol'] = self.new_object.get('protocol') + new_object_params['sourceIP'] = self.new_object.get('sourceIP') + new_object_params['sourcePort'] = self.new_object.get('sourcePort') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['flow_analysis_id'] = self.new_object.get('flow_analysis_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="path_trace", + function="retrives_all_previous_pathtraces_summary", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = items + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="path_trace", + function="retrieves_previous_pathtrace", + params={"flow_analysis_id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if 'request' in items: + items = items.get('request') + result = items + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("flow_analysis_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("flowAnalysisId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(flow_analysis_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("controlPath", "controlPath"), + ("destIP", "destIP"), + ("destPort", "destPort"), + ("inclusions", "inclusions"), + ("periodicRefresh", "periodicRefresh"), + ("protocol", "protocol"), + ("sourceIP", "sourceIP"), + ("sourcePort", "sourcePort"), + ("flowAnalysisId", "flow_analysis_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="path_trace", + function="initiate_a_new_pathtrace", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("flow_analysis_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("flowAnalysisId") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="path_trace", + function="deletes_pathtrace_by_id", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = PathTrace(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/path_trace_info.py b/ansible_collections/cisco/dnac/plugins/action/path_trace_info.py new file mode 100644 index 00000000..d0ff8051 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/path_trace_info.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + periodicRefresh=dict(type="bool"), + sourceIP=dict(type="str"), + destIP=dict(type="str"), + sourcePort=dict(type="str"), + destPort=dict(type="str"), + gtCreateTime=dict(type="str"), + ltCreateTime=dict(type="str"), + protocol=dict(type="str"), + status=dict(type="str"), + taskId=dict(type="str"), + lastUpdateTime=dict(type="str"), + limit=dict(type="str"), + offset=dict(type="str"), + order=dict(type="str"), + sortBy=dict(type="str"), + flowAnalysisId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + periodic_refresh=params.get("periodicRefresh"), + source_ip=params.get("sourceIP"), + dest_ip=params.get("destIP"), + source_port=params.get("sourcePort"), + dest_port=params.get("destPort"), + gt_create_time=params.get("gtCreateTime"), + lt_create_time=params.get("ltCreateTime"), + protocol=params.get("protocol"), + status=params.get("status"), + task_id=params.get("taskId"), + last_update_time=params.get("lastUpdateTime"), + limit=params.get("limit"), + offset=params.get("offset"), + order=params.get("order"), + sort_by=params.get("sortBy"), + flow_analysis_id=params.get("flowAnalysisId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("flowAnalysisId") + if id: + response = dnac.exec( + family="path_trace", + function='retrieves_previous_pathtrace', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="path_trace", + function='retrives_all_previous_pathtraces_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/planned_access_points_info.py b/ansible_collections/cisco/dnac/plugins/action/planned_access_points_info.py new file mode 100644 index 00000000..86cd1a87 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/planned_access_points_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + floorId=dict(type="str"), + limit=dict(type="int"), + offset=dict(type="int"), + radios=dict(type="bool"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + floor_id=params.get("floorId"), + limit=params.get("limit"), + offset=params.get("offset"), + radios=params.get("radios"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_planned_access_points_for_floor', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/platform_nodes_configuration_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/platform_nodes_configuration_summary_info.py new file mode 100644 index 00000000..8063ae16 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/platform_nodes_configuration_summary_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="platform_configuration", + function='nodes_configuration_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/platform_release_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/platform_release_summary_info.py new file mode 100644 index 00000000..449ac4cf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/platform_release_summary_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="platform_configuration", + function='release_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device.py new file mode 100644 index 00000000..ec9c0f36 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device.py @@ -0,0 +1,344 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + _id=dict(type="str"), + deviceInfo=dict(type="dict"), + runSummaryList=dict(type="list"), + systemResetWorkflow=dict(type="dict"), + systemWorkflow=dict(type="dict"), + tenantId=dict(type="str"), + version=dict(type="int"), + workflow=dict(type="dict"), + workflowParameters=dict(type="dict"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id", "deviceInfo"], True), + ("state", "absent", ["id", "deviceInfo"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class PnpDevice(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + _id=params.get("_id"), + deviceInfo=params.get("deviceInfo"), + runSummaryList=params.get("runSummaryList"), + systemResetWorkflow=params.get("systemResetWorkflow"), + systemWorkflow=params.get("systemWorkflow"), + tenantId=params.get("tenantId"), + version=params.get("version"), + workflow=params.get("workflow"), + workflowParameters=params.get("workflowParameters"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['sort'] = self.new_object.get('sort') + new_object_params['sort_order'] = self.new_object.get('sortOrder') or \ + self.new_object.get('sort_order') + new_object_params['serial_number'] = self.new_object.get('serialNumber') or \ + self.new_object.get('serial_number') + new_object_params['state'] = self.new_object.get('state_') or \ + self.new_object.get('state') + new_object_params['onb_state'] = self.new_object.get('onbState') or \ + self.new_object.get('onb_state') + new_object_params['cm_state'] = self.new_object.get('cmState') or \ + self.new_object.get('cm_state') + new_object_params['name'] = name or self.new_object.get('name') + new_object_params['pid'] = self.new_object.get('pid') + new_object_params['source'] = self.new_object.get('source') + new_object_params['project_id'] = self.new_object.get('projectId') or \ + self.new_object.get('project_id') + new_object_params['workflow_id'] = self.new_object.get('workflowId') or \ + self.new_object.get('workflow_id') + new_object_params['project_name'] = self.new_object.get('projectName') or \ + self.new_object.get('project_name') + new_object_params['workflow_name'] = self.new_object.get('workflowName') or \ + self.new_object.get('workflow_name') + new_object_params['smart_account_id'] = self.new_object.get('smartAccountId') or \ + self.new_object.get('smart_account_id') + new_object_params['virtual_account_id'] = self.new_object.get('virtualAccountId') or \ + self.new_object.get('virtual_account_id') + new_object_params['last_contact'] = self.new_object.get('lastContact') or \ + self.new_object.get('last_contact') + new_object_params['mac_address'] = self.new_object.get('macAddress') or \ + self.new_object.get('mac_address') + new_object_params['hostname'] = self.new_object.get('hostname') + new_object_params['site_name'] = self.new_object.get('siteName') or \ + self.new_object.get('site_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['_id'] = self.new_object.get('_id') + new_object_params['deviceInfo'] = self.new_object.get('deviceInfo') + new_object_params['runSummaryList'] = self.new_object.get('runSummaryList') + new_object_params['systemResetWorkflow'] = self.new_object.get('systemResetWorkflow') + new_object_params['systemWorkflow'] = self.new_object.get('systemWorkflow') + new_object_params['tenantId'] = self.new_object.get('tenantId') + new_object_params['version'] = self.new_object.get('version') + new_object_params['workflow'] = self.new_object.get('workflow') + new_object_params['workflowParameters'] = self.new_object.get('workflowParameters') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['_id'] = self.new_object.get('_id') + new_object_params['deviceInfo'] = self.new_object.get('deviceInfo') + new_object_params['runSummaryList'] = self.new_object.get('runSummaryList') + new_object_params['systemResetWorkflow'] = self.new_object.get('systemResetWorkflow') + new_object_params['systemWorkflow'] = self.new_object.get('systemWorkflow') + new_object_params['tenantId'] = self.new_object.get('tenantId') + new_object_params['version'] = self.new_object.get('version') + new_object_params['workflow'] = self.new_object.get('workflow') + new_object_params['workflowParameters'] = self.new_object.get('workflowParameters') + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="device_onboarding_pnp", + function="get_device_list", + params=self.get_all_params(name=name), + ) + if isinstance(items, list): + for i in items: + if isinstance(i, dict) and i.get('deviceInfo'): + tmp = i.get('deviceInfo') + if isinstance(tmp, dict) and tmp.get('name') == name: + result = dict(i) + break + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="device_onboarding_pnp", + function="get_device_by_id", + params={"id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = result or get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + o_id = o_id or self.new_object.get("_id") + device_info = self.new_object.get('deviceInfo') + if device_info and isinstance(device_info, dict) and device_info.get('name'): + name = name or device_info.get('name') + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("_id", "_id"), + ("deviceInfo", "deviceInfo"), + ("runSummaryList", "runSummaryList"), + ("systemResetWorkflow", "systemResetWorkflow"), + ("systemWorkflow", "systemWorkflow"), + ("tenantId", "tenantId"), + ("version", "version"), + ("workflow", "workflow"), + ("workflowParameters", "workflowParameters"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="device_onboarding_pnp", + function="add_device", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + id = id or self.new_object.get("_id") + device_info = self.new_object.get('deviceInfo') + if device_info and isinstance(device_info, dict) and device_info.get('name'): + name = name or device_info.get('name') + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="device_onboarding_pnp", + function="update_device", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + id = id or self.new_object.get("_id") + device_info = self.new_object.get('deviceInfo') + if device_info and isinstance(device_info, dict) and device_info.get('name'): + name = name or device_info.get('name') + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="device_onboarding_pnp", + function="delete_device_by_id_from_pnp", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = PnpDevice(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_authorize.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_authorize.py new file mode 100644 index 00000000..2e6f18ac --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_authorize.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceIdList=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceIdList=params.get("deviceIdList"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="cisco_dna_center_system", + function='authorize_device', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_claim.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_claim.py new file mode 100644 index 00000000..26abade7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_claim.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + configFileUrl=dict(type="str"), + configId=dict(type="str"), + deviceClaimList=dict(type="list"), + fileServiceId=dict(type="str"), + imageId=dict(type="str"), + imageUrl=dict(type="str"), + populateInventory=dict(type="bool"), + projectId=dict(type="str"), + workflowId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + configFileUrl=params.get("configFileUrl"), + configId=params.get("configId"), + deviceClaimList=params.get("deviceClaimList"), + fileServiceId=params.get("fileServiceId"), + imageId=params.get("imageId"), + imageUrl=params.get("imageUrl"), + populateInventory=params.get("populateInventory"), + projectId=params.get("projectId"), + workflowId=params.get("workflowId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='claim_device', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_claim_to_site.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_claim_to_site.py new file mode 100644 index 00000000..e98e13fb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_claim_to_site.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + siteId=dict(type="str"), + type=dict(type="str"), + imageInfo=dict(type="dict"), + configInfo=dict(type="dict"), + hostname=dict(type="str"), + gateway=dict(type="str"), + imageId=dict(type="str"), + removeInactive=dict(type="bool"), + ipInterfaceName=dict(type="str"), + rfProfile=dict(type="str"), + staticIP=dict(type="str"), + subnetMask=dict(type="str"), + vlanId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceId=params.get("deviceId"), + siteId=params.get("siteId"), + type=params.get("type"), + imageInfo=params.get("imageInfo"), + configInfo=params.get("configInfo"), + hostname=params.get("hostname"), + gateway=params.get("gateway"), + imageId=params.get("imageId"), + removeInactive=params.get("removeInactive"), + ipInterfaceName=params.get("ipInterfaceName"), + rfProfile=params.get("rfProfile"), + staticIP=params.get("staticIP"), + subnetMask=params.get("subnetMask"), + vlanId=params.get("vlanId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='claim_a_device_to_a_site', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_config_preview.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_config_preview.py new file mode 100644 index 00000000..0caf043d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_config_preview.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + siteId=dict(type="str"), + type=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceId=params.get("deviceId"), + siteId=params.get("siteId"), + type=params.get("type"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='preview_config', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_count_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_count_info.py new file mode 100644 index 00000000..933b8bd0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_count_info.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + serialNumber=dict(type="list"), + state_=dict(type="list"), + onbState=dict(type="list"), + cmState=dict(type="list"), + name=dict(type="list"), + pid=dict(type="list"), + source=dict(type="list"), + projectId=dict(type="list"), + workflowId=dict(type="list"), + projectName=dict(type="list"), + workflowName=dict(type="list"), + smartAccountId=dict(type="list"), + virtualAccountId=dict(type="list"), + lastContact=dict(type="bool"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + serial_number=params.get("serialNumber"), + state=params.get("state_"), + onb_state=params.get("onbState"), + cm_state=params.get("cmState"), + name=params.get("name"), + pid=params.get("pid"), + source=params.get("source"), + project_id=params.get("projectId"), + workflow_id=params.get("workflowId"), + project_name=params.get("projectName"), + workflow_name=params.get("workflowName"), + smart_account_id=params.get("smartAccountId"), + virtual_account_id=params.get("virtualAccountId"), + last_contact=params.get("lastContact"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='get_device_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_history_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_history_info.py new file mode 100644 index 00000000..49e64041 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_history_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + serialNumber=dict(type="str"), + sort=dict(type="list"), + sortOrder=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + serial_number=params.get("serialNumber"), + sort=params.get("sort"), + sort_order=params.get("sortOrder"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='get_device_history', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_import.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_import.py new file mode 100644 index 00000000..daca60d6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_import.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='import_devices_in_bulk', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_info.py new file mode 100644 index 00000000..52973617 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_info.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + limit=dict(type="int"), + offset=dict(type="int"), + sort=dict(type="list"), + sortOrder=dict(type="str"), + serialNumber=dict(type="list"), + state_=dict(type="list"), + onbState=dict(type="list"), + cmState=dict(type="list"), + name=dict(type="list"), + pid=dict(type="list"), + source=dict(type="list"), + projectId=dict(type="list"), + workflowId=dict(type="list"), + projectName=dict(type="list"), + workflowName=dict(type="list"), + smartAccountId=dict(type="list"), + virtualAccountId=dict(type="list"), + lastContact=dict(type="bool"), + macAddress=dict(type="str"), + hostname=dict(type="str"), + siteName=dict(type="str"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + limit=params.get("limit"), + offset=params.get("offset"), + sort=params.get("sort"), + sort_order=params.get("sortOrder"), + serial_number=params.get("serialNumber"), + state=params.get("state_"), + onb_state=params.get("onbState"), + cm_state=params.get("cmState"), + name=params.get("name"), + pid=params.get("pid"), + source=params.get("source"), + project_id=params.get("projectId"), + workflow_id=params.get("workflowId"), + project_name=params.get("projectName"), + workflow_name=params.get("workflowName"), + smart_account_id=params.get("smartAccountId"), + virtual_account_id=params.get("virtualAccountId"), + last_contact=params.get("lastContact"), + mac_address=params.get("macAddress"), + hostname=params.get("hostname"), + site_name=params.get("siteName"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="device_onboarding_pnp", + function='get_device_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="device_onboarding_pnp", + function='get_device_list', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_reset.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_reset.py new file mode 100644 index 00000000..19ebab29 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_reset.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceResetList=dict(type="list"), + projectId=dict(type="str"), + workflowId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceResetList=params.get("deviceResetList"), + projectId=params.get("projectId"), + workflowId=params.get("workflowId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='reset_device', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_device_unclaim.py b/ansible_collections/cisco/dnac/plugins/action/pnp_device_unclaim.py new file mode 100644 index 00000000..4a950ad0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_device_unclaim.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceIdList=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceIdList=params.get("deviceIdList"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='un_claim_device', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_global_settings.py b/ansible_collections/cisco/dnac/plugins/action/pnp_global_settings.py new file mode 100644 index 00000000..7cd52472 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_global_settings.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + _id=dict(type="str"), + aaaCredentials=dict(type="dict"), + acceptEula=dict(type="bool"), + defaultProfile=dict(type="dict"), + savaMappingList=dict(type="list"), + taskTimeOuts=dict(type="dict"), + tenantId=dict(type="str"), + version=dict(type="int"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class PnpGlobalSettings(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + _id=params.get("_id"), + aaaCredentials=params.get("aaaCredentials"), + acceptEula=params.get("acceptEula"), + defaultProfile=params.get("defaultProfile"), + savaMappingList=params.get("savaMappingList"), + taskTimeOuts=params.get("taskTimeOuts"), + tenantId=params.get("tenantId"), + version=params.get("version"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['_id'] = self.new_object.get('_id') + new_object_params['aaaCredentials'] = self.new_object.get('aaaCredentials') + new_object_params['acceptEula'] = self.new_object.get('acceptEula') + new_object_params['defaultProfile'] = self.new_object.get('defaultProfile') + new_object_params['savaMappingList'] = self.new_object.get('savaMappingList') + new_object_params['taskTimeOuts'] = self.new_object.get('taskTimeOuts') + new_object_params['tenantId'] = self.new_object.get('tenantId') + new_object_params['version'] = self.new_object.get('version') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + result = self.dnac.exec( + family="device_onboarding_pnp", + function="get_pnp_global_settings", + params=self.get_all_params(name=name), + ) + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + name = None + prev_obj = self.get_object_by_name(name) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("_id", "_id"), + ("aaaCredentials", "aaaCredentials"), + ("acceptEula", "acceptEula"), + ("defaultProfile", "defaultProfile"), + ("savaMappingList", "savaMappingList"), + ("taskTimeOuts", "taskTimeOuts"), + ("tenantId", "tenantId"), + ("version", "version"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def update(self): + result = None + result = self.dnac.exec( + family="device_onboarding_pnp", + function="update_pnp_global_settings", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = PnpGlobalSettings(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + dnac.fail_json("Object does not exists, plugin only has update") + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_global_settings_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_global_settings_info.py new file mode 100644 index 00000000..a087b908 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_global_settings_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='get_pnp_global_settings', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_server_profile_update.py b/ansible_collections/cisco/dnac/plugins/action/pnp_server_profile_update.py new file mode 100644 index 00000000..209812d6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_server_profile_update.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + autoSyncPeriod=dict(type="int"), + ccoUser=dict(type="str"), + expiry=dict(type="int"), + lastSync=dict(type="int"), + profile=dict(type="dict"), + smartAccountId=dict(type="str"), + syncResult=dict(type="dict"), + syncResultStr=dict(type="str"), + syncStartTime=dict(type="int"), + syncStatus=dict(type="str"), + tenantId=dict(type="str"), + token=dict(type="str"), + virtualAccountId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + autoSyncPeriod=params.get("autoSyncPeriod"), + ccoUser=params.get("ccoUser"), + expiry=params.get("expiry"), + lastSync=params.get("lastSync"), + profile=params.get("profile"), + smartAccountId=params.get("smartAccountId"), + syncResult=params.get("syncResult"), + syncResultStr=params.get("syncResultStr"), + syncStartTime=params.get("syncStartTime"), + syncStatus=params.get("syncStatus"), + tenantId=params.get("tenantId"), + token=params.get("token"), + virtualAccountId=params.get("virtualAccountId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='update_pnp_server_profile', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_smart_account_domains_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_smart_account_domains_info.py new file mode 100644 index 00000000..8fd09b47 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_smart_account_domains_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='get_smart_account_list', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_add.py b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_add.py new file mode 100644 index 00000000..a41633ac --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_add.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + autoSyncPeriod=dict(type="int"), + ccoUser=dict(type="str"), + expiry=dict(type="int"), + lastSync=dict(type="int"), + profile=dict(type="dict"), + smartAccountId=dict(type="str"), + syncResult=dict(type="dict"), + syncResultStr=dict(type="str"), + syncStartTime=dict(type="int"), + syncStatus=dict(type="str"), + tenantId=dict(type="str"), + token=dict(type="str"), + virtualAccountId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + autoSyncPeriod=params.get("autoSyncPeriod"), + ccoUser=params.get("ccoUser"), + expiry=params.get("expiry"), + lastSync=params.get("lastSync"), + profile=params.get("profile"), + smartAccountId=params.get("smartAccountId"), + syncResult=params.get("syncResult"), + syncResultStr=params.get("syncResultStr"), + syncStartTime=params.get("syncStartTime"), + syncStatus=params.get("syncStatus"), + tenantId=params.get("tenantId"), + token=params.get("token"), + virtualAccountId=params.get("virtualAccountId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='add_virtual_account', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_deregister.py b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_deregister.py new file mode 100644 index 00000000..71f221b8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_deregister.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + domain=dict(type="str"), + name=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + domain=params.get("domain"), + name=params.get("name"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function="deregister_virtual_account", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_devices_sync.py b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_devices_sync.py new file mode 100644 index 00000000..d40859bd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_devices_sync.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + autoSyncPeriod=dict(type="int"), + ccoUser=dict(type="str"), + expiry=dict(type="int"), + lastSync=dict(type="int"), + profile=dict(type="dict"), + smartAccountId=dict(type="str"), + syncResult=dict(type="dict"), + syncResultStr=dict(type="str"), + syncStartTime=dict(type="int"), + syncStatus=dict(type="str"), + tenantId=dict(type="str"), + token=dict(type="str"), + virtualAccountId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + autoSyncPeriod=params.get("autoSyncPeriod"), + ccoUser=params.get("ccoUser"), + expiry=params.get("expiry"), + lastSync=params.get("lastSync"), + profile=params.get("profile"), + smartAccountId=params.get("smartAccountId"), + syncResult=params.get("syncResult"), + syncResultStr=params.get("syncResultStr"), + syncStartTime=params.get("syncStartTime"), + syncStatus=params.get("syncStatus"), + tenantId=params.get("tenantId"), + token=params.get("token"), + virtualAccountId=params.get("virtualAccountId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='sync_virtual_account_devices', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_sync_result_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_sync_result_info.py new file mode 100644 index 00000000..9d3cc0b7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_account_sync_result_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + domain=dict(type="str"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + domain=params.get("domain"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='get_sync_result_for_virtual_account', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_accounts_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_accounts_info.py new file mode 100644 index 00000000..4267d987 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_virtual_accounts_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + domain=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + domain=params.get("domain"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='get_virtual_account_list', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_workflow.py b/ansible_collections/cisco/dnac/plugins/action/pnp_workflow.py new file mode 100644 index 00000000..7a42ea0d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_workflow.py @@ -0,0 +1,351 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + _id=dict(type="str"), + addToInventory=dict(type="bool"), + addedOn=dict(type="int"), + configId=dict(type="str"), + currTaskIdx=dict(type="int"), + description=dict(type="str"), + endTime=dict(type="int"), + execTime=dict(type="int"), + imageId=dict(type="str"), + instanceType=dict(type="str"), + lastupdateOn=dict(type="int"), + name=dict(type="str"), + startTime=dict(type="int"), + state_=dict(type="str"), + tasks=dict(type="list"), + tenantId=dict(type="str"), + type=dict(type="str"), + useState=dict(type="str"), + version=dict(type="int"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id", "name"], True), + ("state", "absent", ["id", "name"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class PnpWorkflow(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + _id=params.get("_id"), + addToInventory=params.get("addToInventory"), + addedOn=params.get("addedOn"), + configId=params.get("configId"), + currTaskIdx=params.get("currTaskIdx"), + description=params.get("description"), + endTime=params.get("endTime"), + execTime=params.get("execTime"), + imageId=params.get("imageId"), + instanceType=params.get("instanceType"), + lastupdateOn=params.get("lastupdateOn"), + name=params.get("name"), + startTime=params.get("startTime"), + state=params.get("state_"), + tasks=params.get("tasks"), + tenantId=params.get("tenantId"), + type=params.get("type"), + useState=params.get("useState"), + version=params.get("version"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['sort'] = self.new_object.get('sort') + new_object_params['sort_order'] = self.new_object.get('sortOrder') or \ + self.new_object.get('sort_order') + new_object_params['type'] = self.new_object.get('type') + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['_id'] = self.new_object.get('_id') + new_object_params['addToInventory'] = self.new_object.get('addToInventory') + new_object_params['addedOn'] = self.new_object.get('addedOn') + new_object_params['configId'] = self.new_object.get('configId') + new_object_params['currTaskIdx'] = self.new_object.get('currTaskIdx') + new_object_params['description'] = self.new_object.get('description') + new_object_params['endTime'] = self.new_object.get('endTime') + new_object_params['execTime'] = self.new_object.get('execTime') + new_object_params['imageId'] = self.new_object.get('imageId') + new_object_params['instanceType'] = self.new_object.get('instanceType') + new_object_params['lastupdateOn'] = self.new_object.get('lastupdateOn') + new_object_params['name'] = self.new_object.get('name') + new_object_params['startTime'] = self.new_object.get('startTime') + new_object_params['state_'] = self.new_object.get('state_') + new_object_params['tasks'] = self.new_object.get('tasks') + new_object_params['tenantId'] = self.new_object.get('tenantId') + new_object_params['type'] = self.new_object.get('type') + new_object_params['useState'] = self.new_object.get('useState') + new_object_params['version'] = self.new_object.get('version') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['_id'] = self.new_object.get('_id') + new_object_params['addToInventory'] = self.new_object.get('addToInventory') + new_object_params['addedOn'] = self.new_object.get('addedOn') + new_object_params['configId'] = self.new_object.get('configId') + new_object_params['currTaskIdx'] = self.new_object.get('currTaskIdx') + new_object_params['description'] = self.new_object.get('description') + new_object_params['endTime'] = self.new_object.get('endTime') + new_object_params['execTime'] = self.new_object.get('execTime') + new_object_params['imageId'] = self.new_object.get('imageId') + new_object_params['instanceType'] = self.new_object.get('instanceType') + new_object_params['lastupdateOn'] = self.new_object.get('lastupdateOn') + new_object_params['name'] = self.new_object.get('name') + new_object_params['startTime'] = self.new_object.get('startTime') + new_object_params['state_'] = self.new_object.get('state_') + new_object_params['tasks'] = self.new_object.get('tasks') + new_object_params['tenantId'] = self.new_object.get('tenantId') + new_object_params['type'] = self.new_object.get('type') + new_object_params['useState'] = self.new_object.get('useState') + new_object_params['version'] = self.new_object.get('version') + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="device_onboarding_pnp", + function="get_workflows", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="device_onboarding_pnp", + function="get_workflow_by_id", + params={"id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("_id", "_id"), + ("addToInventory", "addToInventory"), + ("addedOn", "addedOn"), + ("configId", "configId"), + ("currTaskIdx", "currTaskIdx"), + ("description", "description"), + ("endTime", "endTime"), + ("execTime", "execTime"), + ("imageId", "imageId"), + ("instanceType", "instanceType"), + ("lastupdateOn", "lastupdateOn"), + ("name", "name"), + ("startTime", "startTime"), + ("state_", "state"), + ("tasks", "tasks"), + ("tenantId", "tenantId"), + ("type", "type"), + ("useState", "useState"), + ("version", "version"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="device_onboarding_pnp", + function="add_a_workflow", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="device_onboarding_pnp", + function="update_workflow", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="device_onboarding_pnp", + function="delete_workflow_by_id", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = PnpWorkflow(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_workflow_count_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_workflow_count_info.py new file mode 100644 index 00000000..a5641d09 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_workflow_count_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="list"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="device_onboarding_pnp", + function='get_workflow_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/pnp_workflow_info.py b/ansible_collections/cisco/dnac/plugins/action/pnp_workflow_info.py new file mode 100644 index 00000000..c1847fc7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/pnp_workflow_info.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + limit=dict(type="int"), + offset=dict(type="int"), + sort=dict(type="list"), + sortOrder=dict(type="str"), + type=dict(type="list"), + name=dict(type="list"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + limit=params.get("limit"), + offset=params.get("offset"), + sort=params.get("sort"), + sort_order=params.get("sortOrder"), + type=params.get("type"), + name=params.get("name"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="device_onboarding_pnp", + function='get_workflow_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="device_onboarding_pnp", + function='get_workflows', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/profiling_rules_count_info.py b/ansible_collections/cisco/dnac/plugins/action/profiling_rules_count_info.py new file mode 100644 index 00000000..9f528781 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/profiling_rules_count_info.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ruleType=dict(type="str"), + includeDeleted=dict(type="bool"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + rule_type=params.get("ruleType"), + include_deleted=params.get("includeDeleted"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="policy", + function='get_count_of_profiling_rules', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/profiling_rules_in_bulk_create.py b/ansible_collections/cisco/dnac/plugins/action/profiling_rules_in_bulk_create.py new file mode 100644 index 00000000..ed2944bb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/profiling_rules_in_bulk_create.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + profilingRules=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + profilingRules=params.get("profilingRules"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="policy", + function='import_profiling_rules_in_bulk', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/projects_details_info.py b/ansible_collections/cisco/dnac/plugins/action/projects_details_info.py new file mode 100644 index 00000000..c1f78640 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/projects_details_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + name=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortOrder=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + name=params.get("name"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_order=params.get("sortOrder"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='get_projects_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/qos_device_interface.py b/ansible_collections/cisco/dnac/plugins/action/qos_device_interface.py new file mode 100644 index 00000000..262824cd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/qos_device_interface.py @@ -0,0 +1,264 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id"], True), + ("state", "present", ["payload"], True), + ("state", "absent", ["id"], True), + ("state", "absent", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class QosDeviceInterface(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['network_device_id'] = self.new_object.get('networkDeviceId') or \ + self.new_object.get('network_device_id') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="application_policy", + function="get_qos_device_interface_info", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="application_policy", + function="get_qos_device_interface_info", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + o_id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("id", "id"), + ("name", "name"), + ("excludedInterfaces", "excludedInterfaces"), + ("networkDeviceId", "networkDeviceId"), + ("qosDeviceInterfaceInfo", "qosDeviceInterfaceInfo"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="application_policy", + function="create_qos_device_interface_info", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="application_policy", + function="update_qos_device_interface_info", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="application_policy", + function="delete_qos_device_interface_info", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = QosDeviceInterface(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info.py b/ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info.py new file mode 100644 index 00000000..906116e0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + networkDeviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + network_device_id=params.get("networkDeviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_qos_device_interface_info', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info_count_info.py b/ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info_count_info.py new file mode 100644 index 00000000..d89693b3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/qos_device_interface_info_count_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="application_policy", + function='get_qos_device_interface_info_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reports.py b/ansible_collections/cisco/dnac/plugins/action/reports.py new file mode 100644 index 00000000..28f65687 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reports.py @@ -0,0 +1,259 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + tags=dict(type="list"), + deliveries=dict(type="list"), + name=dict(type="str"), + schedule=dict(type="dict"), + view=dict(type="dict"), + viewGroupId=dict(type="str"), + viewGroupVersion=dict(type="str"), + reportId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "reportId"], True), + ("state", "absent", ["name", "reportId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Reports(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + tags=params.get("tags"), + deliveries=params.get("deliveries"), + name=params.get("name"), + schedule=params.get("schedule"), + view=params.get("view"), + viewGroupId=params.get("viewGroupId"), + viewGroupVersion=params.get("viewGroupVersion"), + report_id=params.get("reportId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['view_group_id'] = self.new_object.get('viewGroupId') or \ + self.new_object.get('view_group_id') + new_object_params['view_id'] = self.new_object.get('view', {}).get('viewId') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['tags'] = self.dnac.verify_array((self.new_object.get('tags'))) + new_object_params['deliveries'] = self.dnac.verify_array(self.new_object.get('deliveries')) + new_object_params['name'] = self.new_object.get('name') + new_object_params['schedule'] = self.new_object.get('schedule') + new_object_params['view'] = self.new_object.get('view') + new_object_params['viewGroupId'] = self.new_object.get('viewGroupId') + new_object_params['viewGroupVersion'] = self.new_object.get('viewGroupVersion') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['report_id'] = self.new_object.get('report_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="reports", + function="get_list_of_scheduled_reports", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="reports", + function="get_a_scheduled_report", + params={"report_id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'reportId', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("report_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("reportId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(report_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("tags", "tags"), + ("deliveries", "deliveries"), + ("name", "name"), + ("schedule", "schedule"), + ("view", "view"), + ("viewGroupId", "viewGroupId"), + ("viewGroupVersion", "viewGroupVersion"), + ("reportId", "report_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="reports", + function="create_or_schedule_a_report", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("report_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("reportId") + if id_: + self.new_object.update(dict(report_id=id_)) + result = self.dnac.exec( + family="reports", + function="delete_a_scheduled_report", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Reports(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reports_executions_info.py b/ansible_collections/cisco/dnac/plugins/action/reports_executions_info.py new file mode 100644 index 00000000..a1de3e4c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reports_executions_info.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + reportId=dict(type="str"), + executionId=dict(type="str"), + dirPath=dict(type="str"), + saveFile=dict(type="bool"), + filename=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + report_id=params.get("reportId"), + execution_id=params.get("executionId"), + dirpath=params.get("dirPath"), + save_file=params.get("saveFile"), + filename=params.get("filename"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("executionId") + if id: + download_response = dnac.exec( + family="reports", + function='download_report_content', + params=self.get_object(self._task.args), + ) + response = dict( + data=download_response.data.decode(encoding='utf-8'), + filename=download_response.filename, + dirpath=download_response.dirpath, + path=download_response.path, + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="reports", + function='get_all_execution_details_for_a_given_report', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reports_info.py b/ansible_collections/cisco/dnac/plugins/action/reports_info.py new file mode 100644 index 00000000..6aad484f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reports_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + viewGroupId=dict(type="str"), + viewId=dict(type="str"), + reportId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + view_group_id=params.get("viewGroupId"), + view_id=params.get("viewId"), + report_id=params.get("reportId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("reportId") + if id: + response = dnac.exec( + family="reports", + function='get_a_scheduled_report', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="reports", + function='get_list_of_scheduled_reports', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reports_view_group_info.py b/ansible_collections/cisco/dnac/plugins/action/reports_view_group_info.py new file mode 100644 index 00000000..98352727 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reports_view_group_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + viewGroupId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + view_group_id=params.get("viewGroupId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("viewGroupId") + if id: + response = dnac.exec( + family="reports", + function='get_views_for_a_given_view_group', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="reports", + function='get_all_view_groups', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reports_view_group_view_info.py b/ansible_collections/cisco/dnac/plugins/action/reports_view_group_view_info.py new file mode 100644 index 00000000..32bd3026 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reports_view_group_view_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + viewGroupId=dict(type="str"), + viewId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + view_group_id=params.get("viewGroupId"), + view_id=params.get("viewId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("viewGroupId") + if id: + response = dnac.exec( + family="reports", + function='get_view_details_for_a_given_view_group_and_view', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool.py b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool.py new file mode 100644 index 00000000..22ea8eda --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool.py @@ -0,0 +1,358 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + type=dict(type="str"), + ipv6AddressSpace=dict(type="bool"), + ipv4GlobalPool=dict(type="str"), + ipv4Prefix=dict(type="bool"), + ipv4PrefixLength=dict(type="int"), + ipv4Subnet=dict(type="str"), + ipv4GateWay=dict(type="str"), + ipv4DhcpServers=dict(type="list"), + ipv4DnsServers=dict(type="list"), + ipv6GlobalPool=dict(type="str"), + ipv6Prefix=dict(type="bool"), + ipv6PrefixLength=dict(type="int"), + ipv6Subnet=dict(type="str"), + ipv6GateWay=dict(type="str"), + ipv6DhcpServers=dict(type="list"), + ipv6DnsServers=dict(type="list"), + ipv4TotalHost=dict(type="int"), + ipv6TotalHost=dict(type="int"), + slaacSupport=dict(type="bool"), + siteId=dict(type="str"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id", "name", "siteId"], True), + ("state", "absent", ["id", "name", "siteId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ReserveIpSubpool(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + name=params.get("name"), + type=params.get("type"), + ipv6AddressSpace=params.get("ipv6AddressSpace"), + ipv4GlobalPool=params.get("ipv4GlobalPool"), + ipv4Prefix=params.get("ipv4Prefix"), + ipv4PrefixLength=params.get("ipv4PrefixLength"), + ipv4Subnet=params.get("ipv4Subnet"), + ipv4GateWay=params.get("ipv4GateWay"), + ipv4DhcpServers=params.get("ipv4DhcpServers"), + ipv4DnsServers=params.get("ipv4DnsServers"), + ipv6GlobalPool=params.get("ipv6GlobalPool"), + ipv6Prefix=params.get("ipv6Prefix"), + ipv6PrefixLength=params.get("ipv6PrefixLength"), + ipv6Subnet=params.get("ipv6Subnet"), + ipv6GateWay=params.get("ipv6GateWay"), + ipv6DhcpServers=params.get("ipv6DhcpServers"), + ipv6DnsServers=params.get("ipv6DnsServers"), + ipv4TotalHost=params.get("ipv4TotalHost"), + ipv6TotalHost=params.get("ipv6TotalHost"), + slaacSupport=params.get("slaacSupport"), + site_id=params.get("siteId"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['site_id'] = self.new_object.get('siteId') or \ + self.new_object.get('site_id') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['type'] = self.new_object.get('type') + new_object_params['ipv6AddressSpace'] = self.new_object.get('ipv6AddressSpace') + new_object_params['ipv4GlobalPool'] = self.new_object.get('ipv4GlobalPool') + new_object_params['ipv4Prefix'] = self.new_object.get('ipv4Prefix') + new_object_params['ipv4PrefixLength'] = self.new_object.get('ipv4PrefixLength') + new_object_params['ipv4Subnet'] = self.new_object.get('ipv4Subnet') + new_object_params['ipv4GateWay'] = self.new_object.get('ipv4GateWay') + new_object_params['ipv4DhcpServers'] = self.new_object.get('ipv4DhcpServers') + new_object_params['ipv4DnsServers'] = self.new_object.get('ipv4DnsServers') + new_object_params['ipv6GlobalPool'] = self.new_object.get('ipv6GlobalPool') + new_object_params['ipv6Prefix'] = self.new_object.get('ipv6Prefix') + new_object_params['ipv6PrefixLength'] = self.new_object.get('ipv6PrefixLength') + new_object_params['ipv6Subnet'] = self.new_object.get('ipv6Subnet') + new_object_params['ipv6GateWay'] = self.new_object.get('ipv6GateWay') + new_object_params['ipv6DhcpServers'] = self.new_object.get('ipv6DhcpServers') + new_object_params['ipv6DnsServers'] = self.new_object.get('ipv6DnsServers') + new_object_params['ipv4TotalHost'] = self.new_object.get('ipv4TotalHost') + new_object_params['ipv6TotalHost'] = self.new_object.get('ipv6TotalHost') + new_object_params['slaacSupport'] = self.new_object.get('slaacSupport') + new_object_params['site_id'] = self.new_object.get('site_id') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['ipv6AddressSpace'] = self.new_object.get('ipv6AddressSpace') + new_object_params['ipv4DhcpServers'] = self.new_object.get('ipv4DhcpServers') + new_object_params['ipv4DnsServers'] = self.new_object.get('ipv4DnsServers') + new_object_params['ipv6GlobalPool'] = self.new_object.get('ipv6GlobalPool') + new_object_params['ipv6Prefix'] = self.new_object.get('ipv6Prefix') + new_object_params['ipv6PrefixLength'] = self.new_object.get('ipv6PrefixLength') + new_object_params['ipv6Subnet'] = self.new_object.get('ipv6Subnet') + new_object_params['ipv6GateWay'] = self.new_object.get('ipv6GateWay') + new_object_params['ipv6DhcpServers'] = self.new_object.get('ipv6DhcpServers') + new_object_params['ipv6DnsServers'] = self.new_object.get('ipv6DnsServers') + new_object_params['ipv6TotalHost'] = self.new_object.get('ipv6TotalHost') + new_object_params['slaacSupport'] = self.new_object.get('slaacSupport') + new_object_params['ipv4GateWay'] = self.new_object.get('ipv4GateWay') + new_object_params['id'] = self.new_object.get('id') + new_object_params['site_id'] = self.new_object.get('site_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="network_settings", + function="get_reserve_ip_subpool", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="network_settings", + function="get_reserve_ip_subpool", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("site_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("siteId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(site_id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("type", "type"), + ("ipv6AddressSpace", "ipv6AddressSpace"), + ("ipv4GlobalPool", "ipv4GlobalPool"), + ("ipv4Prefix", "ipv4Prefix"), + ("ipv4PrefixLength", "ipv4PrefixLength"), + ("ipv4Subnet", "ipv4Subnet"), + ("ipv4GateWay", "ipv4GateWay"), + ("ipv4DhcpServers", "ipv4DhcpServers"), + ("ipv4DnsServers", "ipv4DnsServers"), + ("ipv6GlobalPool", "ipv6GlobalPool"), + ("ipv6Prefix", "ipv6Prefix"), + ("ipv6PrefixLength", "ipv6PrefixLength"), + ("ipv6Subnet", "ipv6Subnet"), + ("ipv6GateWay", "ipv6GateWay"), + ("ipv6DhcpServers", "ipv6DhcpServers"), + ("ipv6DnsServers", "ipv6DnsServers"), + ("ipv4TotalHost", "ipv4TotalHost"), + ("ipv6TotalHost", "ipv6TotalHost"), + ("slaacSupport", "slaacSupport"), + ("siteId", "site_id"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="network_settings", + function="reserve_ip_subpool", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + id = id or self.new_object.get("site_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("siteId") + if id_: + self.new_object.update(dict(site_id=id_)) + result = self.dnac.exec( + family="network_settings", + function="update_reserve_ip_subpool", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("site_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("siteId") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="network_settings", + function="release_reserve_ip_subpool", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = ReserveIpSubpool(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_create.py b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_create.py new file mode 100644 index 00000000..0b34b179 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_create.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + type=dict(type="str"), + ipv6AddressSpace=dict(type="bool"), + ipv4GlobalPool=dict(type="str"), + ipv4Prefix=dict(type="bool"), + ipv4PrefixLength=dict(type="int"), + ipv4Subnet=dict(type="str"), + ipv4GateWay=dict(type="str"), + ipv4DhcpServers=dict(type="list"), + ipv4DnsServers=dict(type="list"), + ipv6GlobalPool=dict(type="str"), + ipv6Prefix=dict(type="bool"), + ipv6PrefixLength=dict(type="int"), + ipv6Subnet=dict(type="str"), + ipv6GateWay=dict(type="str"), + ipv6DhcpServers=dict(type="list"), + ipv6DnsServers=dict(type="list"), + ipv4TotalHost=dict(type="int"), + ipv6TotalHost=dict(type="int"), + slaacSupport=dict(type="bool"), + siteId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + type=params.get("type"), + ipv6AddressSpace=params.get("ipv6AddressSpace"), + ipv4GlobalPool=params.get("ipv4GlobalPool"), + ipv4Prefix=params.get("ipv4Prefix"), + ipv4PrefixLength=params.get("ipv4PrefixLength"), + ipv4Subnet=params.get("ipv4Subnet"), + ipv4GateWay=params.get("ipv4GateWay"), + ipv4DhcpServers=params.get("ipv4DhcpServers"), + ipv4DnsServers=params.get("ipv4DnsServers"), + ipv6GlobalPool=params.get("ipv6GlobalPool"), + ipv6Prefix=params.get("ipv6Prefix"), + ipv6PrefixLength=params.get("ipv6PrefixLength"), + ipv6Subnet=params.get("ipv6Subnet"), + ipv6GateWay=params.get("ipv6GateWay"), + ipv6DhcpServers=params.get("ipv6DhcpServers"), + ipv6DnsServers=params.get("ipv6DnsServers"), + ipv4TotalHost=params.get("ipv4TotalHost"), + ipv6TotalHost=params.get("ipv6TotalHost"), + slaacSupport=params.get("slaacSupport"), + site_id=params.get("siteId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='reserve_ip_subpool', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_delete.py b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_delete.py new file mode 100644 index 00000000..d48b57d7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_delete.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function="release_reserve_ip_subpool", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_info.py b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_info.py new file mode 100644 index 00000000..48238b14 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='get_reserve_ip_subpool', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_update.py b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_update.py new file mode 100644 index 00000000..4d2f8bf5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/reserve_ip_subpool_update.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + ipv6AddressSpace=dict(type="bool"), + ipv4DhcpServers=dict(type="list"), + ipv4DnsServers=dict(type="list"), + ipv6GlobalPool=dict(type="str"), + ipv6Prefix=dict(type="bool"), + ipv6PrefixLength=dict(type="int"), + ipv6Subnet=dict(type="str"), + ipv6GateWay=dict(type="str"), + ipv6DhcpServers=dict(type="list"), + ipv6DnsServers=dict(type="list"), + ipv6TotalHost=dict(type="int"), + slaacSupport=dict(type="bool"), + ipv4GateWay=dict(type="str"), + siteId=dict(type="str"), + id=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + ipv6AddressSpace=params.get("ipv6AddressSpace"), + ipv4DhcpServers=params.get("ipv4DhcpServers"), + ipv4DnsServers=params.get("ipv4DnsServers"), + ipv6GlobalPool=params.get("ipv6GlobalPool"), + ipv6Prefix=params.get("ipv6Prefix"), + ipv6PrefixLength=params.get("ipv6PrefixLength"), + ipv6Subnet=params.get("ipv6Subnet"), + ipv6GateWay=params.get("ipv6GateWay"), + ipv6DhcpServers=params.get("ipv6DhcpServers"), + ipv6DnsServers=params.get("ipv6DnsServers"), + ipv6TotalHost=params.get("ipv6TotalHost"), + slaacSupport=params.get("slaacSupport"), + ipv4GateWay=params.get("ipv4GateWay"), + site_id=params.get("siteId"), + id=params.get("id"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='update_reserve_ip_subpool', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_count_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_count_info.py new file mode 100644 index 00000000..f4b53d82 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_count_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_sda_fabric_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_device_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_device_info.py new file mode 100644 index 00000000..11130027 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_device_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_device_info', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_device_role_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_device_role_info.py new file mode 100644 index 00000000..17532423 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_device_role_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_device_role_in_sda_fabric', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric.py new file mode 100644 index 00000000..934ce809 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric.py @@ -0,0 +1,210 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + fabricName=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaFabric(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + fabricName=params.get("fabricName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['fabric_name'] = self.new_object.get('fabricName') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['fabricName'] = self.new_object.get('fabricName') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['fabric_name'] = self.new_object.get('fabricName') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTICE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_sda_fabric_info", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'fabricName', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("fabricName") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("fabricName", "fabricName"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_fabric", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("fabricName") + result = None + result = self.dnac.exec( + family="sda", + function="delete_sda_fabric", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + dnac = DNACSDK(self._task.args) + obj = SdaFabric(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile.py new file mode 100644 index 00000000..b83b7dd1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile.py @@ -0,0 +1,243 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + siteNameHierarchy=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaFabricAuthenticationProfile(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + site_name_hierarchy=params.get("siteNameHierarchy"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['site_name_hierarchy'] = self.new_object.get('siteNameHierarchy') or \ + self.new_object.get('site_name_hierarchy') + new_object_params['authenticate_template_name'] = self.new_object.get('authenticateTemplateName') or \ + self.new_object.get('authenticate_template_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['site_name_hierarchy'] = self.new_object.get('site_name_hierarchy') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="sda", + function="get_default_authentication_profile", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and 'siteNameHierarchy' in prev_obj + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("siteNameHierarchy", "siteNameHierarchy"), + ("authenticateTemplateName", "authenticateTemplateName"), + ("authenticationOrder", "authenticationOrder"), + ("dot1xToMabFallbackTimeout", "dot1xToMabFallbackTimeout"), + ("wakeOnLan", "wakeOnLan"), + ("numberOfHosts", "numberOfHosts"), + ("siteNameHierarchy", "site_name_hierarchy"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_default_authentication_profile", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def update(self): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + id = self.new_object.get("id") or requested_obj.get("id") + name = self.new_object.get("name") or requested_obj.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="update_default_authentication_profile", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_default_authentication_profile", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaFabricAuthenticationProfile(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile_info.py new file mode 100644 index 00000000..fc99a83d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_authentication_profile_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteNameHierarchy=dict(type="str"), + authenticateTemplateName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_name_hierarchy=params.get("siteNameHierarchy"), + authenticate_template_name=params.get("authenticateTemplateName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_default_authentication_profile', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device.py new file mode 100644 index 00000000..3712ebb2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device.py @@ -0,0 +1,224 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + deviceManagementIpAddress=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaFabricBorderDevice(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + device_management_ip_address=params.get("deviceManagementIpAddress"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('deviceManagementIpAddress') or \ + self.new_object.get('device_management_ip_address') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('device_management_ip_address') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="gets_border_device_detail", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("deviceManagementIpAddress", "deviceManagementIpAddress"), + ("siteNameHierarchy", "siteNameHierarchy"), + ("deviceRole", "deviceRole"), + ("externalDomainRoutingProtocolName", "externalDomainRoutingProtocolName"), + ("externalConnectivityIpPoolName", "externalConnectivityIpPoolName"), + ("internalAutonomouSystemNumber", "internalAutonomouSystemNumber"), + ("borderSessionType", "borderSessionType"), + ("connectedToInternet", "connectedToInternet"), + ("sdaTransitNetworkName", "sdaTransitNetworkName"), + ("borderWithExternalConnectivity", "borderWithExternalConnectivity"), + ("externalConnectivitySettings", "externalConnectivitySettings"), + ("deviceManagementIpAddress", "device_management_ip_address"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="adds_border_device", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="deletes_border_device", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaFabricBorderDevice(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device_info.py new file mode 100644 index 00000000..bf3c2aef --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_border_device_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='gets_border_device_detail', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device.py new file mode 100644 index 00000000..57d82953 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device.py @@ -0,0 +1,215 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + deviceManagementIpAddress=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaFabricControlPlaneDevice(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + device_management_ip_address=params.get("deviceManagementIpAddress"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('deviceManagementIpAddress') or \ + self.new_object.get('device_management_ip_address') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('device_management_ip_address') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_control_plane_device", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("deviceManagementIpAddress", "deviceManagementIpAddress"), + ("siteNameHierarchy", "siteNameHierarchy"), + ("deviceManagementIpAddress", "device_management_ip_address"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_control_plane_device", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_control_plane_device", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaFabricControlPlaneDevice(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device_info.py new file mode 100644 index 00000000..27a324ea --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_control_plane_device_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_control_plane_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device.py new file mode 100644 index 00000000..b2ee07d9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + deviceManagementIpAddress=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), + ("state", "absent", ["deviceManagementIpAddress"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaFabricEdgeDevice(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + device_management_ip_address=params.get("deviceManagementIpAddress"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('deviceManagementIpAddress') or \ + self.new_object.get('device_management_ip_address') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('device_management_ip_address') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_edge_device", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("deviceManagementIpAddress", "deviceManagementIpAddress"), + ("siteNameHierarchy", "siteNameHierarchy"), + ("deviceManagementIpAddress", "device_management_ip_address"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_edge_device", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_edge_device", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaFabricEdgeDevice(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device_info.py new file mode 100644 index 00000000..ca369d73 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_edge_device_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_edge_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_info.py new file mode 100644 index 00000000..02a2aa59 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_info.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + fabricName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + fabric_name=params.get("fabricName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_sda_fabric_info', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_site.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_site.py new file mode 100644 index 00000000..198a8d12 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_site.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + fabricName=dict(type="str"), + siteNameHierarchy=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaFabricSite(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + fabricName=params.get("fabricName"), + siteNameHierarchy=params.get("siteNameHierarchy"), + site_name_hierarchy=params.get("siteNameHierarchy"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['site_name_hierarchy'] = self.new_object.get('siteNameHierarchy') or \ + self.new_object.get('site_name_hierarchy') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['fabricName'] = self.new_object.get('fabricName') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['site_name_hierarchy'] = self.new_object.get('site_name_hierarchy') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_site", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and 'fabricName' in prev_obj + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("fabricName", "fabricName"), + ("siteNameHierarchy", "siteNameHierarchy"), + ("siteNameHierarchy", "site_name_hierarchy"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_site", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_site", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaFabricSite(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_fabric_site_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_site_info.py new file mode 100644 index 00000000..09cf7075 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_fabric_site_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteNameHierarchy=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_name_hierarchy=params.get("siteNameHierarchy"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_site', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_multicast.py b/ansible_collections/cisco/dnac/plugins/action/sda_multicast.py new file mode 100644 index 00000000..9a56d53a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_multicast.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + siteNameHierarchy=dict(type="str"), + multicastMethod=dict(type="str"), + multicastType=dict(type="str"), + multicastVnInfo=dict(type="list"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaMulticast(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + siteNameHierarchy=params.get("siteNameHierarchy"), + multicastMethod=params.get("multicastMethod"), + multicastType=params.get("multicastType"), + multicastVnInfo=params.get("multicastVnInfo"), + site_name_hierarchy=params.get("siteNameHierarchy"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['site_name_hierarchy'] = self.new_object.get('siteNameHierarchy') or \ + self.new_object.get('site_name_hierarchy') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + new_object_params['multicastMethod'] = self.new_object.get('multicastMethod') + new_object_params['multicastType'] = self.new_object.get('multicastType') + new_object_params['multicastVnInfo'] = self.new_object.get('multicastVnInfo') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['site_name_hierarchy'] = self.new_object.get('site_name_hierarchy') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_multicast_details_from_sda_fabric", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and 'siteNameHierarchy' in prev_obj + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("siteNameHierarchy", "siteNameHierarchy"), + ("multicastMethod", "multicastMethod"), + ("multicastType", "multicastType"), + ("multicastVnInfo", "multicastVnInfo"), + ("siteNameHierarchy", "site_name_hierarchy"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_multicast_in_sda_fabric", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_multicast_from_sda_fabric", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaMulticast(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_multicast_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_multicast_info.py new file mode 100644 index 00000000..51716bd4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_multicast_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteNameHierarchy=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_name_hierarchy=params.get("siteNameHierarchy"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_multicast_details_from_sda_fabric', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point.py b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point.py new file mode 100644 index 00000000..5ea494ed --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point.py @@ -0,0 +1,235 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + siteNameHierarchy=dict(type="str"), + deviceManagementIpAddress=dict(type="str"), + interfaceName=dict(type="str"), + dataIpAddressPoolName=dict(type="str"), + authenticateTemplateName=dict(type="str"), + interfaceDescription=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaPortAssignmentForAccessPoint(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + siteNameHierarchy=params.get("siteNameHierarchy"), + deviceManagementIpAddress=params.get("deviceManagementIpAddress"), + interfaceName=params.get("interfaceName"), + dataIpAddressPoolName=params.get("dataIpAddressPoolName"), + authenticateTemplateName=params.get("authenticateTemplateName"), + interfaceDescription=params.get("interfaceDescription"), + device_management_ip_address=params.get("deviceManagementIpAddress"), + interface_name=params.get("interfaceName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('deviceManagementIpAddress') or \ + self.new_object.get('device_management_ip_address') + new_object_params['interface_name'] = self.new_object.get('interfaceName') or \ + self.new_object.get('interface_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + new_object_params['deviceManagementIpAddress'] = self.new_object.get('deviceManagementIpAddress') + new_object_params['interfaceName'] = self.new_object.get('interfaceName') + new_object_params['dataIpAddressPoolName'] = self.new_object.get('dataIpAddressPoolName') + new_object_params['authenticateTemplateName'] = self.new_object.get('authenticateTemplateName') + new_object_params['interfaceDescription'] = self.new_object.get('interfaceDescription') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('device_management_ip_address') + new_object_params['interface_name'] = self.new_object.get('interface_name') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_port_assignment_for_access_point", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("siteNameHierarchy", "siteNameHierarchy"), + ("deviceManagementIpAddress", "deviceManagementIpAddress"), + ("interfaceName", "interfaceName"), + ("dataIpAddressPoolName", "dataIpAddressPoolName"), + ("authenticateTemplateName", "authenticateTemplateName"), + ("interfaceDescription", "interfaceDescription"), + ("deviceManagementIpAddress", "device_management_ip_address"), + ("interfaceName", "interface_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_port_assignment_for_access_point", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_port_assignment_for_access_point", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaPortAssignmentForAccessPoint(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point_info.py new file mode 100644 index 00000000..8ff37844 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_access_point_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + interfaceName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + interface_name=params.get("interfaceName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_port_assignment_for_access_point', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device.py b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device.py new file mode 100644 index 00000000..bcd2fe09 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device.py @@ -0,0 +1,243 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + siteNameHierarchy=dict(type="str"), + deviceManagementIpAddress=dict(type="str"), + interfaceName=dict(type="str"), + dataIpAddressPoolName=dict(type="str"), + voiceIpAddressPoolName=dict(type="str"), + authenticateTemplateName=dict(type="str"), + scalableGroupName=dict(type="str"), + interfaceDescription=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaPortAssignmentForUserDevice(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + siteNameHierarchy=params.get("siteNameHierarchy"), + deviceManagementIpAddress=params.get("deviceManagementIpAddress"), + interfaceName=params.get("interfaceName"), + dataIpAddressPoolName=params.get("dataIpAddressPoolName"), + voiceIpAddressPoolName=params.get("voiceIpAddressPoolName"), + authenticateTemplateName=params.get("authenticateTemplateName"), + scalableGroupName=params.get("scalableGroupName"), + interfaceDescription=params.get("interfaceDescription"), + device_management_ip_address=params.get("deviceManagementIpAddress"), + interface_name=params.get("interfaceName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('deviceManagementIpAddress') or \ + self.new_object.get('device_management_ip_address') + new_object_params['interface_name'] = self.new_object.get('interfaceName') or \ + self.new_object.get('interface_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + new_object_params['deviceManagementIpAddress'] = self.new_object.get('deviceManagementIpAddress') + new_object_params['interfaceName'] = self.new_object.get('interfaceName') + new_object_params['dataIpAddressPoolName'] = self.new_object.get('dataIpAddressPoolName') + new_object_params['voiceIpAddressPoolName'] = self.new_object.get('voiceIpAddressPoolName') + new_object_params['authenticateTemplateName'] = self.new_object.get('authenticateTemplateName') + new_object_params['scalableGroupName'] = self.new_object.get('scalableGroupName') + new_object_params['interfaceDescription'] = self.new_object.get('interfaceDescription') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('device_management_ip_address') + new_object_params['interface_name'] = self.new_object.get('interface_name') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_port_assignment_for_user_device", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("siteNameHierarchy", "siteNameHierarchy"), + ("deviceManagementIpAddress", "deviceManagementIpAddress"), + ("interfaceName", "interfaceName"), + ("dataIpAddressPoolName", "dataIpAddressPoolName"), + ("voiceIpAddressPoolName", "voiceIpAddressPoolName"), + ("authenticateTemplateName", "authenticateTemplateName"), + ("scalableGroupName", "scalableGroupName"), + ("interfaceDescription", "interfaceDescription"), + ("deviceManagementIpAddress", "device_management_ip_address"), + ("interfaceName", "interface_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_port_assignment_for_user_device", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_port_assignment_for_user_device", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaPortAssignmentForUserDevice(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device_info.py new file mode 100644 index 00000000..978a8b04 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_port_assignment_for_user_device_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + interfaceName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + interface_name=params.get("interfaceName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_port_assignment_for_user_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_provision_device.py b/ansible_collections/cisco/dnac/plugins/action/sda_provision_device.py new file mode 100644 index 00000000..53092c86 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_provision_device.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + deviceManagementIpAddress=dict(type="str"), + siteNameHierarchy=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaProvisionDevice(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + deviceManagementIpAddress=params.get("deviceManagementIpAddress"), + siteNameHierarchy=params.get("siteNameHierarchy"), + device_management_ip_address=params.get("deviceManagementIpAddress"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('deviceManagementIpAddress') or \ + self.new_object.get('device_management_ip_address') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['deviceManagementIpAddress'] = self.new_object.get('deviceManagementIpAddress') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['device_management_ip_address'] = self.new_object.get('device_management_ip_address') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['deviceManagementIpAddress'] = self.new_object.get('deviceManagementIpAddress') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="sda", + function="get_provisioned_wired_device", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("deviceManagementIpAddress", "deviceManagementIpAddress"), + ("siteNameHierarchy", "siteNameHierarchy"), + ("deviceManagementIpAddress", "device_management_ip_address"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="provision_wired_device", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="re_provision_wired_device", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_provisioned_wired_device", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaProvisionDevice(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_provision_device_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_provision_device_info.py new file mode 100644 index 00000000..f4081785 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_provision_device_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceManagementIpAddress=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_management_ip_address=params.get("deviceManagementIpAddress"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_provisioned_wired_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network.py b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network.py new file mode 100644 index 00000000..f67649ca --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network.py @@ -0,0 +1,221 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="list"), + virtualNetworkName=dict(type="str"), + siteNameHierarchy=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaVirtualNetwork(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + virtual_network_name=params.get("virtualNetworkName"), + site_name_hierarchy=params.get("siteNameHierarchy"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['virtual_network_name'] = self.new_object.get('virtualNetworkName') or \ + self.new_object.get('virtual_network_name') + new_object_params['site_name_hierarchy'] = self.new_object.get('siteNameHierarchy') or \ + self.new_object.get('site_name_hierarchy') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['virtual_network_name'] = self.new_object.get('virtual_network_name') + new_object_params['site_name_hierarchy'] = self.new_object.get('site_name_hierarchy') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_vn", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("virtualNetworkName", "virtualNetworkName"), + ("siteNameHierarchy", "siteNameHierarchy"), + ("virtualNetworkName", "virtual_network_name"), + ("siteNameHierarchy", "site_name_hierarchy"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_vn", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_vn", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaVirtualNetwork(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_info.py new file mode 100644 index 00000000..1397d9e0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + virtualNetworkName=dict(type="str"), + siteNameHierarchy=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + virtual_network_name=params.get("virtualNetworkName"), + site_name_hierarchy=params.get("siteNameHierarchy"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_vn', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool.py b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool.py new file mode 100644 index 00000000..cc38d79e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool.py @@ -0,0 +1,277 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + siteNameHierarchy=dict(type="str"), + virtualNetworkName=dict(type="str"), + isLayer2Only=dict(type="bool"), + ipPoolName=dict(type="str"), + vlanId=dict(type="str"), + vlanName=dict(type="str"), + autoGenerateVlanName=dict(type="bool"), + trafficType=dict(type="str"), + scalableGroupName=dict(type="str"), + isL2FloodingEnabled=dict(type="bool"), + isThisCriticalPool=dict(type="bool"), + isWirelessPool=dict(type="bool"), + isIpDirectedBroadcast=dict(type="bool"), + isCommonPool=dict(type="bool"), + poolType=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaVirtualNetworkIpPool(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + siteNameHierarchy=params.get("siteNameHierarchy"), + virtualNetworkName=params.get("virtualNetworkName"), + isLayer2Only=params.get("isLayer2Only"), + ipPoolName=params.get("ipPoolName"), + vlanId=params.get("vlanId"), + vlanName=params.get("vlanName"), + autoGenerateVlanName=params.get("autoGenerateVlanName"), + trafficType=params.get("trafficType"), + scalableGroupName=params.get("scalableGroupName"), + isL2FloodingEnabled=params.get("isL2FloodingEnabled"), + isThisCriticalPool=params.get("isThisCriticalPool"), + isWirelessPool=params.get("isWirelessPool"), + isIpDirectedBroadcast=params.get("isIpDirectedBroadcast"), + isCommonPool=params.get("isCommonPool"), + poolType=params.get("poolType"), + site_name_hierarchy=params.get("siteNameHierarchy"), + virtual_network_name=params.get("virtualNetworkName"), + ip_pool_name=params.get("ipPoolName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['site_name_hierarchy'] = self.new_object.get('site_name_hierarchy') or \ + self.new_object.get('siteNameHierarchy') + new_object_params['virtual_network_name'] = self.new_object.get('virtualNetworkName') or \ + self.new_object.get('virtual_network_name') + new_object_params['ip_pool_name'] = self.new_object.get('ipPoolName') or \ + self.new_object.get('ip_pool_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + new_object_params['virtualNetworkName'] = self.new_object.get('virtualNetworkName') + new_object_params['isLayer2Only'] = self.new_object.get('isLayer2Only') + new_object_params['ipPoolName'] = self.new_object.get('ipPoolName') + new_object_params['vlanId'] = self.new_object.get('vlanId') + new_object_params['vlanName'] = self.new_object.get('vlanName') + new_object_params['autoGenerateVlanName'] = self.new_object.get('autoGenerateVlanName') + new_object_params['trafficType'] = self.new_object.get('trafficType') + new_object_params['scalableGroupName'] = self.new_object.get('scalableGroupName') + new_object_params['isL2FloodingEnabled'] = self.new_object.get('isL2FloodingEnabled') + new_object_params['isThisCriticalPool'] = self.new_object.get('isThisCriticalPool') + new_object_params['isWirelessPool'] = self.new_object.get('isWirelessPool') + new_object_params['isIpDirectedBroadcast'] = self.new_object.get('isIpDirectedBroadcast') + new_object_params['isCommonPool'] = self.new_object.get('isCommonPool') + new_object_params['poolType'] = self.new_object.get('poolType') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['siteNameHierarchy'] = self.new_object.get('site_name_hierarchy') + new_object_params['site_name_hierarchy'] = self.new_object.get('site_name_hierarchy') + new_object_params['virtual_network_name'] = self.new_object.get('virtual_network_name') + new_object_params['ip_pool_name'] = self.new_object.get('ip_pool_name') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_ip_pool_from_sda_virtual_network", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("siteNameHierarchy", "siteNameHierarchy"), + ("virtualNetworkName", "virtualNetworkName"), + ("isLayer2Only", "isLayer2Only"), + ("ipPoolName", "ipPoolName"), + ("vlanId", "vlanId"), + ("vlanName", "vlanName"), + ("autoGenerateVlanName", "autoGenerateVlanName"), + ("trafficType", "trafficType"), + ("scalableGroupName", "scalableGroupName"), + ("isL2FloodingEnabled", "isL2FloodingEnabled"), + ("isThisCriticalPool", "isThisCriticalPool"), + ("isWirelessPool", "isWirelessPool"), + ("isIpDirectedBroadcast", "isIpDirectedBroadcast"), + ("isCommonPool", "isCommonPool"), + ("poolType", "poolType"), + ("siteNameHierarchy", "site_name_hierarchy"), + ("virtualNetworkName", "virtual_network_name"), + ("ipPoolName", "ip_pool_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_ip_pool_in_sda_virtual_network", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_ip_pool_from_sda_virtual_network", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaVirtualNetworkIpPool(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool_info.py new file mode 100644 index 00000000..055dece7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_ip_pool_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteNameHierarchy=dict(type="str"), + virtualNetworkName=dict(type="str"), + ipPoolName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_name_hierarchy=params.get("siteNameHierarchy"), + virtual_network_name=params.get("virtualNetworkName"), + ip_pool_name=params.get("ipPoolName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_ip_pool_from_sda_virtual_network', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2.py b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2.py new file mode 100644 index 00000000..e6182b51 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2.py @@ -0,0 +1,239 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + virtualNetworkName=dict(type="str"), + isGuestVirtualNetwork=dict(type="bool"), + scalableGroupNames=dict(type="list"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SdaVirtualNetworkV2(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + virtualNetworkName=params.get("virtualNetworkName"), + isGuestVirtualNetwork=params.get("isGuestVirtualNetwork"), + scalableGroupNames=params.get("scalableGroupNames"), + virtual_network_name=params.get("virtualNetworkName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['virtual_network_name'] = self.new_object.get('virtualNetworkName') or \ + self.new_object.get('virtual_network_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['virtualNetworkName'] = self.new_object.get('virtualNetworkName') + new_object_params['isGuestVirtualNetwork'] = self.new_object.get('isGuestVirtualNetwork') + new_object_params['scalableGroupNames'] = self.new_object.get('scalableGroupNames') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['virtual_network_name'] = self.new_object.get('virtual_network_name') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['virtualNetworkName'] = self.new_object.get('virtualNetworkName') + new_object_params['isGuestVirtualNetwork'] = self.new_object.get('isGuestVirtualNetwork') + new_object_params['scalableGroupNames'] = self.new_object.get('scalableGroupNames') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="sda", + function="get_virtual_network_with_scalable_groups", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("name") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("virtualNetworkName", "virtualNetworkName"), + ("isGuestVirtualNetwork", "isGuestVirtualNetwork"), + ("scalableGroupNames", "scalableGroupNames"), + ("virtualNetworkName", "virtual_network_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_virtual_network_with_scalable_groups", + params=self.create_params(), + op_modifies=True, + ) + if isinstance(result, dict): + if 'response' in result: + result = result.get('response') + if isinstance(result, dict) and result.get("status") == "failed": + raise AnsibleSDAException(response=result) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="update_virtual_network_with_scalable_groups", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_virtual_network_with_scalable_groups", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SdaVirtualNetworkV2(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + try: + response = obj.create() + dnac.object_created() + except AnsibleSDAException as e: + dnac.fail_json("Could not create object {e}".format(e=e._response)) + + elif state == "absent": + try: + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + except AnsibleSDAException as e: + dnac.fail_json("Could not get object to be delete {e}".format(e=e._response)) + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2_info.py b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2_info.py new file mode 100644 index 00000000..0044c8b0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network_v2_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + virtualNetworkName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + virtual_network_name=params.get("virtualNetworkName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_virtual_network_with_scalable_groups', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/security_advisories_devices_info.py b/ansible_collections/cisco/dnac/plugins/action/security_advisories_devices_info.py new file mode 100644 index 00000000..83e51e4e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/security_advisories_devices_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + advisoryId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + advisory_id=params.get("advisoryId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="security_advisories", + function='get_devices_per_advisory', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/security_advisories_ids_per_device_info.py b/ansible_collections/cisco/dnac/plugins/action/security_advisories_ids_per_device_info.py new file mode 100644 index 00000000..eebfa562 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/security_advisories_ids_per_device_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("deviceId") + if id: + response = dnac.exec( + family="security_advisories", + function='get_advisory_ids_per_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/security_advisories_info.py b/ansible_collections/cisco/dnac/plugins/action/security_advisories_info.py new file mode 100644 index 00000000..a365433e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/security_advisories_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="security_advisories", + function='get_advisories_list', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/security_advisories_per_device_info.py b/ansible_collections/cisco/dnac/plugins/action/security_advisories_per_device_info.py new file mode 100644 index 00000000..9694438e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/security_advisories_per_device_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="security_advisories", + function='get_advisories_per_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/security_advisories_summary_info.py b/ansible_collections/cisco/dnac/plugins/action/security_advisories_summary_info.py new file mode 100644 index 00000000..cf2a7ce8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/security_advisories_summary_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="security_advisories", + function='get_advisories_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sensor.py b/ansible_collections/cisco/dnac/plugins/action/sensor.py new file mode 100644 index 00000000..79723983 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sensor.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + ssids=dict(type="list"), + name=dict(type="str"), + connection=dict(type="str"), + apCoverage=dict(type="list"), + modelVersion=dict(type="int"), + templateName=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name"], True), + ("state", "absent", ["name"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Sensor(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + ssids=params.get("ssids"), + name=params.get("name"), + connection=params.get("connection"), + apCoverage=params.get("apCoverage"), + modelVersion=params.get("modelVersion"), + template_name=params.get("templateName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['site_id'] = self.new_object.get('siteId') or \ + self.new_object.get('site_id') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['ssids'] = self.new_object.get('ssids') + new_object_params['name'] = self.new_object.get('name') + new_object_params['connection'] = self.new_object.get('connection') + new_object_params['apCoverage'] = self.new_object.get('apCoverage') + new_object_params['modelVersion'] = self.new_object.get('modelVersion') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['template_name'] = self.new_object.get('template_name') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sensors", + function="sensors", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("ssids", "ssids"), + ("name", "name"), + ("connection", "connection"), + ("apCoverage", "apCoverage"), + ("modelVersion", "modelVersion"), + ("templateName", "template_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sensors", + function="create_sensor_test_template", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sensors", + function="delete_sensor_test", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Sensor(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sensor_info.py b/ansible_collections/cisco/dnac/plugins/action/sensor_info.py new file mode 100644 index 00000000..66277bae --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sensor_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sensors", + function='sensors', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sensor_test_run.py b/ansible_collections/cisco/dnac/plugins/action/sensor_test_run.py new file mode 100644 index 00000000..e3939dc6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sensor_test_run.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + templateName=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + templateName=params.get("templateName"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sensors", + function='run_now_sensor_test', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sensor_test_template_duplicate.py b/ansible_collections/cisco/dnac/plugins/action/sensor_test_template_duplicate.py new file mode 100644 index 00000000..49c831c3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sensor_test_template_duplicate.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + templateName=dict(type="str"), + newTemplateName=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + templateName=params.get("templateName"), + newTemplateName=params.get("newTemplateName"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sensors", + function='duplicate_sensor_test_template', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/sensor_test_template_edit.py b/ansible_collections/cisco/dnac/plugins/action/sensor_test_template_edit.py new file mode 100644 index 00000000..5e75c953 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/sensor_test_template_edit.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + templateName=dict(type="str"), + locationInfoList=dict(type="list"), + schedule=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + templateName=params.get("templateName"), + locationInfoList=params.get("locationInfoList"), + schedule=params.get("schedule"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sensors", + function='edit_sensor_test_template', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/service_provider_create.py b/ansible_collections/cisco/dnac/plugins/action/service_provider_create.py new file mode 100644 index 00000000..eb7ca82c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/service_provider_create.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + settings=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + settings=params.get("settings"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='create_sp_profile', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/service_provider_info.py b/ansible_collections/cisco/dnac/plugins/action/service_provider_info.py new file mode 100644 index 00000000..9fefca6f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/service_provider_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='get_service_provider_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/service_provider_profile_delete.py b/ansible_collections/cisco/dnac/plugins/action/service_provider_profile_delete.py new file mode 100644 index 00000000..31a5f3e4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/service_provider_profile_delete.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + spProfileName=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + sp_profile_name=params.get("spProfileName"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function="delete_sp_profile", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/service_provider_update.py b/ansible_collections/cisco/dnac/plugins/action/service_provider_update.py new file mode 100644 index 00000000..c3bb6247 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/service_provider_update.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + settings=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + settings=params.get("settings"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='update_sp_profile', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_assign_credential.py b/ansible_collections/cisco/dnac/plugins/action/site_assign_credential.py new file mode 100644 index 00000000..e5a7c088 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_assign_credential.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + cliId=dict(type="str"), + snmpV2ReadId=dict(type="str"), + snmpV2WriteId=dict(type="str"), + httpRead=dict(type="str"), + httpWrite=dict(type="str"), + snmpV3Id=dict(type="str"), + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + cliId=params.get("cliId"), + snmpV2ReadId=params.get("snmpV2ReadId"), + snmpV2WriteId=params.get("snmpV2WriteId"), + httpRead=params.get("httpRead"), + httpWrite=params.get("httpWrite"), + snmpV3Id=params.get("snmpV3Id"), + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='assign_credential_to_site', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_assign_device.py b/ansible_collections/cisco/dnac/plugins/action/site_assign_device.py new file mode 100644 index 00000000..40ed9f1a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_assign_device.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + device=dict(type="list"), + siteId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device=params.get("device"), + site_id=params.get("siteId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases." + "New module is assign_device_to_site " + "for 2.3.3.0 or higher") + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function='assign_device_to_site', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_count_info.py b/ansible_collections/cisco/dnac/plugins/action/site_count_info.py new file mode 100644 index 00000000..528b95e0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_count_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function='get_site_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_create.py b/ansible_collections/cisco/dnac/plugins/action/site_create.py new file mode 100644 index 00000000..5f805c4c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_create.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + type=dict(type="str"), + site=dict(type="dict"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + type=params.get("type"), + site=params.get("site"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function='create_site', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_delete.py b/ansible_collections/cisco/dnac/plugins/action/site_delete.py new file mode 100644 index 00000000..5e3b1f0f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_delete.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function="delete_site", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_design_floormap.py b/ansible_collections/cisco/dnac/plugins/action/site_design_floormap.py new file mode 100644 index 00000000..3ec7c65b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_design_floormap.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + floorId=dict(type="str"), + payload=dict(type="dict"), +)) + +required_if = [ + ("state", "present", ["floorId"], True), + ("state", "absent", ["floorId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SiteDesignFloormap(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + floor_id=params.get("floorId"), + payload=params.get("payload"), + ) + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['floor_id'] = self.new_object.get('floor_id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['floor_id'] = self.new_object.get('floor_id') + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTICE: Does not have a get by name method or it is in another action + # NOTICE: Does not have get all + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="site_design", + function="get_floormap", + params={"floor_id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'floorId', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("floor_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("floorId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(floor_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("floorId", "floor_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="site_design", + function="create_floormap", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + id = id or self.new_object.get("floor_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("floorId") + if id_: + self.new_object.update(dict(floor_id=id_)) + result = self.dnac.exec( + family="site_design", + function="update_floormap", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("floor_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("floorId") + if id_: + self.new_object.update(dict(floor_id=id_)) + result = self.dnac.exec( + family="site_design", + function="delete_floormap", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + dnac = DNACSDK(self._task.args) + obj = SiteDesignFloormap(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_design_floormap_info.py b/ansible_collections/cisco/dnac/plugins/action/site_design_floormap_info.py new file mode 100644 index 00000000..83f52b49 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_design_floormap_info.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + floorId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + floor_id=params.get("floorId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("floorId") + if id: + response = dnac.exec( + family="site_design", + function='get_floormap', + params=self.get_object(self._task.args) + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="site_design", + function='get_floormaps', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_health_info.py b/ansible_collections/cisco/dnac/plugins/action/site_health_info.py new file mode 100644 index 00000000..7a38d07d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_health_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + timestamp=dict(type="str"), + siteType=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + timestamp=params.get("timestamp"), + site_type=params.get("siteType"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function='get_site_health', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_info.py b/ansible_collections/cisco/dnac/plugins/action/site_info.py new file mode 100644 index 00000000..92ae0217 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + siteId=dict(type="str"), + type=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + site_id=params.get("siteId"), + type=params.get("type"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function='get_site', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_membership_info.py b/ansible_collections/cisco/dnac/plugins/action/site_membership_info.py new file mode 100644 index 00000000..a2940180 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_membership_info.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + deviceFamily=dict(type="str"), + serialNumber=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + offset=params.get("offset"), + limit=params.get("limit"), + device_family=params.get("deviceFamily"), + serial_number=params.get("serialNumber"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("siteId") + if id: + response = dnac.exec( + family="sites", + function='get_membership', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/site_update.py b/ansible_collections/cisco/dnac/plugins/action/site_update.py new file mode 100644 index 00000000..0f7359d1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/site_update.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + type=dict(type="str"), + site=dict(type="dict"), + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + type=params.get("type"), + site=params.get("site"), + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sites", + function='update_site', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/snmp_properties.py b/ansible_collections/cisco/dnac/plugins/action/snmp_properties.py new file mode 100644 index 00000000..88acb70b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/snmp_properties.py @@ -0,0 +1,202 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + payload=dict(type="list"), +)) + +required_if = [ + ("state", "present", ["payload"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class SnmpProperties(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + ) + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="discovery", + function="get_snmp_properties" + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'systemPropertyName', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="discovery", + function="get_snmp_properties" + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + o_id = self.new_object.get("id") or requested_obj.get("id") + name = requested_obj.get("systemPropertyName") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'systemPropertyName' params don't refer to the same object") + if _id: + payload = self.new_object.get('payload') + payload.update(id=_id) + self.new_object.update(dict(payload=payload)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object.get('payload') + if requested_obj and len(requested_obj) > 0: + requested_obj = requested_obj[0] + + obj_params = [ + ("id", "id"), + ("instanceTenantId", "instanceTenantId"), + ("instanceUuid", "instanceUuid"), + ("intValue", "intValue"), + ("systemPropertyName", "systemPropertyName"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_update_snmp_properties", + params=self.create_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = SnmpProperties(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + try: + response = obj.create() + dnac.object_updated() + except Exception: + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/snmp_properties_info.py b/ansible_collections/cisco/dnac/plugins/action/snmp_properties_info.py new file mode 100644 index 00000000..cd02442a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/snmp_properties_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_snmp_properties', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/snmpv2_read_community_credential.py b/ansible_collections/cisco/dnac/plugins/action/snmpv2_read_community_credential.py new file mode 100644 index 00000000..60edf5c8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/snmpv2_read_community_credential.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + comments=dict(type="str"), + credentialType=dict(type="str"), + description=dict(type="str"), + instanceUuid=dict(type="str"), + readCommunity=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["description"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Snmpv2ReadCommunityCredential(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + comments=params.get("comments"), + credentialType=params.get("credentialType"), + description=params.get("description"), + instanceUuid=params.get("instanceUuid"), + readCommunity=params.get("readCommunity"), + ) + + def create_params(self): + new_object_params = {} + payload = {} + keys = ['comments', 'credentialType', 'description', 'instanceUuid', 'readCommunity', + 'readCommunity'] + for key in keys: + if self.new_object.get(key) is not None: + payload[key] = self.new_object.get(key) + new_object_params['payload'] = [payload] + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['comments'] = self.new_object.get('comments') + new_object_params['credentialType'] = self.new_object.get('credentialType') + new_object_params['description'] = self.new_object.get('description') + new_object_params['instanceUuid'] = self.new_object.get('instanceUuid') + new_object_params['readCommunity'] = self.new_object.get('readCommunity') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'SNMPV2_READ_COMMUNITY'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'description', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'SNMPV2_READ_COMMUNITY'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("description") or self.new_object.get("username") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + obj_params = [ + ("comments", "comments"), + ("credentialType", "credentialType"), + ("description", "description"), + ("instanceUuid", "instanceUuid"), + ("readCommunity", "readCommunity"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_snmp_read_community", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_snmp_read_community", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Snmpv2ReadCommunityCredential(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/snmpv2_write_community_credential.py b/ansible_collections/cisco/dnac/plugins/action/snmpv2_write_community_credential.py new file mode 100644 index 00000000..97982d2c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/snmpv2_write_community_credential.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + comments=dict(type="str"), + credentialType=dict(type="str"), + description=dict(type="str"), + instanceUuid=dict(type="str"), + writeCommunity=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["description"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Snmpv2WriteCommunityCredential(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + comments=params.get("comments"), + credentialType=params.get("credentialType"), + description=params.get("description"), + instanceUuid=params.get("instanceUuid"), + writeCommunity=params.get("writeCommunity"), + ) + + def create_params(self): + new_object_params = {} + payload = {} + keys = ['comments', 'credentialType', 'description', 'instanceUuid', 'writeCommunity', + 'writeCommunity'] + for key in keys: + if self.new_object.get(key) is not None: + payload[key] = self.new_object.get(key) + new_object_params['payload'] = [payload] + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['comments'] = self.new_object.get('comments') + new_object_params['credentialType'] = self.new_object.get('credentialType') + new_object_params['description'] = self.new_object.get('description') + new_object_params['instanceUuid'] = self.new_object.get('instanceUuid') + new_object_params['writeCommunity'] = self.new_object.get('writeCommunity') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'SNMPV2_WRITE_COMMUNITY'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'description', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'SNMPV2_WRITE_COMMUNITY'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("description") or self.new_object.get("username") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + obj_params = [ + ("comments", "comments"), + ("credentialType", "credentialType"), + ("description", "description"), + ("instanceUuid", "instanceUuid"), + ("writeCommunity", "writeCommunity"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_snmp_write_community", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_snmp_write_community", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Snmpv2WriteCommunityCredential(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/snmpv3_credential.py b/ansible_collections/cisco/dnac/plugins/action/snmpv3_credential.py new file mode 100644 index 00000000..480c82e6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/snmpv3_credential.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + authPassword=dict(type="str", no_log=True), + authType=dict(type="str"), + comments=dict(type="str"), + credentialType=dict(type="str"), + description=dict(type="str"), + id=dict(type="str"), + instanceTenantId=dict(type="str"), + instanceUuid=dict(type="str"), + privacyPassword=dict(type="str", no_log=True), + privacyType=dict(type="str"), + snmpMode=dict(type="str"), + username=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["description", "id", "username"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Snmpv3Credential(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + authPassword=params.get("authPassword"), + authType=params.get("authType"), + comments=params.get("comments"), + credentialType=params.get("credentialType"), + description=params.get("description"), + id=params.get("id"), + instanceTenantId=params.get("instanceTenantId"), + instanceUuid=params.get("instanceUuid"), + privacyPassword=params.get("privacyPassword"), + privacyType=params.get("privacyType"), + snmpMode=params.get("snmpMode"), + username=params.get("username"), + ) + + def create_params(self): + new_object_params = {} + payload = {} + keys = ['authPassword', 'authType', 'comments', 'credentialType', 'description', + 'id', 'instanceTenantId', 'instanceUuid', 'privacyPassword', 'privacyType', + 'snmpMode', 'username'] + for key in keys: + if self.new_object.get(key) is not None: + payload[key] = self.new_object.get(key) + new_object_params['payload'] = [payload] + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['authPassword'] = self.new_object.get('authPassword') + new_object_params['authType'] = self.new_object.get('authType') + new_object_params['comments'] = self.new_object.get('comments') + new_object_params['credentialType'] = self.new_object.get('credentialType') + new_object_params['description'] = self.new_object.get('description') + new_object_params['id'] = self.new_object.get('id') + new_object_params['instanceTenantId'] = self.new_object.get('instanceTenantId') + new_object_params['instanceUuid'] = self.new_object.get('instanceUuid') + new_object_params['privacyPassword'] = self.new_object.get('privacyPassword') + new_object_params['privacyType'] = self.new_object.get('privacyType') + new_object_params['snmpMode'] = self.new_object.get('snmpMode') + new_object_params['username'] = self.new_object.get('username') + return new_object_params + + def get_object_by_name(self, name): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'SNMPV3'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'description', name) or get_dict_result(items, 'username', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="discovery", + function="get_global_credentials", + params={'credential_sub_type': 'SNMPV3'}, + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("description") or self.new_object.get("username") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + obj_params = [ + ("authType", "authType"), + ("comments", "comments"), + ("credentialType", "credentialType"), + ("description", "description"), + ("id", "id"), + ("instanceTenantId", "instanceTenantId"), + ("instanceUuid", "instanceUuid"), + ("privacyType", "privacyType"), + ("snmpMode", "snmpMode"), + ("username", "username"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_snmpv3_credentials", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_snmpv3_credentials", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Snmpv3Credential(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/swim_image_details_info.py b/ansible_collections/cisco/dnac/plugins/action/swim_image_details_info.py new file mode 100644 index 00000000..e7151893 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/swim_image_details_info.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + imageUuid=dict(type="str"), + name=dict(type="str"), + family=dict(type="str"), + applicationType=dict(type="str"), + imageIntegrityStatus=dict(type="str"), + version=dict(type="str"), + imageSeries=dict(type="str"), + imageName=dict(type="str"), + isTaggedGolden=dict(type="bool"), + isCCORecommended=dict(type="bool"), + isCCOLatest=dict(type="bool"), + createdTime=dict(type="int"), + imageSizeGreaterThan=dict(type="int"), + imageSizeLesserThan=dict(type="int"), + sortBy=dict(type="str"), + sortOrder=dict(type="str"), + limit=dict(type="int"), + offset=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + image_uuid=params.get("imageUuid"), + name=params.get("name"), + family=params.get("family"), + application_type=params.get("applicationType"), + image_integrity_status=params.get("imageIntegrityStatus"), + version=params.get("version"), + image_series=params.get("imageSeries"), + image_name=params.get("imageName"), + is_tagged_golden=params.get("isTaggedGolden"), + is_cco_recommended=params.get("isCCORecommended"), + is_cco_latest=params.get("isCCOLatest"), + created_time=params.get("createdTime"), + image_size_greater_than=params.get("imageSizeGreaterThan"), + image_size_lesser_than=params.get("imageSizeLesserThan"), + sort_by=params.get("sortBy"), + sort_order=params.get("sortOrder"), + limit=params.get("limit"), + offset=params.get("offset"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function='get_software_image_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/swim_import_local.py b/ansible_collections/cisco/dnac/plugins/action/swim_import_local.py new file mode 100644 index 00000000..57946e44 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/swim_import_local.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + isThirdParty=dict(type="bool"), + thirdPartyVendor=dict(type="str"), + thirdPartyImageFamily=dict(type="str"), + thirdPartyApplicationType=dict(type="str"), + filePath=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + is_third_party=params.get("isThirdParty"), + third_party_vendor=params.get("thirdPartyVendor"), + third_party_image_family=params.get("thirdPartyImageFamily"), + third_party_application_type=params.get("thirdPartyApplicationType"), + file_path=params.get("filePath"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function='import_local_software_image', + op_modifies=True, + params=self.get_object(self._task.args), + file_paths=[('file_path', 'file')], + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/swim_import_via_url.py b/ansible_collections/cisco/dnac/plugins/action/swim_import_via_url.py new file mode 100644 index 00000000..3cf0528a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/swim_import_via_url.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), + scheduleAt=dict(type="str"), + scheduleDesc=dict(type="str"), + scheduleOrigin=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + schedule_at=params.get("scheduleAt"), + schedule_desc=params.get("scheduleDesc"), + schedule_origin=params.get("scheduleOrigin"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function='import_software_image_via_url', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/swim_trigger_activation.py b/ansible_collections/cisco/dnac/plugins/action/swim_trigger_activation.py new file mode 100644 index 00000000..b223b878 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/swim_trigger_activation.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), + scheduleValidate=dict(type="bool"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + schedule_validate=params.get("scheduleValidate"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function='trigger_software_image_activation', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/swim_trigger_distribution.py b/ansible_collections/cisco/dnac/plugins/action/swim_trigger_distribution.py new file mode 100644 index 00000000..b3d75d66 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/swim_trigger_distribution.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="software_image_management_swim", + function='trigger_software_image_distribution', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/syslog_config_create.py b/ansible_collections/cisco/dnac/plugins/action/syslog_config_create.py new file mode 100644 index 00000000..ec91631b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/syslog_config_create.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + configId=dict(type="str"), + name=dict(type="str"), + description=dict(type="str"), + host=dict(type="str"), + protocol=dict(type="str"), + port=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + configId=params.get("configId"), + name=params.get("name"), + description=params.get("description"), + host=params.get("host"), + protocol=params.get("protocol"), + port=params.get("port"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='create_syslog_destination', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/syslog_config_update.py b/ansible_collections/cisco/dnac/plugins/action/syslog_config_update.py new file mode 100644 index 00000000..3529c324 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/syslog_config_update.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + configId=dict(type="str"), + name=dict(type="str"), + description=dict(type="str"), + host=dict(type="str"), + protocol=dict(type="str"), + port=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + configId=params.get("configId"), + name=params.get("name"), + description=params.get("description"), + host=params.get("host"), + protocol=params.get("protocol"), + port=params.get("port"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='update_syslog_destination', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/system_health_count_info.py b/ansible_collections/cisco/dnac/plugins/action/system_health_count_info.py new file mode 100644 index 00000000..58b74f6c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/system_health_count_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + domain=dict(type="str"), + subdomain=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + domain=params.get("domain"), + subdomain=params.get("subdomain"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="health_and_performance", + function='system_health_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/system_health_info.py b/ansible_collections/cisco/dnac/plugins/action/system_health_info.py new file mode 100644 index 00000000..28683d23 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/system_health_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + summary=dict(type="bool"), + domain=dict(type="str"), + subdomain=dict(type="str"), + limit=dict(type="int"), + offset=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + summary=params.get("summary"), + domain=params.get("domain"), + subdomain=params.get("subdomain"), + limit=params.get("limit"), + offset=params.get("offset"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="health_and_performance", + function='system_health', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/system_performance_historical_info.py b/ansible_collections/cisco/dnac/plugins/action/system_performance_historical_info.py new file mode 100644 index 00000000..287c7224 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/system_performance_historical_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + kpi=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + kpi=params.get("kpi"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="health_and_performance", + function='system_performance_historical', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/system_performance_info.py b/ansible_collections/cisco/dnac/plugins/action/system_performance_info.py new file mode 100644 index 00000000..b05406cb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/system_performance_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + kpi=dict(type="str"), + function=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + kpi=params.get("kpi"), + function=params.get("function"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="health_and_performance", + function='system_performance', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag.py b/ansible_collections/cisco/dnac/plugins/action/tag.py new file mode 100644 index 00000000..15596748 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag.py @@ -0,0 +1,283 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + systemTag=dict(type="bool"), + description=dict(type="str"), + dynamicRules=dict(type="list"), + name=dict(type="str"), + id=dict(type="str"), + instanceTenantId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id", "name"], True), + ("state", "absent", ["id", "name"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class Tag(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + systemTag=params.get("systemTag"), + description=params.get("description"), + dynamicRules=params.get("dynamicRules"), + name=params.get("name"), + id=params.get("id"), + instanceTenantId=params.get("instanceTenantId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['name'] = name or self.new_object.get('name') + new_object_params['additional_info_name_space'] = self.new_object.get('additionalInfo_nameSpace') or \ + self.new_object.get('additional_info_name_space') + new_object_params['additional_info_attributes'] = self.new_object.get('additionalInfo_attributes') or \ + self.new_object.get('additional_info_attributes') + new_object_params['level'] = self.new_object.get('level') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['size'] = self.new_object.get('size') + new_object_params['field'] = self.new_object.get('field') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + new_object_params['order'] = self.new_object.get('order') + new_object_params['system_tag'] = self.new_object.get('systemTag') or \ + self.new_object.get('system_tag') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['systemTag'] = self.new_object.get('systemTag') + new_object_params['description'] = self.new_object.get('description') + new_object_params['dynamicRules'] = self.new_object.get('dynamicRules') + new_object_params['name'] = self.new_object.get('name') + new_object_params['id'] = self.new_object.get('id') + new_object_params['instanceTenantId'] = self.new_object.get('instanceTenantId') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['systemTag'] = self.new_object.get('systemTag') + new_object_params['description'] = self.new_object.get('description') + new_object_params['dynamicRules'] = self.new_object.get('dynamicRules') + new_object_params['name'] = self.new_object.get('name') + new_object_params['id'] = self.new_object.get('id') + new_object_params['instanceTenantId'] = self.new_object.get('instanceTenantId') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="tag", + function="get_tag", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="tag", + function="get_tag_by_id", + params={"id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("systemTag", "systemTag"), + ("description", "description"), + ("dynamicRules", "dynamicRules"), + ("name", "name"), + ("id", "id"), + ("instanceTenantId", "instanceTenantId"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="tag", + function="create_tag", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="tag", + function="update_tag", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="tag", + function="delete_tag", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = Tag(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag_count_info.py b/ansible_collections/cisco/dnac/plugins/action/tag_count_info.py new file mode 100644 index 00000000..03827a43 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag_count_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + nameSpace=dict(type="str"), + attributeName=dict(type="str"), + level=dict(type="str"), + size=dict(type="str"), + systemTag=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + name_space=params.get("nameSpace"), + attribute_name=params.get("attributeName"), + level=params.get("level"), + size=params.get("size"), + system_tag=params.get("systemTag"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="tag", + function='get_tag_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag_info.py b/ansible_collections/cisco/dnac/plugins/action/tag_info.py new file mode 100644 index 00000000..4cd2cc1c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag_info.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + name=dict(type="str"), + additionalInfo_nameSpace=dict(type="str"), + additionalInfo_attributes=dict(type="str"), + level=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + size=dict(type="str"), + field=dict(type="str"), + sortBy=dict(type="str"), + order=dict(type="str"), + systemTag=dict(type="str"), + id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + name=params.get("name"), + additional_info_name_space=params.get("additionalInfo_nameSpace"), + additional_info_attributes=params.get("additionalInfo_attributes"), + level=params.get("level"), + offset=params.get("offset"), + limit=params.get("limit"), + size=params.get("size"), + field=params.get("field"), + sort_by=params.get("sortBy"), + order=params.get("order"), + system_tag=params.get("systemTag"), + id=params.get("id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="tag", + function='get_tag_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="tag", + function='get_tag', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag_member.py b/ansible_collections/cisco/dnac/plugins/action/tag_member.py new file mode 100644 index 00000000..e92fdf50 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag_member.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + payload=dict(type="dict"), + object=dict(type="str"), + id=dict(type="str"), + memberId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id", "memberId"], True), + ("state", "absent", ["id", "memberId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class TagMember(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + payload=params.get("payload"), + object=params.get("object"), + id=params.get("id"), + member_id=params.get("memberId"), + ) + + def create_params(self): + new_object_params = {} + new_object_params['payload'] = self.new_object.get('payload') + new_object_params['id'] = self.new_object.get('id') + new_object_params['object'] = self.new_object.get('object') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + new_object_params['member_id'] = self.new_object.get('member_id') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="tag", + function="get_tag_members_by_id", + params={"id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("member_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("memberId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(member_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("object", "object"), + ("id", "id"), + ("memberId", "member_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="tag", + function="add_members_to_the_tag", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("member_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("memberId") + if id_: + self.new_object.update(dict(member_id=id_)) + result = self.dnac.exec( + family="tag", + function="remove_tag_member", + params=self.delete_by_id_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = TagMember(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag_member_count_info.py b/ansible_collections/cisco/dnac/plugins/action/tag_member_count_info.py new file mode 100644 index 00000000..f3457c06 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag_member_count_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + memberType=dict(type="str"), + memberAssociationType=dict(type="str"), + level=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + member_type=params.get("memberType"), + member_association_type=params.get("memberAssociationType"), + level=params.get("level"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="tag", + function='get_tag_member_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag_member_info.py b/ansible_collections/cisco/dnac/plugins/action/tag_member_info.py new file mode 100644 index 00000000..e90f5551 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag_member_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + memberType=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + memberAssociationType=dict(type="str"), + level=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + member_type=params.get("memberType"), + offset=params.get("offset"), + limit=params.get("limit"), + member_association_type=params.get("memberAssociationType"), + level=params.get("level"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="tag", + function='get_tag_members_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag_member_type_info.py b/ansible_collections/cisco/dnac/plugins/action/tag_member_type_info.py new file mode 100644 index 00000000..69ff6ea3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag_member_type_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="tag", + function='get_tag_resource_types', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/tag_membership.py b/ansible_collections/cisco/dnac/plugins/action/tag_membership.py new file mode 100644 index 00000000..451501f9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/tag_membership.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + memberToTags=dict(type="list"), + memberType=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + memberToTags=params["memberToTags"][0] if params.get("memberToTags") and len(params["memberToTags"]) > 0 else None, + memberType=params.get("memberType"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="tag", + function='updates_tag_membership', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/task_count_info.py b/ansible_collections/cisco/dnac/plugins/action/task_count_info.py new file mode 100644 index 00000000..0c302112 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/task_count_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + startTime=dict(type="str"), + endTime=dict(type="str"), + data=dict(type="str"), + errorCode=dict(type="str"), + serviceType=dict(type="str"), + username=dict(type="str"), + progress=dict(type="str"), + isError=dict(type="str"), + failureReason=dict(type="str"), + parentId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + start_time=params.get("startTime"), + end_time=params.get("endTime"), + data=params.get("data"), + error_code=params.get("errorCode"), + service_type=params.get("serviceType"), + username=params.get("username"), + progress=params.get("progress"), + is_error=params.get("isError"), + failure_reason=params.get("failureReason"), + parent_id=params.get("parentId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="task", + function='get_task_count', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/task_info.py b/ansible_collections/cisco/dnac/plugins/action/task_info.py new file mode 100644 index 00000000..246342f7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/task_info.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + startTime=dict(type="str"), + endTime=dict(type="str"), + data=dict(type="str"), + errorCode=dict(type="str"), + serviceType=dict(type="str"), + username=dict(type="str"), + progress=dict(type="str"), + isError=dict(type="str"), + failureReason=dict(type="str"), + parentId=dict(type="str"), + offset=dict(type="str"), + limit=dict(type="str"), + sortBy=dict(type="str"), + order=dict(type="str"), + taskId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + start_time=params.get("startTime"), + end_time=params.get("endTime"), + data=params.get("data"), + error_code=params.get("errorCode"), + service_type=params.get("serviceType"), + username=params.get("username"), + progress=params.get("progress"), + is_error=params.get("isError"), + failure_reason=params.get("failureReason"), + parent_id=params.get("parentId"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + task_id=params.get("taskId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("taskId") + if id: + response = dnac.exec( + family="task", + function='get_task_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="task", + function='get_tasks', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/task_operation_info.py b/ansible_collections/cisco/dnac/plugins/action/task_operation_info.py new file mode 100644 index 00000000..cd17674c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/task_operation_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + operationId=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + operation_id=params.get("operationId"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("operationId") + if id: + response = dnac.exec( + family="task", + function='get_task_by_operationid', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/task_tree_info.py b/ansible_collections/cisco/dnac/plugins/action/task_tree_info.py new file mode 100644 index 00000000..872f8156 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/task_tree_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + taskId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + task_id=params.get("taskId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="task", + function='get_task_tree', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/template_preview.py b/ansible_collections/cisco/dnac/plugins/action/template_preview.py new file mode 100644 index 00000000..48198fe3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/template_preview.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + params=dict(type="dict"), + resourceParams=dict(type="list"), + templateId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + deviceId=params.get("deviceId"), + params=params.get("params"), + resourceParams=params.get("resourceParams"), + templateId=params.get("templateId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='preview_template', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/templates_details_info.py b/ansible_collections/cisco/dnac/plugins/action/templates_details_info.py new file mode 100644 index 00000000..9c8f0ab9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/templates_details_info.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + name=dict(type="str"), + projectId=dict(type="str"), + projectName=dict(type="str"), + softwareType=dict(type="str"), + softwareVersion=dict(type="str"), + productFamily=dict(type="str"), + productSeries=dict(type="str"), + productType=dict(type="str"), + filterConflictingTemplates=dict(type="bool"), + tags=dict(type="list"), + unCommitted=dict(type="bool"), + sortOrder=dict(type="str"), + allTemplateAttributes=dict(type="bool"), + includeVersionDetails=dict(type="bool"), + offset=dict(type="int"), + limit=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + name=params.get("name"), + project_id=params.get("projectId"), + project_name=params.get("projectName"), + software_type=params.get("softwareType"), + software_version=params.get("softwareVersion"), + product_family=params.get("productFamily"), + product_series=params.get("productSeries"), + product_type=params.get("productType"), + filter_conflicting_templates=params.get("filterConflictingTemplates"), + tags=params.get("tags"), + un_committed=params.get("unCommitted"), + sort_order=params.get("sortOrder"), + all_template_attributes=params.get("allTemplateAttributes"), + include_version_details=params.get("includeVersionDetails"), + offset=params.get("offset"), + limit=params.get("limit"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="configuration_templates", + function='get_templates_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/threat_detail.py b/ansible_collections/cisco/dnac/plugins/action/threat_detail.py new file mode 100644 index 00000000..5ecfa84f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/threat_detail.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="int"), + limit=dict(type="int"), + startTime=dict(type="int"), + endTime=dict(type="int"), + siteId=dict(type="list"), + threatLevel=dict(type="list"), + threatType=dict(type="list"), + isNewThreat=dict(type="bool"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + startTime=params.get("startTime"), + endTime=params.get("endTime"), + siteId=params.get("siteId"), + threatLevel=params.get("threatLevel"), + threatType=params.get("threatType"), + isNewThreat=params.get("isNewThreat"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='threat_details', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/threat_detail_count.py b/ansible_collections/cisco/dnac/plugins/action/threat_detail_count.py new file mode 100644 index 00000000..25fc96d2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/threat_detail_count.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + offset=dict(type="int"), + limit=dict(type="int"), + startTime=dict(type="int"), + endTime=dict(type="int"), + siteId=dict(type="list"), + threatLevel=dict(type="list"), + threatType=dict(type="list"), + isNewThreat=dict(type="bool"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + offset=params.get("offset"), + limit=params.get("limit"), + startTime=params.get("startTime"), + endTime=params.get("endTime"), + siteId=params.get("siteId"), + threatLevel=params.get("threatLevel"), + threatType=params.get("threatType"), + isNewThreat=params.get("isNewThreat"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='threat_detail_count', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/threat_summary.py b/ansible_collections/cisco/dnac/plugins/action/threat_summary.py new file mode 100644 index 00000000..898abe1a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/threat_summary.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase, Display +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + startTime=dict(type="int"), + endTime=dict(type="int"), + siteId=dict(type="list"), + threatLevel=dict(type="list"), + threatType=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + startTime=params.get("startTime"), + endTime=params.get("endTime"), + siteId=params.get("siteId"), + threatLevel=params.get("threatLevel"), + threatType=params.get("threatType"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + Display().warning("This module is currently unmaintained " + "and will be removed in future releases.") + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='threat_summary', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/topology_layer_2_info.py b/ansible_collections/cisco/dnac/plugins/action/topology_layer_2_info.py new file mode 100644 index 00000000..2697ad3b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/topology_layer_2_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + vlanID=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + vlan_id=params.get("vlanID"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("vlanID") + if id: + response = dnac.exec( + family="topology", + function='get_topology_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/topology_layer_3_info.py b/ansible_collections/cisco/dnac/plugins/action/topology_layer_3_info.py new file mode 100644 index 00000000..5b295903 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/topology_layer_3_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + topologyType=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + topology_type=params.get("topologyType"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("topologyType") + if id: + response = dnac.exec( + family="topology", + function='get_l3_topology_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/topology_network_health_info.py b/ansible_collections/cisco/dnac/plugins/action/topology_network_health_info.py new file mode 100644 index 00000000..d8a8e75d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/topology_network_health_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + timestamp=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + timestamp=params.get("timestamp"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="topology", + function='get_overall_network_health', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/topology_physical_info.py b/ansible_collections/cisco/dnac/plugins/action/topology_physical_info.py new file mode 100644 index 00000000..d2bf38e7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/topology_physical_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + nodeType=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + node_type=params.get("nodeType"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="topology", + function='get_physical_topology', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/topology_site_info.py b/ansible_collections/cisco/dnac/plugins/action/topology_site_info.py new file mode 100644 index 00000000..4f903dbc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/topology_site_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="topology", + function='get_site_topology', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/topology_vlan_details_info.py b/ansible_collections/cisco/dnac/plugins/action/topology_vlan_details_info.py new file mode 100644 index 00000000..f613a341 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/topology_vlan_details_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="topology", + function='get_vlan_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/transit_peer_network.py b/ansible_collections/cisco/dnac/plugins/action/transit_peer_network.py new file mode 100644 index 00000000..5c9777d9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/transit_peer_network.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, + AnsibleSDAException, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + transitPeerNetworkName=dict(type="str"), + transitPeerNetworkType=dict(type="str"), + ipTransitSettings=dict(type="dict"), + sdaTransitSettings=dict(type="dict"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class TransitPeerNetwork(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + transitPeerNetworkName=params.get("transitPeerNetworkName"), + transitPeerNetworkType=params.get("transitPeerNetworkType"), + ipTransitSettings=params.get("ipTransitSettings"), + sdaTransitSettings=params.get("sdaTransitSettings"), + transit_peer_network_name=params.get("transitPeerNetworkName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['transit_peer_network_name'] = self.new_object.get('transitPeerNetworkName') or \ + self.new_object.get('transit_peer_network_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['transitPeerNetworkName'] = self.new_object.get('transitPeerNetworkName') + new_object_params['transitPeerNetworkType'] = self.new_object.get('transitPeerNetworkType') + new_object_params['ipTransitSettings'] = self.new_object.get('ipTransitSettings') + new_object_params['sdaTransitSettings'] = self.new_object.get('sdaTransitSettings') + return new_object_params + + def delete_all_params(self): + new_object_params = {} + new_object_params['transit_peer_network_name'] = self.new_object.get('transit_peer_network_name') + return new_object_params + + def get_object_by_name(self, name, is_absent=False): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="sda", + function="get_transit_peer_network_info", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if isinstance(items, dict) and items.get("status") == "failed": + if is_absent: + raise AnsibleSDAException(response=items) + result = None + return result + result = get_dict_result(items, 'name', name) + except Exception: + if is_absent: + raise + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self, is_absent=False): + name = self.new_object.get("transitPeerNetworkName") + prev_obj = self.get_object_by_name(name, is_absent=is_absent) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) and prev_obj.get("status") != "failed" + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("transitPeerNetworkName", "transitPeerNetworkName"), + ("transitPeerNetworkType", "transitPeerNetworkType"), + ("ipTransitSettings", "ipTransitSettings"), + ("sdaTransitSettings", "sdaTransitSettings"), + ("transitPeerNetworkName", "transit_peer_network_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="sda", + function="add_transit_peer_network", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="sda", + function="delete_transit_peer_network", + params=self.delete_all_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = TransitPeerNetwork(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists(is_absent=True) + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/transit_peer_network_info.py b/ansible_collections/cisco/dnac/plugins/action/transit_peer_network_info.py new file mode 100644 index 00000000..a0856733 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/transit_peer_network_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + transitPeerNetworkName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + transit_peer_network_name=params.get("transitPeerNetworkName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="sda", + function='get_transit_peer_network_info', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/user_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/action/user_enrichment_details_info.py new file mode 100644 index 00000000..da4c16cd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/user_enrichment_details_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="users", + function='get_user_enrichment_details', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface.py b/ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface.py new file mode 100644 index 00000000..51f458f5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface.py @@ -0,0 +1,229 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + interfaceName=dict(type="str"), + vlanId=dict(type="int"), + headers=dict(type="dict"), +)) + +required_if = [ + ("state", "present", ["interfaceName"], True), + ("state", "absent", ["interfaceName"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class WirelessDynamicInterface(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + interfaceName=params.get("interfaceName"), + vlanId=params.get("vlanId"), + headers=params.get("headers"), + interface_name=params.get("interfaceName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['interface_name'] = self.new_object.get('interface_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['interfaceName'] = self.new_object.get('interfaceName') + new_object_params['vlanId'] = self.new_object.get('vlanId') + return new_object_params + + def delete_by_name_params(self): + new_object_params = {} + new_object_params['interface_name'] = self.new_object.get('interface_name') + new_object_params['headers'] = self.new_object.get('headers') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="wireless", + function="get_dynamic_interface", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'interfaceName', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("interface_name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if id_exists: + _name = prev_obj.get("name") + _name = _name or prev_obj.get("interfaceName") + if _name: + self.new_object.update(dict(interface_name=_name)) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("interfaceName", "interfaceName"), + ("vlanId", "vlanId"), + ("interfaceName", "interface_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="wireless", + function="create_update_dynamic_interface", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("interface_name") + result = None + if not name: + prev_obj_id = self.get_object_by_id(id) + name_ = None + if prev_obj_id: + name_ = prev_obj_id.get("name") + name_ = name_ or prev_obj_id.get("interfaceName") + if name_: + self.new_object.update(dict(interface_name=name_)) + result = self.dnac.exec( + family="wireless", + function="delete_dynamic_interface", + params=self.delete_by_name_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = WirelessDynamicInterface(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface_info.py b/ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface_info.py new file mode 100644 index 00000000..561b620e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_dynamic_interface_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + interface_name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + interface_name=params.get("interface_name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='get_dynamic_interface', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid.py b/ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid.py new file mode 100644 index 00000000..7e2d129c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid.py @@ -0,0 +1,347 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + securityLevel=dict(type="str"), + passphrase=dict(type="str"), + enableFastLane=dict(type="bool"), + enableMACFiltering=dict(type="bool"), + trafficType=dict(type="str"), + radioPolicy=dict(type="str"), + enableBroadcastSSID=dict(type="bool"), + fastTransition=dict(type="str"), + enableSessionTimeOut=dict(type="bool"), + sessionTimeOut=dict(type="int"), + enableClientExclusion=dict(type="bool"), + clientExclusionTimeout=dict(type="int"), + enableBasicServiceSetMaxIdle=dict(type="bool"), + basicServiceSetClientIdleTimeout=dict(type="int"), + enableDirectedMulticastService=dict(type="bool"), + enableNeighborList=dict(type="bool"), + mfpClientProtection=dict(type="str"), + nasOptions=dict(type="list"), + ssidName=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "ssidName"], True), + ("state", "absent", ["name", "ssidName"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class WirelessEnterpriseSsid(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + name=params.get("name"), + securityLevel=params.get("securityLevel"), + passphrase=params.get("passphrase"), + enableFastLane=params.get("enableFastLane"), + enableMACFiltering=params.get("enableMACFiltering"), + trafficType=params.get("trafficType"), + radioPolicy=params.get("radioPolicy"), + enableBroadcastSSID=params.get("enableBroadcastSSID"), + fastTransition=params.get("fastTransition"), + enableSessionTimeOut=params.get("enableSessionTimeOut"), + sessionTimeOut=params.get("sessionTimeOut"), + enableClientExclusion=params.get("enableClientExclusion"), + clientExclusionTimeout=params.get("clientExclusionTimeout"), + enableBasicServiceSetMaxIdle=params.get("enableBasicServiceSetMaxIdle"), + basicServiceSetClientIdleTimeout=params.get("basicServiceSetClientIdleTimeout"), + enableDirectedMulticastService=params.get("enableDirectedMulticastService"), + enableNeighborList=params.get("enableNeighborList"), + mfpClientProtection=params.get("mfpClientProtection"), + nasOptions=params.get("nasOptions"), + ssid_name=params.get("ssidName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['ssid_name'] = self.new_object.get('ssidName') or \ + self.new_object.get('ssid_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['securityLevel'] = self.new_object.get('securityLevel') + new_object_params['passphrase'] = self.new_object.get('passphrase') + new_object_params['enableFastLane'] = self.new_object.get('enableFastLane') + new_object_params['enableMACFiltering'] = self.new_object.get('enableMACFiltering') + new_object_params['trafficType'] = self.new_object.get('trafficType') + new_object_params['radioPolicy'] = self.new_object.get('radioPolicy') + new_object_params['enableBroadcastSSID'] = self.new_object.get('enableBroadcastSSID') + new_object_params['fastTransition'] = self.new_object.get('fastTransition') + new_object_params['enableSessionTimeOut'] = self.new_object.get('enableSessionTimeOut') + new_object_params['sessionTimeOut'] = self.new_object.get('sessionTimeOut') + new_object_params['enableClientExclusion'] = self.new_object.get('enableClientExclusion') + new_object_params['clientExclusionTimeout'] = self.new_object.get('clientExclusionTimeout') + new_object_params['enableBasicServiceSetMaxIdle'] = self.new_object.get('enableBasicServiceSetMaxIdle') + new_object_params['basicServiceSetClientIdleTimeout'] = self.new_object.get('basicServiceSetClientIdleTimeout') + new_object_params['enableDirectedMulticastService'] = self.new_object.get('enableDirectedMulticastService') + new_object_params['enableNeighborList'] = self.new_object.get('enableNeighborList') + new_object_params['mfpClientProtection'] = self.new_object.get('mfpClientProtection') + new_object_params['nasOptions'] = self.new_object.get('nasOptions') + return new_object_params + + def delete_by_name_params(self): + new_object_params = {} + new_object_params['ssid_name'] = self.new_object.get('ssid_name') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['securityLevel'] = self.new_object.get('securityLevel') + new_object_params['passphrase'] = self.new_object.get('passphrase') + new_object_params['enableFastLane'] = self.new_object.get('enableFastLane') + new_object_params['enableMACFiltering'] = self.new_object.get('enableMACFiltering') + new_object_params['trafficType'] = self.new_object.get('trafficType') + new_object_params['radioPolicy'] = self.new_object.get('radioPolicy') + new_object_params['enableBroadcastSSID'] = self.new_object.get('enableBroadcastSSID') + new_object_params['fastTransition'] = self.new_object.get('fastTransition') + new_object_params['enableSessionTimeOut'] = self.new_object.get('enableSessionTimeOut') + new_object_params['sessionTimeOut'] = self.new_object.get('sessionTimeOut') + new_object_params['enableClientExclusion'] = self.new_object.get('enableClientExclusion') + new_object_params['clientExclusionTimeout'] = self.new_object.get('clientExclusionTimeout') + new_object_params['enableBasicServiceSetMaxIdle'] = self.new_object.get('enableBasicServiceSetMaxIdle') + new_object_params['basicServiceSetClientIdleTimeout'] = self.new_object.get('basicServiceSetClientIdleTimeout') + new_object_params['enableDirectedMulticastService'] = self.new_object.get('enableDirectedMulticastService') + new_object_params['enableNeighborList'] = self.new_object.get('enableNeighborList') + new_object_params['mfpClientProtection'] = self.new_object.get('mfpClientProtection') + new_object_params['nasOptions'] = self.new_object.get('nasOptions') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="wireless", + function="get_enterprise_ssid", + params=self.get_all_params(name=name), + ) + if isinstance(items, list): + for item in items: + if isinstance(item, dict): + n_item = None + if 'response' in item: + n_item = item.get('response') + if 'ssidDetails' in item: + n_item = item.get('ssidDetails') + n_item = get_dict_result(n_item, 'name', name) + if n_item is not None: + return n_item + return result + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + if 'ssidDetails' in items: + items = items.get('ssidDetails') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("ssid_name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if id_exists: + _name = prev_obj.get("name") + _name = _name or prev_obj.get("ssidName") + if _name: + self.new_object.update(dict(ssid_name=_name)) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("securityLevel", "securityLevel"), + ("passphrase", "passphrase"), + ("enableFastLane", "enableFastLane"), + ("enableMACFiltering", "enableMACFiltering"), + ("trafficType", "trafficType"), + ("radioPolicy", "radioPolicy"), + ("enableBroadcastSSID", "enableBroadcastSSID"), + ("fastTransition", "fastTransition"), + ("enableSessionTimeOut", "enableSessionTimeOut"), + ("sessionTimeOut", "sessionTimeOut"), + ("enableClientExclusion", "enableClientExclusion"), + ("clientExclusionTimeout", "clientExclusionTimeout"), + ("enableBasicServiceSetMaxIdle", "enableBasicServiceSetMaxIdle"), + ("basicServiceSetClientIdleTimeout", "basicServiceSetClientIdleTimeout"), + ("enableDirectedMulticastService", "enableDirectedMulticastService"), + ("enableNeighborList", "enableNeighborList"), + ("mfpClientProtection", "mfpClientProtection"), + ("nasOptions", "nasOptions"), + ("ssidName", "ssid_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="wireless", + function="create_enterprise_ssid", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="wireless", + function="update_enterprise_ssid", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("ssid_name") + result = None + if not name: + prev_obj_id = self.get_object_by_id(id) + name_ = None + if prev_obj_id: + name_ = prev_obj_id.get("name") + name_ = name_ or prev_obj_id.get("ssidName") + if name_: + self.new_object.update(dict(ssid_name=name_)) + result = self.dnac.exec( + family="wireless", + function="delete_enterprise_ssid", + params=self.delete_by_name_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = WirelessEnterpriseSsid(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid_info.py b/ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid_info.py new file mode 100644 index 00000000..37048d0a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_enterprise_ssid_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ssidName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + ssid_name=params.get("ssidName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='get_enterprise_ssid', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_profile.py b/ansible_collections/cisco/dnac/plugins/action/wireless_profile.py new file mode 100644 index 00000000..f5d9813c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_profile.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + profileDetails=dict(type="dict"), + wirelessProfileName=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["profileDetails"], True), + ("state", "absent", ["wirelessProfileName"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class WirelessProfile(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + profileDetails=params.get("profileDetails"), + wireless_profile_name=params.get("wirelessProfileName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['profile_name'] = name or self.new_object.get('wireless_profile_name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['profileDetails'] = self.new_object.get('profileDetails') + return new_object_params + + def delete_by_name_params(self): + new_object_params = {} + new_object_params['wireless_profile_name'] = self.new_object.get('wireless_profile_name') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['profileDetails'] = self.new_object.get('profileDetails') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="wireless", + function="get_wireless_profile", + params=self.get_all_params(name=name), + ) + if isinstance(items, list): + for i in items: + if isinstance(i, dict) and 'profileDetails' in i: + tmp = i.get('profileDetails') + if isinstance(tmp, dict) and tmp.get('name') == name: + result = dict(i) + break + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("wireless_profile_name") + profile_details = self.new_object.get("profileDetails") + if profile_details and profile_details.get("name"): + name = name or profile_details.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if id_exists: + _name = prev_obj.get("name") + _name = _name or prev_obj.get("wirelessProfileName") + if _name: + self.new_object.update(dict(wireless_profile_name=_name)) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("profileDetails", "profileDetails"), + ("wirelessProfileName", "wireless_profile_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="wireless", + function="create_wireless_profile", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="wireless", + function="update_wireless_profile", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("wireless_profile_name") + result = None + if not name: + prev_obj_id = self.get_object_by_id(id) + name_ = None + if prev_obj_id: + name_ = prev_obj_id.get("name") + name_ = name_ or prev_obj_id.get("wirelessProfileName") + if name_: + self.new_object.update(dict(wireless_profile_name=name_)) + result = self.dnac.exec( + family="wireless", + function="delete_wireless_profile", + params=self.delete_by_name_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = WirelessProfile(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_profile_info.py b/ansible_collections/cisco/dnac/plugins/action/wireless_profile_info.py new file mode 100644 index 00000000..24027bd6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_profile_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + profileName=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + profile_name=params.get("profileName"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='get_wireless_profile', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_provision_access_point.py b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_access_point.py new file mode 100644 index 00000000..8cbce8d3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_access_point.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='ap_provision', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_create.py b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_create.py new file mode 100644 index 00000000..95d3e443 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_create.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='provision', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_update.py b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_update.py new file mode 100644 index 00000000..c62d176e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_device_update.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='provision_update', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_create_provision.py b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_create_provision.py new file mode 100644 index 00000000..b1787ff6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_create_provision.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + managedAPLocations=dict(type="list"), + ssidDetails=dict(type="dict"), + ssidType=dict(type="str"), + enableFabric=dict(type="bool"), + flexConnect=dict(type="dict"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + managedAPLocations=params.get("managedAPLocations"), + ssidDetails=params.get("ssidDetails"), + ssidType=params.get("ssidType"), + enableFabric=params.get("enableFabric"), + flexConnect=params.get("flexConnect"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='create_and_provision_ssid', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_delete_reprovision.py b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_delete_reprovision.py new file mode 100644 index 00000000..6480f992 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_provision_ssid_delete_reprovision.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + ssidName=dict(type="str"), + managedAPLocations=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + ssid_name=params.get("ssidName"), + managed_aplocations=params.get("managedAPLocations"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function="delete_ssid_and_provision_it_to_devices", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_psk_override.py b/ansible_collections/cisco/dnac/plugins/action/wireless_psk_override.py new file mode 100644 index 00000000..6fe372d5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_psk_override.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + payload=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + payload=params.get("payload"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='psk_override', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile.py b/ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile.py new file mode 100644 index 00000000..07ac522d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile.py @@ -0,0 +1,263 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + defaultRfProfile=dict(type="bool"), + enableRadioTypeA=dict(type="bool"), + enableRadioTypeB=dict(type="bool"), + channelWidth=dict(type="str"), + enableCustom=dict(type="bool"), + enableBrownField=dict(type="bool"), + radioTypeAProperties=dict(type="dict"), + radioTypeBProperties=dict(type="dict"), + radioTypeCProperties=dict(type="dict"), + enableRadioTypeC=dict(type="bool"), + rfProfileName=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name", "rfProfileName"], True), + ("state", "absent", ["name", "rfProfileName"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class WirelessRfProfile(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + name=params.get("name"), + defaultRfProfile=params.get("defaultRfProfile"), + enableRadioTypeA=params.get("enableRadioTypeA"), + enableRadioTypeB=params.get("enableRadioTypeB"), + channelWidth=params.get("channelWidth"), + enableCustom=params.get("enableCustom"), + enableBrownField=params.get("enableBrownField"), + radioTypeAProperties=params.get("radioTypeAProperties"), + radioTypeBProperties=params.get("radioTypeBProperties"), + radioTypeCProperties=params.get("radioTypeCProperties"), + enableRadioTypeC=params.get("enableRadioTypeC"), + rf_profile_name=params.get("rfProfileName"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['rf_profile_name'] = self.new_object.get('rf_profile_name') or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('rf_profile_name') or self.new_object.get('name') + new_object_params['defaultRfProfile'] = self.new_object.get('defaultRfProfile') + new_object_params['enableRadioTypeA'] = self.new_object.get('enableRadioTypeA') + new_object_params['enableRadioTypeB'] = self.new_object.get('enableRadioTypeB') + new_object_params['channelWidth'] = self.new_object.get('channelWidth') + new_object_params['enableCustom'] = self.new_object.get('enableCustom') + new_object_params['enableBrownField'] = self.new_object.get('enableBrownField') + new_object_params['radioTypeAProperties'] = self.new_object.get('radioTypeAProperties') + new_object_params['radioTypeBProperties'] = self.new_object.get('radioTypeBProperties') + new_object_params['radioTypeCProperties'] = self.new_object.get('radioTypeCProperties') + new_object_params['enableRadioTypeC'] = self.new_object.get('enableRadioTypeC') + return new_object_params + + def delete_by_name_params(self): + new_object_params = {} + new_object_params['rf_profile_name'] = self.new_object.get('rf_profile_name') or self.new_object.get('name') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="wireless", + function="retrieve_rf_profiles", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("rf_profile_name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if id_exists: + _name = prev_obj.get("name") + _name = _name or prev_obj.get("rfProfileName") + if _name: + self.new_object.update(dict(rf_profile_name=_name)) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("defaultRfProfile", "defaultRfProfile"), + ("enableRadioTypeA", "enableRadioTypeA"), + ("enableRadioTypeB", "enableRadioTypeB"), + ("channelWidth", "channelWidth"), + ("enableCustom", "enableCustom"), + ("enableBrownField", "enableBrownField"), + ("radioTypeAProperties", "radioTypeAProperties"), + ("radioTypeBProperties", "radioTypeBProperties"), + ("radioTypeCProperties", "radioTypeCProperties"), + ("enableRadioTypeC", "enableRadioTypeC"), + ("rfProfileName", "rf_profile_name"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="wireless", + function="create_or_update_rf_profile", + params=self.create_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + name = name or self.new_object.get("rf_profile_name") + result = None + if not name: + prev_obj_id = self.get_object_by_id(id) + name_ = None + if prev_obj_id: + name_ = prev_obj_id.get("name") + name_ = name_ or prev_obj_id.get("rfProfileName") + if name_: + self.new_object.update(dict(rf_profile_name=name_)) + result = self.dnac.exec( + family="wireless", + function="delete_rf_profiles", + params=self.delete_by_name_params(), + ) + return result + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = WirelessRfProfile(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = prev_obj + dnac.object_present_and_different() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile_info.py b/ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile_info.py new file mode 100644 index 00000000..ec207fa4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_rf_profile_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + rf_profile_name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + rf_profile_name=params.get("rf_profile_name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='retrieve_rf_profiles', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/action/wireless_sensor_test_results_info.py b/ansible_collections/cisco/dnac/plugins/action/wireless_sensor_test_results_info.py new file mode 100644 index 00000000..5948fad3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/action/wireless_sensor_test_results_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + startTime=dict(type="int"), + endTime=dict(type="int"), + testFailureBy=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ActionModule(ActionBase): + def __init__(self, *args, **kwargs): + if not ANSIBLE_UTILS_IS_INSTALLED: + raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + start_time=params.get("startTime"), + end_time=params.get("endTime"), + test_failure_by=params.get("testFailureBy"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='sensor_test_results', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/ansible_collections/cisco/dnac/plugins/doc_fragments/__init__.py b/ansible_collections/cisco/dnac/plugins/doc_fragments/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ansible_collections/cisco/dnac/plugins/doc_fragments/intent_params.py b/ansible_collections/cisco/dnac/plugins/doc_fragments/intent_params.py new file mode 100644 index 00000000..fe95d684 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/doc_fragments/intent_params.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +class ModuleDocFragment(object): + + # Standard files documentation fragment + DOCUMENTATION = r''' +options: + dnac_host: + description: + - The Cisco DNA Center hostname. + type: str + required: true + dnac_port: + description: + - The Cisco DNA Center port. + type: str + default: '443' + dnac_username: + description: + - The Cisco DNA Center username to authenticate. + type: str + default: admin + aliases: [ user ] + dnac_password: + description: + - The Cisco DNA Center password to authenticate. + type: str + dnac_verify: + description: + - Flag to enable or disable SSL certificate verification. + type: bool + default: true + dnac_version: + description: + - Informs the SDK which version of Cisco DNA Center to use. + type: str + default: 2.2.3.3 + dnac_debug: + description: + - Flag for Cisco DNA Center SDK to enable debugging. + type: bool + default: false + dnac_log: + description: + - Flag for logging playbook execution details. + If set to true the log file will be created at the location of the execution with the name dnac.log + type: bool + default: false + validate_response_schema: + description: + - Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema. + type: bool + default: true +notes: + - "Does not support C(check_mode)" + - "The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco DNAC SDK" + - "The parameters starting with dnac_ are used by the Cisco DNAC Python SDK to establish the connection" +''' diff --git a/ansible_collections/cisco/dnac/plugins/doc_fragments/module.py b/ansible_collections/cisco/dnac/plugins/doc_fragments/module.py new file mode 100644 index 00000000..e1199f1d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/doc_fragments/module.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + + +class ModuleDocFragment(object): + + # Standard files documentation fragment + DOCUMENTATION = r''' +options: + dnac_host: + description: + - The Cisco DNA Center hostname. + type: str + required: true + dnac_port: + description: + - The Cisco DNA Center port. + type: int + default: 443 + dnac_username: + description: + - The Cisco DNA Center username to authenticate. + type: str + default: admin + aliases: [ user ] + dnac_password: + description: + - The Cisco DNA Center password to authenticate. + type: str + dnac_verify: + description: + - Flag to enable or disable SSL certificate verification. + type: bool + default: true + dnac_version: + description: + - Informs the SDK which version of Cisco DNA Center to use. + type: str + default: 2.3.3.0 + dnac_debug: + description: + - Flag for Cisco DNA Center SDK to enable debugging. + type: bool + default: false + validate_response_schema: + description: + - Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema. + type: bool + default: true +notes: + - "Does not support C(check_mode)" + - "The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco DNAC SDK" + - "The parameters starting with dnac_ are used by the Cisco DNAC Python SDK to establish the connection" +''' diff --git a/ansible_collections/cisco/dnac/plugins/doc_fragments/module_info.py b/ansible_collections/cisco/dnac/plugins/doc_fragments/module_info.py new file mode 100644 index 00000000..3e8c533d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/doc_fragments/module_info.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + + +class ModuleDocFragment(object): + + # Standard files documentation fragment + DOCUMENTATION = r''' +options: + dnac_host: + description: + - The Cisco DNA Center hostname. + type: str + required: true + dnac_port: + description: + - The Cisco DNA Center port. + type: int + default: 443 + dnac_username: + description: + - The Cisco DNA Center username to authenticate. + type: str + default: admin + aliases: [ user ] + dnac_password: + description: + - The Cisco DNA Center password to authenticate. + type: str + dnac_verify: + description: + - Flag to enable or disable SSL certificate verification. + type: bool + default: true + dnac_version: + description: + - Informs the SDK which version of Cisco DNA Center to use. + type: str + default: 2.3.3.0 + dnac_debug: + description: + - Flag for Cisco DNA Center SDK to enable debugging. + type: bool + default: false + validate_response_schema: + description: + - Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema. + type: bool + default: true +notes: + - "Supports C(check_mode)" + - "The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco DNAC SDK" + - "The parameters starting with dnac_ are used by the Cisco DNAC Python SDK to establish the connection" +''' diff --git a/ansible_collections/cisco/dnac/plugins/module_utils/__init__.py b/ansible_collections/cisco/dnac/plugins/module_utils/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ansible_collections/cisco/dnac/plugins/module_utils/dnac.py b/ansible_collections/cisco/dnac/plugins/module_utils/dnac.py new file mode 100644 index 00000000..132d5cb7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/module_utils/dnac.py @@ -0,0 +1,319 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +try: + from dnacentersdk import api, exceptions +except ImportError: + DNAC_SDK_IS_INSTALLED = False +else: + DNAC_SDK_IS_INSTALLED = True +from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils._text import to_native +from ansible.module_utils.common import validation +try: + import logging +except ImportError: + LOGGING_IN_STANDARD = False +else: + LOGGING_IN_STANDARD = True +import os.path +import datetime +import inspect + + +def log(msg): + with open('dnac.log', 'a') as of: + callerframerecord = inspect.stack()[1] + frame = callerframerecord[0] + info = inspect.getframeinfo(frame) + d = datetime.datetime.now().replace(microsecond=0).isoformat() + of.write("---- %s ---- %s@%s ---- %s \n" % (d, info.lineno, info.function, msg)) + + +def is_list_complex(x): + return isinstance(x[0], dict) or isinstance(x[0], list) + + +def has_diff_elem(ls1, ls2): + return any((elem not in ls1 for elem in ls2)) + + +def compare_list(list1, list2): + len_list1 = len(list1) + len_list2 = len(list2) + if len_list1 != len_list2: + return False + + if len_list1 == 0: + return True + + attempt_std_cmp = list1 == list2 + if attempt_std_cmp: + return True + + if not is_list_complex(list1) and not is_list_complex(list2): + return set(list1) == set(list2) + + # Compare normally if it exceeds expected size * 2 (len_list1==len_list2) + MAX_SIZE_CMP = 100 + # Fail fast if elem not in list, thanks to any and generators + if len_list1 > MAX_SIZE_CMP: + return attempt_std_cmp + else: + # not changes 'has diff elem' to list1 != list2 ':lists are not equal' + return not (has_diff_elem(list1, list2)) or not (has_diff_elem(list2, list1)) + + +def fn_comp_key(k, dict1, dict2): + return dnac_compare_equality(dict1.get(k), dict2.get(k)) + + +def dnac_compare_equality(current_value, requested_value): + # print("dnac_compare_equality", current_value, requested_value) + if requested_value is None: + return True + if current_value is None: + return True + if isinstance(current_value, dict) and isinstance(requested_value, dict): + all_dict_params = list(current_value.keys()) + list(requested_value.keys()) + return not any((not fn_comp_key(param, current_value, requested_value) for param in all_dict_params)) + elif isinstance(current_value, list) and isinstance(requested_value, list): + return compare_list(current_value, requested_value) + else: + return current_value == requested_value + + +def simple_cmp(obj1, obj2): + return obj1 == obj2 + + +def get_dict_result(result, key, value, cmp_fn=simple_cmp): + if isinstance(result, list): + if len(result) == 1: + if isinstance(result[0], dict): + result = result[0] + if result.get(key) is not None and result.get(key) != value: + result = None + else: + result = None + else: + for item in result: + if isinstance(item, dict) and (item.get(key) is None or item.get(key) == value): + result = item + return result + result = None + elif not isinstance(result, dict): + result = None + elif result.get(key) is not None and result.get(key) != value: + result = None + return result + + +def dnac_argument_spec(): + argument_spec = dict( + dnac_host=dict(type="str", required=True), + dnac_port=dict(type="int", required=False, default=443), + dnac_username=dict(type="str", default="admin", aliases=["user"]), + dnac_password=dict(type="str", no_log=True), + dnac_verify=dict(type="bool", default=True), + dnac_version=dict(type="str", default="2.2.3.3"), + dnac_debug=dict(type="bool", default=False), + validate_response_schema=dict(type="bool", default=True), + ) + return argument_spec + + +def validate_list_of_dicts(param_list, spec, module=None): + """Validate/Normalize playbook params. Will raise when invalid parameters found. + param_list: a playbook parameter list of dicts + spec: an argument spec dict + e.g. spec = dict(ip=dict(required=True, type='bool'), + foo=dict(type='str', default='bar')) + return: list of normalized input data + """ + v = validation + normalized = [] + invalid_params = [] + for list_entry in param_list: + valid_params_dict = {} + for param in spec: + item = list_entry.get(param) + log(str(item)) + if item is None: + if spec[param].get("required"): + invalid_params.append( + "{0} : Required parameter not found".format(param) + ) + else: + item = spec[param].get("default") + else: + type = spec[param].get("type") + if type == "str": + item = v.check_type_str(item) + if spec[param].get("length_max"): + if 1 <= len(item) <= spec[param].get("length_max"): + pass + else: + invalid_params.append( + "{0}:{1} : The string exceeds the allowed " + "range of max {2} char".format( + param, item, spec[param].get("length_max") + ) + ) + elif type == "int": + item = v.check_type_int(item) + min_value = 1 + if spec[param].get("range_min") is not None: + min_value = spec[param].get("range_min") + if spec[param].get("range_max"): + if min_value <= item <= spec[param].get("range_max"): + pass + else: + invalid_params.append( + "{0}:{1} : The item exceeds the allowed " + "range of max {2}".format( + param, item, spec[param].get("range_max") + ) + ) + elif type == "bool": + item = v.check_type_bool(item) + elif type == "list": + item = v.check_type_list(item) + elif type == "dict": + item = v.check_type_dict(item) + + choice = spec[param].get("choices") + if choice: + if item not in choice: + invalid_params.append( + "{0} : Invalid choice provided".format(item) + ) + + no_log = spec[param].get("no_log") + if no_log: + if module is not None: + module.no_log_values.add(item) + else: + msg = "\n\n'{0}' is a no_log parameter".format(param) + msg += "\nAnsible module object must be passed to this " + msg += "\nfunction to ensure it is not logged\n\n" + raise Exception(msg) + + valid_params_dict[param] = item + normalized.append(valid_params_dict) + + return normalized, invalid_params + + +class DNACSDK(object): + def __init__(self, params): + self.result = dict(changed=False, result="") + self.validate_response_schema = params.get("validate_response_schema") + if DNAC_SDK_IS_INSTALLED: + self.api = api.DNACenterAPI( + username=params.get("dnac_username"), + password=params.get("dnac_password"), + base_url="https://{dnac_host}:{dnac_port}".format( + dnac_host=params.get("dnac_host"), dnac_port=params.get("dnac_port") + ), + version=params.get("dnac_version"), + verify=params.get("dnac_verify"), + debug=params.get("dnac_debug"), + ) + if params.get("dnac_debug") and LOGGING_IN_STANDARD: + logging.getLogger('dnacentersdk').addHandler(logging.StreamHandler()) + else: + self.fail_json(msg="DNA Center Python SDK is not installed. Execute 'pip install dnacentersdk'") + + def changed(self): + self.result["changed"] = True + + def object_created(self): + self.changed() + self.result["result"] = "Object created" + + def object_updated(self): + self.changed() + self.result["result"] = "Object updated" + + def object_deleted(self): + self.changed() + self.result["result"] = "Object deleted" + + def object_already_absent(self): + self.result["result"] = "Object already absent" + + def object_already_present(self): + self.result["result"] = "Object already present" + + def object_present_and_different(self): + self.result["result"] = "Object already present, but it has different values to the requested" + + def object_modify_result(self, changed=None, result=None): + if result is not None: + self.result["result"] = result + if changed: + self.changed() + + def is_file(self, file_path): + return os.path.isfile(file_path) + + def extract_file_name(self, file_path): + return os.path.basename(file_path) + + def exec(self, family, function, params=None, op_modifies=False, **kwargs): + try: + family = getattr(self.api, family) + func = getattr(family, function) + except Exception as e: + self.fail_json(msg=e) + + try: + if params: + file_paths_params = kwargs.get('file_paths', []) + # This substitution is for the import file operation + if file_paths_params and isinstance(file_paths_params, list): + multipart_fields = {} + for (key, value) in file_paths_params: + if isinstance(params.get(key), str) and self.is_file(params[key]): + file_name = self.extract_file_name(params[key]) + file_path = params[key] + multipart_fields[value] = (file_name, open(file_path, 'rb')) + + params.setdefault("multipart_fields", multipart_fields) + params.setdefault("multipart_monitor_callback", None) + + if not self.validate_response_schema and op_modifies: + params["active_validation"] = False + + response = func(**params) + else: + response = func() + except exceptions.dnacentersdkException as e: + self.fail_json( + msg=( + "An error occured when executing operation." + " The error was: {error}" + ).format(error=to_native(e)) + ) + return response + + def fail_json(self, msg, **kwargs): + self.result.update(**kwargs) + raise Exception(msg) + + def exit_json(self): + return self.result + + +def main(): + pass + + +if __name__ == "__main__": + main() diff --git a/ansible_collections/cisco/dnac/plugins/module_utils/exceptions.py b/ansible_collections/cisco/dnac/plugins/module_utils/exceptions.py new file mode 100644 index 00000000..007f8e1f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/module_utils/exceptions.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +class AnsibleDNACException(Exception): + """Base class for all Ansible DNAC package exceptions.""" + pass + + +class InconsistentParameters(AnsibleDNACException): + """Provided parameters are not consistent.""" + pass diff --git a/ansible_collections/cisco/dnac/plugins/modules/__init__.py b/ansible_collections/cisco/dnac/plugins/modules/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ansible_collections/cisco/dnac/plugins/modules/app_policy_default_info.py b/ansible_collections/cisco/dnac/plugins/modules/app_policy_default_info.py new file mode 100644 index 00000000..3ad0878f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/app_policy_default_info.py @@ -0,0 +1,148 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: app_policy_default_info +short_description: Information module for App Policy Default +description: +- Get all App Policy Default. +- Get default application policy. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyDefault + description: Complete reference of the GetApplicationPolicyDefault API. + link: https://developer.cisco.com/docs/dna-center/#!get-application-policy-default +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_application_policy_default, + + - Paths used are + get /dna/intent/api/v1/app-policy-default, + +""" + +EXAMPLES = r""" +- name: Get all App Policy Default + cisco.dnac.app_policy_default_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "createTime": 0, + "deployed": true, + "isSeeded": true, + "isStale": true, + "lastUpdateTime": 0, + "name": "string", + "namespace": "string", + "provisioningState": "string", + "qualifier": "string", + "resourceVersion": 0, + "targetIdList": [ + {} + ], + "type": "string", + "cfsChangeInfo": [ + {} + ], + "customProvisions": [ + {} + ], + "deletePolicyStatus": "string", + "internal": true, + "isDeleted": true, + "isEnabled": true, + "isScopeStale": true, + "iseReserved": true, + "policyStatus": "string", + "priority": 0, + "pushed": true, + "contractList": [ + {} + ], + "exclusiveContract": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "clause": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "priority": 0, + "type": "string", + "relevanceLevel": "string" + } + ] + }, + "identitySource": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "state": "string", + "type": "string" + }, + "producer": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "scalableGroup": [ + { + "idRef": "string" + } + ] + } + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/app_policy_info.py b/ansible_collections/cisco/dnac/plugins/modules/app_policy_info.py new file mode 100644 index 00000000..d70d8fd4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/app_policy_info.py @@ -0,0 +1,194 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: app_policy_info +short_description: Information module for App Policy +description: +- Get all App Policy. +- Get all existing application policies. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + policyScope: + description: + - PolicyScope query parameter. Policy scope name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicy + description: Complete reference of the GetApplicationPolicy API. + link: https://developer.cisco.com/docs/dna-center/#!get-application-policy +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_application_policy, + + - Paths used are + get /dna/intent/api/v1/app-policy, + +""" + +EXAMPLES = r""" +- name: Get all App Policy + cisco.dnac.app_policy_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + policyScope: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "createTime": 0, + "deployed": true, + "isSeeded": true, + "isStale": true, + "lastUpdateTime": 0, + "name": "string", + "namespace": "string", + "provisioningState": "string", + "qualifier": "string", + "resourceVersion": 0, + "targetIdList": [ + {} + ], + "type": "string", + "cfsChangeInfo": [ + {} + ], + "customProvisions": [ + {} + ], + "deletePolicyStatus": "string", + "internal": true, + "isDeleted": true, + "isEnabled": true, + "isScopeStale": true, + "iseReserved": true, + "policyScope": "string", + "policyStatus": "string", + "priority": 0, + "pushed": true, + "advancedPolicyScope": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "name": "string", + "advancedPolicyScopeElement": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "groupId": [ + "string" + ], + "ssid": [ + {} + ] + } + ] + }, + "contractList": [ + {} + ], + "exclusiveContract": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "clause": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "priority": 0, + "type": "string", + "relevanceLevel": "string", + "deviceRemovalBehavior": "string", + "hostTrackingEnabled": true + } + ] + }, + "identitySource": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "state": "string", + "type": "string" + }, + "producer": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "scalableGroup": [ + { + "idRef": "string" + } + ] + }, + "consumer": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "scalableGroup": [ + { + "idRef": "string" + } + ] + } + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/app_policy_intent_create.py b/ansible_collections/cisco/dnac/plugins/modules/app_policy_intent_create.py new file mode 100644 index 00000000..6c1b4683 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/app_policy_intent_create.py @@ -0,0 +1,331 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: app_policy_intent_create +short_description: Resource module for App Policy Intent Create +description: +- Manage operation create of the resource App Policy Intent Create. +- Create/Update/Delete application policy. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + createList: + description: App Policy Intent Create's createList. + elements: dict + suboptions: + advancedPolicyScope: + description: App Policy Intent Create's advancedPolicyScope. + suboptions: + advancedPolicyScopeElement: + description: App Policy Intent Create's advancedPolicyScopeElement. + elements: dict + suboptions: + groupId: + description: Group id. + elements: str + type: list + ssid: + description: Ssid. + elements: str + type: list + type: list + name: + description: Policy name. + type: str + type: dict + consumer: + description: App Policy Intent Create's consumer. + suboptions: + scalableGroup: + description: App Policy Intent Create's scalableGroup. + elements: dict + suboptions: + idRef: + description: Id ref to application Scalable group. + type: str + type: list + type: dict + contract: + description: App Policy Intent Create's contract. + suboptions: + idRef: + description: Id ref to Queueing profile. + type: str + type: dict + deletePolicyStatus: + description: NONE deployed policy to devices, DELETED delete policy from devices, + RESTORED restored to original configuration. + type: str + exclusiveContract: + description: App Policy Intent Create's exclusiveContract. + suboptions: + clause: + description: App Policy Intent Create's clause. + elements: dict + suboptions: + deviceRemovalBehavior: + description: Device eemoval behavior. + type: str + hostTrackingEnabled: + description: Is host tracking enabled. + type: bool + relevanceLevel: + description: Relevance level. + type: str + type: + description: Type. + type: str + type: list + type: dict + name: + description: Concatination of _ or _global_policy_configuration or _queuing_customization. + type: str + policyScope: + description: Policy name. + type: str + priority: + description: Set to 4095 while producer refer to application Scalable group + otherwise 100. + type: str + producer: + description: App Policy Intent Create's producer. + suboptions: + scalableGroup: + description: App Policy Intent Create's scalableGroup. + elements: dict + suboptions: + idRef: + description: Id ref to application-set or application Scalable group. + type: str + type: list + type: dict + type: list + deleteList: + description: Delete list of Group Based Policy ids. + elements: str + type: list + updateList: + description: App Policy Intent Create's updateList. + elements: dict + suboptions: + advancedPolicyScope: + description: App Policy Intent Create's advancedPolicyScope. + suboptions: + advancedPolicyScopeElement: + description: App Policy Intent Create's advancedPolicyScopeElement. + elements: dict + suboptions: + groupId: + description: Group id. + elements: str + type: list + id: + description: Id of Advance policy scope element. + type: str + ssid: + description: Ssid. + elements: str + type: list + type: list + id: + description: Id of Advance policy scope. + type: str + name: + description: Policy name. + type: str + type: dict + consumer: + description: App Policy Intent Create's consumer. + suboptions: + id: + description: Id of Consumer. + type: str + scalableGroup: + description: App Policy Intent Create's scalableGroup. + elements: dict + suboptions: + idRef: + description: Id ref to application Scalable group. + type: str + type: list + type: dict + contract: + description: App Policy Intent Create's contract. + suboptions: + idRef: + description: Id ref to Queueing profile. + type: str + type: dict + deletePolicyStatus: + description: NONE deployed policy to devices, DELETED delete policy from devices, + RESTORED restored to original configuration. + type: str + exclusiveContract: + description: App Policy Intent Create's exclusiveContract. + suboptions: + clause: + description: App Policy Intent Create's clause. + elements: dict + suboptions: + deviceRemovalBehavior: + description: Device removal behavior. + type: str + hostTrackingEnabled: + description: Host tracking enabled. + type: bool + id: + description: Id of Business relevance or Application policy knobs clause. + type: str + relevanceLevel: + description: Relevance level. + type: str + type: + description: Type. + type: str + type: list + id: + description: Id of Exclusive contract. + type: str + type: dict + id: + description: Id of Group based policy. + type: str + name: + description: Concatination of _ or _global_policy_configuration or _queuing_customization. + type: str + policyScope: + description: Policy name. + type: str + priority: + description: Set to 4095 while producer refer to application Scalable group + otherwise 100. + type: str + producer: + description: App Policy Intent Create's producer. + suboptions: + id: + description: Id of Producer. + type: str + scalableGroup: + description: App Policy Intent Create's scalableGroup. + elements: dict + suboptions: + idRef: + description: Id ref to application-set or application Scalable group. + type: str + type: list + type: dict + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy ApplicationPolicyIntent + description: Complete reference of the ApplicationPolicyIntent API. + link: https://developer.cisco.com/docs/dna-center/#!application-policy-intent +notes: + - SDK Method used are + application_policy.ApplicationPolicy.application_policy_intent, + + - Paths used are + post /dna/intent/api/v1/app-policy-intent, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.app_policy_intent_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + createList: + - advancedPolicyScope: + advancedPolicyScopeElement: + - groupId: + - string + ssid: + - string + name: string + consumer: + scalableGroup: + - idRef: string + contract: + idRef: string + deletePolicyStatus: string + exclusiveContract: + clause: + - deviceRemovalBehavior: string + hostTrackingEnabled: true + relevanceLevel: string + type: string + name: string + policyScope: string + priority: string + producer: + scalableGroup: + - idRef: string + deleteList: + - string + updateList: + - advancedPolicyScope: + advancedPolicyScopeElement: + - groupId: + - string + id: string + ssid: + - string + id: string + name: string + consumer: + id: string + scalableGroup: + - idRef: string + contract: + idRef: string + deletePolicyStatus: string + exclusiveContract: + clause: + - deviceRemovalBehavior: string + hostTrackingEnabled: true + id: string + relevanceLevel: string + type: string + id: string + id: string + name: string + policyScope: string + priority: string + producer: + id: string + scalableGroup: + - idRef: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile.py b/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile.py new file mode 100644 index 00000000..769e87fc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile.py @@ -0,0 +1,200 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: app_policy_queuing_profile +short_description: Resource module for App Policy Queuing Profile +description: +- Manage operations create, update and delete of the resource App Policy Queuing Profile. +- Create new custom application queuing profile. +- Delete existing custom application policy queuing profile by id. +- Update existing custom application queuing profile. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. Id of custom queuing profile to delete. + type: str + payload: + description: App Policy Queuing Profile's payload. + elements: dict + suboptions: + clause: + description: App Policy Queuing Profile's clause. + elements: dict + suboptions: + instanceId: + description: Instance id. + type: int + interfaceSpeedBandwidthClauses: + description: App Policy Queuing Profile's interfaceSpeedBandwidthClauses. + elements: dict + suboptions: + instanceId: + description: Instance id. + type: int + interfaceSpeed: + description: Interface speed. + type: str + tcBandwidthSettings: + description: App Policy Queuing Profile's tcBandwidthSettings. + elements: dict + suboptions: + bandwidthPercentage: + description: Bandwidth percentage. + type: int + instanceId: + description: Instance id. + type: int + trafficClass: + description: Traffic Class. + type: str + type: list + type: list + isCommonBetweenAllInterfaceSpeeds: + description: Is common between all interface speeds. + type: bool + tcDscpSettings: + description: App Policy Queuing Profile's tcDscpSettings. + elements: dict + suboptions: + dscp: + description: Dscp value. + type: str + instanceId: + description: Instance id. + type: int + trafficClass: + description: Traffic Class. + type: str + type: list + type: + description: Type. + type: str + type: list + description: + description: Free test description. + type: str + id: + description: Id of Queueing profile. + type: str + name: + description: Queueing profile name. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy CreateApplicationPolicyQueuingProfile + description: Complete reference of the CreateApplicationPolicyQueuingProfile API. + link: https://developer.cisco.com/docs/dna-center/#!create-application-policy-queuing-profile +- name: Cisco DNA Center documentation for Application Policy DeleteApplicationPolicyQueuingProfile + description: Complete reference of the DeleteApplicationPolicyQueuingProfile API. + link: https://developer.cisco.com/docs/dna-center/#!delete-application-policy-queuing-profile +- name: Cisco DNA Center documentation for Application Policy UpdateApplicationPolicyQueuingProfile + description: Complete reference of the UpdateApplicationPolicyQueuingProfile API. + link: https://developer.cisco.com/docs/dna-center/#!update-application-policy-queuing-profile +notes: + - SDK Method used are + application_policy.ApplicationPolicy.create_application_policy_queuing_profile, + application_policy.ApplicationPolicy.delete_application_policy_queuing_profile, + application_policy.ApplicationPolicy.update_application_policy_queuing_profile, + + - Paths used are + post /dna/intent/api/v1/app-policy-queuing-profile, + delete /dna/intent/api/v1/app-policy-queuing-profile/{id}, + put /dna/intent/api/v1/app-policy-queuing-profile, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.app_policy_queuing_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - clause: + - instanceId: 0 + interfaceSpeedBandwidthClauses: + - instanceId: 0 + interfaceSpeed: string + tcBandwidthSettings: + - bandwidthPercentage: 0 + instanceId: 0 + trafficClass: string + isCommonBetweenAllInterfaceSpeeds: true + tcDscpSettings: + - dscp: string + instanceId: 0 + trafficClass: string + type: string + description: string + id: string + name: string + +- name: Create + cisco.dnac.app_policy_queuing_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - clause: + - interfaceSpeedBandwidthClauses: + - interfaceSpeed: string + tcBandwidthSettings: + - bandwidthPercentage: 0 + trafficClass: string + isCommonBetweenAllInterfaceSpeeds: true + tcDscpSettings: + - dscp: string + trafficClass: string + type: string + description: string + name: string + +- name: Delete by id + cisco.dnac.app_policy_queuing_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_count_info.py new file mode 100644 index 00000000..5f814ac1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_count_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: app_policy_queuing_profile_count_info +short_description: Information module for App Policy Queuing Profile Count +description: +- Get all App Policy Queuing Profile Count. +- Get the number of all existing application policy queuing profile. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfileCount + description: Complete reference of the GetApplicationPolicyQueuingProfileCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-application-policy-queuing-profile-count +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_application_policy_queuing_profile_count, + + - Paths used are + get /dna/intent/api/v1/app-policy-queuing-profile-count, + +""" + +EXAMPLES = r""" +- name: Get all App Policy Queuing Profile Count + cisco.dnac.app_policy_queuing_profile_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_info.py b/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_info.py new file mode 100644 index 00000000..860545f2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/app_policy_queuing_profile_info.py @@ -0,0 +1,154 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: app_policy_queuing_profile_info +short_description: Information module for App Policy Queuing Profile +description: +- Get all App Policy Queuing Profile. +- Get all or by name, existing application policy queuing profiles. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. Queuing profile name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfile + description: Complete reference of the GetApplicationPolicyQueuingProfile API. + link: https://developer.cisco.com/docs/dna-center/#!get-application-policy-queuing-profile +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_application_policy_queuing_profile, + + - Paths used are + get /dna/intent/api/v1/app-policy-queuing-profile, + +""" + +EXAMPLES = r""" +- name: Get all App Policy Queuing Profile + cisco.dnac.app_policy_queuing_profile_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "createTime": 0, + "deployed": true, + "description": "string", + "isSeeded": true, + "isStale": true, + "lastUpdateTime": 0, + "name": "string", + "namespace": "string", + "provisioningState": "string", + "qualifier": "string", + "resourceVersion": 0, + "targetIdList": [ + {} + ], + "type": "string", + "cfsChangeInfo": [ + {} + ], + "customProvisions": [ + {} + ], + "genId": 0, + "internal": true, + "isDeleted": true, + "iseReserved": true, + "pushed": true, + "clause": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "priority": 0, + "type": "string", + "isCommonBetweenAllInterfaceSpeeds": true, + "interfaceSpeedBandwidthClauses": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "interfaceSpeed": "string", + "tcBandwidthSettings": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "bandwidthPercentage": 0, + "trafficClass": "string" + } + ] + } + ], + "tcDscpSettings": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "dscp": "string", + "trafficClass": "string" + } + ] + } + ], + "contractClassifier": [ + {} + ] + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/application_sets.py b/ansible_collections/cisco/dnac/plugins/modules/application_sets.py new file mode 100644 index 00000000..1210f90d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/application_sets.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: application_sets +short_description: Resource module for Application Sets +description: +- Manage operations create and delete of the resource Application Sets. +- Create new custom application-set/s. +- Delete existing application-set by it's id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id query parameter. + type: str + payload: + description: Application Sets's payload. + elements: dict + suboptions: + name: + description: Name. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy CreateApplicationSet + description: Complete reference of the CreateApplicationSet API. + link: https://developer.cisco.com/docs/dna-center/#!create-application-set +- name: Cisco DNA Center documentation for Application Policy DeleteApplicationSet + description: Complete reference of the DeleteApplicationSet API. + link: https://developer.cisco.com/docs/dna-center/#!delete-application-set +notes: + - SDK Method used are + application_policy.ApplicationPolicy.create_application_set, + application_policy.ApplicationPolicy.delete_application_set, + + - Paths used are + post /dna/intent/api/v1/application-policy-application-set, + delete /dna/intent/api/v1/application-policy-application-set, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.application_sets: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +- name: Create + cisco.dnac.application_sets: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - name: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "taskId": "string", + "url": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/application_sets_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/application_sets_count_info.py new file mode 100644 index 00000000..b7192371 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/application_sets_count_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: application_sets_count_info +short_description: Information module for Application Sets Count +description: +- Get all Application Sets Count. +- Get the number of existing application-sets. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplicationSetsCount + description: Complete reference of the GetApplicationSetsCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-application-sets-count +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_application_sets_count, + + - Paths used are + get /dna/intent/api/v1/application-policy-application-set-count, + +""" + +EXAMPLES = r""" +- name: Get all Application Sets Count + cisco.dnac.application_sets_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": "string", + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/application_sets_info.py b/ansible_collections/cisco/dnac/plugins/modules/application_sets_info.py new file mode 100644 index 00000000..844341de --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/application_sets_info.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: application_sets_info +short_description: Information module for Application Sets +description: +- Get all Application Sets. +- Get appllication-sets by offset/limit or by name. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + offset: + description: + - Offset query parameter. + type: int + limit: + description: + - Limit query parameter. + type: int + name: + description: + - Name query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplicationSets + description: Complete reference of the GetApplicationSets API. + link: https://developer.cisco.com/docs/dna-center/#!get-application-sets +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_application_sets, + + - Paths used are + get /dna/intent/api/v1/application-policy-application-set, + +""" + +EXAMPLES = r""" +- name: Get all Application Sets + cisco.dnac.application_sets_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: 0 + limit: 0 + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "id": "string", + "identitySource": { + "id": "string", + "type": "string" + }, + "name": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/applications.py b/ansible_collections/cisco/dnac/plugins/modules/applications.py new file mode 100644 index 00000000..22c309bd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/applications.py @@ -0,0 +1,272 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: applications +short_description: Resource module for Applications +description: +- Manage operations create, update and delete of the resource Applications. +- Create new Custom application. +- Delete existing application by its id. +- Edit the attributes of an existing application. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id query parameter. Application's Id. + type: str + payload: + description: Applications's payload. + elements: dict + suboptions: + applicationSet: + description: Applications's applicationSet. + suboptions: + idRef: + description: Id Ref. + type: str + type: dict + indicativeNetworkIdentity: + description: Applications's indicativeNetworkIdentity. + elements: dict + suboptions: + displayName: + description: DisplayName. + type: str + id: + description: Id. + type: str + lowerPort: + description: LowerPort. + type: int + ports: + description: Ports. + type: str + protocol: + description: Protocol. + type: str + upperPort: + description: UpperPort. + type: int + type: list + name: + description: Name. + type: str + networkApplications: + description: Applications's networkApplications. + elements: dict + suboptions: + appProtocol: + description: App Protocol. + type: str + applicationSubType: + description: Application Sub Type. + type: str + applicationType: + description: Application Type. + type: str + categoryId: + description: Category Id. + type: str + displayName: + description: Display Name. + type: str + dscp: + description: Dscp. + type: str + engineId: + description: Engine Id. + type: str + helpString: + description: Help String. + type: str + ignoreConflict: + description: Ignore Conflict. + type: str + longDescription: + description: Long Description. + type: str + name: + description: Name. + type: str + popularity: + description: Popularity. + type: str + rank: + description: Rank. + type: str + serverName: + description: Server Name. + type: str + trafficClass: + description: Traffic Class. + type: str + url: + description: Url. + type: str + type: list + networkIdentity: + description: Applications's networkIdentity. + elements: dict + suboptions: + displayName: + description: Display Name. + type: str + lowerPort: + description: Lower Port. + type: str + ports: + description: Ports. + type: str + protocol: + description: Protocol. + type: str + upperPort: + description: Upper Port. + type: str + type: list + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy CreateApplication + description: Complete reference of the CreateApplication API. + link: https://developer.cisco.com/docs/dna-center/#!create-application +- name: Cisco DNA Center documentation for Application Policy DeleteApplication + description: Complete reference of the DeleteApplication API. + link: https://developer.cisco.com/docs/dna-center/#!delete-application +- name: Cisco DNA Center documentation for Application Policy EditApplication + description: Complete reference of the EditApplication API. + link: https://developer.cisco.com/docs/dna-center/#!edit-application +notes: + - SDK Method used are + application_policy.ApplicationPolicy.create_application, + application_policy.ApplicationPolicy.delete_application, + application_policy.ApplicationPolicy.edit_application, + + - Paths used are + post /dna/intent/api/v1/applications, + delete /dna/intent/api/v1/applications, + put /dna/intent/api/v1/applications, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.applications: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - applicationSet: + idRef: string + indicativeNetworkIdentity: + - displayName: string + id: string + lowerPort: 0 + ports: string + protocol: string + upperPort: 0 + name: string + networkApplications: + - appProtocol: string + applicationSubType: string + applicationType: string + categoryId: string + displayName: string + dscp: string + engineId: string + helpString: string + ignoreConflict: string + longDescription: string + name: string + popularity: string + rank: string + serverName: string + trafficClass: string + url: string + networkIdentity: + - displayName: string + lowerPort: string + ports: string + protocol: string + upperPort: string + +- name: Update all + cisco.dnac.applications: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - applicationSet: + idRef: string + id: string + name: string + networkApplications: + - appProtocol: string + applicationSubType: string + applicationType: string + categoryId: string + displayName: string + dscp: string + engineId: string + helpString: string + id: string + ignoreConflict: string + longDescription: string + name: string + popularity: string + rank: string + serverName: string + trafficClass: string + url: string + networkIdentity: + - displayName: string + id: string + lowerPort: string + ports: string + protocol: string + upperPort: string + +- name: Delete all + cisco.dnac.applications: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "taskId": "string", + "url": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/applications_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/applications_count_info.py new file mode 100644 index 00000000..1c725cb1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/applications_count_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: applications_count_info +short_description: Information module for Applications Count +description: +- Get all Applications Count. +- Get the number of all existing applications. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplicationsCount + description: Complete reference of the GetApplicationsCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-applications-count +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_applications_count, + + - Paths used are + get /dna/intent/api/v1/applications-count, + +""" + +EXAMPLES = r""" +- name: Get all Applications Count + cisco.dnac.applications_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/applications_health_info.py b/ansible_collections/cisco/dnac/plugins/modules/applications_health_info.py new file mode 100644 index 00000000..4bc99840 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/applications_health_info.py @@ -0,0 +1,151 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: applications_health_info +short_description: Information module for Applications Health +description: +- Get all Applications Health. +- > + Intent API to get a list of applications for a specific site, a device, or a client device's MAC address. For a + combination of a specific application with site and/or device the API gets list of issues/devices/endpoints. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. Assurance site UUID value (Cannot be submitted together with deviceId and clientMac). + type: str + deviceId: + description: + - DeviceId query parameter. Assurance device UUID value (Cannot be submitted together with siteId and clientMac). + type: str + macAddress: + description: + - MacAddress query parameter. Client device's MAC address (Cannot be submitted together with siteId and deviceId). + type: str + startTime: + description: + - StartTime query parameter. Starting epoch time in milliseconds of time window. + type: int + endTime: + description: + - EndTime query parameter. Ending epoch time in milliseconds of time window. + type: int + applicationHealth: + description: + - > + ApplicationHealth query parameter. Application health category (POOR, FAIR, or GOOD. Optionally use with + siteId only). + type: str + offset: + description: + - > + Offset query parameter. The offset of the first application in the returned data (optionally used with + siteId only). + type: int + limit: + description: + - > + Limit query parameter. The max number of application entries in returned data 1, 1000 (optionally used with + siteId only). + type: int + applicationName: + description: + - ApplicationName query parameter. The name of the application to get information on. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Applications Applications + description: Complete reference of the Applications API. + link: https://developer.cisco.com/docs/dna-center/#!applications-applications +notes: + - SDK Method used are + applications.Applications.applications, + + - Paths used are + get /dna/intent/api/v1/application-health, + +""" + +EXAMPLES = r""" +- name: Get all Applications Health + cisco.dnac.applications_health_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + deviceId: string + macAddress: string + startTime: 0 + endTime: 0 + applicationHealth: string + offset: 0 + limit: 0 + applicationName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "totalCount": 0, + "response": [ + { + "name": "string", + "health": 0, + "businessRelevance": "string", + "trafficClass": "string", + "usageBytes": 0, + "averageThroughput": 0, + "packetLossPercent": {}, + "networkLatency": {}, + "jitter": {}, + "applicationServerLatency": {}, + "clientNetworkLatency": {}, + "serverNetworkLatency": {}, + "exporterIpAddress": "string", + "exporterName": "string", + "exporterUUID": "string", + "exporterFamily": "string", + "clientName": "string", + "clientIp": "string", + "location": "string", + "operatingSystem": "string", + "deviceType": "string", + "clientMacAddress": "string", + "issueId": "string", + "issueName": "string", + "application": "string", + "severity": "string", + "summary": "string", + "rootCause": "string", + "timestamp": 0, + "occurrences": 0, + "priority": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/applications_info.py b/ansible_collections/cisco/dnac/plugins/modules/applications_info.py new file mode 100644 index 00000000..431d62e3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/applications_info.py @@ -0,0 +1,125 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: applications_info +short_description: Information module for Applications +description: +- Get all Applications. +- Get applications by offset/limit or by name. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + offset: + description: + - Offset query parameter. The offset of the first application to be returned. + type: int + limit: + description: + - Limit query parameter. The maximum number of applications to be returned. + type: int + name: + description: + - Name query parameter. Application's name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetApplications + description: Complete reference of the GetApplications API. + link: https://developer.cisco.com/docs/dna-center/#!get-applications +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_applications, + + - Paths used are + get /dna/intent/api/v1/applications, + +""" + +EXAMPLES = r""" +- name: Get all Applications + cisco.dnac.applications_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: 0 + limit: 0 + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "id": "string", + "name": "string", + "indicativeNetworkIdentity": [ + { + "id": "string", + "displayName": "string", + "lowerPort": 0, + "ports": "string", + "protocol": "string", + "upperPort": 0 + } + ], + "networkApplications": [ + { + "id": "string", + "appProtocol": "string", + "applicationSubType": "string", + "applicationType": "string", + "categoryId": "string", + "displayName": "string", + "engineId": "string", + "helpString": "string", + "longDescription": "string", + "name": "string", + "popularity": 0, + "rank": 0, + "trafficClass": "string", + "serverName": "string", + "url": "string", + "dscp": "string", + "ignoreConflict": "string" + } + ], + "networkIdentity": [ + { + "id": "string", + "displayName": "string", + "lowerPort": 0, + "ports": "string", + "protocol": "string", + "upperPort": 0 + } + ], + "applicationSet": { + "idRef": "string" + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/assign_device_to_site.py b/ansible_collections/cisco/dnac/plugins/modules/assign_device_to_site.py new file mode 100644 index 00000000..fbd3cec3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/assign_device_to_site.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: assign_device_to_site +short_description: Resource module for Assign Device To Site +description: +- Manage operation create of the resource Assign Device To Site. +- Assigns unassigned devices to a site. This API does not move assigned devices to other sites. +version_added: '6.5.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + device: + description: Assign Device To Site's device. + elements: dict + suboptions: + ip: + description: Device ip (eg 10.104.240.64). + type: str + type: list + headers: + description: Additional headers. + type: dict + siteId: + description: SiteId path parameter. Site id to which site the device to assign. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for AssignDevicesToSite + description: Complete reference of the AssignDevicesToSite API. + link: https://developer.cisco.com/docs/dna-center/#!assign-devices-to-site +notes: + - SDK Method used are + ..assign_devices_to_site, + + - Paths used are + post /dna/intent/api/v1/assign-device-to-site/{siteId}/device, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.assign_device_to_site: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + device: + - ip: string + headers: '{{my_headers | from_json}}' + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/associate_site_to_network_profile.py b/ansible_collections/cisco/dnac/plugins/modules/associate_site_to_network_profile.py new file mode 100644 index 00000000..7a2aab8e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/associate_site_to_network_profile.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: associate_site_to_network_profile +short_description: Resource module for Associate Site To Network Profile +description: +- Manage operation create of the resource Associate Site To Network Profile. +- Associate Site to a Network Profile. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + networkProfileId: + description: NetworkProfileId path parameter. Network-Profile Id to be associated. + type: str + siteId: + description: SiteId path parameter. Site Id to be associated. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Site Design Associate + description: Complete reference of the Associate API. + link: https://developer.cisco.com/docs/dna-center/#!associate +notes: + - SDK Method used are + site_design.SiteDesign.associate, + + - Paths used are + post /dna/intent/api/v1/networkprofile/{networkProfileId}/site/{siteId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.associate_site_to_network_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + networkProfileId: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate.py b/ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate.py new file mode 100644 index 00000000..7cfca0c4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: authentication_import_certificate +short_description: Resource module for Authentication Import Certificate +description: +- Manage operation create of the resource Authentication Import Certificate. +- This method is used to upload a certificate. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + certFilePath: + description: Cert file absolute path. + type: str + listOfUsers: + description: ListOfUsers query parameter. + elements: str + type: list + pkFilePath: + description: Pk file absolute path. + type: str + pkPassword: + description: PkPassword query parameter. Private Key Passsword. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Authentication Management ImportCertificate + description: Complete reference of the ImportCertificate API. + link: https://developer.cisco.com/docs/dna-center/#!import-certificate +notes: + - SDK Method used are + authentication_management.AuthenticationManagement.import_certificate, + + - Paths used are + post /dna/intent/api/v1/certificate, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.authentication_import_certificate: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + certFilePath: /tmp/uploads/Test-242.pem + listOfUsers: [] + pkFilePath: /tmp/uploads/Test-242.key + pkPassword: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate_p12.py b/ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate_p12.py new file mode 100644 index 00000000..ab19906f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/authentication_import_certificate_p12.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: authentication_import_certificate_p12 +short_description: Resource module for Authentication Import Certificate P12 +description: +- Manage operation create of the resource Authentication Import Certificate P12. +- This method is used to upload a PKCS\#12 file. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + listOfUsers: + description: ListOfUsers query parameter. + elements: str + type: list + p12FilePath: + description: P12 file absolute path. + type: str + p12Password: + description: P12Password query parameter. P12 Passsword. + type: str + pkPassword: + description: PkPassword query parameter. Private Key Passsword. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Authentication Management ImportCertificateP12 + description: Complete reference of the ImportCertificateP12 API. + link: https://developer.cisco.com/docs/dna-center/#!import-certificate-p-12 +notes: + - SDK Method used are + authentication_management.AuthenticationManagement.import_certificate_p12, + + - Paths used are + post /dna/intent/api/v1/certificate-p12, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.authentication_import_certificate_p12: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + listOfUsers: [] + p12FilePath: /tmp/uploads/Test-242.p12 + p12Password: string + pkPassword: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/buildings_planned_access_points_info.py b/ansible_collections/cisco/dnac/plugins/modules/buildings_planned_access_points_info.py new file mode 100644 index 00000000..07dda3ca --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/buildings_planned_access_points_info.py @@ -0,0 +1,129 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: buildings_planned_access_points_info +short_description: Information module for Buildings Planned Access Points +description: +- Get all Buildings Planned Access Points. +- Provides a list of Planned Access Points for the Building it is requested for. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + buildingId: + description: + - BuildingId path parameter. Building Id. + type: str + limit: + description: + - Limit query parameter. + type: int + offset: + description: + - Offset query parameter. + type: int + radios: + description: + - Radios query parameter. Inlcude planned radio details. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetPlannedAccessPointsForBuilding + description: Complete reference of the GetPlannedAccessPointsForBuilding API. + link: https://developer.cisco.com/docs/dna-center/#!get-planned-access-points-for-building +notes: + - SDK Method used are + devices.Devices.get_planned_access_points_for_building, + + - Paths used are + get /dna/intent/api/v1/buildings/{buildingId}/planned-access-points, + +""" + +EXAMPLES = r""" +- name: Get all Buildings Planned Access Points + cisco.dnac.buildings_planned_access_points_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + limit: 0 + offset: 0 + radios: True + buildingId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "attributes": { + "id": 0, + "instanceUuid": "string", + "name": "string", + "typeString": "string", + "domain": "string", + "heirarchyName": "string", + "source": "string", + "createDate": 0, + "macaddress": {} + }, + "location": {}, + "position": { + "x": 0, + "y": 0, + "z": 0 + }, + "radioCount": 0, + "radios": [ + { + "attributes": { + "id": 0, + "instanceUuid": "string", + "slotId": 0, + "ifTypeString": "string", + "ifTypeSubband": "string", + "channel": {}, + "channelString": {}, + "ifMode": "string" + }, + "antenna": { + "name": "string", + "type": "string", + "mode": "string", + "azimuthAngle": 0, + "elevationAngle": 0, + "gain": 0 + }, + "isSensor": true + } + ], + "isSensor": true + } + ], + "version": 0, + "total": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool.py b/ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool.py new file mode 100644 index 00000000..619474a9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: business_sda_hostonboarding_ssid_ippool +short_description: Resource module for Business Sda Hostonboarding Ssid Ippool +description: +- Manage operations create and update of the resource Business Sda Hostonboarding Ssid Ippool. +- Add SSID to IP Pool Mapping. +- Update SSID to IP Pool Mapping. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + scalableGroupName: + description: Scalable Group Name. + type: str + siteNameHierarchy: + description: Site Name Hierarchy. + type: str + ssidNames: + description: List of SSIDs. + elements: str + type: list + vlanName: + description: VLAN Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Fabric Wireless AddSSIDToIPPoolMapping + description: Complete reference of the AddSSIDToIPPoolMapping API. + link: https://developer.cisco.com/docs/dna-center/#!add-ssid-to-ip-pool-mapping +- name: Cisco DNA Center documentation for Fabric Wireless UpdateSSIDToIPPoolMapping2 + description: Complete reference of the UpdateSSIDToIPPoolMapping2 API. + link: https://developer.cisco.com/docs/dna-center/#!update-ssid-to-ip-pool-mapping-2 +notes: + - SDK Method used are + fabric_wireless.FabricWireless.add_ssid_to_ip_pool_mapping, + fabric_wireless.FabricWireless.update_ssid_to_ip_pool_mapping2, + + - Paths used are + post /dna/intent/api/v1/business/sda/hostonboarding/ssid-ippool, + put /dna/intent/api/v1/business/sda/hostonboarding/ssid-ippool, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.business_sda_hostonboarding_ssid_ippool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + scalableGroupName: string + siteNameHierarchy: string + ssidNames: + - string + vlanName: string + +- name: Update all + cisco.dnac.business_sda_hostonboarding_ssid_ippool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + scalableGroupName: string + siteNameHierarchy: string + ssidNames: + - string + vlanName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + sample: > + [ + { + "executionId": "string", + "executionStatusURL": "string", + "message": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool_info.py b/ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool_info.py new file mode 100644 index 00000000..6ecfdd80 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/business_sda_hostonboarding_ssid_ippool_info.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: business_sda_hostonboarding_ssid_ippool_info +short_description: Information module for Business Sda Hostonboarding Ssid Ippool +description: +- Get all Business Sda Hostonboarding Ssid Ippool. +- Get SSID to IP Pool Mapping. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + vlanName: + description: + - VlanName query parameter. VLAN Name. + type: str + siteNameHierarchy: + description: + - SiteNameHierarchy query parameter. Site Name Heirarchy. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Fabric Wireless GetSSIDToIPPoolMapping + description: Complete reference of the GetSSIDToIPPoolMapping API. + link: https://developer.cisco.com/docs/dna-center/#!get-ssid-to-ip-pool-mapping +notes: + - SDK Method used are + fabric_wireless.FabricWireless.get_ssid_to_ip_pool_mapping, + + - Paths used are + get /dna/intent/api/v1/business/sda/hostonboarding/ssid-ippool, + +""" + +EXAMPLES = r""" +- name: Get all Business Sda Hostonboarding Ssid Ippool + cisco.dnac.business_sda_hostonboarding_ssid_ippool_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + vlanName: string + siteNameHierarchy: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "vlanName": "string", + "ssidDetails": [ + { + "name": "string", + "scalableGroupName": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/business_sda_virtual_network_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/business_sda_virtual_network_summary_info.py new file mode 100644 index 00000000..ff5ae17d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/business_sda_virtual_network_summary_info.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: business_sda_virtual_network_summary_info +short_description: Information module for Business Sda Virtual Network Summary +description: +- Get all Business Sda Virtual Network Summary. +- Get Virtual Network Summary. +version_added: '6.5.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteNameHierarchy: + description: + - SiteNameHierarchy query parameter. Complete fabric siteNameHierarchy Path. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for GetVirtualNetworkSummary + description: Complete reference of the GetVirtualNetworkSummary API. + link: https://developer.cisco.com/docs/dna-center/#!get-virtual-network-summary +notes: + - SDK Method used are + ..get_virtual_network_summary, + + - Paths used are + get /dna/intent/api/v1/business/sda/virtual-network/summary, + +""" + +EXAMPLES = r""" +- name: Get all Business Sda Virtual Network Summary + cisco.dnac.business_sda_virtual_network_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteNameHierarchy: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "status": "string", + "description": "string", + "fabricCount": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_create.py b/ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_create.py new file mode 100644 index 00000000..1d9993a6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_create.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: business_sda_wireless_controller_create +short_description: Resource module for Business Sda Wireless Controller Create +description: +- Manage operation create of the resource Business Sda Wireless Controller Create. +- Add WLC to Fabric Domain. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceName: + description: EWLC Device Name. + type: str + siteNameHierarchy: + description: Site Name Hierarchy. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Fabric Wireless AddWLCToFabricDomain + description: Complete reference of the AddWLCToFabricDomain API. + link: https://developer.cisco.com/docs/dna-center/#!add-wlc-to-fabric-domain +notes: + - SDK Method used are + fabric_wireless.FabricWireless.add_w_l_c_to_fabric_domain, + + - Paths used are + post /dna/intent/api/v1/business/sda/wireless-controller, + + - Removed 'deviceIPAddress' options in v4.3.0. +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.business_sda_wireless_controller_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceName: string + siteNameHierarchy: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusURL": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_delete.py b/ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_delete.py new file mode 100644 index 00000000..6afa8059 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/business_sda_wireless_controller_delete.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: business_sda_wireless_controller_delete +short_description: Resource module for Business Sda Wireless Controller Delete +description: +- Manage operation delete of the resource Business Sda Wireless Controller Delete. +- Remove WLC from Fabric Domain. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceIPAddress: + description: DeviceIPAddress query parameter. Device Management IP Address. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Fabric Wireless RemoveWLCFromFabricDomain + description: Complete reference of the RemoveWLCFromFabricDomain API. + link: https://developer.cisco.com/docs/dna-center/#!remove-wlc-from-fabric-domain +notes: + - SDK Method used are + fabric_wireless.FabricWireless.remove_w_l_c_from_fabric_domain, + + - Paths used are + delete /dna/intent/api/v1/business/sda/wireless-controller, + + - Removed 'deviceName' and 'siteNameHierarchy' options in v4.3.0. +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.business_sda_wireless_controller_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceIPAddress: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/cli_credential.py b/ansible_collections/cisco/dnac/plugins/modules/cli_credential.py new file mode 100644 index 00000000..d7b54296 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/cli_credential.py @@ -0,0 +1,124 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: cli_credential +short_description: Resource module for Cli Credential +description: +- Manage operations create and update of the resource Cli Credential. +- Adds global CLI credential. +- Updates global CLI credentials. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + comments: + description: Cli Credential's comments. + type: str + credentialType: + description: Cli Credential's credentialType. + type: str + description: + description: Cli Credential's description. + type: str + enablePassword: + description: Cli Credential's enablePassword. + type: str + id: + description: Cli Credential's id. + type: str + instanceTenantId: + description: Cli Credential's instanceTenantId. + type: str + instanceUuid: + description: Cli Credential's instanceUuid. + type: str + password: + description: Cli Credential's password. + type: str + username: + description: Cli Credential's username. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateCLICredentials + description: Complete reference of the CreateCLICredentials API. + link: https://developer.cisco.com/docs/dna-center/#!create-cli-credentials +- name: Cisco DNA Center documentation for Discovery UpdateCLICredentials + description: Complete reference of the UpdateCLICredentials API. + link: https://developer.cisco.com/docs/dna-center/#!update-cli-credentials +notes: + - SDK Method used are + discovery.Discovery.create_cli_credentials, + discovery.Discovery.update_cli_credentials, + + - Paths used are + post /dna/intent/api/v1/global-credential/cli, + put /dna/intent/api/v1/global-credential/cli, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.cli_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + enablePassword: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + username: string + +- name: Create + cisco.dnac.cli_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + enablePassword: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + username: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/client_detail_info.py b/ansible_collections/cisco/dnac/plugins/modules/client_detail_info.py new file mode 100644 index 00000000..4a514e7b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/client_detail_info.py @@ -0,0 +1,196 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: client_detail_info +short_description: Information module for Client Detail +description: +- Get all Client Detail. +- Returns detailed Client information retrieved by Mac Address for any given point of time. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + timestamp: + description: + - Timestamp query parameter. Epoch time(in milliseconds) when the Client health data is required. + type: str + macAddress: + description: + - MacAddress query parameter. MAC Address of the client. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Clients GetClientDetail + description: Complete reference of the GetClientDetail API. + link: https://developer.cisco.com/docs/dna-center/#!get-client-detail +notes: + - SDK Method used are + clients.Clients.get_client_detail, + + - Paths used are + get /dna/intent/api/v1/client-detail, + +""" + +EXAMPLES = r""" +- name: Get all Client Detail + cisco.dnac.client_detail_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + timestamp: string + macAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "detail": { + "id": "string", + "connectionStatus": "string", + "hostType": "string", + "userId": {}, + "hostName": "string", + "hostOs": {}, + "hostVersion": {}, + "subType": "string", + "lastUpdated": 0, + "healthScore": [ + { + "healthType": "string", + "reason": "string", + "score": 0 + } + ], + "hostMac": "string", + "hostIpV4": "string", + "hostIpV6": [ + "string" + ], + "authType": "string", + "vlanId": "string", + "vnid": "string", + "ssid": "string", + "frequency": "string", + "channel": "string", + "apGroup": {}, + "location": {}, + "clientConnection": "string", + "connectedDevice": [ + {} + ], + "issueCount": 0, + "rssi": "string", + "avgRssi": {}, + "snr": "string", + "avgSnr": {}, + "dataRate": "string", + "txBytes": "string", + "rxBytes": "string", + "dnsSuccess": {}, + "dnsFailure": {}, + "onboarding": { + "averageRunDuration": {}, + "maxRunDuration": {}, + "averageAssocDuration": {}, + "maxAssocDuration": {}, + "averageAuthDuration": {}, + "maxAuthDuration": {}, + "averageDhcpDuration": {}, + "maxDhcpDuration": {}, + "aaaServerIp": "string", + "dhcpServerIp": {}, + "authDoneTime": {}, + "assocDoneTime": {}, + "dhcpDoneTime": {}, + "assocRootcauseList": [ + {} + ], + "aaaRootcauseList": [ + {} + ], + "dhcpRootcauseList": [ + {} + ], + "otherRootcauseList": [ + {} + ] + }, + "clientType": "string", + "onboardingTime": {}, + "port": {}, + "iosCapable": true + }, + "connectionInfo": { + "hostType": "string", + "nwDeviceName": "string", + "nwDeviceMac": "string", + "protocol": "string", + "band": "string", + "spatialStream": "string", + "channel": "string", + "channelWidth": "string", + "wmm": "string", + "uapsd": "string", + "timestamp": 0 + }, + "topology": { + "nodes": [ + { + "role": "string", + "name": "string", + "id": "string", + "description": "string", + "deviceType": "string", + "platformId": {}, + "family": {}, + "ip": "string", + "softwareVersion": {}, + "userId": {}, + "nodeType": "string", + "radioFrequency": {}, + "clients": {}, + "count": {}, + "healthScore": 0, + "level": 0, + "fabricGroup": {}, + "connectedDevice": {} + } + ], + "links": [ + { + "source": "string", + "linkStatus": "string", + "label": [ + "string" + ], + "target": "string", + "id": {}, + "portUtilization": {} + } + ] + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/client_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/client_enrichment_details_info.py new file mode 100644 index 00000000..da1fd47d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/client_enrichment_details_info.py @@ -0,0 +1,230 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: client_enrichment_details_info +short_description: Information module for Client Enrichment Details +description: +- Get all Client Enrichment Details. +- > + Enriches a given network End User context a network user-id or end user's device Mac Address with details about + the user, the devices that the user is connected to and the assurance issues that the user is impacted by. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Clients GetClientEnrichmentDetails + description: Complete reference of the GetClientEnrichmentDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-client-enrichment-details +notes: + - SDK Method used are + clients.Clients.get_client_enrichment_details, + + - Paths used are + get /dna/intent/api/v1/client-enrichment-details, + +""" + +EXAMPLES = r""" +- name: Get all Client Enrichment Details + cisco.dnac.client_enrichment_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "userDetails": { + "id": "string", + "connectionStatus": "string", + "hostType": "string", + "userId": "string", + "hostName": {}, + "hostOs": {}, + "hostVersion": {}, + "subType": {}, + "lastUpdated": 0, + "healthScore": [ + { + "healthType": "string", + "reason": "string", + "score": 0 + } + ], + "hostMac": "string", + "hostIpV4": "string", + "hostIpV6": [ + {} + ], + "authType": {}, + "vlanId": "string", + "ssid": {}, + "location": {}, + "clientConnection": "string", + "connectedDevice": [ + {} + ], + "issueCount": 0, + "rssi": {}, + "snr": {}, + "dataRate": {}, + "port": {} + }, + "connectedDevice": [ + { + "deviceDetails": { + "family": "string", + "type": "string", + "location": {}, + "errorCode": "string", + "macAddress": "string", + "role": "string", + "apManagerInterfaceIp": "string", + "associatedWlcIp": "string", + "bootDateTime": {}, + "collectionStatus": "string", + "interfaceCount": {}, + "lineCardCount": {}, + "lineCardId": {}, + "managementIpAddress": "string", + "memorySize": "string", + "platformId": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "snmpContact": "string", + "snmpLocation": "string", + "tunnelUdpPort": "string", + "waasDeviceMode": {}, + "series": "string", + "inventoryStatusDetail": "string", + "collectionInterval": "string", + "serialNumber": "string", + "softwareVersion": "string", + "roleSource": "string", + "hostname": "string", + "upTime": "string", + "lastUpdateTime": 0, + "errorDescription": {}, + "locationName": {}, + "tagCount": "string", + "lastUpdated": "string", + "instanceUuid": "string", + "id": "string", + "neighborTopology": [ + { + "nodes": [ + { + "role": "string", + "name": "string", + "id": "string", + "description": "string", + "deviceType": {}, + "platformId": {}, + "family": {}, + "ip": {}, + "softwareVersion": {}, + "userId": {}, + "nodeType": {}, + "radioFrequency": {}, + "clients": 0, + "count": {}, + "healthScore": {}, + "level": 0, + "fabricGroup": {} + } + ], + "links": [ + { + "source": "string", + "linkStatus": "string", + "label": [ + {} + ], + "target": "string", + "id": {}, + "portUtilization": {} + } + ] + } + ], + "cisco360view": "string" + } + } + ], + "issueDetails": { + "issue": [ + { + "issueId": "string", + "issueSource": "string", + "issueCategory": "string", + "issueName": "string", + "issueDescription": "string", + "issueEntity": "string", + "issueEntityValue": "string", + "issueSeverity": "string", + "issuePriority": "string", + "issueSummary": "string", + "issueTimestamp": 0, + "suggestedActions": [ + { + "message": "string", + "steps": [ + {} + ] + } + ], + "impactedHosts": [ + { + "hostType": "string", + "hostName": "string", + "hostOs": "string", + "ssid": "string", + "connectedInterface": "string", + "macAddress": "string", + "failedAttempts": 0, + "location": { + "siteId": "string", + "siteType": "string", + "area": "string", + "building": "string", + "floor": {}, + "apsImpacted": [ + {} + ] + }, + "timestamp": 0 + } + ] + } + ] + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/client_health_info.py b/ansible_collections/cisco/dnac/plugins/modules/client_health_info.py new file mode 100644 index 00000000..2def53c9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/client_health_info.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: client_health_info +short_description: Information module for Client Health +description: +- Get all Client Health. +- Returns Overall Client Health information by Client type Wired and Wireless for any given point of time. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + timestamp: + description: + - Timestamp query parameter. Epoch time(in milliseconds) when the Client health data is required. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Clients GetOverallClientHealth + description: Complete reference of the GetOverallClientHealth API. + link: https://developer.cisco.com/docs/dna-center/#!get-overall-client-health +notes: + - SDK Method used are + clients.Clients.get_overall_client_health, + + - Paths used are + get /dna/intent/api/v1/client-health, + +""" + +EXAMPLES = r""" +- name: Get all Client Health + cisco.dnac.client_health_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + timestamp: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "siteId": "string", + "scoreDetail": [ + { + "scoreCategory": { + "scoreCategory": "string", + "value": "string" + }, + "scoreValue": 0, + "clientCount": 0, + "clientUniqueCount": 0, + "starttime": 0, + "endtime": 0, + "scoreList": [ + { + "scoreCategory": { + "scoreCategory": "string", + "value": "string" + }, + "scoreValue": 0, + "clientCount": 0, + "clientUniqueCount": 0, + "starttime": 0, + "endtime": 0, + "scoreList": [ + { + "scoreCategory": { + "scoreCategory": "string", + "value": "string" + }, + "scoreValue": 0, + "clientCount": 0, + "clientUniqueCount": {}, + "starttime": 0, + "endtime": 0 + } + ] + } + ] + } + ] + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/client_proximity_info.py b/ansible_collections/cisco/dnac/plugins/modules/client_proximity_info.py new file mode 100644 index 00000000..d65c51e0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/client_proximity_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: client_proximity_info +short_description: Information module for Client Proximity +description: +- Get all Client Proximity. +- > + This intent API will provide client proximity information for a specific wireless user. Proximity is defined as + presence on the same floor at the same time as the specified wireless user. The Proximity workflow requires the + subscription to the following event via the Event Notification workflow prior to making this API call NETWORK- + CLIENTS-3-506 - Client Proximity Report. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + username: + description: + - Username query parameter. Wireless client username for which proximity information is required. + type: str + number_days: + description: + - > + Number_days query parameter. Number of days to track proximity until current date. Defaults and maximum up + to 14 days. + type: int + time_resolution: + description: + - > + Time_resolution query parameter. Time interval (in minutes) to measure proximity. Defaults to 15 minutes + with a minimum 5 minutes. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Clients ClientProximity + description: Complete reference of the ClientProximity API. + link: https://developer.cisco.com/docs/dna-center/#!client-proximity +notes: + - SDK Method used are + clients.Clients.client_proximity, + + - Paths used are + get /dna/intent/api/v1/client-proximity, + +""" + +EXAMPLES = r""" +- name: Get all Client Proximity + cisco.dnac.client_proximity_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + username: string + number_days: 0 + time_resolution: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/command_runner_run_command.py b/ansible_collections/cisco/dnac/plugins/modules/command_runner_run_command.py new file mode 100644 index 00000000..34222b28 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/command_runner_run_command.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: command_runner_run_command +short_description: Resource module for Command Runner Run Command +description: +- Manage operation create of the resource Command Runner Run Command. +- Submit request for read-only CLIs. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + commands: + description: Command Runner Run Command's commands. + elements: str + type: list + description: + description: Command Runner Run Command's description. + type: str + deviceUuids: + description: Command Runner Run Command's deviceUuids. + elements: str + type: list + name: + description: Command Runner Run Command's name. + type: str + timeout: + description: Command Runner Run Command's timeout. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Command Runner RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration + description: Complete reference of the RunReadOnlyCommandsOnDevicesToGetTheirRealTimeConfiguration API. + link: https://developer.cisco.com/docs/dna-center/#!run-read-only-commands-on-devices-to-get-their-real-time-configuration +notes: + - SDK Method used are + command_runner.CommandRunner.run_read_only_commands_on_devices, + + - Paths used are + post /dna/intent/api/v1/network-device-poller/cli/read-request, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.command_runner_run_command: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + commands: + - string + description: string + deviceUuids: + - string + name: string + timeout: 0 + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/compliance_check_run.py b/ansible_collections/cisco/dnac/plugins/modules/compliance_check_run.py new file mode 100644 index 00000000..6d9a5c6b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/compliance_check_run.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: compliance_check_run +short_description: Resource module for Compliance Check Run +description: +- Manage operation create of the resource Compliance Check Run. +- Run compliance check for devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + categories: + description: Compliance Check Run's categories. + elements: str + type: list + deviceUuids: + description: Compliance Check Run's deviceUuids. + elements: str + type: list + triggerFull: + description: TriggerFull flag. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Compliance RunCompliance + description: Complete reference of the RunCompliance API. + link: https://developer.cisco.com/docs/dna-center/#!run-compliance +notes: + - SDK Method used are + compliance.Compliance.run_compliance, + + - Paths used are + post /dna/intent/api/v1/compliance/, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.compliance_check_run: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + categories: + - string + deviceUuids: + - string + triggerFull: true + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/compliance_device_by_id_info.py b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_by_id_info.py new file mode 100644 index 00000000..b4b59543 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_by_id_info.py @@ -0,0 +1,143 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: compliance_device_by_id_info +short_description: Information module for Compliance Device By Id +description: +- Get all Compliance Device By Id. +- Return compliance detailed report for a device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceUuid: + description: + - DeviceUuid path parameter. + type: str + category: + description: + - Category query parameter. ComplianceCategory can have any value among 'INTENT', 'RUNNING_CONFIG'. + type: str + complianceType: + description: + - > + ComplianceType query parameter. ComplianceType can have any value among 'NETWORK_DESIGN', 'NETWORK_PROFILE', + 'FABRIC', 'POLICY', 'RUNNING_CONFIG'. + type: str + diffList: + description: + - DiffList query parameter. Diff list pass true to fetch the diff list. + type: bool + key: + description: + - Key query parameter. Extended attribute key. + type: str + value: + description: + - Value query parameter. Extended attribute value. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Compliance ComplianceDetailsOfDevice + description: Complete reference of the ComplianceDetailsOfDevice API. + link: https://developer.cisco.com/docs/dna-center/#!compliance-details-of-device +notes: + - SDK Method used are + compliance.Compliance.compliance_details_of_device, + + - Paths used are + get /dna/intent/api/v1/compliance/{deviceUuid}/detail, + +""" + +EXAMPLES = r""" +- name: Get all Compliance Device By Id + cisco.dnac.compliance_device_by_id_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + category: string + complianceType: string + diffList: True + key: string + value: string + deviceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "deviceUuid": "string", + "version": "string", + "response": [ + { + "displayName": "string", + "complianceType": "string", + "lastSyncTime": "string", + "additionalDataURL": "string", + "sourceInfoList": [ + { + "count": 0, + "displayName": "string", + "diffList": [ + { + "displayName": "string", + "moveFromPath": "string", + "op": "string", + "configuredValue": "string", + "intendedValue": "string", + "path": "string", + "businessKey": "string", + "extendedAttributes": "string" + } + ], + "sourceEnum": "string", + "licenseAppName": "string", + "provisioningArea": "string", + "networkProfileName": "string", + "nameWithBusinessKey": "string", + "appName": "string", + "name": "string", + "type": "string", + "businessKey": { + "otherAttributes": { + "cfsAttributes": "string", + "name": "string" + }, + "resourceName": "string", + "businessKeyAttributes": "string" + } + } + ], + "deviceUuid": "string", + "message": "string", + "state": "string", + "status": "string", + "category": "string", + "lastUpdateTime": 0 + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_count_info.py new file mode 100644 index 00000000..2bc29a30 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_count_info.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: compliance_device_details_count_info +short_description: Information module for Compliance Device Details Count +description: +- Get all Compliance Device Details Count. +- Return Compliance Count Detail. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + complianceType: + description: + - > + ComplianceType query parameter. ComplianceType can have any value among 'NETWORK_PROFILE', 'IMAGE', + 'APPLICATION_VISIBILITY', 'FABRIC', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. + type: str + complianceStatus: + description: + - > + ComplianceStatus query parameter. Compliance status can have value among 'COMPLIANT', 'NON_COMPLIANT', + 'IN_PROGRESS', 'NOT_AVAILABLE', 'NOT_APPLICABLE', 'ERROR'. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Compliance GetComplianceDetailCount + description: Complete reference of the GetComplianceDetailCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-compliance-detail-count +notes: + - SDK Method used are + compliance.Compliance.get_compliance_detail_count, + + - Paths used are + get /dna/intent/api/v1/compliance/detail/count, + +""" + +EXAMPLES = r""" +- name: Get all Compliance Device Details Count + cisco.dnac.compliance_device_details_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + complianceType: string + complianceStatus: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_info.py new file mode 100644 index 00000000..db098576 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_details_info.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: compliance_device_details_info +short_description: Information module for Compliance Device Details +description: +- Get all Compliance Device Details. +- Return Compliance Detail. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + complianceType: + description: + - > + ComplianceType query parameter. ComplianceType can have any value among 'NETWORK_PROFILE', 'IMAGE', + 'APPLICATION_VISIBILITY', 'FABRIC', 'PSIRT', 'RUNNING_CONFIG', 'WORKFLOW'. + type: str + complianceStatus: + description: + - > + ComplianceStatus query parameter. Compliance status can have value among 'COMPLIANT', 'NON_COMPLIANT', + 'IN_PROGRESS', 'NOT_AVAILABLE', 'NOT_APPLICABLE', 'ERROR'. + type: str + deviceUuid: + description: + - DeviceUuid query parameter. Comma separated deviceUuids. + type: str + offset: + description: + - Offset query parameter. Offset/starting row. + type: str + limit: + description: + - Limit query parameter. Number of records to be retrieved. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Compliance GetComplianceDetail + description: Complete reference of the GetComplianceDetail API. + link: https://developer.cisco.com/docs/dna-center/#!get-compliance-detail +notes: + - SDK Method used are + compliance.Compliance.get_compliance_detail, + + - Paths used are + get /dna/intent/api/v1/compliance/detail, + +""" + +EXAMPLES = r""" +- name: Get all Compliance Device Details + cisco.dnac.compliance_device_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + complianceType: string + complianceStatus: string + deviceUuid: string + offset: string + limit: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": [ + { + "complianceType": "string", + "lastSyncTime": "string", + "deviceUuid": "string", + "displayName": "string", + "status": "string", + "category": "string", + "lastUpdateTime": 0, + "state": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/compliance_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_info.py new file mode 100644 index 00000000..d256f41d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_info.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: compliance_device_info +short_description: Information module for Compliance Device +description: +- Get all Compliance Device. +- Get Compliance Device by id. +- Return compliance status of a device. +- Return compliance status of devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + complianceStatus: + description: + - > + ComplianceStatus query parameter. Compliance status can be have value among + 'COMPLIANT','NON_COMPLIANT','IN_PROGRESS', 'ERROR'. + type: str + deviceUuid: + description: + - DeviceUuid query parameter. Comma separated deviceUuids. + type: str + offset: + description: + - Offset query parameter. Offset/starting row. + type: int + limit: + description: + - Limit query parameter. Number of records to be retrieved. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Compliance DeviceComplianceStatus + description: Complete reference of the DeviceComplianceStatus API. + link: https://developer.cisco.com/docs/dna-center/#!device-compliance-status +- name: Cisco DNA Center documentation for Compliance GetComplianceStatus + description: Complete reference of the GetComplianceStatus API. + link: https://developer.cisco.com/docs/dna-center/#!get-compliance-status +notes: + - SDK Method used are + compliance.Compliance.device_compliance_status, + compliance.Compliance.get_compliance_status, + + - Paths used are + get /dna/intent/api/v1/compliance, + get /dna/intent/api/v1/compliance/{deviceUuid}, + +""" + +EXAMPLES = r""" +- name: Get all Compliance Device + cisco.dnac.compliance_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + complianceStatus: string + deviceUuid: string + offset: 0 + limit: 0 + register: result + +- name: Get Compliance Device by id + cisco.dnac.compliance_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "deviceUuid": "string", + "complianceStatus": "string", + "message": "string", + "scheduleTime": 0, + "lastUpdateTime": 0 + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/compliance_device_status_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_status_count_info.py new file mode 100644 index 00000000..ef33aae0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/compliance_device_status_count_info.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: compliance_device_status_count_info +short_description: Information module for Compliance Device Status Count +description: +- Get all Compliance Device Status Count. +- Return Compliance Status Count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + complianceStatus: + description: + - > + ComplianceStatus query parameter. Compliance status can have value among 'COMPLIANT', 'NON_COMPLIANT', + 'IN_PROGRESS', 'NOT_AVAILABLE', 'NOT_APPLICABLE', 'ERROR'. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Compliance GetComplianceStatusCount + description: Complete reference of the GetComplianceStatusCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-compliance-status-count +notes: + - SDK Method used are + compliance.Compliance.get_compliance_status_count, + + - Paths used are + get /dna/intent/api/v1/compliance/count, + +""" + +EXAMPLES = r""" +- name: Get all Compliance Device Status Count + cisco.dnac.compliance_device_status_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + complianceStatus: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template.py new file mode 100644 index 00000000..7df9fc71 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template.py @@ -0,0 +1,734 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template +short_description: Resource module for Configuration Template +description: +- Manage operations update and delete of the resource Configuration Template. +- Deletes the template by its id. +- API to update a template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + author: + description: Author of template. + type: str + composite: + description: Is it composite template. + type: bool + containingTemplates: + description: Configuration Template's containingTemplates. + elements: dict + suboptions: + composite: + description: Is it composite template. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + name: + description: Name of template. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateParams: + description: Configuration Template's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + tags: + description: Configuration Template's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + version: + description: Current version of template. + type: str + type: list + createTime: + description: Create time of template. + type: int + customParamsOrder: + description: Custom Params Order. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + failurePolicy: + description: Define failure policy if template provisioning fails. + type: str + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + lastUpdateTime: + description: Update time of template. + type: int + latestVersionTime: + description: Latest versioned template time. + type: int + name: + description: Name of template. + type: str + parentTemplateId: + description: Parent templateID. + type: str + projectId: + description: Project UUID. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateContent: + description: Rollback template content. + type: str + rollbackTemplateParams: + description: Configuration Template's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + softwareType: + description: Applicable device software type. + type: str + softwareVariant: + description: Applicable device software variant. + type: str + softwareVersion: + description: Applicable device software version. + type: str + tags: + description: Configuration Template's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateId: + description: TemplateId path parameter. TemplateId(UUID) of template to be deleted. + type: str + templateParams: + description: Configuration Template's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + validationErrors: + description: Configuration Template's validationErrors. + suboptions: + rollbackTemplateErrors: + description: Validation or design conflicts errors of rollback template. + elements: dict + type: list + templateErrors: + description: Validation or design conflicts errors. + elements: dict + type: list + templateId: + description: UUID of template. + type: str + templateVersion: + description: Current version of template. + type: str + type: dict + version: + description: Current version of template. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates DeletesTheTemplate + description: Complete reference of the DeletesTheTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!deletes-the-template +- name: Cisco DNA Center documentation for Configuration Templates UpdateTemplate + description: Complete reference of the UpdateTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!update-template +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.deletes_the_template, + configuration_templates.ConfigurationTemplates.update_template, + + - Paths used are + delete /dna/intent/api/v1/template-programmer/template/{templateId}, + put /dna/intent/api/v1/template-programmer/template, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.configuration_template: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + author: string + composite: true + containingTemplates: + - composite: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + id: string + language: string + name: string + projectName: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + version: string + createTime: 0 + customParamsOrder: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + failurePolicy: string + id: string + language: string + lastUpdateTime: 0 + latestVersionTime: 0 + name: string + parentTemplateId: string + projectId: string + projectName: string + rollbackTemplateContent: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + softwareType: string + softwareVariant: string + softwareVersion: string + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + validationErrors: + rollbackTemplateErrors: + - {} + templateErrors: + - {} + templateId: string + templateVersion: string + version: string + +- name: Delete by id + cisco.dnac.configuration_template: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + templateId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_clone.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_clone.py new file mode 100644 index 00000000..be0a5c1c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_clone.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_clone +short_description: Resource module for Configuration Template Clone +description: +- Manage operation create of the resource Configuration Template Clone. +- API to clone template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + name: + description: Name path parameter. Template name to clone template(Name should be + different than existing template name within same project). + type: str + projectId: + description: ProjectId query parameter. UUID of the project in which the template + needs to be created. + type: str + templateId: + description: TemplateId path parameter. UUID of the template to clone it. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates CreatesACloneOfTheGivenTemplate + description: Complete reference of the CreatesACloneOfTheGivenTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!creates-a-clone-of-the-given-template +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.clone_given_template, + + - Paths used are + post /dna/intent/api/v1/template-programmer/clone/name/{name}/project/{projectId}/template/{templateId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_clone: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + name: string + projectId: string + templateId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_create.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_create.py new file mode 100644 index 00000000..c98a2b2d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_create.py @@ -0,0 +1,712 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_create +short_description: Resource module for Configuration Template Create +description: +- Manage operation create of the resource Configuration Template Create. +- API to create a template by project id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + author: + description: Author of template. + type: str + composite: + description: Is it composite template. + type: bool + containingTemplates: + description: Configuration Template Create's containingTemplates. + elements: dict + suboptions: + composite: + description: Is it composite template. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Create's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + name: + description: Name of template. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateParams: + description: Configuration Template Create's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + tags: + description: Configuration Template Create's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Create's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + version: + description: Current version of template. + type: str + type: list + createTime: + description: Create time of template. + type: int + customParamsOrder: + description: Custom Params Order. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Create's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + failurePolicy: + description: Define failure policy if template provisioning fails. + type: str + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + lastUpdateTime: + description: Update time of template. + type: int + latestVersionTime: + description: Latest versioned template time. + type: int + name: + description: Name of template. + type: str + parentTemplateId: + description: Parent templateID. + type: str + projectId: + description: Project UUID. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateContent: + description: Rollback template content. + type: str + rollbackTemplateParams: + description: Configuration Template Create's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + softwareType: + description: Applicable device software type. + type: str + softwareVariant: + description: Applicable device software variant. + type: str + softwareVersion: + description: Applicable device software version. + type: str + tags: + description: Configuration Template Create's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Create's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + validationErrors: + description: Configuration Template Create's validationErrors. + suboptions: + rollbackTemplateErrors: + description: Validation or design conflicts errors of rollback template. + elements: dict + type: list + templateErrors: + description: Validation or design conflicts errors. + elements: dict + type: list + templateId: + description: UUID of template. + type: str + templateVersion: + description: Current version of template. + type: str + type: dict + version: + description: Current version of template. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates CreateTemplate + description: Complete reference of the CreateTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!create-template +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.create_template, + + - Paths used are + post /dna/intent/api/v1/template-programmer/project/{projectId}/template, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + author: string + composite: true + containingTemplates: + - composite: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + id: string + language: string + name: string + projectName: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + version: string + createTime: 0 + customParamsOrder: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + failurePolicy: string + id: string + language: string + lastUpdateTime: 0 + latestVersionTime: 0 + name: string + parentTemplateId: string + projectId: string + projectName: string + rollbackTemplateContent: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + softwareType: string + softwareVariant: string + softwareVersion: string + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + validationErrors: + rollbackTemplateErrors: + - {} + templateErrors: + - {} + templateId: string + templateVersion: string + version: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy.py new file mode 100644 index 00000000..0b2074da --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy.py @@ -0,0 +1,134 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_deploy +short_description: Resource module for Configuration Template Deploy +description: +- Manage operation create of the resource Configuration Template Deploy. +- API to deploy a template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + forcePushTemplate: + description: ForcePushTemplate flag. + type: bool + isComposite: + description: Composite template flag. + type: bool + mainTemplateId: + description: Main template UUID of versioned template. + type: str + memberTemplateDeploymentInfo: + description: MemberTemplateDeploymentInfo. + elements: dict + type: list + targetInfo: + description: Configuration Template Deploy's targetInfo. + elements: dict + suboptions: + hostName: + description: Hostname of device is required if targetType is MANAGED_DEVICE_HOSTNAME. + type: str + id: + description: UUID of target is required if targetType is MANAGED_DEVICE_UUID. + type: str + params: + description: Template params/values to be provisioned. + type: dict + resourceParams: + description: Resource params to be provisioned. + elements: dict + type: list + type: + description: Target type of device. + type: str + versionedTemplateId: + description: Versioned templateUUID to be provisioned. + type: str + type: list + templateId: + description: UUID of template to be provisioned. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates DeployTemplate + description: Complete reference of the DeployTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!deploy-template +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.deploy_template, + + - Paths used are + post /dna/intent/api/v1/template-programmer/template/deploy, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_deploy: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + forcePushTemplate: true + isComposite: true + mainTemplateId: string + memberTemplateDeploymentInfo: + - {} + targetInfo: + - hostName: string + id: string + params: {} + resourceParams: + - {} + type: string + versionedTemplateId: string + templateId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "deploymentId": "string", + "deploymentName": "string", + "devices": [ + { + "detailedStatusMessage": "string", + "deviceId": "string", + "duration": "string", + "endTime": "string", + "identifier": "string", + "ipAddress": "string", + "name": "string", + "startTime": "string", + "status": "string", + "targetType": "string" + } + ], + "duration": "string", + "endTime": "string", + "projectName": "string", + "startTime": "string", + "status": "string", + "statusMessage": "string", + "templateName": "string", + "templateVersion": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_status_info.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_status_info.py new file mode 100644 index 00000000..21fd83a5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_status_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_deploy_status_info +short_description: Information module for Configuration Template Deploy Status +description: +- Get Configuration Template Deploy Status by id. +- API to retrieve the status of template deployment. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deploymentId: + description: + - DeploymentId path parameter. UUID of deployment to retrieve template deployment status. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates StatusOfTemplateDeployment + description: Complete reference of the StatusOfTemplateDeployment API. + link: https://developer.cisco.com/docs/dna-center/#!status-of-template-deployment +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.get_template_deployment_status, + + - Paths used are + get /dna/intent/api/v1/template-programmer/template/deploy/status/{deploymentId}, + +""" + +EXAMPLES = r""" +- name: Get Configuration Template Deploy Status by id + cisco.dnac.configuration_template_deploy_status_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deploymentId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "deploymentId": "string", + "deploymentName": "string", + "devices": [ + { + "detailedStatusMessage": "string", + "deviceId": "string", + "duration": "string", + "endTime": "string", + "identifier": "string", + "ipAddress": "string", + "name": "string", + "startTime": "string", + "status": "string", + "targetType": "string" + } + ], + "duration": "string", + "endTime": "string", + "projectName": "string", + "startTime": "string", + "status": "string", + "statusMessage": "string", + "templateName": "string", + "templateVersion": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_v2.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_v2.py new file mode 100644 index 00000000..62b9935c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_deploy_v2.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_deploy_v2 +short_description: Resource module for Configuration Template Deploy V2 +description: +- Manage operation create of the resource Configuration Template Deploy V2. +- V2 API to deploy a template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + forcePushTemplate: + description: ForcePushTemplate flag. + type: bool + isComposite: + description: Composite template flag. + type: bool + mainTemplateId: + description: Main template UUID of versioned template. + type: str + memberTemplateDeploymentInfo: + description: MemberTemplateDeploymentInfo. + elements: dict + type: list + targetInfo: + description: Configuration Template Deploy V2's targetInfo. + elements: dict + suboptions: + hostName: + description: Hostname of device is required if targetType is MANAGED_DEVICE_HOSTNAME. + type: str + id: + description: UUID of target is required if targetType is MANAGED_DEVICE_UUID. + type: str + params: + description: Template params/values to be provisioned. + type: dict + resourceParams: + description: Resource params to be provisioned. + elements: dict + type: list + type: + description: Target type of device. + type: str + versionedTemplateId: + description: Versioned templateUUID to be provisioned. + type: str + type: list + templateId: + description: UUID of template to be provisioned. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates DeployTemplateV2 + description: Complete reference of the DeployTemplateV2 API. + link: https://developer.cisco.com/docs/dna-center/#!deploy-template-v-2 +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.deploy_template_v2, + + - Paths used are + post /dna/intent/api/v2/template-programmer/template/deploy, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_deploy_v2: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + forcePushTemplate: true + isComposite: true + mainTemplateId: string + memberTemplateDeploymentInfo: + - {} + targetInfo: + - hostName: string + id: string + params: {} + resourceParams: + - {} + type: string + versionedTemplateId: string + templateId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_project.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_project.py new file mode 100644 index 00000000..377f4fbe --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_project.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_export_project +short_description: Resource module for Configuration Template Export Project +description: +- Manage operation create of the resource Configuration Template Export Project. +- Exports the projects for given projectNames. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Configuration Template Export Project's payload. + elements: dict + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates ExportsTheProjectsForAGivenCriteria + description: Complete reference of the ExportsTheProjectsForAGivenCriteria API. + link: https://developer.cisco.com/docs/dna-center/#!exports-the-projects-for-a-given-criteria +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.export_projects, + + - Paths used are + post /dna/intent/api/v1/template-programmer/project/name/exportprojects, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_export_project: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - {} + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_template.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_template.py new file mode 100644 index 00000000..df4a5832 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_export_template.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_export_template +short_description: Resource module for Configuration Template Export Template +description: +- Manage operation create of the resource Configuration Template Export Template. +- Exports the templates for given templateIds. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Configuration Template Export Template's payload. + elements: dict + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates ExportsTheTemplatesForAGivenCriteria + description: Complete reference of the ExportsTheTemplatesForAGivenCriteria API. + link: https://developer.cisco.com/docs/dna-center/#!exports-the-templates-for-a-given-criteria +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.export_templates, + + - Paths used are + post /dna/intent/api/v1/template-programmer/template/exporttemplates, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_export_template: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - {} + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_project.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_project.py new file mode 100644 index 00000000..28466586 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_project.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_import_project +short_description: Resource module for Configuration Template Import Project +description: +- Manage operation create of the resource Configuration Template Import Project. +- Imports the Projects provided in the DTO. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + doVersion: + description: DoVersion query parameter. If this flag is true then it creates a new + version of the template with the imported contents in case if the templates already + exists. " If this flag is false and if template already exists, then operation + fails with 'Template already exists' error. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates ImportsTheProjectsProvided + description: Complete reference of the ImportsTheProjectsProvided API. + link: https://developer.cisco.com/docs/dna-center/#!imports-the-projects-provided +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.imports_the_projects_provided, + + - Paths used are + post /dna/intent/api/v1/template-programmer/project/importprojects, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_import_project: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + doVersion: true + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_template.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_template.py new file mode 100644 index 00000000..7f77a5d9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_import_template.py @@ -0,0 +1,730 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_import_template +short_description: Resource module for Configuration Template Import Template +description: +- Manage operation create of the resource Configuration Template Import Template. +- Imports the templates provided in the DTO by project Name. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + doVersion: + description: DoVersion query parameter. If this flag is true then it creates a new + version of the template with the imported contents in case if the templates already + exists. " If this flag is false and if template already exists, then operation + fails with 'Template already exists' error. + type: bool + payload: + description: Configuration Template Import Template's payload. + elements: dict + suboptions: + author: + description: Author of template. + type: str + composite: + description: Is it composite template. + type: bool + containingTemplates: + description: Configuration Template Import Template's containingTemplates. + elements: dict + suboptions: + composite: + description: Is it composite template. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Import Template's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + name: + description: Name of template. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateParams: + description: Configuration Template Import Template's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Import Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Import Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + tags: + description: Configuration Template Import Template's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Import Template's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Import Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Import Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + version: + description: Current version of template. + type: str + type: list + createTime: + description: Create time of template. + type: int + customParamsOrder: + description: Custom Params Order. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Import Template's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + failurePolicy: + description: Define failure policy if template provisioning fails. + type: str + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + lastUpdateTime: + description: Update time of template. + type: int + latestVersionTime: + description: Latest versioned template time. + type: int + name: + description: Name of template. + type: str + parentTemplateId: + description: Parent templateID. + type: str + projectId: + description: Project UUID. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateContent: + description: Rollback template content. + type: str + rollbackTemplateParams: + description: Configuration Template Import Template's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Import Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Import Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + softwareType: + description: Applicable device software type. + type: str + softwareVariant: + description: Applicable device software variant. + type: str + softwareVersion: + description: Applicable device software version. + type: str + tags: + description: Configuration Template Import Template's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Import Template's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Import Template's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Import Template's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + validationErrors: + description: Configuration Template Import Template's validationErrors. + suboptions: + rollbackTemplateErrors: + description: Validation or design conflicts errors of rollback template. + elements: dict + type: list + templateErrors: + description: Validation or design conflicts errors. + elements: dict + type: list + templateId: + description: UUID of template. + type: str + templateVersion: + description: Current version of template. + type: str + type: dict + version: + description: Current version of template. + type: str + type: list + projectName: + description: ProjectName path parameter. Project name to create template under the + project. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates ImportsTheTemplatesProvided + description: Complete reference of the ImportsTheTemplatesProvided API. + link: https://developer.cisco.com/docs/dna-center/#!imports-the-templates-provided +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.imports_the_templates_provided, + + - Paths used are + post /dna/intent/api/v1/template-programmer/project/name/{projectName}/template/importtemplates, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_import_template: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + doVersion: true + payload: + - author: string + composite: true + containingTemplates: + - composite: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + id: string + language: string + name: string + projectName: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + version: string + createTime: 0 + customParamsOrder: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + failurePolicy: string + id: string + language: string + lastUpdateTime: 0 + latestVersionTime: 0 + name: string + parentTemplateId: string + projectId: string + projectName: string + rollbackTemplateContent: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + softwareType: string + softwareVariant: string + softwareVersion: string + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + validationErrors: + rollbackTemplateErrors: + - {} + templateErrors: + - {} + templateId: string + templateVersion: string + version: string + projectName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_info.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_info.py new file mode 100644 index 00000000..0d756061 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_info.py @@ -0,0 +1,355 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_info +short_description: Information module for Configuration Template +description: +- Get all Configuration Template. +- Get Configuration Template by id. +- Details of the template by its id. +- List the templates available. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + projectId: + description: + - ProjectId query parameter. Filter template(s) based on project UUID. + type: str + softwareType: + description: + - SoftwareType query parameter. Filter template(s) based software type. + type: str + softwareVersion: + description: + - SoftwareVersion query parameter. Filter template(s) based softwareVersion. + type: str + productFamily: + description: + - ProductFamily query parameter. Filter template(s) based on device family. + type: str + productSeries: + description: + - ProductSeries query parameter. Filter template(s) based on device series. + type: str + productType: + description: + - ProductType query parameter. Filter template(s) based on device type. + type: str + filterConflictingTemplates: + description: + - FilterConflictingTemplates query parameter. Filter template(s) based on confliting templates. + type: bool + tags: + description: + - Tags query parameter. Filter template(s) based on tags. + elements: str + type: list + projectNames: + description: + - ProjectNames query parameter. Filter template(s) based on project names. + elements: str + type: list + unCommitted: + description: + - UnCommitted query parameter. Filter template(s) based on template commited or not. + type: bool + sortOrder: + description: + - SortOrder query parameter. Sort Order Ascending (asc) or Descending (des). + type: str + templateId: + description: + - TemplateId path parameter. TemplateId(UUID) to get details of the template. + type: str + latestVersion: + description: + - LatestVersion query parameter. LatestVersion flag to get the latest versioned template. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates GetsDetailsOfAGivenTemplate + description: Complete reference of the GetsDetailsOfAGivenTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!gets-details-of-a-given-template +- name: Cisco DNA Center documentation for Configuration Templates GetsTheTemplatesAvailable + description: Complete reference of the GetsTheTemplatesAvailable API. + link: https://developer.cisco.com/docs/dna-center/#!gets-the-templates-available +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.get_template_details, + configuration_templates.ConfigurationTemplates.gets_the_templates_available, + + - Paths used are + get /dna/intent/api/v1/template-programmer/template, + get /dna/intent/api/v1/template-programmer/template/{templateId}, + +""" + +EXAMPLES = r""" +- name: Get all Configuration Template + cisco.dnac.configuration_template_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + projectId: string + softwareType: string + softwareVersion: string + productFamily: string + productSeries: string + productType: string + filterConflictingTemplates: True + tags: [] + projectNames: [] + unCommitted: True + sortOrder: string + register: result + +- name: Get Configuration Template by id + cisco.dnac.configuration_template_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + latestVersion: True + templateId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "author": "string", + "composite": true, + "containingTemplates": [ + { + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "composite": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "id": "string", + "language": "string", + "name": "string", + "projectName": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "version": "string" + } + ], + "createTime": 0, + "customParamsOrder": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "failurePolicy": "string", + "id": "string", + "language": "string", + "lastUpdateTime": 0, + "latestVersionTime": 0, + "name": "string", + "parentTemplateId": "string", + "projectId": "string", + "projectName": "string", + "rollbackTemplateContent": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "softwareType": "string", + "softwareVariant": "string", + "softwareVersion": "string", + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "validationErrors": { + "rollbackTemplateErrors": [ + {} + ], + "templateErrors": [ + {} + ], + "templateId": "string", + "templateVersion": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_project.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_project.py new file mode 100644 index 00000000..518ac61f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_project.py @@ -0,0 +1,958 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_project +short_description: Resource module for Configuration Template Project +description: +- Manage operations create, update and delete of the resource Configuration Template Project. +- This API is used to create a new project. +- Deletes the project by its id. +- This API is used to update an existing project. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + createTime: + description: Create time of project. + type: int + description: + description: Description of project. + type: str + id: + description: UUID of project. + type: str + lastUpdateTime: + description: Update time of project. + type: int + name: + description: Name of project. + type: str + projectId: + description: ProjectId path parameter. ProjectId(UUID) of project to be deleted. + type: str + tags: + description: Configuration Template Project's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templates: + description: List of templates within the project. + elements: dict + suboptions: + author: + description: Author of template. + type: str + composite: + description: Is it composite template. + type: bool + containingTemplates: + description: Configuration Template Project's containingTemplates. + elements: dict + suboptions: + composite: + description: Is it composite template. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Project's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + name: + description: Name of template. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateParams: + description: Configuration Template Project's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Project's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Project's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + tags: + description: Configuration Template Project's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Project's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Project's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Project's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + version: + description: Current version of template. + type: str + type: list + createTime: + description: Create time of template. + type: int + customParamsOrder: + description: Custom Params Order. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Project's deviceTypes. + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + failurePolicy: + description: Define failure policy if template provisioning fails. + type: str + id: + description: UUID of template. + type: str + language: + description: Template language (JINJA or VELOCITY). + type: str + lastUpdateTime: + description: Update time of template. + type: int + latestVersionTime: + description: Latest versioned template time. + type: int + name: + description: Name of template. + type: str + parentTemplateId: + description: Parent templateID. + type: str + projectId: + description: Project UUID. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateContent: + description: Rollback template content. + type: str + rollbackTemplateParams: + description: Configuration Template Project's rollbackTemplateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Project's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Project's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + softwareType: + description: Applicable device software type. + type: str + softwareVariant: + description: Applicable device software variant. + type: str + softwareVersion: + description: Applicable device software version. + type: str + tags: + description: Configuration Template Project's tags. + elements: dict + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Project's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Project's range. + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Project's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + validationErrors: + description: Configuration Template Project's validationErrors. + suboptions: + rollbackTemplateErrors: + description: Validation or design conflicts errors of rollback template. + elements: dict + type: list + templateErrors: + description: Validation or design conflicts errors. + elements: dict + type: list + templateId: + description: UUID of template. + type: str + templateVersion: + description: Current version of template. + type: str + type: dict + version: + description: Current version of template. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates CreateProject + description: Complete reference of the CreateProject API. + link: https://developer.cisco.com/docs/dna-center/#!create-project +- name: Cisco DNA Center documentation for Configuration Templates DeletesTheProject + description: Complete reference of the DeletesTheProject API. + link: https://developer.cisco.com/docs/dna-center/#!deletes-the-project +- name: Cisco DNA Center documentation for Configuration Templates UpdateProject + description: Complete reference of the UpdateProject API. + link: https://developer.cisco.com/docs/dna-center/#!update-project +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.create_project, + configuration_templates.ConfigurationTemplates.deletes_the_project, + configuration_templates.ConfigurationTemplates.update_project, + + - Paths used are + post /dna/intent/api/v1/template-programmer/project, + delete /dna/intent/api/v1/template-programmer/project/{projectId}, + put /dna/intent/api/v1/template-programmer/project, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_project: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + createTime: 0 + description: string + id: string + lastUpdateTime: 0 + name: string + tags: + - id: string + name: string + templates: + - author: string + composite: true + containingTemplates: + - composite: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + id: string + language: string + name: string + projectName: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + version: string + createTime: 0 + customParamsOrder: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + failurePolicy: string + id: string + language: string + lastUpdateTime: 0 + latestVersionTime: 0 + name: string + parentTemplateId: string + projectId: string + projectName: string + rollbackTemplateContent: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + softwareType: string + softwareVariant: string + softwareVersion: string + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + validationErrors: + rollbackTemplateErrors: + - {} + templateErrors: + - {} + templateId: string + templateVersion: string + version: string + +- name: Update all + cisco.dnac.configuration_template_project: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + createTime: 0 + description: string + id: string + lastUpdateTime: 0 + name: string + tags: + - id: string + name: string + templates: + - author: string + composite: true + containingTemplates: + - composite: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + id: string + language: string + name: string + projectName: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + version: string + createTime: 0 + customParamsOrder: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + failurePolicy: string + id: string + language: string + lastUpdateTime: 0 + latestVersionTime: 0 + name: string + parentTemplateId: string + projectId: string + projectName: string + rollbackTemplateContent: string + rollbackTemplateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + softwareType: string + softwareVariant: string + softwareVersion: string + tags: + - id: string + name: string + templateContent: string + templateParams: + - binding: string + customOrder: 0 + dataType: string + defaultValue: string + description: string + displayName: string + group: string + id: string + instructionText: string + key: string + notParam: true + order: 0 + paramArray: true + parameterName: string + provider: string + range: + - id: string + maxValue: 0 + minValue: 0 + required: true + selection: + defaultSelectedValues: + - string + id: string + selectionType: string + selectionValues: {} + validationErrors: + rollbackTemplateErrors: + - {} + templateErrors: + - {} + templateId: string + templateVersion: string + version: string + +- name: Delete by id + cisco.dnac.configuration_template_project: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + projectId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_project_info.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_project_info.py new file mode 100644 index 00000000..fa1c0424 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_project_info.py @@ -0,0 +1,319 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_project_info +short_description: Information module for Configuration Template Project +description: +- Get all Configuration Template Project. +- Get Configuration Template Project by id. +- Get the details of the given project by its id. +- List the projects. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. Name of project to be searched. + type: str + sortOrder: + description: + - SortOrder query parameter. Sort Order Ascending (asc) or Descending (des). + type: str + projectId: + description: + - ProjectId path parameter. ProjectId(UUID) of project to get project details. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates GetsAListOfProjects + description: Complete reference of the GetsAListOfProjects API. + link: https://developer.cisco.com/docs/dna-center/#!gets-a-list-of-projects +- name: Cisco DNA Center documentation for Configuration Templates GetsTheDetailsOfAGivenProject + description: Complete reference of the GetsTheDetailsOfAGivenProject API. + link: https://developer.cisco.com/docs/dna-center/#!gets-the-details-of-a-given-project +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.get_project_details, + configuration_templates.ConfigurationTemplates.get_projects, + + - Paths used are + get /dna/intent/api/v1/template-programmer/project, + get /dna/intent/api/v1/template-programmer/project/{projectId}, + +""" + +EXAMPLES = r""" +- name: Get all Configuration Template Project + cisco.dnac.configuration_template_project_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + sortOrder: string + register: result + +- name: Get Configuration Template Project by id + cisco.dnac.configuration_template_project_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + projectId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "createTime": 0, + "description": "string", + "id": "string", + "lastUpdateTime": 0, + "name": "string", + "templates": [ + { + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "author": "string", + "composite": true, + "containingTemplates": [ + { + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "composite": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "id": "string", + "language": "string", + "name": "string", + "projectName": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "version": "string" + } + ], + "createTime": 0, + "customParamsOrder": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "failurePolicy": "string", + "id": "string", + "language": "string", + "lastUpdateTime": 0, + "latestVersionTime": 0, + "name": "string", + "parentTemplateId": "string", + "projectId": "string", + "projectName": "string", + "rollbackTemplateContent": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "softwareType": "string", + "softwareVariant": "string", + "softwareVersion": "string", + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "validationErrors": { + "rollbackTemplateErrors": [ + {} + ], + "templateErrors": [ + {} + ], + "templateId": "string", + "templateVersion": "string" + }, + "version": "string" + } + ], + "isDeletable": true + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_create.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_create.py new file mode 100644 index 00000000..b3210a7c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_create.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_version_create +short_description: Resource module for Configuration Template Version Create +description: +- Manage operation create of the resource Configuration Template Version Create. +- API to version the current contents of the template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + comments: + description: Template version comments. + type: str + templateId: + description: UUID of template. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates VersionTemplate + description: Complete reference of the VersionTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!version-template +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.version_template, + + - Paths used are + post /dna/intent/api/v1/template-programmer/template/version, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.configuration_template_version_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + comments: string + templateId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_info.py b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_info.py new file mode 100644 index 00000000..0f695665 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/configuration_template_version_info.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: configuration_template_version_info +short_description: Information module for Configuration Template Version +description: +- Get Configuration Template Version by id. +- Get all the versions of template by its id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + templateId: + description: + - TemplateId path parameter. TemplateId(UUID) to get list of versioned templates. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates GetsAllTheVersionsOfAGivenTemplate + description: Complete reference of the GetsAllTheVersionsOfAGivenTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!gets-all-the-versions-of-a-given-template +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.get_template_versions, + + - Paths used are + get /dna/intent/api/v1/template-programmer/template/version/{templateId}, + +""" + +EXAMPLES = r""" +- name: Get Configuration Template Version by id + cisco.dnac.configuration_template_version_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + templateId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "composite": true, + "name": "string", + "projectId": "string", + "projectName": "string", + "templateId": "string", + "versionsInfo": [ + { + "author": "string", + "description": "string", + "id": "string", + "version": "string", + "versionComment": "string", + "versionTime": 0 + } + ] + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_configurations_export.py b/ansible_collections/cisco/dnac/plugins/modules/device_configurations_export.py new file mode 100644 index 00000000..8f761afc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_configurations_export.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_configurations_export +short_description: Resource module for Device Configurations Export +description: +- Manage operation create of the resource Device Configurations Export. +- Export Device configurations to an encrypted zip file. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceId: + description: Device Id. + elements: str + type: list + password: + description: Password. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Archive ExportDeviceConfigurations + description: Complete reference of the ExportDeviceConfigurations API. + link: https://developer.cisco.com/docs/dna-center/#!export-device-configurations +notes: + - SDK Method used are + configuration_archive.ConfigurationArchive.export_device_configurations, + + - Paths used are + post /dna/intent/api/v1/network-device-archive/cleartext, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.device_configurations_export: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceId: + - string + password: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_credential_create.py b/ansible_collections/cisco/dnac/plugins/modules/device_credential_create.py new file mode 100644 index 00000000..d5732808 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_credential_create.py @@ -0,0 +1,192 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_credential_create +short_description: Resource module for Device Credential Create +description: +- Manage operation create of the resource Device Credential Create. +- API to create device credentials. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + settings: + description: Device Credential Create's settings. + suboptions: + cliCredential: + description: Device Credential Create's cliCredential. + elements: dict + suboptions: + description: + description: Name or description for CLI credential. + type: str + enablePassword: + description: Enable password for CLI credential. + type: str + password: + description: Password for CLI credential. + type: str + username: + description: User name for CLI credential. + type: str + type: list + httpsRead: + description: Device Credential Create's httpsRead. + elements: dict + suboptions: + name: + description: Name or description of http read credential. + type: str + password: + description: Password for http read credential. + type: str + port: + description: Port for http read credential. + type: int + username: + description: User name of the http read credential. + type: str + type: list + httpsWrite: + description: Device Credential Create's httpsWrite. + elements: dict + suboptions: + name: + description: Name or description of http write credential. + type: str + password: + description: Password for http write credential. + type: str + port: + description: Port for http write credential. + type: int + username: + description: User name of the http write credential. + type: str + type: list + snmpV2cRead: + description: Device Credential Create's snmpV2cRead. + elements: dict + suboptions: + description: + description: Description for snmp v2 read. + type: str + readCommunity: + description: Ready community for snmp v2 read credential. + type: str + type: list + snmpV2cWrite: + description: Device Credential Create's snmpV2cWrite. + elements: dict + suboptions: + description: + description: Description for snmp v2 write. + type: str + writeCommunity: + description: Write community for snmp v2 write credential. + type: str + type: list + snmpV3: + description: Device Credential Create's snmpV3. + elements: dict + suboptions: + authPassword: + description: Authentication password for snmpv3 credential. + type: str + authType: + description: Authentication type for snmpv3 credential. + type: str + description: + description: Name or description for SNMPV3 credential. + type: str + privacyPassword: + description: Privacy password for snmpv3 credential. + type: str + privacyType: + description: Privacy type for snmpv3 credential. + type: str + snmpMode: + description: Mode for snmpv3 credential. + type: str + username: + description: User name for SNMPv3 credential. + type: str + type: list + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings CreateDeviceCredentials + description: Complete reference of the CreateDeviceCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!create-device-credentials +notes: + - SDK Method used are + network_settings.NetworkSettings.create_device_credentials, + + - Paths used are + post /dna/intent/api/v1/device-credential, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.device_credential_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + settings: + cliCredential: + - description: string + enablePassword: string + password: string + username: string + httpsRead: + - name: string + password: string + port: 0 + username: string + httpsWrite: + - name: string + password: string + port: 0 + username: string + snmpV2cRead: + - description: string + readCommunity: string + snmpV2cWrite: + - description: string + writeCommunity: string + snmpV3: + - authPassword: string + authType: string + description: string + privacyPassword: string + privacyType: string + snmpMode: string + username: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_credential_delete.py b/ansible_collections/cisco/dnac/plugins/modules/device_credential_delete.py new file mode 100644 index 00000000..42cd7bf9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_credential_delete.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_credential_delete +short_description: Resource module for Device Credential Delete +description: +- Manage operation delete of the resource Device Credential Delete. +- Delete device credential. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. Global credential id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings DeleteDeviceCredential + description: Complete reference of the DeleteDeviceCredential API. + link: https://developer.cisco.com/docs/dna-center/#!delete-device-credential +notes: + - SDK Method used are + network_settings.NetworkSettings.delete_device_credential, + + - Paths used are + delete /dna/intent/api/v1/device-credential/{id}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.device_credential_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_credential_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_credential_info.py new file mode 100644 index 00000000..184d8205 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_credential_info.py @@ -0,0 +1,145 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_credential_info +short_description: Information module for Device Credential +description: +- Get all Device Credential. +- API to get device credential details. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. Site id to retrieve the credential details associated with the site. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings GetDeviceCredentialDetails + description: Complete reference of the GetDeviceCredentialDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-credential-details +notes: + - SDK Method used are + network_settings.NetworkSettings.get_device_credential_details, + + - Paths used are + get /dna/intent/api/v1/device-credential, + +""" + +EXAMPLES = r""" +- name: Get all Device Credential + cisco.dnac.device_credential_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "snmp_v3": [ + { + "username": "string", + "authPassword": "string", + "authType": "string", + "privacyPassword": "string", + "privacyType": "string", + "snmpMode": "string", + "comments": "string", + "description": "string", + "credentialType": "string", + "instanceUuid": "string", + "instanceTenantId": "string", + "id": "string" + } + ], + "http_read": [ + { + "secure": "string", + "username": "string", + "password": "string", + "port": "string", + "comments": "string", + "description": "string", + "credentialType": "string", + "instanceUuid": "string", + "instanceTenantId": "string", + "id": "string" + } + ], + "http_write": [ + { + "secure": "string", + "username": "string", + "password": "string", + "port": "string", + "comments": "string", + "description": "string", + "credentialType": "string", + "instanceUuid": "string", + "instanceTenantId": "string", + "id": "string" + } + ], + "snmp_v2_write": [ + { + "writeCommunity": "string", + "comments": "string", + "description": "string", + "credentialType": "string", + "instanceUuid": "string", + "instanceTenantId": "string", + "id": "string" + } + ], + "snmp_v2_read": [ + { + "readCommunity": "string", + "comments": "string", + "description": "string", + "credentialType": "string", + "instanceUuid": "string", + "instanceTenantId": "string", + "id": "string" + } + ], + "cli": [ + { + "username": "string", + "enablePassword": "string", + "password": "string", + "comments": "string", + "description": "string", + "credentialType": "string", + "instanceUuid": "string", + "instanceTenantId": "string", + "id": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_credential_update.py b/ansible_collections/cisco/dnac/plugins/modules/device_credential_update.py new file mode 100644 index 00000000..f17c18fb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_credential_update.py @@ -0,0 +1,210 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_credential_update +short_description: Resource module for Device Credential Update +description: +- Manage operation update of the resource Device Credential Update. +- API to update device credentials. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + settings: + description: Device Credential Update's settings. + suboptions: + cliCredential: + description: Device Credential Update's cliCredential. + suboptions: + description: + description: Description. + type: str + enablePassword: + description: Enable Password. + type: str + id: + description: Id. + type: str + password: + description: Password. + type: str + username: + description: Username. + type: str + type: dict + httpsRead: + description: Device Credential Update's httpsRead. + suboptions: + id: + description: Id. + type: str + name: + description: Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + username: + description: Username. + type: str + type: dict + httpsWrite: + description: Device Credential Update's httpsWrite. + suboptions: + id: + description: Id. + type: str + name: + description: Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + username: + description: Username. + type: str + type: dict + snmpV2cRead: + description: Device Credential Update's snmpV2cRead. + suboptions: + description: + description: Description. + type: str + id: + description: Id. + type: str + readCommunity: + description: Read Community. + type: str + type: dict + snmpV2cWrite: + description: Device Credential Update's snmpV2cWrite. + suboptions: + description: + description: Description. + type: str + id: + description: Id. + type: str + writeCommunity: + description: Write Community. + type: str + type: dict + snmpV3: + description: Device Credential Update's snmpV3. + suboptions: + authPassword: + description: Auth Password. + type: str + authType: + description: Auth Type. + type: str + description: + description: Description. + type: str + id: + description: Id. + type: str + privacyPassword: + description: Privacy Password. + type: str + privacyType: + description: Privacy Type. + type: str + snmpMode: + description: Snmp Mode. + type: str + username: + description: Username. + type: str + type: dict + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings UpdateDeviceCredentials + description: Complete reference of the UpdateDeviceCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!update-device-credentials +notes: + - SDK Method used are + network_settings.NetworkSettings.update_device_credentials, + + - Paths used are + put /dna/intent/api/v1/device-credential, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.device_credential_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + settings: + cliCredential: + description: string + enablePassword: string + id: string + password: string + username: string + httpsRead: + id: string + name: string + password: string + port: string + username: string + httpsWrite: + id: string + name: string + password: string + port: string + username: string + snmpV2cRead: + description: string + id: string + readCommunity: string + snmpV2cWrite: + description: string + id: string + writeCommunity: string + snmpV3: + authPassword: string + authType: string + description: string + id: string + privacyPassword: string + privacyType: string + snmpMode: string + username: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_details_info.py new file mode 100644 index 00000000..108be2c4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_details_info.py @@ -0,0 +1,120 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_details_info +short_description: Information module for Device Details +description: +- Get all Device Details. +- Returns detailed Network Device information retrieved by Mac Address, Device Name or UUID for any given point of time. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + timestamp: + description: + - Timestamp query parameter. Epoch time(in milliseconds) when the device data is required. + type: str + searchBy: + description: + - SearchBy query parameter. MAC Address or Device Name value or UUID of the network device. + type: str + identifier: + description: + - Identifier query parameter. One of keywords macAddress or uuid or nwDeviceName. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceDetail + description: Complete reference of the GetDeviceDetail API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-detail +notes: + - SDK Method used are + devices.Devices.get_device_detail, + + - Paths used are + get /dna/intent/api/v1/device-detail, + +""" + +EXAMPLES = r""" +- name: Get all Device Details + cisco.dnac.device_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + timestamp: string + searchBy: string + identifier: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "HALastResetReason": "string", + "managementIpAddr": "string", + "HAPrimaryPowerStatus": "string", + "redundancyMode": "string", + "communicationState": "string", + "nwDeviceName": "string", + "redundancyUnit": "string", + "platformId": "string", + "redundancyPeerState": "string", + "nwDeviceId": "string", + "redundancyState": "string", + "nwDeviceRole": "string", + "nwDeviceFamily": "string", + "macAddress": "string", + "collectionStatus": "string", + "deviceSeries": "string", + "osType": "string", + "clientCount": "string", + "HASecondaryPowerStatus": "string", + "softwareVersion": "string", + "nwDeviceType": "string", + "overallHealth": 0, + "memoryScore": 0, + "cpuScore": 0, + "noiseScore": 0, + "utilizationScore": 0, + "airQualityScore": 0, + "interferenceScore": 0, + "wqeScore": 0, + "freeMbufScore": 0, + "packetPoolScore": 0, + "freeTimerScore": 0, + "memory": "string", + "cpu": "string", + "noise": "string", + "utilization": "string", + "airQuality": "string", + "interference": "string", + "wqe": "string", + "freeMbuf": "string", + "packetPool": "string", + "freeTimer": "string", + "location": "string", + "timestamp": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_enrichment_details_info.py new file mode 100644 index 00000000..c0be8c61 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_enrichment_details_info.py @@ -0,0 +1,143 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_enrichment_details_info +short_description: Information module for Device Enrichment Details +description: +- Get all Device Enrichment Details. +- > + Enriches a given network device context device id or device Mac Address or device management IP address with + details about the device and neighbor topology. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceEnrichmentDetails + description: Complete reference of the GetDeviceEnrichmentDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-enrichment-details +notes: + - SDK Method used are + devices.Devices.get_device_enrichment_details, + + - Paths used are + get /dna/intent/api/v1/device-enrichment-details, + +""" + +EXAMPLES = r""" +- name: Get all Device Enrichment Details + cisco.dnac.device_enrichment_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "deviceDetails": { + "family": "string", + "type": "string", + "location": {}, + "errorCode": "string", + "macAddress": "string", + "role": "string", + "apManagerInterfaceIp": "string", + "associatedWlcIp": "string", + "bootDateTime": "string", + "collectionStatus": "string", + "interfaceCount": "string", + "lineCardCount": "string", + "lineCardId": "string", + "managementIpAddress": "string", + "memorySize": "string", + "platformId": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "snmpContact": "string", + "snmpLocation": "string", + "tunnelUdpPort": {}, + "waasDeviceMode": {}, + "series": "string", + "inventoryStatusDetail": "string", + "collectionInterval": "string", + "serialNumber": "string", + "softwareVersion": "string", + "roleSource": "string", + "hostname": "string", + "upTime": "string", + "lastUpdateTime": 0, + "errorDescription": "string", + "locationName": {}, + "tagCount": "string", + "lastUpdated": "string", + "instanceUuid": "string", + "id": "string", + "neighborTopology": [ + { + "nodes": [ + { + "role": "string", + "name": "string", + "id": "string", + "description": "string", + "deviceType": "string", + "platformId": "string", + "family": "string", + "ip": "string", + "softwareVersion": "string", + "userId": {}, + "nodeType": "string", + "radioFrequency": {}, + "clients": {}, + "count": {}, + "healthScore": 0, + "level": 0, + "fabricGroup": {}, + "connectedDevice": {} + } + ], + "links": [ + { + "source": "string", + "linkStatus": "string", + "label": [ + {} + ], + "target": "string", + "id": {}, + "portUtilization": {} + } + ] + } + ] + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_family_identifiers_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_family_identifiers_details_info.py new file mode 100644 index 00000000..515a0d94 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_family_identifiers_details_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_family_identifiers_details_info +short_description: Information module for Device Family Identifiers Details +description: +- Get all Device Family Identifiers Details. +- API to get Device Family Identifiers for all Device Families that can be used for tagging an image golden. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) GetDeviceFamilyIdentifiers + description: Complete reference of the GetDeviceFamilyIdentifiers API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-family-identifiers +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.get_device_family_identifiers, + + - Paths used are + get /dna/intent/api/v1/image/importation/device-family-identifiers, + +""" + +EXAMPLES = r""" +- name: Get all Device Family Identifiers Details + cisco.dnac.device_family_identifiers_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": [ + { + "deviceFamily": "string", + "deviceFamilyIdentifier": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_health_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_health_info.py new file mode 100644 index 00000000..9b329a7a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_health_info.py @@ -0,0 +1,149 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_health_info +short_description: Information module for Device Health +description: +- Get all Device Health. +- > + Intent API for accessing DNA Assurance Device object for generating reports, creating dashboards or creating + additional value added services. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceRole: + description: + - DeviceRole query parameter. The device role (One of CORE, ACCESS, DISTRIBUTION, ROUTER, WLC, AP). + type: str + siteId: + description: + - SiteId query parameter. Assurance site UUID value. + type: str + health: + description: + - Health query parameter. The device overall health (One of POOR, FAIR, GOOD). + type: str + startTime: + description: + - StartTime query parameter. UTC epoch time in milliseconds. + type: int + endTime: + description: + - EndTime query parameter. UTC epoch time in miliseconds. + type: int + limit: + description: + - Limit query parameter. Max number of device entries in the response (default to 50. Max at 1000). + type: int + offset: + description: + - Offset query parameter. The offset of the first device in the returned data. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices Devices + description: Complete reference of the Devices API. + link: https://developer.cisco.com/docs/dna-center/#!api-devices-devices +notes: + - SDK Method used are + devices.Devices.devices, + + - Paths used are + get /dna/intent/api/v1/device-health, + +""" + +EXAMPLES = r""" +- name: Get all Device Health + cisco.dnac.device_health_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceRole: string + siteId: string + health: string + startTime: 0 + endTime: 0 + limit: 0 + offset: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "totalCount": 0, + "response": [ + { + "name": "string", + "model": "string", + "osVersion": "string", + "ipAddress": "string", + "overallHealth": 0, + "issueCount": 0, + "location": "string", + "deviceFamily": "string", + "deviceType": "string", + "macAddress": "string", + "interfaceLinkErrHealth": 0, + "cpuUlitilization": 0, + "cpuHealth": 0, + "memoryUtilizationHealth": 0, + "memoryUtilization": 0, + "interDeviceLinkAvailHealth": 0, + "reachabilityHealth": "string", + "clientCount": { + "radio0": 0, + "radio1": 0, + "Ghz24": 0, + "Ghz50": 0 + }, + "interferenceHealth": { + "radio0": 0, + "radio1": 0, + "Ghz24": 0, + "Ghz50": 0 + }, + "noiseHealth": { + "radio1": 0, + "Ghz50": 0 + }, + "airQualityHealth": { + "radio0": 0, + "radio1": 0, + "Ghz24": 0, + "Ghz50": 0 + }, + "utilizationHealth": { + "radio0": 0, + "radio1": 0, + "Ghz24": 0, + "Ghz50": 0 + } + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_interface_by_ip_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_interface_by_ip_info.py new file mode 100644 index 00000000..7d5d984f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_interface_by_ip_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_interface_by_ip_info +short_description: Information module for Device Interface By Ip +description: +- Get Device Interface By Ip by id. +- Returns list of interfaces for specified device management IP address. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + ipAddress: + description: + - IpAddress path parameter. IP address of the interface. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetInterfaceByIP + description: Complete reference of the GetInterfaceByIP API. + link: https://developer.cisco.com/docs/dna-center/#!get-interface-by-ip +notes: + - SDK Method used are + devices.Devices.get_interface_by_ip, + + - Paths used are + get /dna/intent/api/v1/interface/ip-address/{ipAddress}, + +""" + +EXAMPLES = r""" +- name: Get Device Interface By Ip by id + cisco.dnac.device_interface_by_ip_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + ipAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "adminStatus": "string", + "className": "string", + "description": "string", + "deviceId": "string", + "duplex": "string", + "id": "string", + "ifIndex": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceType": "string", + "ipv4Address": "string", + "ipv4Mask": "string", + "isisSupport": "string", + "lastUpdated": "string", + "macAddress": "string", + "mappedPhysicalInterfaceId": "string", + "mappedPhysicalInterfaceName": "string", + "mediaType": "string", + "nativeVlanId": "string", + "ospfSupport": "string", + "pid": "string", + "portMode": "string", + "portName": "string", + "portType": "string", + "serialNo": "string", + "series": "string", + "speed": "string", + "status": "string", + "vlanId": "string", + "voiceVlan": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_interface_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_interface_count_info.py new file mode 100644 index 00000000..24e0290a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_interface_count_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_interface_count_info +short_description: Information module for Device Interface Count +description: +- Get all Device Interface Count. +- Returns the count of interfaces for all devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceInterfaceCount + description: Complete reference of the GetDeviceInterfaceCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-interface-count +notes: + - SDK Method used are + devices.Devices.get_device_interface_count, + + - Paths used are + get /dna/intent/api/v1/interface/count, + +""" + +EXAMPLES = r""" +- name: Get all Device Interface Count + cisco.dnac.device_interface_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_interface_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_interface_info.py new file mode 100644 index 00000000..b94f8818 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_interface_info.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_interface_info +short_description: Information module for Device Interface +description: +- Get all Device Interface. +- Get Device Interface by id. +- Returns all available interfaces. This endpoint can return a maximum of 500 interfaces. +- Returns the interface for the given interface ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + offset: + description: + - Offset query parameter. + type: int + limit: + description: + - Limit query parameter. + type: int + id: + description: + - Id path parameter. Interface ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetAllInterfaces + description: Complete reference of the GetAllInterfaces API. + link: https://developer.cisco.com/docs/dna-center/#!get-all-interfaces +- name: Cisco DNA Center documentation for Devices GetInterfaceById + description: Complete reference of the GetInterfaceById API. + link: https://developer.cisco.com/docs/dna-center/#!get-interface-by-id +notes: + - SDK Method used are + devices.Devices.get_all_interfaces, + devices.Devices.get_interface_by_id, + + - Paths used are + get /dna/intent/api/v1/interface, + get /dna/intent/api/v1/interface/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Device Interface + cisco.dnac.device_interface_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: 0 + limit: 0 + register: result + +- name: Get Device Interface by id + cisco.dnac.device_interface_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "adminStatus": "string", + "className": "string", + "description": "string", + "deviceId": "string", + "duplex": "string", + "id": "string", + "ifIndex": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceType": "string", + "ipv4Address": "string", + "ipv4Mask": "string", + "isisSupport": "string", + "lastUpdated": "string", + "macAddress": "string", + "mappedPhysicalInterfaceId": "string", + "mappedPhysicalInterfaceName": "string", + "mediaType": "string", + "nativeVlanId": "string", + "ospfSupport": "string", + "pid": "string", + "portMode": "string", + "portName": "string", + "portType": "string", + "serialNo": "string", + "series": "string", + "speed": "string", + "status": "string", + "vlanId": "string", + "voiceVlan": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_interface_isis_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_interface_isis_info.py new file mode 100644 index 00000000..242344a1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_interface_isis_info.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_interface_isis_info +short_description: Information module for Device Interface Isis +description: +- Get all Device Interface Isis. +- Returns the interfaces that has ISIS enabled. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetISISInterfaces + description: Complete reference of the GetISISInterfaces API. + link: https://developer.cisco.com/docs/dna-center/#!get-isis-interfaces +notes: + - SDK Method used are + devices.Devices.get_isis_interfaces, + + - Paths used are + get /dna/intent/api/v1/interface/isis, + +""" + +EXAMPLES = r""" +- name: Get all Device Interface Isis + cisco.dnac.device_interface_isis_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "adminStatus": "string", + "className": "string", + "description": "string", + "deviceId": "string", + "duplex": "string", + "id": "string", + "ifIndex": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceType": "string", + "ipv4Address": "string", + "ipv4Mask": "string", + "isisSupport": "string", + "lastUpdated": "string", + "macAddress": "string", + "mappedPhysicalInterfaceId": "string", + "mappedPhysicalInterfaceName": "string", + "mediaType": "string", + "nativeVlanId": "string", + "ospfSupport": "string", + "pid": "string", + "portMode": "string", + "portName": "string", + "portType": "string", + "serialNo": "string", + "series": "string", + "speed": "string", + "status": "string", + "vlanId": "string", + "voiceVlan": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_interface_ospf_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_interface_ospf_info.py new file mode 100644 index 00000000..759f4584 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_interface_ospf_info.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_interface_ospf_info +short_description: Information module for Device Interface Ospf +description: +- Get all Device Interface Ospf. +- Returns the interfaces that has OSPF enabled. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetOSPFInterfaces + description: Complete reference of the GetOSPFInterfaces API. + link: https://developer.cisco.com/docs/dna-center/#!get-ospf-interfaces +notes: + - SDK Method used are + devices.Devices.get_ospf_interfaces, + + - Paths used are + get /dna/intent/api/v1/interface/ospf, + +""" + +EXAMPLES = r""" +- name: Get all Device Interface Ospf + cisco.dnac.device_interface_ospf_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "adminStatus": "string", + "className": "string", + "description": "string", + "deviceId": "string", + "duplex": "string", + "id": "string", + "ifIndex": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceType": "string", + "ipv4Address": "string", + "ipv4Mask": "string", + "isisSupport": "string", + "lastUpdated": "string", + "macAddress": "string", + "mappedPhysicalInterfaceId": "string", + "mappedPhysicalInterfaceName": "string", + "mediaType": "string", + "nativeVlanId": "string", + "ospfSupport": "string", + "pid": "string", + "portMode": "string", + "portName": "string", + "portType": "string", + "serialNo": "string", + "series": "string", + "speed": "string", + "status": "string", + "vlanId": "string", + "voiceVlan": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_replacement.py b/ansible_collections/cisco/dnac/plugins/modules/device_replacement.py new file mode 100644 index 00000000..e6ec8cbd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_replacement.py @@ -0,0 +1,156 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_replacement +short_description: Resource module for Device Replacement +description: +- Manage operations create and update of the resource Device Replacement. +- Marks device for replacement. +- UnMarks device for replacement. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Device Replacement's payload. + elements: dict + suboptions: + creationTime: + description: Device Replacement's creationTime. + type: int + family: + description: Device Replacement's family. + type: str + faultyDeviceId: + description: Device Replacement's faultyDeviceId. + type: str + faultyDeviceName: + description: Device Replacement's faultyDeviceName. + type: str + faultyDevicePlatform: + description: Device Replacement's faultyDevicePlatform. + type: str + faultyDeviceSerialNumber: + description: Device Replacement's faultyDeviceSerialNumber. + type: str + id: + description: Device Replacement's id. + type: str + neighbourDeviceId: + description: Device Replacement's neighbourDeviceId. + type: str + networkReadinessTaskId: + description: Device Replacement's networkReadinessTaskId. + type: str + replacementDevicePlatform: + description: Device Replacement's replacementDevicePlatform. + type: str + replacementDeviceSerialNumber: + description: Device Replacement's replacementDeviceSerialNumber. + type: str + replacementStatus: + description: Device Replacement's replacementStatus. + type: str + replacementTime: + description: Device Replacement's replacementTime. + type: int + workflowId: + description: Device Replacement's workflowId. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Replacement MarkDeviceForReplacement + description: Complete reference of the MarkDeviceForReplacement API. + link: https://developer.cisco.com/docs/dna-center/#!mark-device-for-replacement +- name: Cisco DNA Center documentation for Device Replacement UnMarkDeviceForReplacement + description: Complete reference of the UnMarkDeviceForReplacement API. + link: https://developer.cisco.com/docs/dna-center/#!un-mark-device-for-replacement +notes: + - SDK Method used are + device_replacement.DeviceReplacement.mark_device_for_replacement, + device_replacement.DeviceReplacement.unmark_device_for_replacement, + + - Paths used are + post /dna/intent/api/v1/device-replacement, + put /dna/intent/api/v1/device-replacement, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.device_replacement: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - creationTime: 0 + family: string + faultyDeviceId: string + faultyDeviceName: string + faultyDevicePlatform: string + faultyDeviceSerialNumber: string + id: string + neighbourDeviceId: string + networkReadinessTaskId: string + replacementDevicePlatform: string + replacementDeviceSerialNumber: string + replacementStatus: string + replacementTime: 0 + workflowId: string + +- name: Create + cisco.dnac.device_replacement: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - creationTime: 0 + family: string + faultyDeviceId: string + faultyDeviceName: string + faultyDevicePlatform: string + faultyDeviceSerialNumber: string + id: string + neighbourDeviceId: string + networkReadinessTaskId: string + replacementDevicePlatform: string + replacementDeviceSerialNumber: string + replacementStatus: string + replacementTime: 0 + workflowId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_replacement_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_replacement_count_info.py new file mode 100644 index 00000000..c15cf18d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_replacement_count_info.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_replacement_count_info +short_description: Information module for Device Replacement Count +description: +- Get all Device Replacement Count. +- Get replacement devices count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + replacementStatus: + description: + - > + ReplacementStatus query parameter. Device Replacement status listREADY-FOR-REPLACEMENT, REPLACEMENT-IN- + PROGRESS, REPLACEMENT-SCHEDULED, REPLACED, ERROR. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Replacement ReturnReplacementDevicesCount + description: Complete reference of the ReturnReplacementDevicesCount API. + link: https://developer.cisco.com/docs/dna-center/#!return-replacement-devices-count +notes: + - SDK Method used are + device_replacement.DeviceReplacement.return_replacement_devices_count, + + - Paths used are + get /dna/intent/api/v1/device-replacement/count, + +""" + +EXAMPLES = r""" +- name: Get all Device Replacement Count + cisco.dnac.device_replacement_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + replacementStatus: [] + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_replacement_deploy.py b/ansible_collections/cisco/dnac/plugins/modules/device_replacement_deploy.py new file mode 100644 index 00000000..14f591d2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_replacement_deploy.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_replacement_deploy +short_description: Resource module for Device Replacement Deploy +description: +- Manage operation create of the resource Device Replacement Deploy. +- > + API to trigger RMA workflow that will replace faulty device with replacement device with same configuration and + images. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + faultyDeviceSerialNumber: + description: Device Replacement Deploy's faultyDeviceSerialNumber. + type: str + replacementDeviceSerialNumber: + description: Device Replacement Deploy's replacementDeviceSerialNumber. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Replacement DeployDeviceReplacementWorkflow + description: Complete reference of the DeployDeviceReplacementWorkflow API. + link: https://developer.cisco.com/docs/dna-center/#!deploy-device-replacement-workflow +notes: + - SDK Method used are + device_replacement.DeviceReplacement.deploy_device_replacement_workflow, + + - Paths used are + post /dna/intent/api/v1/device-replacement/workflow, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.device_replacement_deploy: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + faultyDeviceSerialNumber: string + replacementDeviceSerialNumber: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/device_replacement_info.py b/ansible_collections/cisco/dnac/plugins/modules/device_replacement_info.py new file mode 100644 index 00000000..91977952 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/device_replacement_info.py @@ -0,0 +1,142 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_replacement_info +short_description: Information module for Device Replacement +description: +- Get all Device Replacement. +- > + Get list of replacement devices with replacement details and it can filter replacement devices based on Faulty + Device Name,Faulty Device Platform, Replacement Device Platform, Faulty Device Serial Number,Replacement Device + Serial Number, Device Replacement status, Product Family. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + faultyDeviceName: + description: + - FaultyDeviceName query parameter. Faulty Device Name. + type: str + faultyDevicePlatform: + description: + - FaultyDevicePlatform query parameter. Faulty Device Platform. + type: str + replacementDevicePlatform: + description: + - ReplacementDevicePlatform query parameter. Replacement Device Platform. + type: str + faultyDeviceSerialNumber: + description: + - FaultyDeviceSerialNumber query parameter. Faulty Device Serial Number. + type: str + replacementDeviceSerialNumber: + description: + - ReplacementDeviceSerialNumber query parameter. Replacement Device Serial Number. + type: str + replacementStatus: + description: + - > + ReplacementStatus query parameter. Device Replacement status READY-FOR-REPLACEMENT, REPLACEMENT-IN-PROGRESS, + REPLACEMENT-SCHEDULED, REPLACED, ERROR, NETWORK_READINESS_REQUESTED, NETWORK_READINESS_FAILED. + elements: str + type: list + family: + description: + - Family query parameter. List of familiesRouters, Switches and Hubs, AP. + elements: str + type: list + sortBy: + description: + - SortBy query parameter. SortBy this field. SortBy is mandatory when order is used. + type: str + sortOrder: + description: + - SortOrder query parameter. Order on displayNameASC,DESC. + type: str + offset: + description: + - Offset query parameter. + type: int + limit: + description: + - Limit query parameter. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Replacement ReturnListOfReplacementDevicesWithReplacementDetails + description: Complete reference of the ReturnListOfReplacementDevicesWithReplacementDetails API. + link: https://developer.cisco.com/docs/dna-center/#!return-list-of-replacement-devices-with-replacement-details +notes: + - SDK Method used are + device_replacement.DeviceReplacement.return_replacement_devices_with_details, + + - Paths used are + get /dna/intent/api/v1/device-replacement, + +""" + +EXAMPLES = r""" +- name: Get all Device Replacement + cisco.dnac.device_replacement_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + faultyDeviceName: string + faultyDevicePlatform: string + replacementDevicePlatform: string + faultyDeviceSerialNumber: string + replacementDeviceSerialNumber: string + replacementStatus: [] + family: [] + sortBy: string + sortOrder: string + offset: 0 + limit: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "creationTime": 0, + "family": "string", + "faultyDeviceId": "string", + "faultyDeviceName": "string", + "faultyDevicePlatform": "string", + "faultyDeviceSerialNumber": "string", + "id": "string", + "neighbourDeviceId": "string", + "networkReadinessTaskId": "string", + "replacementDevicePlatform": "string", + "replacementDeviceSerialNumber": "string", + "replacementStatus": "string", + "replacementTime": 0, + "workflowId": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/disassociate_site_to_network_profile.py b/ansible_collections/cisco/dnac/plugins/modules/disassociate_site_to_network_profile.py new file mode 100644 index 00000000..de80f579 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/disassociate_site_to_network_profile.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: disassociate_site_to_network_profile +short_description: Resource module for Disassociate Site To Network Profile +description: +- Manage operation delete of the resource Disassociate Site To Network Profile. +- Disassociate a Site from a Network Profile. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + networkProfileId: + description: NetworkProfileId path parameter. Network-Profile Id to be associated. + type: str + siteId: + description: SiteId path parameter. Site Id to be associated. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Site Design Disassociate + description: Complete reference of the Disassociate API. + link: https://developer.cisco.com/docs/dna-center/#!disassociate +notes: + - SDK Method used are + site_design.SiteDesign.disassociate, + + - Paths used are + delete /dna/intent/api/v1/networkprofile/{networkProfileId}/site/{siteId}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.disassociate_site_to_network_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + networkProfileId: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_operationstatus_info.py b/ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_operationstatus_info.py new file mode 100644 index 00000000..0cda92e4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_operationstatus_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: disasterrecovery_system_operationstatus_info +short_description: Information module for Disasterrecovery System Operationstatus +description: +- Get all Disasterrecovery System Operationstatus. +- Returns the status of Disaster Recovery operation performed on the system. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + disaster_recovery.DisasterRecovery.disaster_recovery_operational_status, + + - Paths used are + get /dna/intent/api/v1/disasterrecovery/system/operationstatus, + +""" + +EXAMPLES = r""" +- name: Get all Disasterrecovery System Operationstatus + cisco.dnac.disasterrecovery_system_operationstatus_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "severity": "string", + "status": "string", + "initiated_by": "string", + "ipconfig": [ + { + "interface": "string", + "vip": "string", + "ip": "string" + } + ], + "tasks": [ + { + "status": "string", + "ipconfig": [ + { + "interface": "string", + "vip": "string", + "ip": "string" + } + ], + "title": "string", + "site": "string", + "startTimestamp": "string", + "message": "string", + "endTimestamp": "string" + } + ], + "title": "string", + "site": "string", + "startTimestamp": "string", + "message": "string", + "endTimestamp": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_status_info.py b/ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_status_info.py new file mode 100644 index 00000000..7014eb3f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/disasterrecovery_system_status_info.py @@ -0,0 +1,143 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: disasterrecovery_system_status_info +short_description: Information module for Disasterrecovery System Status +description: +- Get all Disasterrecovery System Status. +- Detailed and Summarized status of DR components (Active, Standby and Witness system's health). +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + disaster_recovery.DisasterRecovery.disaster_recovery_status, + + - Paths used are + get /dna/intent/api/v1/disasterrecovery/system/status, + +""" + +EXAMPLES = r""" +- name: Get all Disasterrecovery System Status + cisco.dnac.disasterrecovery_system_status_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "ipconfig": [ + { + "interface": "string", + "vip": true, + "ip": "string" + } + ], + "site": "string", + "main": { + "ipconfig": [ + { + "interface": "string", + "vip": true, + "ip": "string" + } + ], + "state": "string", + "nodes": [ + { + "hostname": "string", + "state": "string", + "ipaddresses": [ + { + "interface": "string", + "vip": true, + "ip": "string" + } + ] + } + ] + }, + "recovery": { + "ipconfig": [ + { + "interface": "string", + "vip": true, + "ip": "string" + } + ], + "state": "string", + "nodes": [ + { + "hostname": "string", + "state": "string", + "ipconfig": [ + { + "interface": "string", + "vip": true, + "ip": "string" + } + ] + } + ] + }, + "witness": { + "ipconfig": [ + { + "interface": "string", + "vip": true, + "ip": "string" + } + ], + "state": "string", + "nodes": [ + { + "hostname": "string", + "state": "string", + "ipconfig": [ + { + "interface": "string", + "vip": true, + "ip": "string" + } + ] + } + ] + }, + "state": "string", + "ipsec-tunnel": [ + { + "side_a": "string", + "side_b": "string", + "status": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery.py b/ansible_collections/cisco/dnac/plugins/modules/discovery.py new file mode 100644 index 00000000..10e7e37a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery.py @@ -0,0 +1,405 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery +short_description: Resource module for Discovery +description: +- Manage operations create, update and delete of the resource Discovery. +- Initiates discovery with the given parameters. +- Stops all the discoveries and removes them. +- > + Stops the discovery for the given Discovery ID and removes it. Discovery ID can be obtained using the "Get + Discoveries by range" API. +- Stops or starts an existing discovery. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + attributeInfo: + description: Discovery's attributeInfo. + type: dict + cdpLevel: + description: Discovery's cdpLevel. + type: int + deviceIds: + description: Discovery's deviceIds. + type: str + discoveryCondition: + description: Discovery's discoveryCondition. + type: str + discoveryStatus: + description: Discovery's discoveryStatus. + type: str + discoveryType: + description: Discovery's discoveryType. + type: str + enablePasswordList: + description: Discovery's enablePasswordList. + type: str + globalCredentialIdList: + description: Discovery's globalCredentialIdList. + elements: str + type: list + httpReadCredential: + description: Discovery's httpReadCredential. + suboptions: + comments: + description: Discovery's comments. + type: str + credentialType: + description: Discovery's credentialType. + type: str + description: + description: Discovery's description. + type: str + id: + description: Discovery's id. + type: str + instanceTenantId: + description: Discovery's instanceTenantId. + type: str + instanceUuid: + description: Discovery's instanceUuid. + type: str + password: + description: Discovery's password. + type: str + port: + description: Discovery's port. + type: int + secure: + description: Secure flag. + type: bool + username: + description: Discovery's username. + type: str + type: dict + httpWriteCredential: + description: Discovery's httpWriteCredential. + suboptions: + comments: + description: Discovery's comments. + type: str + credentialType: + description: Discovery's credentialType. + type: str + description: + description: Discovery's description. + type: str + id: + description: Discovery's id. + type: str + instanceTenantId: + description: Discovery's instanceTenantId. + type: str + instanceUuid: + description: Discovery's instanceUuid. + type: str + password: + description: Discovery's password. + type: str + port: + description: Discovery's port. + type: int + secure: + description: Secure flag. + type: bool + username: + description: Discovery's username. + type: str + type: dict + id: + description: Discovery's id. + type: str + ipAddressList: + description: Discovery's ipAddressList. + type: str + ipFilterList: + description: Discovery's ipFilterList. + type: str + isAutoCdp: + description: IsAutoCdp flag. + type: bool + lldpLevel: + description: Discovery's lldpLevel. + type: int + name: + description: Discovery's name. + type: str + netconfPort: + description: Discovery's netconfPort. + type: str + numDevices: + description: Discovery's numDevices. + type: int + parentDiscoveryId: + description: Discovery's parentDiscoveryId. + type: str + passwordList: + description: Discovery's passwordList. + type: str + preferredMgmtIPMethod: + description: Discovery's preferredMgmtIPMethod. + type: str + protocolOrder: + description: Discovery's protocolOrder. + type: str + retry: + description: Number of times to try establishing connection to device. + type: int + retryCount: + description: Discovery's retryCount. + type: int + snmpAuthPassphrase: + description: Discovery's snmpAuthPassphrase. + type: str + snmpAuthProtocol: + description: Discovery's snmpAuthProtocol. + type: str + snmpMode: + description: Discovery's snmpMode. + type: str + snmpPrivPassphrase: + description: Discovery's snmpPrivPassphrase. + type: str + snmpPrivProtocol: + description: Discovery's snmpPrivProtocol. + type: str + snmpROCommunity: + description: Snmp RO community of the devices to be discovered. + type: str + snmpROCommunityDesc: + description: Description for Snmp RO community. + type: str + snmpRWCommunity: + description: Snmp RW community of the devices to be discovered. + type: str + snmpRWCommunityDesc: + description: Description for Snmp RW community. + type: str + snmpRoCommunity: + description: Discovery's snmpRoCommunity. + type: str + snmpRoCommunityDesc: + description: Discovery's snmpRoCommunityDesc. + type: str + snmpRwCommunity: + description: Discovery's snmpRwCommunity. + type: str + snmpRwCommunityDesc: + description: Discovery's snmpRwCommunityDesc. + type: str + snmpUserName: + description: Discovery's snmpUserName. + type: str + snmpVersion: + description: Version of SNMP. V2 or v3. + type: str + timeOut: + description: Discovery's timeOut. + type: int + timeout: + description: Time to wait for device response in seconds. + type: int + updateMgmtIp: + description: UpdateMgmtIp flag. + type: bool + userNameList: + description: Discovery's userNameList. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery StartDiscovery + description: Complete reference of the StartDiscovery API. + link: https://developer.cisco.com/docs/dna-center/#!start-discovery +- name: Cisco DNA Center documentation for Discovery DeleteAllDiscovery + description: Complete reference of the DeleteAllDiscovery API. + link: https://developer.cisco.com/docs/dna-center/#!delete-all-discovery +- name: Cisco DNA Center documentation for Discovery DeleteDiscoveryById + description: Complete reference of the DeleteDiscoveryById API. + link: https://developer.cisco.com/docs/dna-center/#!delete-discovery-by-id +- name: Cisco DNA Center documentation for Discovery UpdatesAnExistingDiscoveryBySpecifiedId + description: Complete reference of the UpdatesAnExistingDiscoveryBySpecifiedId API. + link: https://developer.cisco.com/docs/dna-center/#!updates-an-existing-discovery-by-specified-id +notes: + - SDK Method used are + discovery.Discovery.delete_discovery_by_id, + discovery.Discovery.start_discovery, + discovery.Discovery.updates_discovery_by_id, + + - Paths used are + post /dna/intent/api/v1/discovery, + delete /dna/intent/api/v1/discovery, + delete /dna/intent/api/v1/discovery/{id}, + put /dna/intent/api/v1/discovery, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.discovery: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + +- name: Update all + cisco.dnac.discovery: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + attributeInfo: {} + cdpLevel: 0 + deviceIds: string + discoveryCondition: string + discoveryStatus: string + discoveryType: string + enablePasswordList: string + globalCredentialIdList: + - string + httpReadCredential: + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + port: 0 + secure: true + username: string + httpWriteCredential: + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + port: 0 + secure: true + username: string + id: string + ipAddressList: string + ipFilterList: string + isAutoCdp: true + lldpLevel: 0 + name: string + netconfPort: string + numDevices: 0 + parentDiscoveryId: string + passwordList: string + preferredMgmtIPMethod: string + protocolOrder: string + retryCount: 0 + snmpAuthPassphrase: string + snmpAuthProtocol: string + snmpMode: string + snmpPrivPassphrase: string + snmpPrivProtocol: string + snmpRoCommunity: string + snmpRoCommunityDesc: string + snmpRwCommunity: string + snmpRwCommunityDesc: string + snmpUserName: string + timeOut: 0 + updateMgmtIp: true + userNameList: string + +- name: Create + cisco.dnac.discovery: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + cdpLevel: 0 + discoveryType: string + enablePasswordList: + - string + globalCredentialIdList: + - string + httpReadCredential: + password: string + port: 0 + secure: true + username: string + httpWriteCredential: + password: string + port: 0 + secure: true + username: string + ipAddressList: string + ipFilterList: + - string + lldpLevel: 0 + name: string + netconfPort: string + passwordList: + - string + preferredMgmtIPMethod: string + protocolOrder: string + retry: 0 + snmpAuthPassphrase: string + snmpAuthProtocol: string + snmpMode: string + snmpPrivPassphrase: string + snmpPrivProtocol: string + snmpROCommunity: string + snmpROCommunityDesc: string + snmpRWCommunity: string + snmpRWCommunityDesc: string + snmpUserName: string + snmpVersion: string + timeout: 0 + userNameList: + - string + +- name: Delete by id + cisco.dnac.discovery: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_count_info.py new file mode 100644 index 00000000..6622742f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_count_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_count_info +short_description: Information module for Discovery Count +description: +- Get all Discovery Count. +- Returns the count of all available discovery jobs. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetCountOfAllDiscoveryJobs + description: Complete reference of the GetCountOfAllDiscoveryJobs API. + link: https://developer.cisco.com/docs/dna-center/#!get-count-of-all-discovery-jobs +notes: + - SDK Method used are + discovery.Discovery.get_count_of_all_discovery_jobs, + + - Paths used are + get /dna/intent/api/v1/discovery/count, + +""" + +EXAMPLES = r""" +- name: Get all Discovery Count + cisco.dnac.discovery_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_device_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_device_count_info.py new file mode 100644 index 00000000..b258a513 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_device_count_info.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_device_count_info +short_description: Information module for Discovery Device Count +description: +- Get all Discovery Device Count. +- > + Returns the count of network devices discovered in the given discovery. Discovery ID can be obtained using the + "Get Discoveries by range" API. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Discovery ID. + type: str + taskId: + description: + - TaskId query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetDevicesDiscoveredById + description: Complete reference of the GetDevicesDiscoveredById API. + link: https://developer.cisco.com/docs/dna-center/#!get-devices-discovered-by-id +notes: + - SDK Method used are + discovery.Discovery.get_devices_discovered_by_id, + + - Paths used are + get /dna/intent/api/v1/discovery/{id}/network-device/count, + +""" + +EXAMPLES = r""" +- name: Get all Discovery Device Count + cisco.dnac.discovery_device_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + taskId: string + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_device_info.py new file mode 100644 index 00000000..345000ca --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_device_info.py @@ -0,0 +1,124 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_device_info +short_description: Information module for Discovery Device +description: +- Get all Discovery Device. +- > + Returns the network devices discovered for the given Discovery ID. Discovery ID can be obtained using the "Get + Discoveries by range" API. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Discovery ID. + type: str + taskId: + description: + - TaskId query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetDiscoveredNetworkDevicesByDiscoveryId + description: Complete reference of the GetDiscoveredNetworkDevicesByDiscoveryId API. + link: https://developer.cisco.com/docs/dna-center/#!get-discovered-network-devices-by-discovery-id +notes: + - SDK Method used are + discovery.Discovery.get_discovered_network_devices_by_discovery_id, + + - Paths used are + get /dna/intent/api/v1/discovery/{id}/network-device, + +""" + +EXAMPLES = r""" +- name: Get all Discovery Device + cisco.dnac.discovery_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + taskId: string + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "anchorWlcForAp": "string", + "authModelId": "string", + "avgUpdateFrequency": 0, + "bootDateTime": "string", + "cliStatus": "string", + "duplicateDeviceId": "string", + "errorCode": "string", + "errorDescription": "string", + "family": "string", + "hostname": "string", + "httpStatus": "string", + "id": "string", + "imageName": "string", + "ingressQueueConfig": "string", + "interfaceCount": "string", + "inventoryCollectionStatus": "string", + "inventoryReachabilityStatus": "string", + "lastUpdated": "string", + "lineCardCount": "string", + "lineCardId": "string", + "location": "string", + "locationName": "string", + "macAddress": "string", + "managementIpAddress": "string", + "memorySize": "string", + "netconfStatus": "string", + "numUpdates": 0, + "pingStatus": "string", + "platformId": "string", + "portRange": "string", + "qosStatus": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "role": "string", + "roleSource": "string", + "serialNumber": "string", + "snmpContact": "string", + "snmpLocation": "string", + "snmpStatus": "string", + "softwareVersion": "string", + "tag": "string", + "tagCount": 0, + "type": "string", + "upTime": "string", + "vendor": "string", + "wlcApDeviceStatus": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_device_range_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_device_range_info.py new file mode 100644 index 00000000..47dcb087 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_device_range_info.py @@ -0,0 +1,134 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_device_range_info +short_description: Information module for Discovery Device Range +description: +- Get all Discovery Device Range. +- > + Returns the network devices discovered for the given discovery and for the given range. The maximum number of + records that can be retrieved is 500. Discovery ID can be obtained using the "Get Discoveries by range" API. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Discovery ID. + type: str + startIndex: + description: + - StartIndex path parameter. Start index. + type: int + recordsToReturn: + description: + - RecordsToReturn path parameter. Number of records to return. + type: int + taskId: + description: + - TaskId query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetDiscoveredDevicesByRange + description: Complete reference of the GetDiscoveredDevicesByRange API. + link: https://developer.cisco.com/docs/dna-center/#!get-discovered-devices-by-range +notes: + - SDK Method used are + discovery.Discovery.get_discovered_devices_by_range, + + - Paths used are + get /dna/intent/api/v1/discovery/{id}/network-device/{startIndex}/{recordsToReturn}, + +""" + +EXAMPLES = r""" +- name: Get all Discovery Device Range + cisco.dnac.discovery_device_range_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + taskId: string + id: string + startIndex: 0 + recordsToReturn: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "anchorWlcForAp": "string", + "authModelId": "string", + "avgUpdateFrequency": 0, + "bootDateTime": "string", + "cliStatus": "string", + "duplicateDeviceId": "string", + "errorCode": "string", + "errorDescription": "string", + "family": "string", + "hostname": "string", + "httpStatus": "string", + "id": "string", + "imageName": "string", + "ingressQueueConfig": "string", + "interfaceCount": "string", + "inventoryCollectionStatus": "string", + "inventoryReachabilityStatus": "string", + "lastUpdated": "string", + "lineCardCount": "string", + "lineCardId": "string", + "location": "string", + "locationName": "string", + "macAddress": "string", + "managementIpAddress": "string", + "memorySize": "string", + "netconfStatus": "string", + "numUpdates": 0, + "pingStatus": "string", + "platformId": "string", + "portRange": "string", + "qosStatus": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "role": "string", + "roleSource": "string", + "serialNumber": "string", + "snmpContact": "string", + "snmpLocation": "string", + "snmpStatus": "string", + "softwareVersion": "string", + "tag": "string", + "tagCount": 0, + "type": "string", + "upTime": "string", + "vendor": "string", + "wlcApDeviceStatus": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_info.py new file mode 100644 index 00000000..68922693 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_info.py @@ -0,0 +1,129 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_info +short_description: Information module for Discovery +description: +- Get Discovery by id. +- Returns discovery by Discovery ID. Discovery ID can be obtained using the "Get Discoveries by range" API. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Discovery ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetDiscoveryById + description: Complete reference of the GetDiscoveryById API. + link: https://developer.cisco.com/docs/dna-center/#!get-discovery-by-id +notes: + - SDK Method used are + discovery.Discovery.get_discovery_by_id, + + - Paths used are + get /dna/intent/api/v1/discovery/{id}, + +""" + +EXAMPLES = r""" +- name: Get Discovery by id + cisco.dnac.discovery_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "attributeInfo": {}, + "cdpLevel": 0, + "deviceIds": "string", + "discoveryCondition": "string", + "discoveryStatus": "string", + "discoveryType": "string", + "enablePasswordList": "string", + "globalCredentialIdList": [ + "string" + ], + "httpReadCredential": { + "comments": "string", + "credentialType": "string", + "description": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "password": "string", + "port": 0, + "secure": true, + "username": "string" + }, + "httpWriteCredential": { + "comments": "string", + "credentialType": "string", + "description": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "password": "string", + "port": 0, + "secure": true, + "username": "string" + }, + "id": "string", + "ipAddressList": "string", + "ipFilterList": "string", + "isAutoCdp": true, + "lldpLevel": 0, + "name": "string", + "netconfPort": "string", + "numDevices": 0, + "parentDiscoveryId": "string", + "passwordList": "string", + "preferredMgmtIPMethod": "string", + "protocolOrder": "string", + "retryCount": 0, + "snmpAuthPassphrase": "string", + "snmpAuthProtocol": "string", + "snmpMode": "string", + "snmpPrivPassphrase": "string", + "snmpPrivProtocol": "string", + "snmpRoCommunity": "string", + "snmpRoCommunityDesc": "string", + "snmpRwCommunity": "string", + "snmpRwCommunityDesc": "string", + "snmpUserName": "string", + "timeOut": 0, + "updateMgmtIp": true, + "userNameList": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_job_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_job_info.py new file mode 100644 index 00000000..202f57c8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_job_info.py @@ -0,0 +1,131 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_job_info +short_description: Information module for Discovery Job +description: +- Get all Discovery Job. +- Get Discovery Job by id. +- > + Returns the list of discovery jobs for the given Discovery ID. The results can be optionally filtered based on IP. + Discovery ID can be obtained using the "Get Discoveries by range" API. +- Returns the list of discovery jobs for the given IP. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + offset: + description: + - Offset query parameter. + type: int + limit: + description: + - Limit query parameter. + type: int + ipAddress: + description: + - IpAddress query parameter. + type: str + name: + description: + - Name query parameter. + type: str + id: + description: + - Id path parameter. Discovery ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetDiscoveryJobsByIP + description: Complete reference of the GetDiscoveryJobsByIP API. + link: https://developer.cisco.com/docs/dna-center/#!get-discovery-jobs-by-ip +- name: Cisco DNA Center documentation for Discovery GetListOfDiscoveriesByDiscoveryId + description: Complete reference of the GetListOfDiscoveriesByDiscoveryId API. + link: https://developer.cisco.com/docs/dna-center/#!get-list-of-discoveries-by-discovery-id +notes: + - SDK Method used are + discovery.Discovery.get_discovery_jobs_by_ip, + discovery.Discovery.get_list_of_discoveries_by_discovery_id, + + - Paths used are + get /dna/intent/api/v1/discovery/job, + get /dna/intent/api/v1/discovery/{id}/job, + +""" + +EXAMPLES = r""" +- name: Get all Discovery Job + cisco.dnac.discovery_job_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: 0 + limit: 0 + ipAddress: string + name: string + register: result + +- name: Get Discovery Job by id + cisco.dnac.discovery_job_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: 0 + limit: 0 + ipAddress: string + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "attributeInfo": {}, + "cliStatus": "string", + "discoveryStatus": "string", + "endTime": "string", + "httpStatus": "string", + "id": "string", + "inventoryCollectionStatus": "string", + "inventoryReachabilityStatus": "string", + "ipAddress": "string", + "jobStatus": "string", + "name": "string", + "netconfStatus": "string", + "pingStatus": "string", + "snmpStatus": "string", + "startTime": "string", + "taskId": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_range_delete.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_range_delete.py new file mode 100644 index 00000000..07c380a1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_range_delete.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_range_delete +short_description: Resource module for Discovery Range Delete +description: +- Manage operation delete of the resource Discovery Range Delete. +- Stops discovery for the given range and removes them. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + recordsToDelete: + description: RecordsToDelete path parameter. Number of records to delete. + type: int + startIndex: + description: StartIndex path parameter. Start index. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery DeleteDiscoveryBySpecifiedRange + description: Complete reference of the DeleteDiscoveryBySpecifiedRange API. + link: https://developer.cisco.com/docs/dna-center/#!delete-discovery-by-specified-range +notes: + - SDK Method used are + discovery.Discovery.delete_discovery_by_specified_range, + + - Paths used are + delete /dna/intent/api/v1/discovery/{startIndex}/{recordsToDelete}, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.discovery_range_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + recordsToDelete: 0 + startIndex: 0 + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_range_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_range_info.py new file mode 100644 index 00000000..c08902f8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_range_info.py @@ -0,0 +1,136 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_range_info +short_description: Information module for Discovery Range +description: +- Get all Discovery Range. +- Returns the discovery by specified range. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + startIndex: + description: + - StartIndex path parameter. Start index. + type: int + recordsToReturn: + description: + - RecordsToReturn path parameter. Number of records to return. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetDiscoveriesByRange + description: Complete reference of the GetDiscoveriesByRange API. + link: https://developer.cisco.com/docs/dna-center/#!get-discoveries-by-range +notes: + - SDK Method used are + discovery.Discovery.get_discoveries_by_range, + + - Paths used are + get /dna/intent/api/v1/discovery/{startIndex}/{recordsToReturn}, + +""" + +EXAMPLES = r""" +- name: Get all Discovery Range + cisco.dnac.discovery_range_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + startIndex: 0 + recordsToReturn: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "attributeInfo": {}, + "cdpLevel": 0, + "deviceIds": "string", + "discoveryCondition": "string", + "discoveryStatus": "string", + "discoveryType": "string", + "enablePasswordList": "string", + "globalCredentialIdList": [ + "string" + ], + "httpReadCredential": { + "comments": "string", + "credentialType": "string", + "description": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "password": "string", + "port": 0, + "secure": true, + "username": "string" + }, + "httpWriteCredential": { + "comments": "string", + "credentialType": "string", + "description": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "password": "string", + "port": 0, + "secure": true, + "username": "string" + }, + "id": "string", + "ipAddressList": "string", + "ipFilterList": "string", + "isAutoCdp": true, + "lldpLevel": 0, + "name": "string", + "netconfPort": "string", + "numDevices": 0, + "parentDiscoveryId": "string", + "passwordList": "string", + "preferredMgmtIPMethod": "string", + "protocolOrder": "string", + "retryCount": 0, + "snmpAuthPassphrase": "string", + "snmpAuthProtocol": "string", + "snmpMode": "string", + "snmpPrivPassphrase": "string", + "snmpPrivProtocol": "string", + "snmpRoCommunity": "string", + "snmpRoCommunityDesc": "string", + "snmpRwCommunity": "string", + "snmpRwCommunityDesc": "string", + "snmpUserName": "string", + "timeOut": 0, + "updateMgmtIp": true, + "userNameList": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/discovery_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/discovery_summary_info.py new file mode 100644 index 00000000..bd8e6dcf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/discovery_summary_info.py @@ -0,0 +1,121 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: discovery_summary_info +short_description: Information module for Discovery Summary +description: +- Get all Discovery Summary. +- > + Returns the network devices from a discovery job based on given filters. Discovery ID can be obtained using the + "Get Discoveries by range" API. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Discovery ID. + type: str + taskId: + description: + - TaskId query parameter. + type: str + sortBy: + description: + - SortBy query parameter. + type: str + sortOrder: + description: + - SortOrder query parameter. + type: str + ipAddress: + description: + - IpAddress query parameter. + elements: str + type: list + pingStatus: + description: + - PingStatus query parameter. + elements: str + type: list + snmpStatus: + description: + - SnmpStatus query parameter. + elements: str + type: list + cliStatus: + description: + - CliStatus query parameter. + elements: str + type: list + netconfStatus: + description: + - NetconfStatus query parameter. + elements: str + type: list + httpStatus: + description: + - HttpStatus query parameter. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetNetworkDevicesFromDiscovery + description: Complete reference of the GetNetworkDevicesFromDiscovery API. + link: https://developer.cisco.com/docs/dna-center/#!get-network-devices-from-discovery +notes: + - SDK Method used are + discovery.Discovery.get_network_devices_from_discovery, + + - Paths used are + get /dna/intent/api/v1/discovery/{id}/summary, + +""" + +EXAMPLES = r""" +- name: Get all Discovery Summary + cisco.dnac.discovery_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + taskId: string + sortBy: string + sortOrder: string + ipAddress: [] + pingStatus: [] + snmpStatus: [] + cliStatus: [] + netconfStatus: [] + httpStatus: [] + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/dna_command_runner_keywords_info.py b/ansible_collections/cisco/dnac/plugins/modules/dna_command_runner_keywords_info.py new file mode 100644 index 00000000..dee8c3ff --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/dna_command_runner_keywords_info.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: dna_command_runner_keywords_info +short_description: Information module for Dna Command Runner Keywords +description: +- Get all Dna Command Runner Keywords. +- Get valid keywords. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Command Runner GetAllKeywordsOfCLIsAcceptedByCommandRunner + description: Complete reference of the GetAllKeywordsOfCLIsAcceptedByCommandRunner API. + link: https://developer.cisco.com/docs/dna-center/#!get-all-keywords-of-cl-is-accepted-by-command-runner +notes: + - SDK Method used are + command_runner.CommandRunner.get_all_keywords_of_clis_accepted, + + - Paths used are + get /dna/intent/api/v1/network-device-poller/cli/legit-reads, + +""" + +EXAMPLES = r""" +- name: Get all Dna Command Runner Keywords + cisco.dnac.dna_command_runner_keywords_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + "string" + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/dnacaap_management_execution_status_info.py b/ansible_collections/cisco/dnac/plugins/modules/dnacaap_management_execution_status_info.py new file mode 100644 index 00000000..1afb01df --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/dnacaap_management_execution_status_info.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: dnacaap_management_execution_status_info +short_description: Information module for Dnacaap Management Execution Status +description: +- Get Dnacaap Management Execution Status by id. +- Retrieves the execution details of a Business API. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + executionId: + description: + - ExecutionId path parameter. Execution Id of API. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Task GetBusinessAPIExecutionDetails + description: Complete reference of the GetBusinessAPIExecutionDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-business-api-execution-details +notes: + - SDK Method used are + task.Task.get_business_api_execution_details, + + - Paths used are + get /dna/intent/api/v1/dnacaap/management/execution-status/{executionId}, + +""" + +EXAMPLES = r""" +- name: Get Dnacaap Management Execution Status by id + cisco.dnac.dnacaap_management_execution_status_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + executionId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "bapiKey": "string", + "bapiName": "string", + "bapiExecutionId": "string", + "startTime": "string", + "startTimeEpoch": 0, + "endTime": "string", + "endTimeEpoch": 0, + "timeDuration": 0, + "status": "string", + "bapiError": "string", + "runtimeInstanceId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules.py b/ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules.py new file mode 100644 index 00000000..48cfa0fa --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules.py @@ -0,0 +1,244 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: endpoint_analytics_profiling_rules +short_description: Resource module for Endpoint Analytics Profiling Rules +description: +- Manage operations create, update and delete of the resource Endpoint Analytics Profiling Rules. +- Creates profiling rule from the request body. +- Deletes the profiling rule for the given 'ruleId'. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + clusterId: + description: Unique identifier for ML cluster. Only applicable for 'ML Rule'. + type: str + conditionGroups: + description: Endpoint Analytics Profiling Rules's conditionGroups. + suboptions: + condition: + description: Endpoint Analytics Profiling Rules's condition. + suboptions: + attribute: + description: Endpoint Analytics Profiling Rules's attribute. + type: str + attributeDictionary: + description: Endpoint Analytics Profiling Rules's attributeDictionary. + type: str + operator: + description: Endpoint Analytics Profiling Rules's operator. + type: str + value: + description: Endpoint Analytics Profiling Rules's value. + type: str + type: dict + conditionGroup: + description: Endpoint Analytics Profiling Rules's conditionGroup. + elements: dict + type: list + operator: + description: Endpoint Analytics Profiling Rules's operator. + type: str + type: + description: Endpoint Analytics Profiling Rules's type. + type: str + type: dict + isDeleted: + description: Flag to indicate whether the rule was deleted. + type: bool + lastModifiedBy: + description: User that last modified the rule. It is read-only, and is ignored if + provided as part of input request. + type: str + lastModifiedOn: + description: Timestamp (in epoch milliseconds) of last modification. It is read-only, + and is ignored if provided as part of input request. + type: int + pluginId: + description: Plugin for the rule. Only applicable for 'Cisco Default' rules. + type: str + rejected: + description: Flag to indicate whether rule has been rejected by user or not. Only + applicable for 'ML Rule'. + type: bool + result: + description: Endpoint Analytics Profiling Rules's result. + suboptions: + deviceType: + description: List of device types determined by the current rule. + elements: str + type: list + hardwareManufacturer: + description: List of hardware manufacturers determined by the current rule. + elements: str + type: list + hardwareModel: + description: List of hardware models determined by the current rule. + elements: str + type: list + operatingSystem: + description: List of operating systems determined by the current rule. + elements: str + type: list + type: dict + ruleId: + description: Unique identifier for the rule. This is normally generated by the system, + and client does not need to provide it for rules that need to be newly created. + type: str + ruleName: + description: Human readable name for the rule. + type: str + rulePriority: + description: Priority for the rule. + type: int + ruleType: + description: Type of the rule. Allowed values are 'Cisco Default - Static', 'Cisco + Default - Dynamic', 'Custom Rule', 'ML Rule'. + type: str + ruleVersion: + description: Version of the rule. + type: int + sourcePriority: + description: Source priority for the rule. + type: int + usedAttributes: + description: List of attributes used in the rule. Only applicable for 'Cisco Default' + rules. + elements: str + type: list +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + policy.Policy.create_a_profiling_rule, + policy.Policy.delete_an_existing_profiling_rule, + policy.Policy.update_an_existing_profiling_rule, + + - Paths used are + post /dna/intent/api/v1/endpoint-analytics/profiling-rules, + delete /dna/intent/api/v1/endpoint-analytics/profiling-rules/{ruleId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.endpoint_analytics_profiling_rules: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + clusterId: string + conditionGroups: + condition: + attribute: string + attributeDictionary: string + operator: string + value: string + conditionGroup: + - {} + operator: string + type: string + isDeleted: true + lastModifiedBy: string + lastModifiedOn: 0 + pluginId: string + rejected: true + result: + deviceType: + - string + hardwareManufacturer: + - string + hardwareModel: + - string + operatingSystem: + - string + ruleId: string + ruleName: string + rulePriority: 0 + ruleType: string + ruleVersion: 0 + sourcePriority: 0 + usedAttributes: + - string + +- name: Update by id + cisco.dnac.endpoint_analytics_profiling_rules: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + clusterId: string + conditionGroups: + condition: + attribute: string + attributeDictionary: string + operator: string + value: string + conditionGroup: + - {} + operator: string + type: string + isDeleted: true + lastModifiedBy: string + lastModifiedOn: 0 + pluginId: string + rejected: true + result: + deviceType: + - string + hardwareManufacturer: + - string + hardwareModel: + - string + operatingSystem: + - string + ruleId: string + ruleName: string + rulePriority: 0 + ruleType: string + ruleVersion: 0 + sourcePriority: 0 + usedAttributes: + - string + +- name: Delete by id + cisco.dnac.endpoint_analytics_profiling_rules: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + ruleId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "id": "string", + "link": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules_info.py b/ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules_info.py new file mode 100644 index 00000000..a7115eef --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/endpoint_analytics_profiling_rules_info.py @@ -0,0 +1,162 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: endpoint_analytics_profiling_rules_info +short_description: Information module for Endpoint Analytics Profiling Rules +description: +- Get all Endpoint Analytics Profiling Rules. +- Get Endpoint Analytics Profiling Rules by id. +- Fetches details of the profiling rule for the given 'ruleId'. +- This API fetches the list of profiling rules. It can be used to show profiling rules in client applications, or export those from an environment. + 'POST /profiling-rules/bulk' API can be used to import such exported rules into another environment. + If this API is used to export rules to be imported into another Cisco DNA Center system, then ensure that 'includeDeleted' parameter is 'true', + so that deleted rules get synchronized correctly. + Use query parameters to filter the data, as required. If no filter is provided, then it will include only rules of type 'Custom Rule' in the response. + By default, the response is limited to 500 records. Use 'limit' parameter to fetch higher number of records, if required. + 'GET /profiling-rules/count' API can be used to find out the total number of rules in the system. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + ruleType: + description: + - RuleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. + type: str + includeDeleted: + description: + - IncludeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. + type: bool + limit: + description: + - > + Limit query parameter. Maximum number of records to be fetched. If not provided, 500 records will be fetched + by default. To fetch all the records in the system, provide a large value for this parameter. + type: int + offset: + description: + - Offset query parameter. Record offset to start data fetch at. Offset starts at zero. + type: int + sortBy: + description: + - > + SortBy query parameter. Name of the column to sort the results on. Please note that fetch might take more + time if sorting is requested. + type: str + order: + description: + - Order query parameter. Order to be used for sorting. + type: str + ruleId: + description: + - RuleId path parameter. Unique rule identifier. + type: str +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + policy.Policy.get_details_of_a_single_profiling_rule, + policy.Policy.get_list_of_profiling_rules, + + - Paths used are + get /dna/intent/api/v1/endpoint-analytics/profiling-rules, + get /dna/intent/api/v1/endpoint-analytics/profiling-rules/{ruleId}, + +""" + +EXAMPLES = r""" +- name: Get all Endpoint Analytics Profiling Rules + cisco.dnac.endpoint_analytics_profiling_rules_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + ruleType: string + includeDeleted: True + limit: 0 + offset: 0 + sortBy: string + order: string + register: result + +- name: Get Endpoint Analytics Profiling Rules by id + cisco.dnac.endpoint_analytics_profiling_rules_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + ruleId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "ruleId": "string", + "ruleName": "string", + "ruleType": "string", + "ruleVersion": 0, + "rulePriority": 0, + "sourcePriority": 0, + "isDeleted": true, + "lastModifiedBy": "string", + "lastModifiedOn": 0, + "pluginId": "string", + "clusterId": "string", + "rejected": true, + "result": { + "deviceType": [ + "string" + ], + "hardwareManufacturer": [ + "string" + ], + "hardwareModel": [ + "string" + ], + "operatingSystem": [ + "string" + ] + }, + "conditionGroups": { + "type": "string", + "condition": { + "attribute": "string", + "operator": "string", + "value": "string", + "attributeDictionary": "string" + }, + "operator": "string", + "conditionGroup": [ + {} + ] + }, + "usedAttributes": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_api_status_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_api_status_info.py new file mode 100644 index 00000000..4ddaaca0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_api_status_info.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_api_status_info +short_description: Information module for Event Api Status +description: +- Get Event Api Status by id. +- Get the Status of events API calls with provided executionId as mandatory path parameter. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + executionId: + description: + - ExecutionId path parameter. Execution ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetStatusAPIForEvents + description: Complete reference of the GetStatusAPIForEvents API. + link: https://developer.cisco.com/docs/dna-center/#!get-status-api-for-events +notes: + - SDK Method used are + event_management.EventManagement.get_status_api_for_events, + + - Paths used are + get /dna/intent/api/v1/event/api-status/{executionId}, + +""" + +EXAMPLES = r""" +- name: Get Event Api Status by id + cisco.dnac.event_api_status_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + executionId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": {}, + "apiStatus": "string", + "statusMessage": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_artifact_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_artifact_count_info.py new file mode 100644 index 00000000..f34e77fe --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_artifact_count_info.py @@ -0,0 +1,62 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_artifact_count_info +short_description: Information module for Event Artifact Count +description: +- Get all Event Artifact Count. +- Get the count of registered event artifacts with provided eventIds or tags as mandatory. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management EventArtifactCount + description: Complete reference of the EventArtifactCount API. + link: https://developer.cisco.com/docs/dna-center/#!event-artifact-count +notes: + - SDK Method used are + event_management.EventManagement.eventartifact_count, + + - Paths used are + get /dna/system/api/v1/event/artifact/count, + +""" + +EXAMPLES = r""" +- name: Get all Event Artifact Count + cisco.dnac.event_artifact_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_artifact_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_artifact_info.py new file mode 100644 index 00000000..6e4f14b6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_artifact_info.py @@ -0,0 +1,134 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_artifact_info +short_description: Information module for Event Artifact +description: +- Get all Event Artifact. +- Gets the list of artifacts based on provided offset and limit. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - EventIds query parameter. List of eventIds. + type: str + tags: + description: + - Tags query parameter. Tags defined. + type: str + offset: + description: + - Offset query parameter. Record start offset. + type: int + limit: + description: + - Limit query parameter. # of records to return in result set. + type: int + sortBy: + description: + - SortBy query parameter. Sort by field. + type: str + order: + description: + - Order query parameter. Sorting order (asc/desc). + type: str + search: + description: + - Search query parameter. Findd matches in name, description, eventId, type, category. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetEventArtifacts + description: Complete reference of the GetEventArtifacts API. + link: https://developer.cisco.com/docs/dna-center/#!get-event-artifacts +notes: + - SDK Method used are + event_management.EventManagement.get_eventartifacts, + + - Paths used are + get /dna/system/api/v1/event/artifact, + +""" + +EXAMPLES = r""" +- name: Get all Event Artifact + cisco.dnac.event_artifact_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + tags: string + offset: 0 + limit: 0 + sortBy: string + order: string + search: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "version": "string", + "artifactId": "string", + "namespace": "string", + "name": "string", + "description": "string", + "domain": "string", + "subDomain": "string", + "tags": [ + "string" + ], + "isTemplateEnabled": true, + "ciscoDNAEventLink": "string", + "note": "string", + "isPrivate": true, + "eventPayload": { + "eventId": "string", + "version": "string", + "category": "string", + "type": "string", + "source": "string", + "severity": "string", + "details": { + "device_ip": "string", + "message": "string" + }, + "additionalDetails": {} + }, + "eventTemplates": [ + {} + ], + "isTenantAware": true, + "supportedConnectorTypes": [ + "string" + ], + "tenantId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_config_connector_types_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_config_connector_types_info.py new file mode 100644 index 00000000..8c0958e7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_config_connector_types_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_config_connector_types_info +short_description: Information module for Event Config Connector Types +description: +- Get all Event Config Connector Types. +- Get the list of connector types. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetConnectorTypes + description: Complete reference of the GetConnectorTypes API. + link: https://developer.cisco.com/docs/dna-center/#!get-connector-types +notes: + - SDK Method used are + event_management.EventManagement.get_connector_types, + + - Paths used are + get /dna/system/api/v1/event/config/connector-types, + +""" + +EXAMPLES = r""" +- name: Get all Event Config Connector Types + cisco.dnac.event_config_connector_types_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "connectorType": "string", + "displayName": "string", + "isDefaultSupported": true, + "isCustomConnector": true + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_count_info.py new file mode 100644 index 00000000..13171234 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_count_info.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_count_info +short_description: Information module for Event Count +description: +- Get all Event Count. +- Get the count of registered events with provided eventIds or tags as mandatory. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventId: + description: + - EventId query parameter. The registered EventId should be provided. + type: str + tags: + description: + - Tags query parameter. The registered Tags should be provided. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CountOfEvents + description: Complete reference of the CountOfEvents API. + link: https://developer.cisco.com/docs/dna-center/#!count-of-events +notes: + - SDK Method used are + event_management.EventManagement.count_of_events, + + - Paths used are + get /dna/intent/api/v1/events/count, + +""" + +EXAMPLES = r""" +- name: Get all Event Count + cisco.dnac.event_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventId: string + tags: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_email_config_create.py b/ansible_collections/cisco/dnac/plugins/modules/event_email_config_create.py new file mode 100644 index 00000000..b207dde2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_email_config_create.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_email_config_create +short_description: Resource module for Event Email Config Create +description: +- Manage operation create of the resource Event Email Config Create. +- Create Email Destination. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + emailConfigId: + description: Required only for update email configuration. + type: str + fromEmail: + description: From Email. + type: str + primarySMTPConfig: + description: Event Email Config Create's primarySMTPConfig. + suboptions: + hostName: + description: Host Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + userName: + description: User Name. + type: str + type: dict + secondarySMTPConfig: + description: Event Email Config Create's secondarySMTPConfig. + suboptions: + hostName: + description: Host Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + userName: + description: User Name. + type: str + type: dict + subject: + description: Subject. + type: str + toEmail: + description: To Email. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateEmailDestination + description: Complete reference of the CreateEmailDestination API. + link: https://developer.cisco.com/docs/dna-center/#!create-email-destination +notes: + - SDK Method used are + event_management.EventManagement.create_email_destination, + + - Paths used are + post /dna/intent/api/v1/event/email-config, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.event_email_config_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + emailConfigId: string + fromEmail: string + primarySMTPConfig: + hostName: string + password: string + port: string + userName: string + secondarySMTPConfig: + hostName: string + password: string + port: string + userName: string + subject: string + toEmail: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "statusUri": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_email_config_update.py b/ansible_collections/cisco/dnac/plugins/modules/event_email_config_update.py new file mode 100644 index 00000000..2234ae90 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_email_config_update.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_email_config_update +short_description: Resource module for Event Email Config Update +description: +- Manage operation update of the resource Event Email Config Update. +- Update Email Destination. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + emailConfigId: + description: Required only for update email configuration. + type: str + fromEmail: + description: From Email. + type: str + primarySMTPConfig: + description: Event Email Config Update's primarySMTPConfig. + suboptions: + hostName: + description: Host Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + userName: + description: User Name. + type: str + type: dict + secondarySMTPConfig: + description: Event Email Config Update's secondarySMTPConfig. + suboptions: + hostName: + description: Host Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + userName: + description: User Name. + type: str + type: dict + subject: + description: Subject. + type: str + toEmail: + description: To Email. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management UpdateEmailDestination + description: Complete reference of the UpdateEmailDestination API. + link: https://developer.cisco.com/docs/dna-center/#!update-email-destination +notes: + - SDK Method used are + event_management.EventManagement.update_email_destination, + + - Paths used are + put /dna/intent/api/v1/event/email-config, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.event_email_config_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + emailConfigId: string + fromEmail: string + primarySMTPConfig: + hostName: string + password: string + port: string + userName: string + secondarySMTPConfig: + hostName: string + password: string + port: string + userName: string + subject: string + toEmail: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "statusUri": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_info.py new file mode 100644 index 00000000..ac34fbf2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_info.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_info +short_description: Information module for Event +description: +- Get all Event. +- Gets the list of registered Events with provided eventIds or tags as mandatory. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventId: + description: + - EventId query parameter. The registered EventId should be provided. + type: str + tags: + description: + - Tags query parameter. The registered Tags should be provided. + type: str + offset: + description: + - Offset query parameter. The number of Registries to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of Registries to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetEvents + description: Complete reference of the GetEvents API. + link: https://developer.cisco.com/docs/dna-center/#!get-events +notes: + - SDK Method used are + event_management.EventManagement.get_events, + + - Paths used are + get /dna/intent/api/v1/events, + +""" + +EXAMPLES = r""" +- name: Get all Event + cisco.dnac.event_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventId: string + tags: string + offset: 0 + limit: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "eventId": "string", + "nameSpace": "string", + "name": "string", + "description": "string", + "version": "string", + "category": "string", + "domain": "string", + "subDomain": "string", + "type": "string", + "tags": [ + "string" + ], + "severity": 0, + "details": {}, + "subscriptionTypes": [ + "string" + ] + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_info.py new file mode 100644 index 00000000..dbb7b532 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_info.py @@ -0,0 +1,219 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_series_audit_logs_info +short_description: Information module for Event Series Audit Logs +description: +- Get all Event Series Audit Logs. +- Get Audit Log Event instances from the Event-Hub. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + parentInstanceId: + description: + - ParentInstanceId query parameter. Parent Audit Log record's instanceID. + type: str + instanceId: + description: + - InstanceId query parameter. InstanceID of the Audit Log. + type: str + name: + description: + - Name query parameter. Audit Log notification event name. + type: str + eventId: + description: + - EventId query parameter. Audit Log notification's event ID. + type: str + category: + description: + - > + Category query parameter. Audit Log notification's event category. Supported values INFO, WARN, ERROR, + ALERT, TASK_PROGRESS, TASK_FAILURE, TASK_COMPLETE, COMMAND, QUERY, CONVERSATION. + type: str + severity: + description: + - Severity query parameter. Audit Log notification's event severity. Supported values 1, 2, 3, 4, 5. + type: str + domain: + description: + - Domain query parameter. Audit Log notification's event domain. + type: str + subDomain: + description: + - SubDomain query parameter. Audit Log notification's event sub-domain. + type: str + source: + description: + - Source query parameter. Audit Log notification's event source. + type: str + userId: + description: + - UserId query parameter. Audit Log notification's event userId. + type: str + context: + description: + - Context query parameter. Audit Log notification's event correlationId. + type: str + eventHierarchy: + description: + - > + EventHierarchy query parameter. Audit Log notification's event eventHierarchy. Example "US.CA.San Jose" OR + "US.CA" OR "CA.San Jose" - Delimiter for hierarchy separation is ".". + type: str + siteId: + description: + - SiteId query parameter. Audit Log notification's siteId. + type: str + deviceId: + description: + - DeviceId query parameter. Audit Log notification's deviceId. + type: str + isSystemEvents: + description: + - IsSystemEvents query parameter. Parameter to filter system generated audit-logs. + type: bool + description: + description: + - > + Description query parameter. String full/partial search - (Provided input string is case insensitively + matched for records). + type: str + offset: + description: + - Offset query parameter. Position of a particular Audit Log record in the data. + type: int + limit: + description: + - Limit query parameter. Number of Audit Log records to be returned per page. + type: int + startTime: + description: + - > + StartTime query parameter. Start Time in milliseconds since Epoch Eg. 1597950637211 (when provided endTime + is mandatory). + type: int + endTime: + description: + - > + EndTime query parameter. End Time in milliseconds since Epoch Eg. 1597961437211 (when provided startTime is + mandatory). + type: int + sortBy: + description: + - > + SortBy query parameter. Sort the Audit Logs by certain fields. Supported values are event notification + header attributes. + type: str + order: + description: + - > + Order query parameter. Order of the sorted Audit Log records. Default value is desc by timestamp. Supported + values asc, desc. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetAuditLogRecords + description: Complete reference of the GetAuditLogRecords API. + link: https://developer.cisco.com/docs/dna-center/#!get-audit-log-records +notes: + - SDK Method used are + event_management.EventManagement.get_auditlog_records, + + - Paths used are + get /dna/data/api/v1/event/event-series/audit-logs, + +""" + +EXAMPLES = r""" +- name: Get all Event Series Audit Logs + cisco.dnac.event_series_audit_logs_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + parentInstanceId: string + instanceId: string + name: string + eventId: string + category: string + severity: string + domain: string + subDomain: string + source: string + userId: string + context: string + eventHierarchy: string + siteId: string + deviceId: string + isSystemEvents: True + description: string + offset: 0 + limit: 0 + startTime: 0 + endTime: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "version": "string", + "instanceId": "string", + "eventId": "string", + "namespace": "string", + "name": "string", + "description": "string", + "type": "string", + "category": "string", + "domain": "string", + "subDomain": "string", + "severity": 0, + "source": "string", + "timestamp": 0, + "tags": [ + {} + ], + "details": {}, + "ciscoDnaEventLink": "string", + "note": "string", + "tntId": "string", + "context": "string", + "userId": "string", + "i18n": "string", + "eventHierarchy": "string", + "message": "string", + "messageParams": "string", + "additionalDetails": {}, + "parentInstanceId": "string", + "network": "string", + "childCount": 0, + "tenantId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_parent_records_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_parent_records_info.py new file mode 100644 index 00000000..d23d8306 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_parent_records_info.py @@ -0,0 +1,214 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_series_audit_logs_parent_records_info +short_description: Information module for Event Series Audit Logs Parent Records +description: +- Get all Event Series Audit Logs Parent Records. +- Get Parent Audit Log Event instances from the Event-Hub. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + instanceId: + description: + - InstanceId query parameter. InstanceID of the Audit Log. + type: str + name: + description: + - Name query parameter. Audit Log notification event name. + type: str + eventId: + description: + - EventId query parameter. Audit Log notification's event ID. + type: str + category: + description: + - > + Category query parameter. Audit Log notification's event category. Supported values INFO, WARN, ERROR, + ALERT, TASK_PROGRESS, TASK_FAILURE, TASK_COMPLETE, COMMAND, QUERY, CONVERSATION. + type: str + severity: + description: + - Severity query parameter. Audit Log notification's event severity. Supported values 1, 2, 3, 4, 5. + type: str + domain: + description: + - Domain query parameter. Audit Log notification's event domain. + type: str + subDomain: + description: + - SubDomain query parameter. Audit Log notification's event sub-domain. + type: str + source: + description: + - Source query parameter. Audit Log notification's event source. + type: str + userId: + description: + - UserId query parameter. Audit Log notification's event userId. + type: str + context: + description: + - Context query parameter. Audit Log notification's event correlationId. + type: str + eventHierarchy: + description: + - > + EventHierarchy query parameter. Audit Log notification's event eventHierarchy. Example "US.CA.San Jose" OR + "US.CA" OR "CA.San Jose" - Delimiter for hierarchy separation is ".". + type: str + siteId: + description: + - SiteId query parameter. Audit Log notification's siteId. + type: str + deviceId: + description: + - DeviceId query parameter. Audit Log notification's deviceId. + type: str + isSystemEvents: + description: + - IsSystemEvents query parameter. Parameter to filter system generated audit-logs. + type: bool + description: + description: + - > + Description query parameter. String full/partial search - (Provided input string is case insensitively + matched for records). + type: str + offset: + description: + - Offset query parameter. Position of a particular Audit Log record in the data. + type: int + limit: + description: + - Limit query parameter. Number of Audit Log records to be returned per page. + type: int + startTime: + description: + - > + StartTime query parameter. Start Time in milliseconds since Epoch Eg. 1597950637211 (when provided endTime + is mandatory). + type: int + endTime: + description: + - > + EndTime query parameter. End Time in milliseconds since Epoch Eg. 1597961437211 (when provided startTime is + mandatory). + type: int + sortBy: + description: + - > + SortBy query parameter. Sort the Audit Logs by certain fields. Supported values are event notification + header attributes. + type: str + order: + description: + - > + Order query parameter. Order of the sorted Audit Log records. Default value is desc by timestamp. Supported + values asc, desc. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetAuditLogParentRecords + description: Complete reference of the GetAuditLogParentRecords API. + link: https://developer.cisco.com/docs/dna-center/#!get-audit-log-parent-records +notes: + - SDK Method used are + event_management.EventManagement.get_auditlog_parent_records, + + - Paths used are + get /dna/data/api/v1/event/event-series/audit-log/parent-records, + +""" + +EXAMPLES = r""" +- name: Get all Event Series Audit Logs Parent Records + cisco.dnac.event_series_audit_logs_parent_records_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + instanceId: string + name: string + eventId: string + category: string + severity: string + domain: string + subDomain: string + source: string + userId: string + context: string + eventHierarchy: string + siteId: string + deviceId: string + isSystemEvents: True + description: string + offset: 0 + limit: 0 + startTime: 0 + endTime: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "version": "string", + "instanceId": "string", + "eventId": "string", + "namespace": "string", + "name": "string", + "description": "string", + "type": "string", + "category": "string", + "domain": "string", + "subDomain": "string", + "severity": 0, + "source": "string", + "timestamp": 0, + "tags": [ + {} + ], + "details": {}, + "ciscoDnaEventLink": {}, + "note": {}, + "tntId": "string", + "context": "string", + "userId": "string", + "i18n": "string", + "eventHierarchy": {}, + "message": "string", + "messageParams": {}, + "additionalDetails": {}, + "parentInstanceId": {}, + "network": {}, + "childCount": 0, + "tenantId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_summary_info.py new file mode 100644 index 00000000..ee2063fa --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_series_audit_logs_summary_info.py @@ -0,0 +1,172 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_series_audit_logs_summary_info +short_description: Information module for Event Series Audit Logs Summary +description: +- Get all Event Series Audit Logs Summary. +- Get Audit Log Summary from the Event-Hub. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + parentInstanceId: + description: + - ParentInstanceId query parameter. Parent Audit Log record's instanceID. + type: str + isParentOnly: + description: + - IsParentOnly query parameter. Parameter to filter parent only audit-logs. + type: bool + instanceId: + description: + - InstanceId query parameter. InstanceID of the Audit Log. + type: str + name: + description: + - Name query parameter. Audit Log notification event name. + type: str + eventId: + description: + - EventId query parameter. Audit Log notification's event ID. + type: str + category: + description: + - > + Category query parameter. Audit Log notification's event category. Supported values INFO, WARN, ERROR, + ALERT, TASK_PROGRESS, TASK_FAILURE, TASK_COMPLETE, COMMAND, QUERY, CONVERSATION. + type: str + severity: + description: + - Severity query parameter. Audit Log notification's event severity. Supported values 1, 2, 3, 4, 5. + type: str + domain: + description: + - Domain query parameter. Audit Log notification's event domain. + type: str + subDomain: + description: + - SubDomain query parameter. Audit Log notification's event sub-domain. + type: str + source: + description: + - Source query parameter. Audit Log notification's event source. + type: str + userId: + description: + - UserId query parameter. Audit Log notification's event userId. + type: str + context: + description: + - Context query parameter. Audit Log notification's event correlationId. + type: str + eventHierarchy: + description: + - > + EventHierarchy query parameter. Audit Log notification's event eventHierarchy. Example "US.CA.San Jose" OR + "US.CA" OR "CA.San Jose" - Delimiter for hierarchy separation is ".". + type: str + siteId: + description: + - SiteId query parameter. Audit Log notification's siteId. + type: str + deviceId: + description: + - DeviceId query parameter. Audit Log notification's deviceId. + type: str + isSystemEvents: + description: + - IsSystemEvents query parameter. Parameter to filter system generated audit-logs. + type: bool + description: + description: + - > + Description query parameter. String full/partial search - (Provided input string is case insensitively + matched for records). + type: str + startTime: + description: + - > + StartTime query parameter. Start Time in milliseconds since Epoch Eg. 1597950637211 (when provided endTime + is mandatory). + type: int + endTime: + description: + - > + EndTime query parameter. End Time in milliseconds since Epoch Eg. 1597961437211 (when provided startTime is + mandatory). + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetAuditLogSummary + description: Complete reference of the GetAuditLogSummary API. + link: https://developer.cisco.com/docs/dna-center/#!get-audit-log-summary +notes: + - SDK Method used are + event_management.EventManagement.get_auditlog_summary, + + - Paths used are + get /dna/data/api/v1/event/event-series/audit-log/summary, + +""" + +EXAMPLES = r""" +- name: Get all Event Series Audit Logs Summary + cisco.dnac.event_series_audit_logs_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + parentInstanceId: string + isParentOnly: True + instanceId: string + name: string + eventId: string + category: string + severity: string + domain: string + subDomain: string + source: string + userId: string + context: string + eventHierarchy: string + siteId: string + deviceId: string + isSystemEvents: True + description: string + startTime: 0 + endTime: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "count": 0, + "maxTimestamp": 0, + "minTimestamp": 0 + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_series_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_series_count_info.py new file mode 100644 index 00000000..6fd07cf4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_series_count_info.py @@ -0,0 +1,105 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_series_count_info +short_description: Information module for Event Series Count +description: +- Get all Event Series Count. +- Get the Count of Published Notifications. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - EventIds query parameter. The registered EventId should be provided. + type: str + startTime: + description: + - StartTime query parameter. Start Time in milliseconds. + type: int + endTime: + description: + - EndTime query parameter. End Time in milliseconds. + type: int + category: + description: + - Category query parameter. + type: str + type: + description: + - Type query parameter. + type: str + severity: + description: + - Severity query parameter. + type: str + domain: + description: + - Domain query parameter. + type: str + subDomain: + description: + - SubDomain query parameter. Sub Domain. + type: str + source: + description: + - Source query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CountOfNotifications + description: Complete reference of the CountOfNotifications API. + link: https://developer.cisco.com/docs/dna-center/#!count-of-notifications +notes: + - SDK Method used are + event_management.EventManagement.count_of_notifications, + + - Paths used are + get /dna/intent/api/v1/event/event-series/count, + +""" + +EXAMPLES = r""" +- name: Get all Event Series Count + cisco.dnac.event_series_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + startTime: 0 + endTime: 0 + category: string + type: string + severity: string + domain: string + subDomain: string + source: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: str + sample: > + "string" +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_series_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_series_info.py new file mode 100644 index 00000000..523e5a70 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_series_info.py @@ -0,0 +1,163 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_series_info +short_description: Information module for Event Series +description: +- Get all Event Series. +- Get the list of Published Notifications. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - EventIds query parameter. The registered EventId should be provided. + type: str + startTime: + description: + - StartTime query parameter. Start Time in milliseconds. + type: int + endTime: + description: + - EndTime query parameter. End Time in milliseconds. + type: int + category: + description: + - Category query parameter. + type: str + type: + description: + - Type query parameter. + type: str + severity: + description: + - Severity query parameter. + type: str + domain: + description: + - Domain query parameter. + type: str + subDomain: + description: + - SubDomain query parameter. Sub Domain. + type: str + source: + description: + - Source query parameter. + type: str + offset: + description: + - Offset query parameter. Start Offset. + type: int + limit: + description: + - Limit query parameter. # of records. + type: int + sortBy: + description: + - SortBy query parameter. Sort By column. + type: str + order: + description: + - Order query parameter. Ascending/Descending order asc/desc. + type: str + tags: + description: + - Tags query parameter. + type: str + namespace: + description: + - Namespace query parameter. + type: str + siteId: + description: + - SiteId query parameter. Site Id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetNotifications + description: Complete reference of the GetNotifications API. + link: https://developer.cisco.com/docs/dna-center/#!get-notifications +notes: + - SDK Method used are + event_management.EventManagement.get_notifications, + + - Paths used are + get /dna/intent/api/v1/event/event-series, + +""" + +EXAMPLES = r""" +- name: Get all Event Series + cisco.dnac.event_series_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + startTime: 0 + endTime: 0 + category: string + type: string + severity: string + domain: string + subDomain: string + source: string + offset: 0 + limit: 0 + sortBy: string + order: string + tags: string + namespace: string + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "eventId": "string", + "instanceId": "string", + "namespace": "string", + "name": "string", + "description": "string", + "version": "string", + "category": "string", + "domain": "string", + "subDomain": "string", + "type": "string", + "severity": "string", + "source": "string", + "timestamp": "string", + "details": "string", + "eventHierarchy": "string", + "network": { + "siteId": "string", + "deviceId": "string" + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription.py new file mode 100644 index 00000000..38c2899a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription.py @@ -0,0 +1,220 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription +short_description: Resource module for Event Subscription +description: +- Manage operations create, update and delete of the resource Event Subscription. +- Subscribe SubscriptionEndpoint to list of registered events Deprecated . +- Delete EventSubscriptions. +- Update SubscriptionEndpoint to list of registered events Deprecated . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Event Subscription's payload. + elements: dict + suboptions: + description: + description: Description. + type: str + filter: + description: Event Subscription's filter. + suboptions: + categories: + description: Categories. + elements: str + type: list + domainsSubdomains: + description: Event Subscription's domainsSubdomains. + elements: dict + suboptions: + domain: + description: Domain. + type: str + subDomains: + description: Sub Domains. + elements: str + type: list + type: list + eventIds: + description: Event Ids (Comma separated event ids). + elements: str + type: list + severities: + description: Severities. + elements: str + type: list + siteIds: + description: Site Ids. + elements: str + type: list + sources: + description: Sources. + elements: str + type: list + types: + description: Types. + elements: str + type: list + type: dict + name: + description: Name. + type: str + subscriptionEndpoints: + description: Event Subscription's subscriptionEndpoints. + elements: dict + suboptions: + instanceId: + description: (From Get Rest/Webhook Subscription Details --> pick instanceId). + type: str + subscriptionDetails: + description: Event Subscription's subscriptionDetails. + suboptions: + connectorType: + description: Connector Type (Must be REST). + type: str + type: dict + type: list + subscriptionId: + description: Subscription Id (Unique UUID). + type: str + version: + description: Version. + type: str + type: list + subscriptions: + description: Subscriptions query parameter. List of EventSubscriptionId's for removal. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateEventSubscriptions + description: Complete reference of the CreateEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!create-event-subscriptions +- name: Cisco DNA Center documentation for Event Management DeleteEventSubscriptions + description: Complete reference of the DeleteEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!delete-event-subscriptions +- name: Cisco DNA Center documentation for Event Management UpdateEventSubscriptions + description: Complete reference of the UpdateEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!update-event-subscriptions +notes: + - SDK Method used are + event_management.EventManagement.create_event_subscriptions, + event_management.EventManagement.delete_event_subscriptions, + event_management.EventManagement.update_event_subscriptions, + + - Paths used are + post /dna/intent/api/v1/event/subscription, + delete /dna/intent/api/v1/event/subscription, + put /dna/intent/api/v1/event/subscription, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.event_subscription: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + subscriptions: string + +- name: Update all + cisco.dnac.event_subscription: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - string + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + subscriptionId: string + version: string + +- name: Create + cisco.dnac.event_subscription: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - string + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + subscriptionId: string + version: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "statusUri": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_count_info.py new file mode 100644 index 00000000..e9eb3e43 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_count_info.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_count_info +short_description: Information module for Event Subscription Count +description: +- Get all Event Subscription Count. +- Returns the Count of EventSubscriptions. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - EventIds query parameter. List of subscriptions related to the respective eventIds. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CountOfEventSubscriptions + description: Complete reference of the CountOfEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!count-of-event-subscriptions +notes: + - SDK Method used are + event_management.EventManagement.count_of_event_subscriptions, + + - Paths used are + get /dna/intent/api/v1/event/subscription/count, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription Count + cisco.dnac.event_subscription_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_email_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_email_info.py new file mode 100644 index 00000000..7109b1ac --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_email_info.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_details_email_info +short_description: Information module for Event Subscription Details Email +description: +- Get all Event Subscription Details Email. +- Gets the list of subscription details for specified connectorType. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. Name of the specific configuration. + type: str + instanceId: + description: + - InstanceId query parameter. Instance Id of the specific configuration. + type: str + offset: + description: + - Offset query parameter. The number of Email Subscription detail's to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of Email Subscription detail's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetEmailSubscriptionDetails + description: Complete reference of the GetEmailSubscriptionDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-email-subscription-details +notes: + - SDK Method used are + event_management.EventManagement.get_email_subscription_details, + + - Paths used are + get /dna/intent/api/v1/event/subscription-details/email, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription Details Email + cisco.dnac.event_subscription_details_email_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + instanceId: string + offset: 0 + limit: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "instanceId": "string", + "name": "string", + "description": "string", + "connectorType": "string", + "fromEmailAddress": "string", + "toEmailAddresses": [ + "string" + ], + "subject": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_rest_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_rest_info.py new file mode 100644 index 00000000..cde6348b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_rest_info.py @@ -0,0 +1,117 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_details_rest_info +short_description: Information module for Event Subscription Details Rest +description: +- Get all Event Subscription Details Rest. +- Gets the list of subscription details for specified connectorType. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. Name of the specific configuration. + type: str + instanceId: + description: + - InstanceId query parameter. Instance Id of the specific configuration. + type: str + offset: + description: + - > + Offset query parameter. The number of Rest/Webhook Subscription detail's to offset in the resultset whose + default value 0. + type: int + limit: + description: + - > + Limit query parameter. The number of Rest/Webhook Subscription detail's to limit in the resultset whose + default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetRestWebhookSubscriptionDetails + description: Complete reference of the GetRestWebhookSubscriptionDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-rest-webhook-subscription-details +notes: + - SDK Method used are + event_management.EventManagement.get_rest_webhook_subscription_details, + + - Paths used are + get /dna/intent/api/v1/event/subscription-details/rest, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription Details Rest + cisco.dnac.event_subscription_details_rest_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + instanceId: string + offset: 0 + limit: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "instanceId": "string", + "name": "string", + "description": "string", + "connectorType": "string", + "url": "string", + "method": "string", + "trustCert": "string", + "headers": [ + { + "name": "string", + "value": "string" + } + ], + "queryParams": [ + "string" + ], + "pathParams": [ + "string" + ] + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_syslog_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_syslog_info.py new file mode 100644 index 00000000..2d367675 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_details_syslog_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_details_syslog_info +short_description: Information module for Event Subscription Details Syslog +description: +- Get all Event Subscription Details Syslog. +- Gets the list of subscription details for specified connectorType. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. Name of the specific configuration. + type: str + instanceId: + description: + - InstanceId query parameter. Instance Id of the specific configuration. + type: str + offset: + description: + - > + Offset query parameter. The number of Syslog Subscription detail's to offset in the resultset whose default + value 0. + type: int + limit: + description: + - Limit query parameter. The number of Syslog Subscription detail's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetSyslogSubscriptionDetails + description: Complete reference of the GetSyslogSubscriptionDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-syslog-subscription-details +notes: + - SDK Method used are + event_management.EventManagement.get_syslog_subscription_details, + + - Paths used are + get /dna/intent/api/v1/event/subscription-details/syslog, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription Details Syslog + cisco.dnac.event_subscription_details_syslog_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + instanceId: string + offset: 0 + limit: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "instanceId": "string", + "name": "string", + "description": "string", + "connectorType": "string", + "syslogConfig": { + "configId": "string", + "name": "string", + "description": "string", + "host": "string", + "port": "string", + "protocol": "string" + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_email.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_email.py new file mode 100644 index 00000000..56b82b4a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_email.py @@ -0,0 +1,227 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_email +short_description: Resource module for Event Subscription Email +description: +- Manage operations create and update of the resource Event Subscription Email. +- Create Email Subscription Endpoint for list of registered events. +- Update Email Subscription Endpoint for list of registered events. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Event Subscription Email's payload. + elements: dict + suboptions: + description: + description: Description. + type: str + filter: + description: Event Subscription Email's filter. + suboptions: + categories: + description: Categories. + elements: str + type: list + domainsSubdomains: + description: Event Subscription Email's domainsSubdomains. + elements: dict + suboptions: + domain: + description: Domain. + type: str + subDomains: + description: Sub Domains. + elements: str + type: list + type: list + eventIds: + description: Event Ids. + elements: str + type: list + severities: + description: Severities. + elements: int + type: list + siteIds: + description: Site Ids. + elements: str + type: list + sources: + description: Sources. + elements: str + type: list + types: + description: Types. + elements: str + type: list + type: dict + name: + description: Name. + type: str + subscriptionEndpoints: + description: Event Subscription Email's subscriptionEndpoints. + elements: dict + suboptions: + instanceId: + description: (From Get Email Subscription Details --> pick InstanceId). + type: str + subscriptionDetails: + description: Event Subscription Email's subscriptionDetails. + suboptions: + connectorType: + description: Connector Type (Must be EMAIL). + type: str + description: + description: Description. + type: str + fromEmailAddress: + description: Senders Email Address. + type: str + name: + description: Name. + type: str + subject: + description: Email Subject. + type: str + toEmailAddresses: + description: Recipient's Email Addresses (Comma separated). + elements: str + type: list + type: dict + type: list + subscriptionId: + description: Subscription Id (Unique UUID). + type: str + version: + description: Version. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateEmailEventSubscription + description: Complete reference of the CreateEmailEventSubscription API. + link: https://developer.cisco.com/docs/dna-center/#!create-email-event-subscription +- name: Cisco DNA Center documentation for Event Management UpdateEmailEventSubscription + description: Complete reference of the UpdateEmailEventSubscription API. + link: https://developer.cisco.com/docs/dna-center/#!update-email-event-subscription +notes: + - SDK Method used are + event_management.EventManagement.create_email_event_subscription, + event_management.EventManagement.update_email_event_subscription, + + - Paths used are + post /dna/intent/api/v1/event/subscription/email, + put /dna/intent/api/v1/event/subscription/email, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.event_subscription_email: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - 0 + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + description: string + fromEmailAddress: string + name: string + subject: string + toEmailAddresses: + - string + subscriptionId: string + version: string + +- name: Update all + cisco.dnac.event_subscription_email: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - 0 + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + description: string + fromEmailAddress: string + name: string + subject: string + toEmailAddresses: + - string + subscriptionId: string + version: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "statusUri": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_email_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_email_info.py new file mode 100644 index 00000000..5d20ef47 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_email_info.py @@ -0,0 +1,170 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_email_info +short_description: Information module for Event Subscription Email +description: +- Get all Event Subscription Email. +- Gets the list of email Subscriptions's based on provided query params. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - > + EventIds query parameter. List of email subscriptions related to the respective eventIds (Comma separated + event ids). + type: str + offset: + description: + - Offset query parameter. The number of Subscriptions's to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of Subscriptions's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str + domain: + description: + - Domain query parameter. List of email subscriptions related to the respective domain. + type: str + subDomain: + description: + - SubDomain query parameter. List of email subscriptions related to the respective sub-domain. + type: str + category: + description: + - Category query parameter. List of email subscriptions related to the respective category. + type: str + type: + description: + - Type query parameter. List of email subscriptions related to the respective type. + type: str + name: + description: + - Name query parameter. List of email subscriptions related to the respective name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetEmailEventSubscriptions + description: Complete reference of the GetEmailEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!get-email-event-subscriptions +notes: + - SDK Method used are + event_management.EventManagement.get_email_event_subscriptions, + + - Paths used are + get /dna/intent/api/v1/event/subscription/email, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription Email + cisco.dnac.event_subscription_email_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + offset: 0 + limit: 0 + sortBy: string + order: string + domain: string + subDomain: string + category: string + type: string + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "version": "string", + "subscriptionId": "string", + "name": "string", + "description": "string", + "subscriptionEndpoints": [ + { + "instanceId": "string", + "subscriptionDetails": { + "connectorType": "string", + "instanceId": "string", + "name": "string", + "description": "string", + "fromEmailAddress": "string", + "toEmailAddresses": [ + "string" + ], + "subject": "string" + }, + "connectorType": "string" + } + ], + "filter": { + "eventIds": [ + "string" + ], + "others": [ + "string" + ], + "domainsSubdomains": [ + { + "domain": "string", + "subDomains": [ + "string" + ] + } + ], + "types": [ + "string" + ], + "categories": [ + "string" + ], + "severities": [ + "string" + ], + "sources": [ + "string" + ], + "siteIds": [ + "string" + ] + }, + "isPrivate": true, + "tenantId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_info.py new file mode 100644 index 00000000..9030b2a0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_info.py @@ -0,0 +1,161 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_info +short_description: Information module for Event Subscription +description: +- Get all Event Subscription. +- Gets the list of Subscriptions's based on provided offset and limit Deprecated . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - EventIds query parameter. List of subscriptions related to the respective eventIds. + type: str + offset: + description: + - Offset query parameter. The number of Subscriptions's to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of Subscriptions's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetEventSubscriptions + description: Complete reference of the GetEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!get-event-subscriptions +notes: + - SDK Method used are + event_management.EventManagement.get_event_subscriptions, + + - Paths used are + get /dna/intent/api/v1/event/subscription, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription + cisco.dnac.event_subscription_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + offset: 0 + limit: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "version": "string", + "subscriptionId": "string", + "name": "string", + "description": "string", + "subscriptionEndpoints": [ + { + "instanceId": "string", + "subscriptionDetails": { + "connectorType": "string", + "instanceId": "string", + "name": "string", + "description": "string", + "url": "string", + "basePath": "string", + "resource": "string", + "method": "string", + "trustCert": "string", + "headers": [ + { + "string": "string" + } + ], + "queryParams": [ + { + "string": "string" + } + ], + "pathParams": [ + { + "string": "string" + } + ], + "body": "string", + "connectTimeout": "string", + "readTimeout": "string" + }, + "connectorType": "string" + } + ], + "filter": { + "eventIds": [ + "string" + ], + "others": [ + "string" + ], + "domainsSubdomains": [ + { + "domain": "string", + "subDomains": [ + "string" + ] + } + ], + "types": [ + "string" + ], + "categories": [ + "string" + ], + "severities": [ + "string" + ], + "sources": [ + "string" + ], + "siteIds": [ + "string" + ] + }, + "isPrivate": true, + "tenantId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest.py new file mode 100644 index 00000000..acfc5f9e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest.py @@ -0,0 +1,199 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_rest +short_description: Resource module for Event Subscription Rest +description: +- Manage operations create and update of the resource Event Subscription Rest. +- Create Rest/Webhook Subscription Endpoint for list of registered events. +- Update Rest/Webhook Subscription Endpoint for list of registered events. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Event Subscription Rest's payload. + elements: dict + suboptions: + description: + description: Description. + type: str + filter: + description: Event Subscription Rest's filter. + suboptions: + categories: + description: Categories. + elements: str + type: list + domainsSubdomains: + description: Event Subscription Rest's domainsSubdomains. + elements: dict + suboptions: + domain: + description: Domain. + type: str + subDomains: + description: Sub Domains. + elements: str + type: list + type: list + eventIds: + description: Event Ids (Comma separated event ids). + elements: str + type: list + severities: + description: Severities. + elements: str + type: list + siteIds: + description: Site Ids. + elements: str + type: list + sources: + description: Sources. + elements: str + type: list + types: + description: Types. + elements: str + type: list + type: dict + name: + description: Name. + type: str + subscriptionEndpoints: + description: Event Subscription Rest's subscriptionEndpoints. + elements: dict + suboptions: + instanceId: + description: (From Get Rest/Webhook Subscription Details --> pick instanceId). + type: str + subscriptionDetails: + description: Event Subscription Rest's subscriptionDetails. + suboptions: + connectorType: + description: Connector Type (Must be REST). + type: str + type: dict + type: list + subscriptionId: + description: Subscription Id (Unique UUID). + type: str + version: + description: Version. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateRestWebhookEventSubscription + description: Complete reference of the CreateRestWebhookEventSubscription API. + link: https://developer.cisco.com/docs/dna-center/#!create-rest-webhook-event-subscription +- name: Cisco DNA Center documentation for Event Management UpdateRestWebhookEventSubscription + description: Complete reference of the UpdateRestWebhookEventSubscription API. + link: https://developer.cisco.com/docs/dna-center/#!update-rest-webhook-event-subscription +notes: + - SDK Method used are + event_management.EventManagement.create_rest_webhook_event_subscription, + event_management.EventManagement.update_rest_webhook_event_subscription, + + - Paths used are + post /dna/intent/api/v1/event/subscription/rest, + put /dna/intent/api/v1/event/subscription/rest, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.event_subscription_rest: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - string + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + subscriptionId: string + version: string + +- name: Update all + cisco.dnac.event_subscription_rest: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - string + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + subscriptionId: string + version: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "statusUri": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest_info.py new file mode 100644 index 00000000..66736563 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_rest_info.py @@ -0,0 +1,186 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_rest_info +short_description: Information module for Event Subscription Rest +description: +- Get all Event Subscription Rest. +- Gets the list of Rest/Webhook Subscriptions's based on provided query params. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - EventIds query parameter. List of subscriptions related to the respective eventIds (Comma separated event ids). + type: str + offset: + description: + - Offset query parameter. The number of Subscriptions's to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of Subscriptions's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str + domain: + description: + - Domain query parameter. List of subscriptions related to the respective domain. + type: str + subDomain: + description: + - SubDomain query parameter. List of subscriptions related to the respective sub-domain. + type: str + category: + description: + - Category query parameter. List of subscriptions related to the respective category. + type: str + type: + description: + - Type query parameter. List of subscriptions related to the respective type. + type: str + name: + description: + - Name query parameter. List of subscriptions related to the respective name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetRestWebhookEventSubscriptions + description: Complete reference of the GetRestWebhookEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!get-rest-webhook-event-subscriptions +notes: + - SDK Method used are + event_management.EventManagement.get_rest_webhook_event_subscriptions, + + - Paths used are + get /dna/intent/api/v1/event/subscription/rest, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription Rest + cisco.dnac.event_subscription_rest_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + offset: 0 + limit: 0 + sortBy: string + order: string + domain: string + subDomain: string + category: string + type: string + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "version": "string", + "subscriptionId": "string", + "name": "string", + "description": "string", + "subscriptionEndpoints": [ + { + "instanceId": "string", + "subscriptionDetails": { + "connectorType": "string", + "instanceId": "string", + "name": "string", + "description": "string", + "url": "string", + "basePath": "string", + "resource": "string", + "method": "string", + "trustCert": "string", + "headers": [ + { + "string": "string" + } + ], + "queryParams": [ + { + "string": "string" + } + ], + "pathParams": [ + { + "string": "string" + } + ], + "body": "string", + "connectTimeout": "string", + "readTimeout": "string" + }, + "connectorType": "string" + } + ], + "filter": { + "eventIds": [ + "string" + ], + "others": [ + "string" + ], + "domainsSubdomains": [ + { + "domain": "string", + "subDomains": [ + "string" + ] + } + ], + "types": [ + "string" + ], + "categories": [ + "string" + ], + "severities": [ + "string" + ], + "sources": [ + "string" + ], + "siteIds": [ + "string" + ] + }, + "isPrivate": true, + "tenantId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog.py new file mode 100644 index 00000000..80266403 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog.py @@ -0,0 +1,199 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_syslog +short_description: Resource module for Event Subscription Syslog +description: +- Manage operations create and update of the resource Event Subscription Syslog. +- Create Syslog Subscription Endpoint for list of registered events. +- Update Syslog Subscription Endpoint for list of registered events. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Event Subscription Syslog's payload. + elements: dict + suboptions: + description: + description: Description. + type: str + filter: + description: Event Subscription Syslog's filter. + suboptions: + categories: + description: Categories. + elements: str + type: list + domainsSubdomains: + description: Event Subscription Syslog's domainsSubdomains. + elements: dict + suboptions: + domain: + description: Domain. + type: str + subDomains: + description: Sub Domains. + elements: str + type: list + type: list + eventIds: + description: Event Ids (Comma separated event ids). + elements: str + type: list + severities: + description: Severities. + elements: str + type: list + siteIds: + description: Site Ids. + elements: str + type: list + sources: + description: Sources. + elements: str + type: list + types: + description: Types. + elements: str + type: list + type: dict + name: + description: Name. + type: str + subscriptionEndpoints: + description: Event Subscription Syslog's subscriptionEndpoints. + elements: dict + suboptions: + instanceId: + description: (From Get Syslog Subscription Details --> pick instanceId). + type: str + subscriptionDetails: + description: Event Subscription Syslog's subscriptionDetails. + suboptions: + connectorType: + description: Connector Type (Must be SYSLOG). + type: str + type: dict + type: list + subscriptionId: + description: Subscription Id (Unique UUID). + type: str + version: + description: Version. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateSyslogEventSubscription + description: Complete reference of the CreateSyslogEventSubscription API. + link: https://developer.cisco.com/docs/dna-center/#!create-syslog-event-subscription +- name: Cisco DNA Center documentation for Event Management UpdateSyslogEventSubscription + description: Complete reference of the UpdateSyslogEventSubscription API. + link: https://developer.cisco.com/docs/dna-center/#!update-syslog-event-subscription +notes: + - SDK Method used are + event_management.EventManagement.create_syslog_event_subscription, + event_management.EventManagement.update_syslog_event_subscription, + + - Paths used are + post /dna/intent/api/v1/event/subscription/syslog, + put /dna/intent/api/v1/event/subscription/syslog, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.event_subscription_syslog: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - string + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + subscriptionId: string + version: string + +- name: Create + cisco.dnac.event_subscription_syslog: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - description: string + filter: + categories: + - string + domainsSubdomains: + - domain: string + subDomains: + - string + eventIds: + - string + severities: + - string + siteIds: + - string + sources: + - string + types: + - string + name: string + subscriptionEndpoints: + - instanceId: string + subscriptionDetails: + connectorType: string + subscriptionId: string + version: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "statusUri": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog_info.py b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog_info.py new file mode 100644 index 00000000..2252f984 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_subscription_syslog_info.py @@ -0,0 +1,172 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_subscription_syslog_info +short_description: Information module for Event Subscription Syslog +description: +- Get all Event Subscription Syslog. +- Gets the list of Syslog Subscriptions's based on provided offset and limit. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + eventIds: + description: + - EventIds query parameter. List of subscriptions related to the respective eventIds (Comma separated event ids). + type: str + offset: + description: + - Offset query parameter. The number of Subscriptions's to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of Subscriptions's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str + domain: + description: + - Domain query parameter. List of subscriptions related to the respective domain. + type: str + subDomain: + description: + - SubDomain query parameter. List of subscriptions related to the respective sub-domain. + type: str + category: + description: + - Category query parameter. List of subscriptions related to the respective category. + type: str + type: + description: + - Type query parameter. List of subscriptions related to the respective type. + type: str + name: + description: + - Name query parameter. List of subscriptions related to the respective name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetSyslogEventSubscriptions + description: Complete reference of the GetSyslogEventSubscriptions API. + link: https://developer.cisco.com/docs/dna-center/#!get-syslog-event-subscriptions +notes: + - SDK Method used are + event_management.EventManagement.get_syslog_event_subscriptions, + + - Paths used are + get /dna/intent/api/v1/event/subscription/syslog, + +""" + +EXAMPLES = r""" +- name: Get all Event Subscription Syslog + cisco.dnac.event_subscription_syslog_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + eventIds: string + offset: 0 + limit: 0 + sortBy: string + order: string + domain: string + subDomain: string + category: string + type: string + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "version": "string", + "subscriptionId": "string", + "name": "string", + "description": "string", + "subscriptionEndpoints": [ + { + "instanceId": "string", + "subscriptionDetails": { + "connectorType": "string", + "instanceId": "string", + "name": "string", + "description": "string", + "syslogConfig": { + "version": "string", + "tenantId": "string", + "configId": "string", + "name": "string", + "description": "string", + "host": "string", + "port": "string" + } + }, + "connectorType": "string" + } + ], + "filter": { + "eventIds": [ + "string" + ], + "others": [ + "string" + ], + "domainsSubdomains": [ + { + "domain": "string", + "subDomains": [ + "string" + ] + } + ], + "types": [ + "string" + ], + "categories": [ + "string" + ], + "severities": [ + {} + ], + "sources": [ + "string" + ], + "siteIds": [ + "string" + ] + }, + "isPrivate": true, + "tenantId": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_webhook_create.py b/ansible_collections/cisco/dnac/plugins/modules/event_webhook_create.py new file mode 100644 index 00000000..b9c585ee --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_webhook_create.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_webhook_create +short_description: Resource module for Event Webhook Create +description: +- Manage operation create of the resource Event Webhook Create. +- Create Webhook Destination. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + description: + description: Description. + type: str + headers: + description: Event Webhook Create's headers. + elements: dict + suboptions: + defaultValue: + description: Default Value. + type: str + encrypt: + description: Encrypt. + type: bool + name: + description: Name. + type: str + value: + description: Value. + type: str + type: list + method: + description: Method. + type: str + name: + description: Name. + type: str + trustCert: + description: Trust Cert. + type: bool + url: + description: Url. + type: str + webhookId: + description: Required only for update webhook configuration. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateWebhookDestination + description: Complete reference of the CreateWebhookDestination API. + link: https://developer.cisco.com/docs/dna-center/#!create-webhook-destination +notes: + - SDK Method used are + event_management.EventManagement.create_webhook_destination, + + - Paths used are + post /dna/intent/api/v1/event/webhook, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.event_webhook_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + description: string + headers: + - defaultValue: string + encrypt: true + name: string + value: string + method: string + name: string + trustCert: true + url: string + webhookId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": { + "errors": [ + "string" + ] + }, + "apiStatus": "string", + "statusMessage": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/event_webhook_update.py b/ansible_collections/cisco/dnac/plugins/modules/event_webhook_update.py new file mode 100644 index 00000000..91d70839 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/event_webhook_update.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_webhook_update +short_description: Resource module for Event Webhook Update +description: +- Manage operation update of the resource Event Webhook Update. +- Update Webhook Destination. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + description: + description: Description. + type: str + headers: + description: Event Webhook Update's headers. + elements: dict + suboptions: + defaultValue: + description: Default Value. + type: str + encrypt: + description: Encrypt. + type: bool + name: + description: Name. + type: str + value: + description: Value. + type: str + type: list + method: + description: Method. + type: str + name: + description: Name. + type: str + trustCert: + description: Trust Cert. + type: bool + url: + description: Url. + type: str + webhookId: + description: Required only for update webhook configuration. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management UpdateWebhookDestination + description: Complete reference of the UpdateWebhookDestination API. + link: https://developer.cisco.com/docs/dna-center/#!update-webhook-destination +notes: + - SDK Method used are + event_management.EventManagement.update_webhook_destination, + + - Paths used are + put /dna/intent/api/v1/event/webhook, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.event_webhook_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + description: string + headers: + - defaultValue: string + encrypt: true + name: string + value: string + method: string + name: string + trustCert: true + url: string + webhookId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": { + "errors": [ + "string" + ] + }, + "apiStatus": "string", + "statusMessage": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/file_import.py b/ansible_collections/cisco/dnac/plugins/modules/file_import.py new file mode 100644 index 00000000..f82598e0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/file_import.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: file_import +short_description: Resource module for File Import +description: +- Manage operation create of the resource File Import. +- Uploads a new file within a specific nameSpace. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + filePath: + description: File absolute path. + type: str + nameSpace: + description: NameSpace path parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for File UploadFile + description: Complete reference of the UploadFile API. + link: https://developer.cisco.com/docs/dna-center/#!upload-file +notes: + - SDK Method used are + file.File.upload_file, + + - Paths used are + post /dna/intent/api/v1/file/{nameSpace}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.file_import: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + filePath: /tmp/uploads/Test-242.bin + nameSpace: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + {} +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/file_info.py b/ansible_collections/cisco/dnac/plugins/modules/file_info.py new file mode 100644 index 00000000..bf07d107 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/file_info.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: file_info +short_description: Information module for File +description: +- Get File by id. +- Downloads a file specified by fileId. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + fileId: + description: + - FileId path parameter. File Identification number. + type: str + dirPath: + description: + - Directory absolute path. Defaults to the current working directory. + type: str + saveFile: + description: + - Enable or disable automatic file creation of raw response. + type: bool + filename: + description: + - The filename used to save the download file. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for File DownloadAFileByFileId + description: Complete reference of the DownloadAFileByFileId API. + link: https://developer.cisco.com/docs/dna-center/#!download-a-file-by-file-id +notes: + - SDK Method used are + file.File.download_a_file_by_fileid, + + - Paths used are + get /dna/intent/api/v1/file/{fileId}, + +""" + +EXAMPLES = r""" +- name: Get File by id + cisco.dnac.file_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + fileId: string + dirPath: /tmp/downloads/Test-242.bin + saveFile: true + filename: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "data": "filecontent", + "filename": "filename", + "dirpath": "download/directory", + "path": "download/directory/filename" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/file_namespace_files_info.py b/ansible_collections/cisco/dnac/plugins/modules/file_namespace_files_info.py new file mode 100644 index 00000000..e28b10c8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/file_namespace_files_info.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: file_namespace_files_info +short_description: Information module for File Namespace Files +description: +- Get File Namespace Files by name. +- Returns list of files under a specific namespace. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + nameSpace: + description: + - NameSpace path parameter. A listing of fileId's. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for File GetListOfFiles + description: Complete reference of the GetListOfFiles API. + link: https://developer.cisco.com/docs/dna-center/#!get-list-of-files +notes: + - SDK Method used are + file.File.get_list_of_files, + + - Paths used are + get /dna/intent/api/v1/file/namespace/{nameSpace}, + +""" + +EXAMPLES = r""" +- name: Get File Namespace Files by name + cisco.dnac.file_namespace_files_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + nameSpace: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "attributeInfo": {}, + "downloadPath": "string", + "encrypted": true, + "fileFormat": "string", + "fileSize": "string", + "id": "string", + "md5Checksum": "string", + "name": "string", + "nameSpace": "string", + "sftpServerList": [ + {} + ], + "sha1Checksum": "string", + "taskId": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/file_namespaces_info.py b/ansible_collections/cisco/dnac/plugins/modules/file_namespaces_info.py new file mode 100644 index 00000000..a0fc5682 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/file_namespaces_info.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: file_namespaces_info +short_description: Information module for File Namespaces +description: +- Get all File Namespaces. +- Returns list of available namespaces. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for File GetListOfAvailableNamespaces + description: Complete reference of the GetListOfAvailableNamespaces API. + link: https://developer.cisco.com/docs/dna-center/#!get-list-of-available-namespaces +notes: + - SDK Method used are + file.File.get_list_of_available_namespaces, + + - Paths used are + get /dna/intent/api/v1/file/namespace, + +""" + +EXAMPLES = r""" +- name: Get all File Namespaces + cisco.dnac.file_namespaces_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + "string" + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/global_credential_delete.py b/ansible_collections/cisco/dnac/plugins/modules/global_credential_delete.py new file mode 100644 index 00000000..13c9630c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/global_credential_delete.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: global_credential_delete +short_description: Resource module for Global Credential Delete +description: +- Manage operation delete of the resource Global Credential Delete. +- Deletes global credential for the given ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + globalCredentialId: + description: GlobalCredentialId path parameter. ID of global-credential. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery DeleteGlobalCredentialsById + description: Complete reference of the DeleteGlobalCredentialsById API. + link: https://developer.cisco.com/docs/dna-center/#!delete-global-credentials-by-id +notes: + - SDK Method used are + discovery.Discovery.delete_global_credentials_by_id, + + - Paths used are + delete /dna/intent/api/v1/global-credential/{globalCredentialId}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.global_credential_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + globalCredentialId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/global_credential_info.py b/ansible_collections/cisco/dnac/plugins/modules/global_credential_info.py new file mode 100644 index 00000000..4fe317b6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/global_credential_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: global_credential_info +short_description: Information module for Global Credential +description: +- Get all Global Credential. +- Get Global Credential by id. +- Returns global credential for the given credential sub type. +- Returns the credential sub type for the given Id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + credentialSubType: + description: + - > + CredentialSubType query parameter. Credential type as CLI / SNMPV2_READ_COMMUNITY / SNMPV2_WRITE_COMMUNITY / + SNMPV3 / HTTP_WRITE / HTTP_READ / NETCONF. + type: str + sortBy: + description: + - SortBy query parameter. + type: str + order: + description: + - Order query parameter. + type: str + id: + description: + - Id path parameter. Global Credential ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetCredentialSubTypeByCredentialId + description: Complete reference of the GetCredentialSubTypeByCredentialId API. + link: https://developer.cisco.com/docs/dna-center/#!get-credential-sub-type-by-credential-id +- name: Cisco DNA Center documentation for Discovery GetGlobalCredentials + description: Complete reference of the GetGlobalCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!get-global-credentials +notes: + - SDK Method used are + discovery.Discovery.get_credential_sub_type_by_credential_id, + discovery.Discovery.get_global_credentials, + + - Paths used are + get /dna/intent/api/v1/global-credential, + get /dna/intent/api/v1/global-credential/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Global Credential + cisco.dnac.global_credential_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + credentialSubType: string + sortBy: string + order: string + register: result + +- name: Get Global Credential by id + cisco.dnac.global_credential_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": "string", + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/global_credential_update.py b/ansible_collections/cisco/dnac/plugins/modules/global_credential_update.py new file mode 100644 index 00000000..12750484 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/global_credential_update.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: global_credential_update +short_description: Resource module for Global Credential Update +description: +- Manage operation update of the resource Global Credential Update. +- Update global credential for network devices in sites. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + globalCredentialId: + description: GlobalCredentialId path parameter. Global credential Uuid. + type: str + siteUuids: + description: Global Credential Update's siteUuids. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery UpdateGlobalCredentials + description: Complete reference of the UpdateGlobalCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!update-global-credentials +notes: + - SDK Method used are + discovery.Discovery.update_global_credentials, + + - Paths used are + put /dna/intent/api/v1/global-credential/{globalCredentialId}, + +""" + +EXAMPLES = r""" +- name: Update by id + cisco.dnac.global_credential_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + globalCredentialId: string + siteUuids: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/global_pool.py b/ansible_collections/cisco/dnac/plugins/modules/global_pool.py new file mode 100644 index 00000000..3c94f9c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/global_pool.py @@ -0,0 +1,144 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: global_pool +short_description: Resource module for Global Pool +description: +- Manage operations create, update and delete of the resource Global Pool. +- API to create global pool. +- API to delete global IP pool. +- API to update global pool. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. Global pool id. + type: str + settings: + description: Global Pool's settings. + suboptions: + ippool: + description: Global Pool's ippool. + elements: dict + suboptions: + dhcpServerIps: + description: Dhcp Server Ips. + elements: str + type: list + dnsServerIps: + description: Dns Server Ips. + elements: str + type: list + gateway: + description: Gateway. + type: str + id: + description: Id. + type: str + ipPoolName: + description: Ip Pool Name. + type: str + type: list + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings CreateGlobalPool + description: Complete reference of the CreateGlobalPool API. + link: https://developer.cisco.com/docs/dna-center/#!create-global-pool +- name: Cisco DNA Center documentation for Network Settings DeleteGlobalIPPool + description: Complete reference of the DeleteGlobalIPPool API. + link: https://developer.cisco.com/docs/dna-center/#!delete-global-ip-pool +- name: Cisco DNA Center documentation for Network Settings UpdateGlobalPool + description: Complete reference of the UpdateGlobalPool API. + link: https://developer.cisco.com/docs/dna-center/#!update-global-pool +notes: + - SDK Method used are + network_settings.NetworkSettings.create_global_pool, + network_settings.NetworkSettings.delete_global_ip_pool, + network_settings.NetworkSettings.update_global_pool, + + - Paths used are + post /dna/intent/api/v1/global-pool, + delete /dna/intent/api/v1/global-pool/{id}, + put /dna/intent/api/v1/global-pool, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.global_pool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + settings: + ippool: + - dhcpServerIps: + - string + dnsServerIps: + - string + gateway: string + id: string + ipPoolName: string + +- name: Create + cisco.dnac.global_pool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + settings: + ippool: + - IpAddressSpace: string + dhcpServerIps: + - string + dnsServerIps: + - string + gateway: string + ipPoolCidr: string + ipPoolName: string + type: string + +- name: Delete by id + cisco.dnac.global_pool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/global_pool_info.py b/ansible_collections/cisco/dnac/plugins/modules/global_pool_info.py new file mode 100644 index 00000000..707a7979 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/global_pool_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: global_pool_info +short_description: Information module for Global Pool +description: +- Get all Global Pool. +- API to get global pool. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + offset: + description: + - Offset query parameter. Offset/starting row. + type: str + limit: + description: + - Limit query parameter. No of Global Pools to be retrieved. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings GetGlobalPool + description: Complete reference of the GetGlobalPool API. + link: https://developer.cisco.com/docs/dna-center/#!get-global-pool +notes: + - SDK Method used are + network_settings.NetworkSettings.get_global_pool, + + - Paths used are + get /dna/intent/api/v1/global-pool, + +""" + +EXAMPLES = r""" +- name: Get all Global Pool + cisco.dnac.global_pool_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: string + limit: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "ipPoolName": "string", + "dhcpServerIps": [ + "string" + ], + "gateways": [ + "string" + ], + "createTime": 0, + "lastUpdateTime": 0, + "totalIpAddressCount": 0, + "usedIpAddressCount": 0, + "parentUuid": "string", + "owner": "string", + "shared": true, + "overlapping": true, + "configureExternalDhcp": true, + "usedPercentage": "string", + "clientOptions": {}, + "dnsServerIps": [ + "string" + ], + "context": [ + { + "owner": "string", + "contextKey": "string", + "contextValue": "string" + } + ], + "ipv6": true, + "id": "string", + "ipPoolCidr": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/golden_image_create.py b/ansible_collections/cisco/dnac/plugins/modules/golden_image_create.py new file mode 100644 index 00000000..1f176f17 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/golden_image_create.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: golden_image_create +short_description: Resource module for Golden Image Create +description: +- Manage operation create of the resource Golden Image Create. +- Golden Tag image. Set siteId as -1 for Global site. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceFamilyIdentifier: + description: Device Family Identifier e.g. 277696480-283933147, 277696480. + type: str + deviceRole: + description: Device Role. Permissible Values ALL, UNKNOWN, ACCESS, BORDER ROUTER, + DISTRIBUTION and CORE. + type: str + imageId: + description: ImageId in uuid format. + type: str + siteId: + description: SiteId in uuid format. For Global Site "-1" to be used. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) TagAsGoldenImage + description: Complete reference of the TagAsGoldenImage API. + link: https://developer.cisco.com/docs/dna-center/#!tag-as-golden-image +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.tag_as_golden_image, + + - Paths used are + post /dna/intent/api/v1/image/importation/golden, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.golden_image_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceFamilyIdentifier: string + deviceRole: string + imageId: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "url": "string", + "taskId": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_delete.py b/ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_delete.py new file mode 100644 index 00000000..8191e491 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_delete.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: golden_tag_image_delete +short_description: Resource module for Golden Tag Image Delete +description: +- Manage operation delete of the resource Golden Tag Image Delete. +- Remove golden tag. Set siteId as -1 for Global site. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceFamilyIdentifier: + description: DeviceFamilyIdentifier path parameter. Device family identifier e.g. + 277696480-283933147, e.g. 277696480. + type: str + deviceRole: + description: DeviceRole path parameter. Device Role. Permissible Values ALL, UNKNOWN, + ACCESS, BORDER ROUTER, DISTRIBUTION and CORE. + type: str + imageId: + description: ImageId path parameter. Image Id in uuid format. + type: str + siteId: + description: SiteId path parameter. Site Id in uuid format. Set siteId as -1 for + Global site. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) RemoveGoldenTagForImage + description: Complete reference of the RemoveGoldenTagForImage API. + link: https://developer.cisco.com/docs/dna-center/#!remove-golden-tag-for-image +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.remove_golden_tag_for_image, + + - Paths used are + delete /dna/intent/api/v1/image/importation/golden/site/{siteId}/family/{deviceFamilyIdentifier}/role/{deviceRole}/image/{imageId}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.golden_tag_image_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceFamilyIdentifier: string + deviceRole: string + imageId: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "url": "string", + "taskId": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_details_info.py new file mode 100644 index 00000000..9d41a761 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/golden_tag_image_details_info.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: golden_tag_image_details_info +short_description: Information module for Golden Tag Image Details +description: +- Get Golden Tag Image Details by id. +- Get golden tag status of an image. Set siteId as -1 for Global site. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId path parameter. Site Id in uuid format. Set siteId as -1 for Global site. + type: str + deviceFamilyIdentifier: + description: + - DeviceFamilyIdentifier path parameter. Device family identifier e.g. 277696480-283933147, e.g. 277696480. + type: str + deviceRole: + description: + - > + DeviceRole path parameter. Device Role. Permissible Values ALL, UNKNOWN, ACCESS, BORDER ROUTER, DISTRIBUTION + and CORE. + type: str + imageId: + description: + - ImageId path parameter. Image Id in uuid format. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) GetGoldenTagStatusOfAnImage + description: Complete reference of the GetGoldenTagStatusOfAnImage API. + link: https://developer.cisco.com/docs/dna-center/#!get-golden-tag-status-of-an-image +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.get_golden_tag_status_of_an_image, + + - Paths used are + get /dna/intent/api/v1/image/importation/golden/site/{siteId}/family/{deviceFamilyIdentifier}/role/{deviceRole}/image/{imageId}, + +""" + +EXAMPLES = r""" +- name: Get Golden Tag Image Details by id + cisco.dnac.golden_tag_image_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + deviceFamilyIdentifier: string + deviceRole: string + imageId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "deviceRole": "string", + "taggedGolden": true, + "inheritedSiteName": "string", + "inheritedSiteId": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/http_read_credential.py b/ansible_collections/cisco/dnac/plugins/modules/http_read_credential.py new file mode 100644 index 00000000..63c19d5c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/http_read_credential.py @@ -0,0 +1,129 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: http_read_credential +short_description: Resource module for Http Read Credential +description: +- Manage operations create and update of the resource Http Read Credential. +- Adds HTTP read credentials. +- Updates global HTTP Read credential. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + comments: + description: Http Read Credential's comments. + type: str + credentialType: + description: Http Read Credential's credentialType. + type: str + description: + description: Http Read Credential's description. + type: str + id: + description: Http Read Credential's id. + type: str + instanceTenantId: + description: Http Read Credential's instanceTenantId. + type: str + instanceUuid: + description: Http Read Credential's instanceUuid. + type: str + password: + description: Http Read Credential's password. + type: str + port: + description: Http Read Credential's port. + type: int + secure: + description: Secure flag. + type: bool + username: + description: Http Read Credential's username. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateHTTPReadCredentials + description: Complete reference of the CreateHTTPReadCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!create-http-read-credentials +- name: Cisco DNA Center documentation for Discovery UpdateHTTPReadCredential + description: Complete reference of the UpdateHTTPReadCredential API. + link: https://developer.cisco.com/docs/dna-center/#!update-http-read-credential +notes: + - SDK Method used are + discovery.Discovery.create_http_read_credentials, + discovery.Discovery.update_http_read_credential, + + - Paths used are + post /dna/intent/api/v1/global-credential/http-read, + put /dna/intent/api/v1/global-credential/http-read, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.http_read_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + port: 0 + secure: true + username: string + +- name: Update all + cisco.dnac.http_read_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + port: 0 + secure: true + username: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/http_write_credential.py b/ansible_collections/cisco/dnac/plugins/modules/http_write_credential.py new file mode 100644 index 00000000..2db38bb6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/http_write_credential.py @@ -0,0 +1,129 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: http_write_credential +short_description: Resource module for Http Write Credential +description: +- Manage operations create and update of the resource Http Write Credential. +- Adds global HTTP write credentials. +- Updates global HTTP write credentials. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + comments: + description: Http Write Credential's comments. + type: str + credentialType: + description: Http Write Credential's credentialType. + type: str + description: + description: Http Write Credential's description. + type: str + id: + description: Http Write Credential's id. + type: str + instanceTenantId: + description: Http Write Credential's instanceTenantId. + type: str + instanceUuid: + description: Http Write Credential's instanceUuid. + type: str + password: + description: Http Write Credential's password. + type: str + port: + description: Http Write Credential's port. + type: int + secure: + description: Secure flag. + type: bool + username: + description: Http Write Credential's username. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateHTTPWriteCredentials + description: Complete reference of the CreateHTTPWriteCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!create-http-write-credentials +- name: Cisco DNA Center documentation for Discovery UpdateHTTPWriteCredentials + description: Complete reference of the UpdateHTTPWriteCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!update-http-write-credentials +notes: + - SDK Method used are + discovery.Discovery.create_http_write_credentials, + discovery.Discovery.update_http_write_credentials, + + - Paths used are + post /dna/intent/api/v1/global-credential/http-write, + put /dna/intent/api/v1/global-credential/http-write, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.http_write_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + port: 0 + secure: true + username: string + +- name: Create + cisco.dnac.http_write_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + password: string + port: 0 + secure: true + username: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/interface_info.py b/ansible_collections/cisco/dnac/plugins/modules/interface_info.py new file mode 100644 index 00000000..431bf3d4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/interface_info.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: interface_info +short_description: Information module for Interface +description: +- Get all Interface. +- Get list of all properties & operations valid for an interface. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + interfaceUuid: + description: + - InterfaceUuid path parameter. Interface ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices LegitOperationsForInterface + description: Complete reference of the LegitOperationsForInterface API. + link: https://developer.cisco.com/docs/dna-center/#!legit-operations-for-interface +notes: + - SDK Method used are + devices.Devices.legit_operations_for_interface, + + - Paths used are + get /dna/intent/api/v1/interface/{interfaceUuid}/legit-operation, + +""" + +EXAMPLES = r""" +- name: Get all Interface + cisco.dnac.interface_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + interfaceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "interfaceUuid": "string", + "properties": { + "name": "string", + "applicable": true, + "failureReason": {} + }, + "operations": { + "name": "string", + "applicable": true, + "failureReason": {} + } + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_detail_info.py b/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_detail_info.py new file mode 100644 index 00000000..344f22a2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_detail_info.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: interface_network_device_detail_info +short_description: Information module for Interface Network Device Detail +description: +- Get all Interface Network Device Detail. +- Returns interface by specified device Id and interface name. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device ID. + type: str + name: + description: + - Name query parameter. Interface name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetInterfaceDetailsByDeviceIdAndInterfaceName + description: Complete reference of the GetInterfaceDetailsByDeviceIdAndInterfaceName API. + link: https://developer.cisco.com/docs/dna-center/#!get-interface-details-by-device-id-and-interface-name +notes: + - SDK Method used are + devices.Devices.get_interface_details, + + - Paths used are + get /dna/intent/api/v1/interface/network-device/{deviceId}/interface-name, + +""" + +EXAMPLES = r""" +- name: Get all Interface Network Device Detail + cisco.dnac.interface_network_device_detail_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "adminStatus": "string", + "className": "string", + "description": "string", + "deviceId": "string", + "duplex": "string", + "id": "string", + "ifIndex": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceType": "string", + "ipv4Address": "string", + "ipv4Mask": "string", + "isisSupport": "string", + "lastUpdated": "string", + "macAddress": "string", + "mappedPhysicalInterfaceId": "string", + "mappedPhysicalInterfaceName": "string", + "mediaType": "string", + "nativeVlanId": "string", + "ospfSupport": "string", + "pid": "string", + "portMode": "string", + "portName": "string", + "portType": "string", + "serialNo": "string", + "series": "string", + "speed": "string", + "status": "string", + "vlanId": "string", + "voiceVlan": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_info.py new file mode 100644 index 00000000..8fdc0e22 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: interface_network_device_info +short_description: Information module for Interface Network Device +description: +- Get Interface Network Device by id. +- Returns list of interfaces by specified device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetInterfaceInfoById + description: Complete reference of the GetInterfaceInfoById API. + link: https://developer.cisco.com/docs/dna-center/#!get-interface-info-by-id +notes: + - SDK Method used are + devices.Devices.get_interface_info_by_id, + + - Paths used are + get /dna/intent/api/v1/interface/network-device/{deviceId}, + +""" + +EXAMPLES = r""" +- name: Get Interface Network Device by id + cisco.dnac.interface_network_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "adminStatus": "string", + "className": "string", + "description": "string", + "deviceId": "string", + "duplex": "string", + "id": "string", + "ifIndex": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceType": "string", + "ipv4Address": "string", + "ipv4Mask": "string", + "isisSupport": "string", + "lastUpdated": "string", + "macAddress": "string", + "mappedPhysicalInterfaceId": "string", + "mappedPhysicalInterfaceName": "string", + "mediaType": "string", + "nativeVlanId": "string", + "ospfSupport": "string", + "pid": "string", + "portMode": "string", + "portName": "string", + "portType": "string", + "serialNo": "string", + "series": "string", + "speed": "string", + "status": "string", + "vlanId": "string", + "voiceVlan": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_range_info.py b/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_range_info.py new file mode 100644 index 00000000..0a3f1448 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/interface_network_device_range_info.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: interface_network_device_range_info +short_description: Information module for Interface Network Device Range +description: +- Get all Interface Network Device Range. +- Returns the list of interfaces for the device for the specified range. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device ID. + type: str + startIndex: + description: + - StartIndex path parameter. Start index. + type: int + recordsToReturn: + description: + - RecordsToReturn path parameter. Number of records to return. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceInterfacesBySpecifiedRange + description: Complete reference of the GetDeviceInterfacesBySpecifiedRange API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-interfaces-by-specified-range +notes: + - SDK Method used are + devices.Devices.get_device_interfaces_by_specified_range, + + - Paths used are + get /dna/intent/api/v1/interface/network-device/{deviceId}/{startIndex}/{recordsToReturn}, + +""" + +EXAMPLES = r""" +- name: Get all Interface Network Device Range + cisco.dnac.interface_network_device_range_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + startIndex: 0 + recordsToReturn: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "adminStatus": "string", + "className": "string", + "description": "string", + "deviceId": "string", + "duplex": "string", + "id": "string", + "ifIndex": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceType": "string", + "ipv4Address": "string", + "ipv4Mask": "string", + "isisSupport": "string", + "lastUpdated": "string", + "macAddress": "string", + "mappedPhysicalInterfaceId": "string", + "mappedPhysicalInterfaceName": "string", + "mediaType": "string", + "nativeVlanId": "string", + "ospfSupport": "string", + "pid": "string", + "portMode": "string", + "portName": "string", + "portType": "string", + "serialNo": "string", + "series": "string", + "speed": "string", + "status": "string", + "vlanId": "string", + "voiceVlan": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/interface_operation_create.py b/ansible_collections/cisco/dnac/plugins/modules/interface_operation_create.py new file mode 100644 index 00000000..98995c1d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/interface_operation_create.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: interface_operation_create +short_description: Resource module for Interface Operation Create +description: +- Manage operation create of the resource Interface Operation Create. +- > + Clear mac-address on an individual port. In request body, operation needs to be specified as 'ClearMacAddress'. In + the future more possible operations will be added to this API. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deploymentMode: + description: DeploymentMode query parameter. Preview/Deploy 'Preview' means the + configuration is not pushed to the device. 'Deploy' makes the configuration pushed + to the device. + type: str + interfaceUuid: + description: InterfaceUuid path parameter. Interface Id. + type: str + operation: + description: Operation. + type: str + payload: + description: Payload. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices ClearMacAddressTable + description: Complete reference of the ClearMacAddressTable API. + link: https://developer.cisco.com/docs/dna-center/#!clear-mac-address-table +notes: + - SDK Method used are + devices.Devices.clear_mac_address_table, + + - Paths used are + post /dna/intent/api/v1/interface/{interfaceUuid}/operation, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.interface_operation_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deploymentMode: string + interfaceUuid: string + operation: string + payload: {} + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/interface_update.py b/ansible_collections/cisco/dnac/plugins/modules/interface_update.py new file mode 100644 index 00000000..5ac59eca --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/interface_update.py @@ -0,0 +1,99 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: interface_update +short_description: Resource module for Interface Update +description: +- Manage operation update of the resource Interface Update. +- > + Add/Update Interface description, VLAN membership, Voice VLAN and change Interface admin status 'UP'/'DOWN' from + Request body. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + adminStatus: + description: Admin Status. + type: str + deploymentMode: + description: DeploymentMode query parameter. Preview/Deploy 'Preview' means the + configuration is not pushed to the device. 'Deploy' makes the configuration pushed + to the device. + type: str + description: + description: Description. + type: str + interfaceUuid: + description: InterfaceUuid path parameter. Interface ID. + type: str + vlanId: + description: Vlan Id. + type: int + voiceVlanId: + description: Voice Vlan Id. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices UpdateInterfaceDetails + description: Complete reference of the UpdateInterfaceDetails API. + link: https://developer.cisco.com/docs/dna-center/#!update-interface-details +notes: + - SDK Method used are + devices.Devices.update_interface_details, + + - Paths used are + put /dna/intent/api/v1/interface/{interfaceUuid}, + +""" + +EXAMPLES = r""" +- name: Update by id + cisco.dnac.interface_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + adminStatus: string + deploymentMode: string + description: string + interfaceUuid: string + vlanId: 0 + voiceVlanId: 0 + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "type": "string", + "properties": { + "taskId": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "string" + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/issues_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/issues_enrichment_details_info.py new file mode 100644 index 00000000..e81d3f2d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/issues_enrichment_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: issues_enrichment_details_info +short_description: Information module for Issues Enrichment Details +description: +- Get all Issues Enrichment Details. +- > + Enriches a given network issue context an issue id or end user's Mac Address with details about the issues, + impacted hosts and suggested actions for remediation. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Issues GetIssueEnrichmentDetails + description: Complete reference of the GetIssueEnrichmentDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-issue-enrichment-details +notes: + - SDK Method used are + issues.Issues.get_issue_enrichment_details, + + - Paths used are + get /dna/intent/api/v1/issue-enrichment-details, + +""" + +EXAMPLES = r""" +- name: Get all Issues Enrichment Details + cisco.dnac.issues_enrichment_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "issue": [ + { + "issueId": "string", + "issueSource": "string", + "issueCategory": "string", + "issueName": "string", + "issueDescription": "string", + "issueEntity": "string", + "issueEntityValue": "string", + "issueSeverity": "string", + "issuePriority": "string", + "issueSummary": "string", + "issueTimestamp": 0, + "suggestedActions": [ + { + "message": "string", + "steps": [ + {} + ] + } + ], + "impactedHosts": [ + {} + ] + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/issues_info.py b/ansible_collections/cisco/dnac/plugins/modules/issues_info.py new file mode 100644 index 00000000..b94e0f1c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/issues_info.py @@ -0,0 +1,125 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: issues_info +short_description: Information module for Issues +description: +- Get all Issues. +- > + Intent API to get a list of global issues, issues for a specific device, or issue for a specific client device's + MAC address. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + startTime: + description: + - StartTime query parameter. Starting epoch time in milliseconds of query time window. + type: int + endTime: + description: + - EndTime query parameter. Ending epoch time in milliseconds of query time window. + type: int + siteId: + description: + - SiteId query parameter. Assurance UUID value of the site in the issue content. + type: str + deviceId: + description: + - DeviceId query parameter. Assurance UUID value of the device in the issue content. + type: str + macAddress: + description: + - MacAddress query parameter. Client's device MAC address of the issue (format xx xx xx xx xx xx). + type: str + priority: + description: + - > + Priority query parameter. The issue's priority value (One of P1, P2, P3, or P4)(Use only when macAddress and + deviceId are not provided). + type: str + aiDriven: + description: + - > + AiDriven query parameter. The issue's AI driven value (Yes or No)(Use only when macAddress and deviceId are + not provided). + type: str + issueStatus: + description: + - IssueStatus query parameter. The issue's status value (One of ACTIVE, IGNORED, RESOLVED). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Issues Issues + description: Complete reference of the Issues API. + link: https://developer.cisco.com/docs/dna-center/#!issues-issues +notes: + - SDK Method used are + issues.Issues.issues, + + - Paths used are + get /dna/intent/api/v1/issues, + +""" + +EXAMPLES = r""" +- name: Get all Issues + cisco.dnac.issues_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + startTime: 0 + endTime: 0 + siteId: string + deviceId: string + macAddress: string + priority: string + aiDriven: string + issueStatus: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "totalCount": 0, + "response": [ + { + "issueId": "string", + "name": "string", + "siteId": "string", + "deviceId": "string", + "deviceRole": "string", + "aiDriven": true, + "clientMac": "string", + "issue_occurence_count": 0, + "status": "string", + "priority": "string", + "category": "string", + "last_occurence_time": 0 + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/itsm_cmdb_sync_status_info.py b/ansible_collections/cisco/dnac/plugins/modules/itsm_cmdb_sync_status_info.py new file mode 100644 index 00000000..ba572112 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/itsm_cmdb_sync_status_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: itsm_cmdb_sync_status_info +short_description: Information module for Itsm Cmdb Sync Status +description: +- Get all Itsm Cmdb Sync Status. +- > + This API allows to retrieve the detail of CMDB sync status.It accepts two query parameter "status","date".The + supported values for status field are "Success","Failed","Unknown" and date field should be in "YYYY-MM-DD" + format. By default all the cmdb sync status will be send as response and based on the query parameter filtered + detail will be send as response. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + status: + description: + - > + Status query parameter. Supported values are "Success","Failed" and "Unknown". Providing other values will + result in all the available sync job status. + type: str + date: + description: + - Date query parameter. Provide date in "YYYY-MM-DD" format. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for ITSM GetCMDBSyncStatus + description: Complete reference of the GetCMDBSyncStatus API. + link: https://developer.cisco.com/docs/dna-center/#!get-cmdb-sync-status +notes: + - SDK Method used are + itsm.Itsm.get_cmdb_sync_status, + + - Paths used are + get /dna/intent/api/v1/cmdb-sync/detail, + +""" + +EXAMPLES = r""" +- name: Get all Itsm Cmdb Sync Status + cisco.dnac.itsm_cmdb_sync_status_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + status: string + date: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "successCount": "string", + "failureCount": "string", + "devices": [ + { + "deviceId": "string", + "status": "string" + } + ], + "unknownErrorCount": "string", + "message": "string", + "syncTime": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_failed_info.py b/ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_failed_info.py new file mode 100644 index 00000000..b02e8dc1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_failed_info.py @@ -0,0 +1,86 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: itsm_integration_events_failed_info +short_description: Information module for Itsm Integration Events Failed +description: +- Get all Itsm Integration Events Failed. +- Used to retrieve the list of integration events that failed to create tickets in ITSM. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + instanceId: + description: + - InstanceId query parameter. Instance Id of the failed event as in the Runtime Dashboard. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for ITSM GetFailedITSMEvents + description: Complete reference of the GetFailedITSMEvents API. + link: https://developer.cisco.com/docs/dna-center/#!get-failed-itsm-events +notes: + - SDK Method used are + itsm.Itsm.get_failed_itsm_events, + + - Paths used are + get /dna/intent/api/v1/integration/events, + +""" + +EXAMPLES = r""" +- name: Get all Itsm Integration Events Failed + cisco.dnac.itsm_integration_events_failed_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + instanceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "instanceId": "string", + "eventId": "string", + "name": "string", + "type": "string", + "category": "string", + "domain": "string", + "subDomain": "string", + "severity": "string", + "source": "string", + "timestamp": 0, + "enrichmentInfo": { + "eventStatus": "string", + "errorCode": "string", + "errorDescription": "string", + "responseReceivedFromITSMSystem": {} + }, + "description": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_retry.py b/ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_retry.py new file mode 100644 index 00000000..201f6891 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/itsm_integration_events_retry.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: itsm_integration_events_retry +short_description: Resource module for Itsm Integration Events Retry +description: +- Manage operation create of the resource Itsm Integration Events Retry. +- > + Allows retry of multiple failed ITSM event instances. The retry request payload can be given as a list of strings + "instance1","instance2","instance3",.. A minimum of one instance Id is mandatory. The list of failed event + instance Ids can be retrieved using the 'Get Failed ITSM Events' API in the 'instanceId' attribute. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Itsm Integration Events Retry's payload. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for ITSM RetryIntegrationEvents + description: Complete reference of the RetryIntegrationEvents API. + link: https://developer.cisco.com/docs/dna-center/#!retry-integration-events +notes: + - SDK Method used are + itsm.Itsm.retry_integration_events, + + - Paths used are + post /dna/intent/api/v1/integration/events, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.itsm_integration_events_retry: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/lan_automation_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_count_info.py new file mode 100644 index 00000000..d172a752 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_count_info.py @@ -0,0 +1,62 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: lan_automation_count_info +short_description: Information module for Lan Automation Count +description: +- Get all Lan Automation Count. +- Invoke this API to get the total count of LAN Automation sessions. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for LAN Automation LANAutomationSessionCount + description: Complete reference of the LANAutomationSessionCount API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-session-count +notes: + - SDK Method used are + lan_automation.LanAutomation.lan_automation_session_count, + + - Paths used are + get /dna/intent/api/v1/lan-automation/count, + +""" + +EXAMPLES = r""" +- name: Get all Lan Automation Count + cisco.dnac.lan_automation_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "sessionCount": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/lan_automation_create.py b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_create.py new file mode 100644 index 00000000..d669dd73 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_create.py @@ -0,0 +1,122 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: lan_automation_create +short_description: Resource module for Lan Automation Create +description: +- Manage operation create of the resource Lan Automation Create. +- Invoke this API to start LAN Automation for the given site. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Lan Automation Create's payload. + elements: dict + suboptions: + discoveredDeviceSiteNameHierarchy: + description: Discovered device site name. + type: str + hostNameFileId: + description: Use /dna/intent/api/v1/file/namespace/nw_orch api to get the file + id for the already uploaded file in nw_orch namespace. + type: str + hostNamePrefix: + description: Host name prefix which shall be assigned to the discovered device. + type: str + ipPools: + description: Lan Automation Create's ipPools. + elements: dict + suboptions: + ipPoolName: + description: Name of the IP pool. + type: str + ipPoolRole: + description: Role of the IP pool. Supported roles are MAIN_POOL and PHYSICAL_LINK_POOL. + type: str + type: list + isisDomainPwd: + description: IS-IS domain password in plain text. + type: str + mulitcastEnabled: + description: To enable underlay native multicast. + type: bool + peerDeviceManagmentIPAddress: + description: Peer seed management IP address. + type: str + primaryDeviceInterfaceNames: + description: The list of interfaces on primary seed via which the discovered + devices are connected. + elements: str + type: list + primaryDeviceManagmentIPAddress: + description: Primary seed management IP address. + type: str + redistributeIsisToBgp: + description: Advertise LAN Automation summary route into BGP. + type: bool + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for LAN Automation LANAutomation2 + description: Complete reference of the LANAutomation2 API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-2 +notes: + - SDK Method used are + lan_automation.LanAutomation.lan_automation2, + + - Paths used are + post /dna/intent/api/v1/lan-automation, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.lan_automation_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - discoveredDeviceSiteNameHierarchy: string + hostNameFileId: string + hostNamePrefix: string + ipPools: + - ipPoolName: string + ipPoolRole: string + isisDomainPwd: string + mulitcastEnabled: true + peerDeviceManagmentIPAddress: string + primaryDeviceInterfaceNames: + - string + primaryDeviceManagmentIPAddress: string + redistributeIsisToBgp: true + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "errorCode": "string", + "message": "string", + "detail": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/lan_automation_delete.py b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_delete.py new file mode 100644 index 00000000..4439efb2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_delete.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: lan_automation_delete +short_description: Resource module for Lan Automation Delete +description: +- Manage operation delete of the resource Lan Automation Delete. +- Invoke this API to stop LAN Automation for the given site. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. LAN Automation id can be obtained from /dna/intent/api/v1/lan-automation/status. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for LAN Automation LANAutomation + description: Complete reference of the LANAutomation API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation +notes: + - SDK Method used are + lan_automation.LanAutomation.lan_automation, + + - Paths used are + delete /dna/intent/api/v1/lan-automation/{id}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.lan_automation_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "errorCode": "string", + "message": "string", + "detail": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/lan_automation_log_info.py b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_log_info.py new file mode 100644 index 00000000..c0eeb71d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_log_info.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: lan_automation_log_info +short_description: Information module for Lan Automation Log +description: +- Get all Lan Automation Log. +- Get Lan Automation Log by id. +- Invoke this API to get the LAN Automation session logs based on the given LAN Automation session id. +- Invoke this API to get the LAN Automation session logs. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + offset: + description: + - Offset query parameter. Starting index of the LAN Automation session. Minimum value is 1. + type: str + limit: + description: + - Limit query parameter. Number of LAN Automation sessions to be retrieved. Limit value can range between 1 to 10. + type: str + id: + description: + - Id path parameter. LAN Automation session identifier. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for LAN Automation LANAutomationLog + description: Complete reference of the LANAutomationLog API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-log +- name: Cisco DNA Center documentation for LAN Automation LANAutomationLogById + description: Complete reference of the LANAutomationLogById API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-log-by-id +notes: + - SDK Method used are + lan_automation.LanAutomation.lan_automation_log, + lan_automation.LanAutomation.lan_automation_log_by_id, + + - Paths used are + get /dna/intent/api/v1/lan-automation/log, + get /dna/intent/api/v1/lan-automation/log/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Lan Automation Log + cisco.dnac.lan_automation_log_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: string + limit: string + register: result + +- name: Get Lan Automation Log by id + cisco.dnac.lan_automation_log_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "nwOrchId": "string", + "entry": [ + { + "logLevel": "string", + "timeStamp": "string", + "record": "string", + "deviceId": "string" + } + ] + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/lan_automation_status_info.py b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_status_info.py new file mode 100644 index 00000000..a96d3285 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/lan_automation_status_info.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: lan_automation_status_info +short_description: Information module for Lan Automation Status +description: +- Get all Lan Automation Status. +- Get Lan Automation Status by id. +- Invoke this API to get the LAN Automation session status based on the given Lan Automation session id. +- Invoke this API to get the LAN Automation session status. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + offset: + description: + - Offset query parameter. Starting index of the LAN Automation session. Minimum value is 1. + type: str + limit: + description: + - Limit query parameter. Number of LAN Automation sessions to be retrieved. Limit value can range between 1 to 10. + type: str + id: + description: + - Id path parameter. LAN Automation session identifier. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for LAN Automation LANAutomationStatus + description: Complete reference of the LANAutomationStatus API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-status +- name: Cisco DNA Center documentation for LAN Automation LANAutomationStatusById + description: Complete reference of the LANAutomationStatusById API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-status-by-id +notes: + - SDK Method used are + lan_automation.LanAutomation.lan_automation_status, + lan_automation.LanAutomation.lan_automation_status_by_id, + + - Paths used are + get /dna/intent/api/v1/lan-automation/status, + get /dna/intent/api/v1/lan-automation/status/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Lan Automation Status + cisco.dnac.lan_automation_status_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: string + limit: string + register: result + +- name: Get Lan Automation Status by id + cisco.dnac.lan_automation_status_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "discoveredDeviceSiteNameHierarchy": "string", + "primaryDeviceManagmentIPAddress": "string", + "ipPoolList": [ + { + "ipPoolName": "string", + "ipPoolRole": "string" + } + ], + "primaryDeviceInterfaceNames": [ + "string" + ], + "status": "string", + "action": "string", + "creationTime": "string", + "multicastEnabled": true, + "peerDeviceManagmentIPAddress": "string", + "discoveredDeviceList": [ + { + "name": "string", + "serialNumber": "string", + "state": "string", + "ipAddressInUseList": [ + "string" + ] + } + ], + "redistributeIsisToBgp": true + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_device_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/license_device_count_info.py new file mode 100644 index 00000000..3abbf785 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_device_count_info.py @@ -0,0 +1,88 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_device_count_info +short_description: Information module for License Device Count +description: +- Get all License Device Count. +- Get total number of managed devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + device_type: + description: + - Device_type query parameter. Type of device. + type: str + registration_status: + description: + - Registration_status query parameter. Smart license registration status of device. + type: str + dna_level: + description: + - Dna_level query parameter. Device Cisco DNA license level. + type: str + virtual_account_name: + description: + - Virtual_account_name query parameter. Name of virtual account. + type: str + smart_account_id: + description: + - Smart_account_id query parameter. Id of smart account. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses DeviceCountDetails + description: Complete reference of the DeviceCountDetails API. + link: https://developer.cisco.com/docs/dna-center/#!device-count-details +notes: + - SDK Method used are + licenses.Licenses.device_count_details, + + - Paths used are + get /dna/intent/api/v1/licenses/device/count, + +""" + +EXAMPLES = r""" +- name: Get all License Device Count + cisco.dnac.license_device_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + device_type: string + registration_status: string + dna_level: string + virtual_account_name: string + smart_account_id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_device_deregistration.py b/ansible_collections/cisco/dnac/plugins/modules/license_device_deregistration.py new file mode 100644 index 00000000..b126dec7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_device_deregistration.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_device_deregistration +short_description: Resource module for License Device Deregistration +description: +- Manage operation update of the resource License Device Deregistration. +- Deregister devices from CSSM Cisco Smart Software Manager . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + device_uuids: + description: Comma separated device ids. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses DeviceDeregistration + description: Complete reference of the DeviceDeregistration API. + link: https://developer.cisco.com/docs/dna-center/#!device-deregistration +notes: + - SDK Method used are + licenses.Licenses.device_deregistration, + + - Paths used are + put /dna/intent/api/v1/licenses/smartAccount/virtualAccount/deregister, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.license_device_deregistration: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + device_uuids: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_device_license_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/license_device_license_details_info.py new file mode 100644 index 00000000..0d9000f4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_device_license_details_info.py @@ -0,0 +1,123 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_device_license_details_info +short_description: Information module for License Device License Details +description: +- Get all License Device License Details. +- Get detailed license information of a device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + device_uuid: + description: + - Device_uuid path parameter. Id of device. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses DeviceLicenseDetails + description: Complete reference of the DeviceLicenseDetails API. + link: https://developer.cisco.com/docs/dna-center/#!device-license-details +notes: + - SDK Method used are + licenses.Licenses.device_license_details, + + - Paths used are + get /dna/intent/api/v1/licenses/device/{device_uuid}/details, + +""" + +EXAMPLES = r""" +- name: Get all License Device License Details + cisco.dnac.license_device_license_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + device_uuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "device_uuid": "string", + "site": "string", + "model": "string", + "license_mode": "string", + "is_license_expired": true, + "software_version": "string", + "network_license": "string", + "evaluation_license_expiry": "string", + "device_name": "string", + "device_type": "string", + "dna_level": "string", + "virtual_account_name": "string", + "ip_address": "string", + "mac_address": "string", + "sntc_status": "string", + "feature_license": [ + "string" + ], + "has_sup_cards": true, + "udi": "string", + "stacked_devices": [ + { + "mac_address": "string", + "id": "string", + "role": "string", + "serial_number": "string" + } + ], + "is_stacked_device": true, + "access_points": [ + { + "ap_type": "string", + "count": "string" + } + ], + "chassis_details": { + "board_serial_number": "string", + "modules": [ + { + "module_type": "string", + "module_name": "string", + "serial_number": "string", + "id": "string" + } + ], + "supervisor_cards": [ + { + "serial_number": "string", + "supervisor_card_type": "string", + "status": "string" + } + ], + "port": 0 + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_device_license_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/license_device_license_summary_info.py new file mode 100644 index 00000000..c2e48882 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_device_license_summary_info.py @@ -0,0 +1,149 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_device_license_summary_info +short_description: Information module for License Device License Summary +description: +- Get all License Device License Summary. +- Show license summary of devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + page_number: + description: + - Page_number query parameter. Page number of response. + type: int + order: + description: + - Order query parameter. Sorting order. + type: str + sort_by: + description: + - Sort_by query parameter. Sort result by field. + type: str + dna_level: + description: + - Dna_level query parameter. Device Cisco DNA license level. + type: str + device_type: + description: + - Device_type query parameter. Type of device. + type: str + limit: + description: + - Limit query parameter. + type: int + registration_status: + description: + - Registration_status query parameter. Smart license registration status of device. + type: str + virtual_account_name: + description: + - Virtual_account_name query parameter. Name of virtual account. + type: str + smart_account_id: + description: + - Smart_account_id query parameter. Id of smart account. + type: int + device_uuid: + description: + - Device_uuid query parameter. Id of device. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses DeviceLicenseSummary + description: Complete reference of the DeviceLicenseSummary API. + link: https://developer.cisco.com/docs/dna-center/#!device-license-summary +notes: + - SDK Method used are + licenses.Licenses.device_license_summary, + + - Paths used are + get /dna/intent/api/v1/licenses/device/summary, + +""" + +EXAMPLES = r""" +- name: Get all License Device License Summary + cisco.dnac.license_device_license_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + page_number: 0 + order: string + sort_by: string + dna_level: string + device_type: string + limit: 0 + registration_status: string + virtual_account_name: string + smart_account_id: 0 + device_uuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "authorization_status": "string", + "last_updated_time": "string", + "is_performance_allowed": true, + "sle_auth_code": "string", + "throughput_level": "string", + "hsec_status": "string", + "device_uuid": "string", + "site": "string", + "total_access_point_count": 0, + "model": "string", + "is_wireless_capable": true, + "registration_status": "string", + "sle_state": "string", + "performance_license": "string", + "license_mode": "string", + "is_license_expired": true, + "software_version": "string", + "reservation_status": "string", + "is_wireless": true, + "network_license": "string", + "evaluation_license_expiry": "string", + "wireless_capable_network_license": "string", + "device_name": "string", + "device_type": "string", + "dna_level": "string", + "virtual_account_name": "string", + "last_successful_rum_usage_upload_time": "string", + "ip_address": "string", + "wireless_capable_dna_license": "string", + "mac_address": "string", + "customer_tag1": "string", + "customer_tag2": "string", + "customer_tag3": "string", + "customer_tag4": "string", + "smart_account_name": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_device_registration.py b/ansible_collections/cisco/dnac/plugins/modules/license_device_registration.py new file mode 100644 index 00000000..de9ed6c3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_device_registration.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_device_registration +short_description: Resource module for License Device Registration +description: +- Manage operation update of the resource License Device Registration. +- Register devices in CSSM Cisco Smart Software Manager . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + device_uuids: + description: Comma separated device ids. + elements: str + type: list + virtual_account_name: + description: Virtual_account_name path parameter. Name of virtual account. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses DeviceRegistration + description: Complete reference of the DeviceRegistration API. + link: https://developer.cisco.com/docs/dna-center/#!device-registration +notes: + - SDK Method used are + licenses.Licenses.device_registration, + + - Paths used are + put /dna/intent/api/v1/licenses/smartAccount/virtualAccount/{virtual_account_name}/register, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.license_device_registration: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + device_uuids: + - string + virtual_account_name: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_smart_account_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/license_smart_account_details_info.py new file mode 100644 index 00000000..b70fa56c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_smart_account_details_info.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_smart_account_details_info +short_description: Information module for License Smart Account Details +description: +- Get all License Smart Account Details. +- Get detail of all smart accounts. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses SmartAccountDetails + description: Complete reference of the SmartAccountDetails API. + link: https://developer.cisco.com/docs/dna-center/#!smart-account-details +notes: + - SDK Method used are + licenses.Licenses.smart_account_details, + + - Paths used are + get /dna/intent/api/v1/licenses/smartAccounts, + +""" + +EXAMPLES = r""" +- name: Get all License Smart Account Details + cisco.dnac.license_smart_account_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "name": "string", + "id": "string", + "domain": "string", + "is_active_smart_account": true + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_term_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/license_term_details_info.py new file mode 100644 index 00000000..055dcec7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_term_details_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_term_details_info +short_description: Information module for License Term Details +description: +- Get License Term Details by name. +- Get license term details. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + smart_account_id: + description: + - Smart_account_id path parameter. Id of smart account. + type: str + virtual_account_name: + description: + - > + Virtual_account_name path parameter. Name of virtual account. Putting "All" will give license term detail + for all virtual accounts. + type: str + device_type: + description: + - Device_type query parameter. Type of device like router, switch, wireless or ise. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses LicenseTermDetails + description: Complete reference of the LicenseTermDetails API. + link: https://developer.cisco.com/docs/dna-center/#!license-term-details +notes: + - SDK Method used are + licenses.Licenses.license_term_details, + + - Paths used are + get /dna/intent/api/v1/licenses/term/smartAccount/{smart_account_id}/virtualAccount/{virtual_account_name}, + +""" + +EXAMPLES = r""" +- name: Get License Term Details by name + cisco.dnac.license_term_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + device_type: string + smart_account_id: string + virtual_account_name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "license_details": [ + { + "model": "string", + "virtual_account_name": "string", + "license_term_start_date": "string", + "license_term_end_date": "string", + "dna_level": "string", + "purchased_dna_license_count": "string", + "is_license_expired": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_usage_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/license_usage_details_info.py new file mode 100644 index 00000000..e1307e70 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_usage_details_info.py @@ -0,0 +1,114 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_usage_details_info +short_description: Information module for License Usage Details +description: +- Get License Usage Details by name. +- Get count of purchased and in use Cisco DNA and Network licenses. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + smart_account_id: + description: + - Smart_account_id path parameter. Id of smart account. + type: str + virtual_account_name: + description: + - > + Virtual_account_name path parameter. Name of virtual account. Putting "All" will give license usage detail + for all virtual accounts. + type: str + device_type: + description: + - Device_type query parameter. Type of device like router, switch, wireless or ise. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses LicenseUsageDetails + description: Complete reference of the LicenseUsageDetails API. + link: https://developer.cisco.com/docs/dna-center/#!license-usage-details +notes: + - SDK Method used are + licenses.Licenses.license_usage_details, + + - Paths used are + get /dna/intent/api/v1/licenses/usage/smartAccount/{smart_account_id}/virtualAccount/{virtual_account_name}, + +""" + +EXAMPLES = r""" +- name: Get License Usage Details by name + cisco.dnac.license_usage_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + device_type: string + smart_account_id: string + virtual_account_name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "purchased_dna_license": { + "total_license_count": 0, + "license_count_by_type": [ + { + "license_type": "string", + "license_count": 0 + } + ] + }, + "purchased_network_license": { + "total_license_count": 0, + "license_count_by_type": [ + { + "license_type": "string", + "license_count": 0 + } + ] + }, + "used_dna_license": { + "total_license_count": 0, + "license_count_by_type": [ + { + "license_type": "string", + "license_count": 0 + } + ] + }, + "used_network_license": { + "total_license_count": 0, + "license_count_by_type": [ + { + "license_type": "string", + "license_count": 0 + } + ] + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_change.py b/ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_change.py new file mode 100644 index 00000000..007970fd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_change.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_virtual_account_change +short_description: Resource module for License Virtual Account Change +description: +- Manage operation create of the resource License Virtual Account Change. +- Transfer devices from one virtual account to another within same smart account. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + device_uuids: + description: Comma separated device ids. + elements: str + type: list + smart_account_id: + description: Smart_account_id path parameter. Id of smart account. + type: str + virtual_account_name: + description: Virtual_account_name path parameter. Name of target virtual account. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses ChangeVirtualAccount + description: Complete reference of the ChangeVirtualAccount API. + link: https://developer.cisco.com/docs/dna-center/#!change-virtual-account +notes: + - SDK Method used are + licenses.Licenses.change_virtual_account, + + - Paths used are + post /dna/intent/api/v1/licenses/smartAccount/{smart_account_id}/virtualAccount/{virtual_account_name}/device/transfer, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.license_virtual_account_change: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + device_uuids: + - string + smart_account_id: string + virtual_account_name: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_details_info.py new file mode 100644 index 00000000..4d4bc171 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/license_virtual_account_details_info.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: license_virtual_account_details_info +short_description: Information module for License Virtual Account Details +description: +- Get all License Virtual Account Details. +- Get virtual account details of a smart account. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + smart_account_id: + description: + - Smart_account_id path parameter. Id of smart account. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Licenses VirtualAccountDetails + description: Complete reference of the VirtualAccountDetails API. + link: https://developer.cisco.com/docs/dna-center/#!virtual-account-details +notes: + - SDK Method used are + licenses.Licenses.virtual_account_details, + + - Paths used are + get /dna/intent/api/v1/licenses/smartAccount/{smart_account_id}/virtualAccounts, + +""" + +EXAMPLES = r""" +- name: Get all License Virtual Account Details + cisco.dnac.license_virtual_account_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + smart_account_id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "smart_account_id": "string", + "smart_account_name": "string", + "virtual_account_details": [ + { + "virtual_account_id": "string", + "virtual_account_name": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/netconf_credential.py b/ansible_collections/cisco/dnac/plugins/modules/netconf_credential.py new file mode 100644 index 00000000..a8cec094 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/netconf_credential.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: netconf_credential +short_description: Resource module for Netconf Credential +description: +- Manage operations create and update of the resource Netconf Credential. +- Adds global netconf credentials. +- Updates global netconf credentials. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + comments: + description: Netconf Credential's comments. + type: str + credentialType: + description: Netconf Credential's credentialType. + type: str + description: + description: Netconf Credential's description. + type: str + id: + description: Netconf Credential's id. + type: str + instanceTenantId: + description: Netconf Credential's instanceTenantId. + type: str + instanceUuid: + description: Netconf Credential's instanceUuid. + type: str + netconfPort: + description: Netconf Credential's netconfPort. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateNetconfCredentials + description: Complete reference of the CreateNetconfCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!create-netconf-credentials +- name: Cisco DNA Center documentation for Discovery UpdateNetconfCredentials + description: Complete reference of the UpdateNetconfCredentials API. + link: https://developer.cisco.com/docs/dna-center/#!update-netconf-credentials +notes: + - SDK Method used are + discovery.Discovery.create_netconf_credentials, + discovery.Discovery.update_netconf_credentials, + + - Paths used are + post /dna/intent/api/v1/global-credential/netconf, + put /dna/intent/api/v1/global-credential/netconf, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.netconf_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + netconfPort: string + +- name: Create + cisco.dnac.netconf_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + netconfPort: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_create.py b/ansible_collections/cisco/dnac/plugins/modules/network_create.py new file mode 100644 index 00000000..98e38c40 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_create.py @@ -0,0 +1,214 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_create +short_description: Resource module for Network Create +description: +- Manage operation create of the resource Network Create. +- > + API to create a network for DHCP, Syslog, SNMP, NTP, Network AAA, Client and Endpint AAA, and/or DNS center server + settings. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + settings: + description: Network Create's settings. + suboptions: + clientAndEndpoint_aaa: + description: Network Create's clientAndEndpoint_aaa. + suboptions: + ipAddress: + description: IP address for ISE serve (eg 1.1.1.4). + type: str + network: + description: IP address for AAA or ISE server (eg 2.2.2.1). + type: str + protocol: + description: Protocol for AAA or ISE serve (eg RADIUS). + type: str + servers: + description: Server type AAA or ISE server (eg AAA). + type: str + sharedSecret: + description: Shared secret for ISE server. + type: str + type: dict + dhcpServer: + description: Dhcp serve Ip (eg 1.1.1.1). + elements: str + type: list + dnsServer: + description: Network Create's dnsServer. + suboptions: + domainName: + description: Domain name of DHCP (eg; cisco). + type: str + primaryIpAddress: + description: Primary ip address for DHCP (eg 2.2.2.2). + type: str + secondaryIpAddress: + description: Secondary ip address for DHCP (eg 3.3.3.3). + type: str + type: dict + messageOfTheday: + description: Network Create's messageOfTheday. + suboptions: + bannerMessage: + description: Massage for banner message (eg; Good day). + type: str + retainExistingBanner: + description: Retain existing banner message (eg "true" or "false"). + type: str + type: dict + netflowcollector: + description: Network Create's netflowcollector. + suboptions: + ipAddress: + description: IP address for netflow collector (eg 3.3.3.1). + type: str + port: + description: Port for netflow collector (eg; 443). + type: int + type: dict + network_aaa: + description: Network Create's network_aaa. + suboptions: + ipAddress: + description: IP address for AAA and ISE server (eg 1.1.1.1). + type: str + network: + description: IP address for AAA or ISE server (eg 2.2.2.2). + type: str + protocol: + description: Protocol for AAA or ISE serve (eg RADIUS). + type: str + servers: + description: Server type for AAA network (eg AAA). + type: str + sharedSecret: + description: Shared secret for ISE server. + type: str + type: dict + ntpServer: + description: IP address for NTP server (eg 1.1.1.2). + elements: str + type: list + snmpServer: + description: Network Create's snmpServer. + suboptions: + configureDnacIP: + description: Configuration dnac ip for snmp server (eg true). + type: bool + ipAddresses: + description: IP address for snmp server (eg 4.4.4.1). + elements: str + type: list + type: dict + syslogServer: + description: Network Create's syslogServer. + suboptions: + configureDnacIP: + description: Configuration dnac ip for syslog server (eg true). + type: bool + ipAddresses: + description: IP address for syslog server (eg 4.4.4.4). + elements: str + type: list + type: dict + timezone: + description: Input for time zone (eg Africa/Abidjan). + type: str + type: dict + siteId: + description: SiteId path parameter. Site id to which site details to associate with + the network settings. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings CreateNetwork + description: Complete reference of the CreateNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!create-network +notes: + - SDK Method used are + network_settings.NetworkSettings.create_network, + + - Paths used are + post /dna/intent/api/v1/network/{siteId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.network_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + settings: + clientAndEndpoint_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + dhcpServer: + - string + dnsServer: + domainName: string + primaryIpAddress: string + secondaryIpAddress: string + messageOfTheday: + bannerMessage: string + retainExistingBanner: string + netflowcollector: + ipAddress: string + port: 0 + network_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + ntpServer: + - string + snmpServer: + configureDnacIP: true + ipAddresses: + - string + syslogServer: + configureDnacIP: true + ipAddresses: + - string + timezone: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device.py b/ansible_collections/cisco/dnac/plugins/modules/network_device.py new file mode 100644 index 00000000..e103dbbf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device.py @@ -0,0 +1,259 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device +short_description: Resource module for Network Device +description: +- Manage operations create, update and delete of the resource Network Device. +- Adds the device with given credential. +- Deletes the network device for the given Id. +- Sync the devices provided as input. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + cleanConfig: + description: CleanConfig query parameter. + type: bool + version_added: 4.0.0 + cliTransport: + description: Network Device's cliTransport. + type: str + computeDevice: + description: ComputeDevice flag. + type: bool + enablePassword: + description: Network Device's enablePassword. + type: str + extendedDiscoveryInfo: + description: Network Device's extendedDiscoveryInfo. + type: str + httpPassword: + description: Network Device's httpPassword. + type: str + httpPort: + description: Network Device's httpPort. + type: str + httpSecure: + description: HttpSecure flag. + type: bool + httpUserName: + description: Network Device's httpUserName. + type: str + id: + description: Id path parameter. Device ID. + type: str + ipAddress: + description: Network Device's ipAddress. + elements: str + type: list + merakiOrgId: + description: Network Device's merakiOrgId. + elements: str + type: list + netconfPort: + description: Network Device's netconfPort. + type: str + password: + description: Network Device's password. + type: str + serialNumber: + description: Network Device's serialNumber. + type: str + snmpAuthPassphrase: + description: Network Device's snmpAuthPassphrase. + type: str + snmpAuthProtocol: + description: Network Device's snmpAuthProtocol. + type: str + snmpMode: + description: Network Device's snmpMode. + type: str + snmpPrivPassphrase: + description: Network Device's snmpPrivPassphrase. + type: str + snmpPrivProtocol: + description: Network Device's snmpPrivProtocol. + type: str + snmpROCommunity: + description: Network Device's snmpROCommunity. + type: str + snmpRWCommunity: + description: Network Device's snmpRWCommunity. + type: str + snmpRetry: + description: Network Device's snmpRetry. + type: int + snmpTimeout: + description: Network Device's snmpTimeout. + type: int + snmpUserName: + description: Network Device's snmpUserName. + type: str + snmpVersion: + description: Network Device's snmpVersion. + type: str + type: + description: Network Device's type. + type: str + updateMgmtIPaddressList: + description: Network Device's updateMgmtIPaddressList. + elements: dict + suboptions: + existMgmtIpAddress: + description: Network Device's existMgmtIpAddress. + type: str + newMgmtIpAddress: + description: Network Device's newMgmtIpAddress. + type: str + type: list + userName: + description: Network Device's userName. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices AddDevice2 + description: Complete reference of the AddDevice2 API. + link: https://developer.cisco.com/docs/dna-center/#!add-device +- name: Cisco DNA Center documentation for Devices DeleteDeviceById + description: Complete reference of the DeleteDeviceById API. + link: https://developer.cisco.com/docs/dna-center/#!delete-device-by-id +- name: Cisco DNA Center documentation for Devices SyncDevices2 + description: Complete reference of the SyncDevices2 API. + link: https://developer.cisco.com/docs/dna-center/#!sync-devices +notes: + - SDK Method used are + devices.Devices.add_device, + devices.Devices.delete_device_by_id, + devices.Devices.sync_devices, + + - Paths used are + post /dna/intent/api/v1/network-device, + delete /dna/intent/api/v1/network-device/{id}, + put /dna/intent/api/v1/network-device, + + - Removed 'managementIpAddress' options in v4.3.0. +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.network_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + cliTransport: string + computeDevice: true + enablePassword: string + extendedDiscoveryInfo: string + httpPassword: string + httpPort: string + httpSecure: true + httpUserName: string + ipAddress: + - string + merakiOrgId: + - string + netconfPort: string + password: string + serialNumber: string + snmpAuthPassphrase: string + snmpAuthProtocol: string + snmpMode: string + snmpPrivPassphrase: string + snmpPrivProtocol: string + snmpROCommunity: string + snmpRWCommunity: string + snmpRetry: 0 + snmpTimeout: 0 + snmpUserName: string + snmpVersion: string + type: string + updateMgmtIPaddressList: + - existMgmtIpAddress: string + newMgmtIpAddress: string + userName: string + +- name: Update all + cisco.dnac.network_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + cliTransport: string + computeDevice: true + enablePassword: string + extendedDiscoveryInfo: string + httpPassword: string + httpPort: string + httpSecure: true + httpUserName: string + ipAddress: + - string + merakiOrgId: + - string + netconfPort: string + password: string + serialNumber: string + snmpAuthPassphrase: string + snmpAuthProtocol: string + snmpMode: string + snmpPrivPassphrase: string + snmpPrivProtocol: string + snmpROCommunity: string + snmpRWCommunity: string + snmpRetry: 0 + snmpTimeout: 0 + snmpUserName: string + snmpVersion: string + type: string + updateMgmtIPaddressList: + - existMgmtIpAddress: string + newMgmtIpAddress: string + userName: string + +- name: Delete by id + cisco.dnac.network_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + cleanConfig: true + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_by_ip_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_by_ip_info.py new file mode 100644 index 00000000..151347c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_by_ip_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_by_ip_info +short_description: Information module for Network Device By Ip +description: +- Get Network Device By Ip by id. +- Returns the network device by specified IP address. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + ipAddress: + description: + - IpAddress path parameter. Device IP address. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetNetworkDeviceByIP + description: Complete reference of the GetNetworkDeviceByIP API. + link: https://developer.cisco.com/docs/dna-center/#!get-network-device-by-ip +notes: + - SDK Method used are + devices.Devices.get_network_device_by_ip, + + - Paths used are + get /dna/intent/api/v1/network-device/ip-address/{ipAddress}, + +""" + +EXAMPLES = r""" +- name: Get Network Device By Ip by id + cisco.dnac.network_device_by_ip_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + ipAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "apManagerInterfaceIp": "string", + "associatedWlcIp": "string", + "bootDateTime": "string", + "collectionInterval": "string", + "collectionStatus": "string", + "errorCode": "string", + "errorDescription": "string", + "family": "string", + "hostname": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceCount": "string", + "inventoryStatusDetail": "string", + "lastUpdateTime": 0, + "lastUpdated": "string", + "lineCardCount": "string", + "lineCardId": "string", + "location": "string", + "locationName": "string", + "macAddress": "string", + "managementIpAddress": "string", + "memorySize": "string", + "platformId": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "role": "string", + "roleSource": "string", + "serialNumber": "string", + "series": "string", + "snmpContact": "string", + "snmpLocation": "string", + "softwareType": "string", + "softwareVersion": "string", + "tagCount": "string", + "tunnelUdpPort": "string", + "type": "string", + "upTime": "string", + "waasDeviceMode": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_by_serial_number_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_by_serial_number_info.py new file mode 100644 index 00000000..3b4a9521 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_by_serial_number_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_by_serial_number_info +short_description: Information module for Network Device By Serial Number +description: +- Get Network Device By Serial Number by id. +- Returns the network device with given serial number. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + serialNumber: + description: + - SerialNumber path parameter. Device serial number. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceBySerialNumber + description: Complete reference of the GetDeviceBySerialNumber API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-by-serial-number +notes: + - SDK Method used are + devices.Devices.get_device_by_serial_number, + + - Paths used are + get /dna/intent/api/v1/network-device/serial-number/{serialNumber}, + +""" + +EXAMPLES = r""" +- name: Get Network Device By Serial Number by id + cisco.dnac.network_device_by_serial_number_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + serialNumber: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "apManagerInterfaceIp": "string", + "associatedWlcIp": "string", + "bootDateTime": "string", + "collectionInterval": "string", + "collectionStatus": "string", + "errorCode": "string", + "errorDescription": "string", + "family": "string", + "hostname": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceCount": "string", + "inventoryStatusDetail": "string", + "lastUpdateTime": 0, + "lastUpdated": "string", + "lineCardCount": "string", + "lineCardId": "string", + "location": "string", + "locationName": "string", + "macAddress": "string", + "managementIpAddress": "string", + "memorySize": "string", + "platformId": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "role": "string", + "roleSource": "string", + "serialNumber": "string", + "series": "string", + "snmpContact": "string", + "snmpLocation": "string", + "softwareType": "string", + "softwareVersion": "string", + "tagCount": "string", + "tunnelUdpPort": "string", + "type": "string", + "upTime": "string", + "waasDeviceMode": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_chassis_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_chassis_details_info.py new file mode 100644 index 00000000..6d540eae --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_chassis_details_info.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_chassis_details_info +short_description: Information module for Network Device Chassis Details +description: +- Get all Network Device Chassis Details. +- Returns chassis details for given device ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetChassisDetailsForDevice + description: Complete reference of the GetChassisDetailsForDevice API. + link: https://developer.cisco.com/docs/dna-center/#!get-chassis-details-for-device +notes: + - SDK Method used are + devices.Devices.get_chassis_details_for_device, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceId}/chassis, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Chassis Details + cisco.dnac.network_device_chassis_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "assemblyNumber": "string", + "assemblyRevision": "string", + "containmentEntity": "string", + "description": "string", + "entityPhysicalIndex": "string", + "hardwareVersion": "string", + "instanceUuid": "string", + "isFieldReplaceable": "string", + "isReportingAlarmsAllowed": "string", + "manufacturer": "string", + "name": "string", + "partNumber": "string", + "serialNumber": "string", + "vendorEquipmentType": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_config_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_config_count_info.py new file mode 100644 index 00000000..e2b2a244 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_config_count_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_config_count_info +short_description: Information module for Network Device Config Count +description: +- Get all Network Device Config Count. +- Returns the count of device configs. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceConfigCount + description: Complete reference of the GetDeviceConfigCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-config-count +notes: + - SDK Method used are + devices.Devices.get_device_config_count, + + - Paths used are + get /dna/intent/api/v1/network-device/config/count, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Config Count + cisco.dnac.network_device_config_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_config_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_config_info.py new file mode 100644 index 00000000..b2832bb7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_config_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_config_info +short_description: Information module for Network Device Config +description: +- Get all Network Device Config. +- Get Network Device Config by id. +- Returns the config for all devices. +- Returns the device config by specified device ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + networkDeviceId: + description: + - NetworkDeviceId path parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceConfigById + description: Complete reference of the GetDeviceConfigById API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-config-by-id +- name: Cisco DNA Center documentation for Devices GetDeviceConfigForAllDevices + description: Complete reference of the GetDeviceConfigForAllDevices API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-config-for-all-devices +notes: + - SDK Method used are + devices.Devices.get_device_config_by_id, + devices.Devices.get_device_config_for_all_devices, + + - Paths used are + get /dna/intent/api/v1/network-device/config, + get /dna/intent/api/v1/network-device/{networkDeviceId}/config, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Config + cisco.dnac.network_device_config_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +- name: Get Network Device Config by id + cisco.dnac.network_device_config_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + networkDeviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": "string", + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_count_info.py new file mode 100644 index 00000000..3a865dac --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_count_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_count_info +short_description: Information module for Network Device Count +description: +- Get all Network Device Count. +- Get Network Device Count by id. +- > + Returns the count of network devices based on the filter criteria by management IP address, mac address, hostname + and location name. +- Returns the interface count for the given device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceCount2 + description: Complete reference of the GetDeviceCount2 API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-count +- name: Cisco DNA Center documentation for Devices GetDeviceInterfaceCount2 + description: Complete reference of the GetDeviceInterfaceCount2 API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-interface-count-2 +notes: + - SDK Method used are + devices.Devices.get_device_count, + devices.Devices.get_device_interface_count_by_id, + + - Paths used are + get /dna/intent/api/v1/interface/network-device/{deviceId}/count, + get /dna/intent/api/v1/network-device/count, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Count + cisco.dnac.network_device_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +- name: Get Network Device Count by id + cisco.dnac.network_device_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt.py new file mode 100644 index 00000000..ab60bde8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_custom_prompt +short_description: Resource module for Network Device Custom Prompt +description: +- Manage operation create of the resource Network Device Custom Prompt. +- > + Save custom prompt added by user in Cisco DNA Center. API will always override the existing prompts. User should + provide all the custom prompt in case of any update. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + passwordPrompt: + description: Password Prompt. + type: str + usernamePrompt: + description: Username Prompt. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for System Settings CustomPromptPOSTAPI + description: Complete reference of the CustomPromptPOSTAPI API. + link: https://developer.cisco.com/docs/dna-center/#!custom-prompt-postapi +notes: + - SDK Method used are + system_settings.SystemSettings.custom_prompt_post_api, + + - Paths used are + post /dna/intent/api/v1/network-device/custom-prompt, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.network_device_custom_prompt: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + passwordPrompt: string + usernamePrompt: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt_info.py new file mode 100644 index 00000000..03a4e0bb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_custom_prompt_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_custom_prompt_info +short_description: Information module for Network Device Custom Prompt +description: +- Get all Network Device Custom Prompt. +- Returns supported custom prompts by Cisco DNA Center. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for System Settings CustomPromptSupportGETAPI + description: Complete reference of the CustomPromptSupportGETAPI API. + link: https://developer.cisco.com/docs/dna-center/#!custom-prompt-support-getapi +notes: + - SDK Method used are + system_settings.SystemSettings.custom_prompt_support_get_api, + + - Paths used are + get /dna/intent/api/v1/network-device/custom-prompt, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Custom Prompt + cisco.dnac.network_device_custom_prompt_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "customUsernamePrompt": "string", + "customPasswordPrompt": "string", + "defaultUsernamePrompt": "string", + "defaultPasswordPrompt": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_equipment_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_equipment_info.py new file mode 100644 index 00000000..88ea72c4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_equipment_info.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_equipment_info +short_description: Information module for Network Device Equipment +description: +- Get all Network Device Equipment. +- Return PowerSupply/ Fan details for the Given device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceUuid: + description: + - DeviceUuid path parameter. + type: str + type: + description: + - Type query parameter. Type value should be PowerSupply or Fan. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices ReturnPowerSupplyFanDetailsForTheGivenDevice + description: Complete reference of the ReturnPowerSupplyFanDetailsForTheGivenDevice API. + link: https://developer.cisco.com/docs/dna-center/#!return-power-supply-fan-details-for-the-given-device +notes: + - SDK Method used are + devices.Devices.return_power_supply_fan_details_for_the_given_device, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceUuid}/equipment, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Equipment + cisco.dnac.network_device_equipment_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + type: string + deviceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "operationalStateCode": "string", + "productId": "string", + "serialNumber": "string", + "vendorEquipmentType": "string", + "description": "string", + "instanceUuid": "string", + "name": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_export.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_export.py new file mode 100644 index 00000000..93bb723e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_export.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_export +short_description: Resource module for Network Device Export +description: +- Manage operation create of the resource Network Device Export. +- Exports the selected network device to a file. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceUuids: + description: Network Device Export's deviceUuids. + elements: str + type: list + id: + description: Network Device Export's id. + type: str + operationEnum: + description: Network Device Export's operationEnum. + type: str + parameters: + description: Network Device Export's parameters. + elements: str + type: list + password: + description: Network Device Export's password. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices ExportDeviceList + description: Complete reference of the ExportDeviceList API. + link: https://developer.cisco.com/docs/dna-center/#!export-device-list +notes: + - SDK Method used are + devices.Devices.export_device_list, + + - Paths used are + post /dna/intent/api/v1/network-device/file, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.network_device_export: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceUuids: + - string + id: string + operationEnum: string + parameters: + - string + password: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_functional_capability_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_functional_capability_info.py new file mode 100644 index 00000000..60d2c04b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_functional_capability_info.py @@ -0,0 +1,113 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_functional_capability_info +short_description: Information module for Network Device Functional Capability +description: +- Get all Network Device Functional Capability. +- Get Network Device Functional Capability by id. +- Returns functional capability with given Id. +- Returns the functional-capability for given devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - > + DeviceId query parameter. Accepts comma separated deviceid's and return list of functional-capabilities for + the given id's. If invalid or not-found id's are provided, null entry will be returned in the list. + type: str + functionName: + description: + - FunctionName query parameter. + elements: str + type: list + id: + description: + - Id path parameter. Functional Capability UUID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetFunctionalCapabilityById + description: Complete reference of the GetFunctionalCapabilityById API. + link: https://developer.cisco.com/docs/dna-center/#!get-functional-capability-by-id +- name: Cisco DNA Center documentation for Devices GetFunctionalCapabilityForDevices + description: Complete reference of the GetFunctionalCapabilityForDevices API. + link: https://developer.cisco.com/docs/dna-center/#!get-functional-capability-for-devices +notes: + - SDK Method used are + devices.Devices.get_functional_capability_by_id, + devices.Devices.get_functional_capability_for_devices, + + - Paths used are + get /dna/intent/api/v1/network-device/functional-capability, + get /dna/intent/api/v1/network-device/functional-capability/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Functional Capability + cisco.dnac.network_device_functional_capability_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + functionName: [] + register: result + +- name: Get Network Device Functional Capability by id + cisco.dnac.network_device_functional_capability_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "attributeInfo": {}, + "functionDetails": [ + { + "attributeInfo": {}, + "id": "string", + "propertyName": "string", + "stringValue": "string" + } + ], + "functionName": "string", + "functionOpState": "string", + "id": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_global_polling_interval_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_global_polling_interval_info.py new file mode 100644 index 00000000..4d1df2f6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_global_polling_interval_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_global_polling_interval_info +short_description: Information module for Network Device Global Polling Interval +description: +- Get all Network Device Global Polling Interval. +- Returns polling interval of all devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetPollingIntervalForAllDevices + description: Complete reference of the GetPollingIntervalForAllDevices API. + link: https://developer.cisco.com/docs/dna-center/#!get-polling-interval-for-all-devices +notes: + - SDK Method used are + devices.Devices.get_polling_interval_for_all_devices, + + - Paths used are + get /dna/intent/api/v1/network-device/collection-schedule/global, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Global Polling Interval + cisco.dnac.network_device_global_polling_interval_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_info.py new file mode 100644 index 00000000..49d427c0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_info.py @@ -0,0 +1,325 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_info +short_description: Information module for Network Device +description: +- Get all Network Device. +- Get Network Device by id. +- Returns list of network devices based on filter criteria such as management IP address, mac address, hostname, etc. +- Returns the network device details for the given device ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + hostname: + description: + - Hostname query parameter. + elements: str + type: list + managementIpAddress: + description: + - ManagementIpAddress query parameter. + elements: str + type: list + macAddress: + description: + - MacAddress query parameter. + elements: str + type: list + locationName: + description: + - LocationName query parameter. + elements: str + type: list + serialNumber: + description: + - SerialNumber query parameter. + elements: str + type: list + location: + description: + - Location query parameter. + elements: str + type: list + family: + description: + - Family query parameter. + elements: str + type: list + type: + description: + - Type query parameter. + elements: str + type: list + series: + description: + - Series query parameter. + elements: str + type: list + collectionStatus: + description: + - CollectionStatus query parameter. + elements: str + type: list + collectionInterval: + description: + - CollectionInterval query parameter. + elements: str + type: list + notSyncedForMinutes: + description: + - NotSyncedForMinutes query parameter. + elements: str + type: list + errorCode: + description: + - ErrorCode query parameter. + elements: str + type: list + errorDescription: + description: + - ErrorDescription query parameter. + elements: str + type: list + softwareVersion: + description: + - SoftwareVersion query parameter. + elements: str + type: list + softwareType: + description: + - SoftwareType query parameter. + elements: str + type: list + platformId: + description: + - PlatformId query parameter. + elements: str + type: list + role: + description: + - Role query parameter. + elements: str + type: list + reachabilityStatus: + description: + - ReachabilityStatus query parameter. + elements: str + type: list + upTime: + description: + - UpTime query parameter. + elements: str + type: list + associatedWlcIp: + description: + - AssociatedWlcIp query parameter. + elements: str + type: list + license_name: + description: + - License.name query parameter. + elements: str + type: list + license_type: + description: + - License.type query parameter. + elements: str + type: list + license_status: + description: + - License.status query parameter. + elements: str + type: list + module_name: + description: + - Module+name query parameter. + elements: str + type: list + module_equpimenttype: + description: + - Module+equpimenttype query parameter. + elements: str + type: list + module_servicestate: + description: + - Module+servicestate query parameter. + elements: str + type: list + module_vendorequipmenttype: + description: + - Module+vendorequipmenttype query parameter. + elements: str + type: list + module_partnumber: + description: + - Module+partnumber query parameter. + elements: str + type: list + module_operationstatecode: + description: + - Module+operationstatecode query parameter. + elements: str + type: list + id: + description: + - > + Id query parameter. Accepts comma separated ids and return list of network-devices for the given ids. If + invalid or not-found ids are provided, null entry will be returned in the list. + type: str + deviceSupportLevel: + description: + - DeviceSupportLevel query parameter. + type: str + offset: + description: + - Offset query parameter. Offset >= 1 X gives results from Xth device onwards. + type: int + limit: + description: + - Limit query parameter. 1 <= limit <= 500 max. No. Of devices to be returned in the result. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceByID + description: Complete reference of the GetDeviceByID API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-by-id +- name: Cisco DNA Center documentation for Devices GetDeviceList + description: Complete reference of the GetDeviceList API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-list +notes: + - SDK Method used are + devices.Devices.get_device_by_id, + devices.Devices.get_device_list, + + - Paths used are + get /dna/intent/api/v1/network-device, + get /dna/intent/api/v1/network-device/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Network Device + cisco.dnac.network_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + hostname: [] + managementIpAddress: [] + macAddress: [] + locationName: [] + serialNumber: [] + location: [] + family: [] + type: [] + series: [] + collectionStatus: [] + collectionInterval: [] + notSyncedForMinutes: [] + errorCode: [] + errorDescription: [] + softwareVersion: [] + softwareType: [] + platformId: [] + role: [] + reachabilityStatus: [] + upTime: [] + associatedWlcIp: [] + license_name: [] + license_type: [] + license_status: [] + module_name: [] + module_equpimenttype: [] + module_servicestate: [] + module_vendorequipmenttype: [] + module_partnumber: [] + module_operationstatecode: [] + id: string + deviceSupportLevel: string + offset: 0 + limit: 0 + register: result + +- name: Get Network Device by id + cisco.dnac.network_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "apManagerInterfaceIp": "string", + "associatedWlcIp": "string", + "bootDateTime": "string", + "collectionInterval": "string", + "collectionStatus": "string", + "errorCode": "string", + "errorDescription": "string", + "family": "string", + "hostname": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceCount": "string", + "inventoryStatusDetail": "string", + "lastUpdateTime": 0, + "lastUpdated": "string", + "lineCardCount": "string", + "lineCardId": "string", + "location": "string", + "locationName": "string", + "macAddress": "string", + "managementIpAddress": "string", + "memorySize": "string", + "platformId": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "role": "string", + "roleSource": "string", + "serialNumber": "string", + "series": "string", + "snmpContact": "string", + "snmpLocation": "string", + "softwareType": "string", + "softwareVersion": "string", + "tagCount": "string", + "tunnelUdpPort": "string", + "type": "string", + "upTime": "string", + "waasDeviceMode": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_interface_neighbor_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_interface_neighbor_info.py new file mode 100644 index 00000000..9b34f8a9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_interface_neighbor_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_interface_neighbor_info +short_description: Information module for Network Device Interface Neighbor +description: +- Get all Network Device Interface Neighbor. +- Get connected device detail for given deviceUuid and interfaceUuid. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceUuid: + description: + - DeviceUuid path parameter. Instanceuuid of Device. + type: str + interfaceUuid: + description: + - InterfaceUuid path parameter. Instanceuuid of interface. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetConnectedDeviceDetail + description: Complete reference of the GetConnectedDeviceDetail API. + link: https://developer.cisco.com/docs/dna-center/#!get-connected-device-detail +notes: + - SDK Method used are + devices.Devices.get_connected_device_detail, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceUuid}/interface/{interfaceUuid}/neighbor, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Interface Neighbor + cisco.dnac.network_device_interface_neighbor_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceUuid: string + interfaceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "neighborDevice": "string", + "neighborPort": "string", + "capabilities": [ + "string" + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_interface_poe_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_interface_poe_info.py new file mode 100644 index 00000000..3da01e14 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_interface_poe_info.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_interface_poe_info +short_description: Information module for Network Device Interface Poe +description: +- Get all Network Device Interface Poe. +- > + Returns POE interface details for the device, where deviceuuid is mandatory & accepts comma seperated interface + names which is optional and returns information for that particular interfaces where operStatus = + operationalStatus . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceUuid: + description: + - DeviceUuid path parameter. Uuid of the device. + type: str + interfaceNameList: + description: + - InterfaceNameList query parameter. Comma seperated interface names. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices ReturnsPOEInterfaceDetailsForTheDevice + description: Complete reference of the ReturnsPOEInterfaceDetailsForTheDevice API. + link: https://developer.cisco.com/docs/dna-center/#!returns-poe-interface-details-for-the-device +notes: + - SDK Method used are + devices.Devices.poe_interface_details, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceUuid}/interface/poe-detail, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Interface Poe + cisco.dnac.network_device_interface_poe_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + interfaceNameList: string + deviceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": [ + { + "adminStatus": "string", + "operStatus": "string", + "interfaceName": "string", + "maxPortPower": "string", + "allocatedPower": "string", + "portPowerDrawn": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_inventory_insight_link_mismatch_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_inventory_insight_link_mismatch_info.py new file mode 100644 index 00000000..c62e0a01 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_inventory_insight_link_mismatch_info.py @@ -0,0 +1,127 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_inventory_insight_link_mismatch_info +short_description: Information module for Network Device Inventory Insight Link Mismatch +description: +- Get all Network Device Inventory Insight Link Mismatch. +- Find all devices with link mismatch speed / vlan . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId path parameter. + type: str + offset: + description: + - Offset query parameter. Row Number. Default value is 1. + type: str + limit: + description: + - Limit query parameter. Default value is 500. + type: str + category: + description: + - Category query parameter. Links mismatch category. Value can be speed-duplex or vlan. + type: str + sortBy: + description: + - SortBy query parameter. Sort By. + type: str + order: + description: + - Order query parameter. Order. Value can be asc or desc. Default value is asc. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices InventoryInsightDeviceLinkMismatchAPI + description: Complete reference of the InventoryInsightDeviceLinkMismatchAPI API. + link: https://developer.cisco.com/docs/dna-center/#!inventory-insight-device-link-mismatch-api +notes: + - SDK Method used are + devices.Devices.inventory_insight_device_link_mismatch, + + - Paths used are + get /dna/intent/api/v1/network-device/insight/{siteId}/device-link, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Inventory Insight Link Mismatch + cisco.dnac.network_device_inventory_insight_link_mismatch_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: string + limit: string + category: string + sortBy: string + order: string + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "endPortAllowedVlanIds": "string", + "endPortNativeVlanId": "string", + "startPortAllowedVlanIds": "string", + "startPortNativeVlanId": "string", + "linkStatus": "string", + "endDeviceHostName": "string", + "endDeviceId": "string", + "endDeviceIpAddress": "string", + "endPortAddress": "string", + "endPortDuplex": "string", + "endPortId": "string", + "endPortMask": "string", + "endPortName": "string", + "endPortPepId": "string", + "endPortSpeed": "string", + "startDeviceHostName": "string", + "startDeviceId": "string", + "startDeviceIpAddress": "string", + "startPortAddress": "string", + "startPortDuplex": "string", + "startPortId": "string", + "startPortMask": "string", + "startPortName": "string", + "startPortPepId": "string", + "startPortSpeed": "string", + "lastUpdated": "string", + "numUpdates": 0, + "avgUpdateFrequency": 0, + "type": "string", + "instanceUuid": "string", + "instanceTenantId": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_lexicographically_sorted_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_lexicographically_sorted_info.py new file mode 100644 index 00000000..04e1ebfc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_lexicographically_sorted_info.py @@ -0,0 +1,175 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_lexicographically_sorted_info +short_description: Information module for Network Device Lexicographically Sorted +description: +- Get all Network Device Lexicographically Sorted. +- Returns the list of values of the first given required parameter. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + vrfName: + description: + - VrfName query parameter. + type: str + managementIpAddress: + description: + - ManagementIpAddress query parameter. + type: str + hostname: + description: + - Hostname query parameter. + type: str + macAddress: + description: + - MacAddress query parameter. + type: str + family: + description: + - Family query parameter. + type: str + collectionStatus: + description: + - CollectionStatus query parameter. + type: str + collectionInterval: + description: + - CollectionInterval query parameter. + type: str + softwareVersion: + description: + - SoftwareVersion query parameter. + type: str + softwareType: + description: + - SoftwareType query parameter. + type: str + reachabilityStatus: + description: + - ReachabilityStatus query parameter. + type: str + reachabilityFailureReason: + description: + - ReachabilityFailureReason query parameter. + type: str + errorCode: + description: + - ErrorCode query parameter. + type: str + platformId: + description: + - PlatformId query parameter. + type: str + series: + description: + - Series query parameter. + type: str + type: + description: + - Type query parameter. + type: str + serialNumber: + description: + - SerialNumber query parameter. + type: str + upTime: + description: + - UpTime query parameter. + type: str + role: + description: + - Role query parameter. + type: str + roleSource: + description: + - RoleSource query parameter. + type: str + associatedWlcIp: + description: + - AssociatedWlcIp query parameter. + type: str + offset: + description: + - Offset query parameter. + type: int + limit: + description: + - Limit query parameter. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceValuesThatMatchFullyOrPartiallyAnAttribute + description: Complete reference of the GetDeviceValuesThatMatchFullyOrPartiallyAnAttribute API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-values-that-match-fully-or-partially-an-attribute +notes: + - SDK Method used are + devices.Devices.get_device_values_that_match_fully_or_partially_an_attribute, + + - Paths used are + get /dna/intent/api/v1/network-device/autocomplete, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Lexicographically Sorted + cisco.dnac.network_device_lexicographically_sorted_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + vrfName: string + managementIpAddress: string + hostname: string + macAddress: string + family: string + collectionStatus: string + collectionInterval: string + softwareVersion: string + softwareType: string + reachabilityStatus: string + reachabilityFailureReason: string + errorCode: string + platformId: string + series: string + type: string + serialNumber: string + upTime: string + role: string + roleSource: string + associatedWlcIp: string + offset: 0 + limit: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + "string" + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_linecard_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_linecard_details_info.py new file mode 100644 index 00000000..a2267a75 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_linecard_details_info.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_linecard_details_info +short_description: Information module for Network Device Linecard Details +description: +- Get all Network Device Linecard Details. +- Get line card detail for a given deviceuuid. Response will contain serial no, part no, switch no and slot no. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceUuid: + description: + - DeviceUuid path parameter. Instanceuuid of device. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetLinecardDetails + description: Complete reference of the GetLinecardDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-linecard-details +notes: + - SDK Method used are + devices.Devices.get_linecard_details, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceUuid}/line-card, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Linecard Details + cisco.dnac.network_device_linecard_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "serialno": "string", + "partno": "string", + "switchno": "string", + "slotno": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_meraki_organization_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_meraki_organization_info.py new file mode 100644 index 00000000..a9bde346 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_meraki_organization_info.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_meraki_organization_info +short_description: Information module for Network Device Meraki Organization +description: +- Get all Network Device Meraki Organization. +- Returns list of organizations for meraki dashboard. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetOrganizationListForMeraki + description: Complete reference of the GetOrganizationListForMeraki API. + link: https://developer.cisco.com/docs/dna-center/#!get-organization-list-for-meraki +notes: + - SDK Method used are + devices.Devices.get_organization_list_for_meraki, + + - Paths used are + get /dna/intent/api/v1/network-device/{id}/meraki-organization, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Meraki Organization + cisco.dnac.network_device_meraki_organization_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + "string" + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_module_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_module_count_info.py new file mode 100644 index 00000000..6bddca67 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_module_count_info.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_module_count_info +short_description: Information module for Network Device Module Count +description: +- Get all Network Device Module Count. +- Returns Module Count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId query parameter. + type: str + nameList: + description: + - NameList query parameter. + elements: str + type: list + vendorEquipmentTypeList: + description: + - VendorEquipmentTypeList query parameter. + elements: str + type: list + partNumberList: + description: + - PartNumberList query parameter. + elements: str + type: list + operationalStateCodeList: + description: + - OperationalStateCodeList query parameter. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetModuleCount + description: Complete reference of the GetModuleCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-module-count +notes: + - SDK Method used are + devices.Devices.get_module_count, + + - Paths used are + get /dna/intent/api/v1/network-device/module/count, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Module Count + cisco.dnac.network_device_module_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + nameList: [] + vendorEquipmentTypeList: [] + partNumberList: [] + operationalStateCodeList: [] + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_module_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_module_info.py new file mode 100644 index 00000000..83cc6b7f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_module_info.py @@ -0,0 +1,143 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_module_info +short_description: Information module for Network Device Module +description: +- Get all Network Device Module. +- Get Network Device Module by id. +- Returns Module info by 'module id'. +- Returns modules by specified device id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId query parameter. + type: str + limit: + description: + - Limit query parameter. + type: str + offset: + description: + - Offset query parameter. + type: str + nameList: + description: + - NameList query parameter. + elements: str + type: list + vendorEquipmentTypeList: + description: + - VendorEquipmentTypeList query parameter. + elements: str + type: list + partNumberList: + description: + - PartNumberList query parameter. + elements: str + type: list + operationalStateCodeList: + description: + - OperationalStateCodeList query parameter. + elements: str + type: list + id: + description: + - Id path parameter. Module id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetModuleInfoById + description: Complete reference of the GetModuleInfoById API. + link: https://developer.cisco.com/docs/dna-center/#!get-module-info-by-id +- name: Cisco DNA Center documentation for Devices GetModules + description: Complete reference of the GetModules API. + link: https://developer.cisco.com/docs/dna-center/#!get-modules +notes: + - SDK Method used are + devices.Devices.get_module_info_by_id, + devices.Devices.get_modules, + + - Paths used are + get /dna/intent/api/v1/network-device/module, + get /dna/intent/api/v1/network-device/module/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Module + cisco.dnac.network_device_module_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + limit: string + offset: string + nameList: [] + vendorEquipmentTypeList: [] + partNumberList: [] + operationalStateCodeList: [] + register: result + +- name: Get Network Device Module by id + cisco.dnac.network_device_module_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "assemblyNumber": "string", + "assemblyRevision": "string", + "attributeInfo": {}, + "containmentEntity": "string", + "description": "string", + "entityPhysicalIndex": "string", + "id": "string", + "isFieldReplaceable": "string", + "isReportingAlarmsAllowed": "string", + "manufacturer": "string", + "moduleIndex": 0, + "name": "string", + "operationalStateCode": "string", + "partNumber": "string", + "serialNumber": "string", + "vendorEquipmentType": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_poe_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_poe_info.py new file mode 100644 index 00000000..ca99bdd3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_poe_info.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_poe_info +short_description: Information module for Network Device Poe +description: +- Get all Network Device Poe. +- Returns POE details for device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceUuid: + description: + - DeviceUuid path parameter. Uuid of the device. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices POEDetails + description: Complete reference of the POEDetails API. + link: https://developer.cisco.com/docs/dna-center/#!p-oe-details +notes: + - SDK Method used are + devices.Devices.poe_details, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceUuid}/poe, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Poe + cisco.dnac.network_device_poe_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "powerAllocated": "string", + "powerConsumed": "string", + "powerRemaining": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_polling_interval_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_polling_interval_info.py new file mode 100644 index 00000000..36bfbce0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_polling_interval_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_polling_interval_info +short_description: Information module for Network Device Polling Interval +description: +- Get all Network Device Polling Interval. +- Returns polling interval by device id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Device ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetPollingIntervalById + description: Complete reference of the GetPollingIntervalById API. + link: https://developer.cisco.com/docs/dna-center/#!get-polling-interval-by-id +notes: + - SDK Method used are + devices.Devices.get_polling_interval_by_id, + + - Paths used are + get /dna/intent/api/v1/network-device/{id}/collection-schedule, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Polling Interval + cisco.dnac.network_device_polling_interval_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_range_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_range_info.py new file mode 100644 index 00000000..c9fbae51 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_range_info.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_range_info +short_description: Information module for Network Device Range +description: +- Get all Network Device Range. +- Returns the list of network devices for the given pagination range. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + startIndex: + description: + - StartIndex path parameter. Start index. + type: int + recordsToReturn: + description: + - RecordsToReturn path parameter. Number of records to return. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetNetworkDeviceByPaginationRange + description: Complete reference of the GetNetworkDeviceByPaginationRange API. + link: https://developer.cisco.com/docs/dna-center/#!get-network-device-by-pagination-range +notes: + - SDK Method used are + devices.Devices.get_network_device_by_pagination_range, + + - Paths used are + get /dna/intent/api/v1/network-device/{startIndex}/{recordsToReturn}, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Range + cisco.dnac.network_device_range_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + startIndex: 0 + recordsToReturn: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "apManagerInterfaceIp": "string", + "associatedWlcIp": "string", + "bootDateTime": "string", + "collectionInterval": "string", + "collectionStatus": "string", + "errorCode": "string", + "errorDescription": "string", + "family": "string", + "hostname": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "interfaceCount": "string", + "inventoryStatusDetail": "string", + "lastUpdateTime": 0, + "lastUpdated": "string", + "lineCardCount": "string", + "lineCardId": "string", + "location": "string", + "locationName": "string", + "macAddress": "string", + "managementIpAddress": "string", + "memorySize": "string", + "platformId": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "role": "string", + "roleSource": "string", + "serialNumber": "string", + "series": "string", + "snmpContact": "string", + "snmpLocation": "string", + "softwareType": "string", + "softwareVersion": "string", + "tagCount": "string", + "tunnelUdpPort": "string", + "type": "string", + "upTime": "string", + "waasDeviceMode": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_register_for_wsa_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_register_for_wsa_info.py new file mode 100644 index 00000000..a813bda2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_register_for_wsa_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_register_for_wsa_info +short_description: Information module for Network Device Register For Wsa +description: +- Get all Network Device Register For Wsa. +- Registers a device for WSA notification. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + serialNumber: + description: + - SerialNumber query parameter. Serial number of the device. + type: str + macaddress: + description: + - Macaddress query parameter. Mac addres of the device. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices RegisterDeviceForWSA + description: Complete reference of the RegisterDeviceForWSA API. + link: https://developer.cisco.com/docs/dna-center/#!register-device-for-wsa +notes: + - SDK Method used are + devices.Devices.register_device_for_wsa, + + - Paths used are + get /dna/intent/api/v1/network-device/tenantinfo/macaddress, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Register For Wsa + cisco.dnac.network_device_register_for_wsa_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + serialNumber: string + macaddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "macAddress": "string", + "modelNumber": "string", + "name": "string", + "serialNumber": "string", + "tenantId": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_stack_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_stack_details_info.py new file mode 100644 index 00000000..4f8912bc --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_stack_details_info.py @@ -0,0 +1,132 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_stack_details_info +short_description: Information module for Network Device Stack Details +description: +- Get all Network Device Stack Details. +- Retrieves complete stack details for given device ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetStackDetailsForDevice + description: Complete reference of the GetStackDetailsForDevice API. + link: https://developer.cisco.com/docs/dna-center/#!get-stack-details-for-device +notes: + - SDK Method used are + devices.Devices.get_stack_details_for_device, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceId}/stack, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Stack Details + cisco.dnac.network_device_stack_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "deviceId": "string", + "stackPortInfo": [ + { + "isSynchOk": "string", + "linkActive": true, + "linkOk": true, + "name": "string", + "neighborPort": "string", + "nrLinkOkChanges": 0, + "stackCableLengthInfo": "string", + "stackPortOperStatusInfo": "string", + "switchPort": "string" + } + ], + "stackSwitchInfo": [ + { + "entPhysicalIndex": "string", + "hwPriority": 0, + "macAddress": "string", + "numNextReload": 0, + "platformId": "string", + "role": "string", + "serialNumber": "string", + "softwareImage": "string", + "stackMemberNumber": 0, + "state": "string", + "switchPriority": 0 + } + ], + "svlSwitchInfo": [ + { + "dadProtocol": "string", + "dadRecoveryReloadEnabled": true, + "domainNumber": 0, + "inDadRecoveryMode": true, + "swVirtualStatus": "string", + "switchMembers": [ + { + "bandwidth": "string", + "svlMemberEndPoints": [ + { + "svlMemberEndPointPorts": [ + { + "svlProtocolStatus": "string", + "swLocalInterface": "string", + "swRemoteInterface": "string" + } + ], + "svlNumber": 0, + "svlStatus": "string" + } + ], + "svlMemberNumber": 0, + "svlMemberPepSettings": [ + { + "dadEnabled": true, + "dadInterfaceName": "string" + } + ] + } + ] + } + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_summary_info.py new file mode 100644 index 00000000..4aa0c294 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_summary_info.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_summary_info +short_description: Information module for Network Device Summary +description: +- Get all Network Device Summary. +- Returns brief summary of device info such as hostname, management IP address for the given device Id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Device ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceSummary + description: Complete reference of the GetDeviceSummary API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-summary +notes: + - SDK Method used are + devices.Devices.get_device_summary, + + - Paths used are + get /dna/intent/api/v1/network-device/{id}/brief, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Summary + cisco.dnac.network_device_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "id": "string", + "role": "string", + "roleSource": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_supervisor_card_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_supervisor_card_details_info.py new file mode 100644 index 00000000..f4547f29 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_supervisor_card_details_info.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_supervisor_card_details_info +short_description: Information module for Network Device Supervisor Card Details +description: +- Get all Network Device Supervisor Card Details. +- Get supervisor card detail for a given deviceuuid. Response will contain serial no, part no, switch no and slot no. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceUuid: + description: + - DeviceUuid path parameter. Instanceuuid of device. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetSupervisorCardDetail + description: Complete reference of the GetSupervisorCardDetail API. + link: https://developer.cisco.com/docs/dna-center/#!get-supervisor-card-detail +notes: + - SDK Method used are + devices.Devices.get_supervisor_card_detail, + + - Paths used are + get /dna/intent/api/v1/network-device/{deviceUuid}/supervisor-card, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Supervisor Card Details + cisco.dnac.network_device_supervisor_card_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceUuid: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "serialno": "string", + "partno": "string", + "switchno": "string", + "slotno": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_sync.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_sync.py new file mode 100644 index 00000000..255d81e1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_sync.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_sync +short_description: Resource module for Network Device Sync +description: +- Manage operation update of the resource Network Device Sync. +- > + Synchronizes the devices. If forceSync param is false default then the sync would run in normal priority thread. + If forceSync param is true then the sync would run in high priority thread if available, else the sync will fail. + Result can be seen in the child task of each device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + forceSync: + description: ForceSync query parameter. + type: bool + payload: + description: Network Device Sync's payload. + elements: dict + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices SyncDevices + description: Complete reference of the SyncDevices API. + link: https://developer.cisco.com/docs/dna-center/#!sync-devices-2 +notes: + - SDK Method used are + devices.Devices.sync_devices_using_forcesync, + + - Paths used are + put /dna/intent/api/v1/network-device/sync, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.network_device_sync: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + forceSync: true + payload: + - {} + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_update_role.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_update_role.py new file mode 100644 index 00000000..16972e2e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_update_role.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_update_role +short_description: Resource module for Network Device Update Role +description: +- Manage operation update of the resource Network Device Update Role. +- Updates the role of the device as access, core, distribution, border router. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Network Device Update Role's id. + type: str + role: + description: Network Device Update Role's role. + type: str + roleSource: + description: Network Device Update Role's roleSource. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices UpdateDeviceRole + description: Complete reference of the UpdateDeviceRole API. + link: https://developer.cisco.com/docs/dna-center/#!update-device-role +notes: + - SDK Method used are + devices.Devices.update_device_role, + + - Paths used are + put /dna/intent/api/v1/network-device/brief, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.network_device_update_role: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + id: string + role: string + roleSource: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_vlan_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_vlan_info.py new file mode 100644 index 00000000..d236beee --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_vlan_info.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_vlan_info +short_description: Information module for Network Device Vlan +description: +- Get all Network Device Vlan. +- Returns Device Interface VLANs. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. + type: str + interfaceType: + description: + - InterfaceType query parameter. Vlan assocaited with sub-interface. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetDeviceInterfaceVLANs + description: Complete reference of the GetDeviceInterfaceVLANs API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-interface-vla-ns +notes: + - SDK Method used are + devices.Devices.get_device_interface_vlans, + + - Paths used are + get /dna/intent/api/v1/network-device/{id}/vlan, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Vlan + cisco.dnac.network_device_vlan_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + interfaceType: string + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "interfaceName": "string", + "ipAddress": "string", + "mask": 0, + "networkAddress": "string", + "numberOfIPs": 0, + "prefix": "string", + "vlanNumber": 0, + "vlanType": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_wireless_lan_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_wireless_lan_info.py new file mode 100644 index 00000000..29615e66 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_wireless_lan_info.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_wireless_lan_info +short_description: Information module for Network Device Wireless Lan +description: +- Get all Network Device Wireless Lan. +- Returns the wireless lan controller info with given device ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Device ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetWirelessLanControllerDetailsById + description: Complete reference of the GetWirelessLanControllerDetailsById API. + link: https://developer.cisco.com/docs/dna-center/#!get-wireless-lan-controller-details-by-id +notes: + - SDK Method used are + devices.Devices.get_wireless_lan_controller_details_by_id, + + - Paths used are + get /dna/intent/api/v1/network-device/{id}/wireless-info, + +""" + +EXAMPLES = r""" +- name: Get all Network Device Wireless Lan + cisco.dnac.network_device_wireless_lan_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "adminEnabledPorts": [ + 0 + ], + "apGroupName": "string", + "deviceId": "string", + "ethMacAddress": "string", + "flexGroupName": "string", + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "lagModeEnabled": true, + "netconfEnabled": true, + "wirelessLicenseInfo": "string", + "wirelessPackageInstalled": true + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_device_with_snmp_v3_des_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_device_with_snmp_v3_des_info.py new file mode 100644 index 00000000..c9a75092 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_device_with_snmp_v3_des_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_with_snmp_v3_des_info +short_description: Information module for Network Device With Snmp V3 Des +description: +- Get all Network Device With Snmp V3 Des. +- > + Returns devices added to Cisco DNA center with snmp v3 DES, where siteId is mandatory & accepts offset, limit, + sortby, order which are optional. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId path parameter. + type: str + offset: + description: + - Offset query parameter. Row Number. Default value is 1. + type: str + limit: + description: + - Limit query parameter. Default value is 500. + type: str + sortBy: + description: + - SortBy query parameter. Sort By. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices ReturnsDevicesAddedToCiscoDNACenterWithSnmpV3DES + description: Complete reference of the ReturnsDevicesAddedToCiscoDNACenterWithSnmpV3DES API. + link: https://developer.cisco.com/docs/dna-center/#!returns-devices-added-to-cisco-dna-center-with-snmp-v-3-des +notes: + - SDK Method used are + devices.Devices.get_devices_with_snmpv3_des, + + - Paths used are + get /dna/intent/api/v1/network-device/insight/{siteId}/insecure-connection, + +""" + +EXAMPLES = r""" +- name: Get all Network Device With Snmp V3 Des + cisco.dnac.network_device_with_snmp_v3_des_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: string + limit: string + sortBy: string + order: string + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "managementIpAddress": "string", + "hostname": "string", + "type": "string", + "family": "string", + "lastUpdated": "string", + "upTime": "string", + "reachabilityStatus": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_info.py b/ansible_collections/cisco/dnac/plugins/modules/network_info.py new file mode 100644 index 00000000..682a9b5b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_info.py @@ -0,0 +1,88 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_info +short_description: Information module for Network +description: +- Get all Network. +- API to get DHCP and DNS center server details. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. Site id to get the network settings associated with the site. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings GetNetwork + description: Complete reference of the GetNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!get-network +notes: + - SDK Method used are + network_settings.NetworkSettings.get_network, + + - Paths used are + get /dna/intent/api/v1/network, + +""" + +EXAMPLES = r""" +- name: Get all Network + cisco.dnac.network_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "instanceType": "string", + "instanceUuid": "string", + "namespace": "string", + "type": "string", + "key": "string", + "version": 0, + "value": [ + { + "ipAddresses": [ + "string" + ], + "configureDnacIP": true + } + ], + "groupUuid": "string", + "inheritedGroupUuid": "string", + "inheritedGroupName": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/network_update.py b/ansible_collections/cisco/dnac/plugins/modules/network_update.py new file mode 100644 index 00000000..f2bc5e88 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/network_update.py @@ -0,0 +1,208 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_update +short_description: Resource module for Network Update +description: +- Manage operation update of the resource Network Update. +- API to update network for DHCP and DNS center server settings. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + settings: + description: Network Update's settings. + suboptions: + clientAndEndpoint_aaa: + description: Network Update's clientAndEndpoint_aaa. + suboptions: + ipAddress: + description: IP address for ISE serve (eg 1.1.1.4). + type: str + network: + description: IP address for AAA or ISE server (eg 2.2.2.1). + type: str + protocol: + description: Protocol for AAA or ISE serve (eg RADIUS). + type: str + servers: + description: Server type AAA or ISE server (eg AAA). + type: str + sharedSecret: + description: Shared secret for ISE server. + type: str + type: dict + dhcpServer: + description: Dhcp serve Ip (eg 1.1.1.1). + elements: str + type: list + dnsServer: + description: Network Update's dnsServer. + suboptions: + domainName: + description: Domain name of DHCP (eg; cisco). + type: str + primaryIpAddress: + description: Primary ip address for DHCP (eg 2.2.2.2). + type: str + secondaryIpAddress: + description: Secondary ip address for DHCP (eg 3.3.3.3). + type: str + type: dict + messageOfTheday: + description: Network Update's messageOfTheday. + suboptions: + bannerMessage: + description: Massage for banner message (eg; Good day). + type: str + retainExistingBanner: + description: Retain existing banner message (eg "true" or "false"). + type: str + type: dict + netflowcollector: + description: Network Update's netflowcollector. + suboptions: + ipAddress: + description: IP address for netflow collector (eg 3.3.3.1). + type: str + port: + description: Port for netflow collector (eg; 443). + type: int + type: dict + network_aaa: + description: Network Update's network_aaa. + suboptions: + ipAddress: + description: IP address for AAA and ISE server (eg 1.1.1.1). + type: str + network: + description: IP address for AAA or ISE server (eg 2.2.2.2). + type: str + protocol: + description: Protocol for AAA or ISE serve (eg RADIUS). + type: str + servers: + description: Server type for AAA network (eg AAA). + type: str + sharedSecret: + description: Shared secret for ISE server. + type: str + type: dict + ntpServer: + description: IP address for NTP server (eg 1.1.1.2). + elements: str + type: list + snmpServer: + description: Network Update's snmpServer. + suboptions: + configureDnacIP: + description: Configuration dnac ip for snmp server (eg true). + type: bool + ipAddresses: + description: IP address for snmp server (eg 4.4.4.1). + elements: str + type: list + type: dict + syslogServer: + description: Network Update's syslogServer. + suboptions: + configureDnacIP: + description: Configuration dnac ip for syslog server (eg true). + type: bool + ipAddresses: + description: IP address for syslog server (eg 4.4.4.4). + elements: str + type: list + type: dict + timezone: + description: Input for time zone (eg Africa/Abidjan). + type: str + type: dict + siteId: + description: SiteId path parameter. Site id to update the network settings which + is associated with the site. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings UpdateNetwork + description: Complete reference of the UpdateNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!update-network +notes: + - SDK Method used are + network_settings.NetworkSettings.update_network, + + - Paths used are + put /dna/intent/api/v1/network/{siteId}, + +""" + +EXAMPLES = r""" +- name: Update by id + cisco.dnac.network_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + settings: + clientAndEndpoint_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + dhcpServer: + - string + dnsServer: + domainName: string + primaryIpAddress: string + secondaryIpAddress: string + messageOfTheday: + bannerMessage: string + retainExistingBanner: string + netflowcollector: + ipAddress: string + port: 0 + network_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + ntpServer: + - string + snmpServer: + configureDnacIP: true + ipAddresses: + - string + syslogServer: + configureDnacIP: true + ipAddresses: + - string + timezone: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/nfv_profile.py b/ansible_collections/cisco/dnac/plugins/modules/nfv_profile.py new file mode 100644 index 00000000..55f7950d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/nfv_profile.py @@ -0,0 +1,292 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: nfv_profile +short_description: Resource module for Nfv Profile +description: +- Manage operations create, update and delete of the resource Nfv Profile. +- API to create network profile for different NFV topologies. +- API to delete nfv network profile. +- API to update a NFV Network profile. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + device: + description: Nfv Profile's device. + elements: dict + suboptions: + customNetworks: + description: Nfv Profile's customNetworks. + elements: dict + suboptions: + connectionType: + description: Type of network connection from custom network (eg lan). + type: str + networkName: + description: Name of custom network (eg cust-1). + type: str + servicesToConnect: + description: Nfv Profile's servicesToConnect. + elements: dict + suboptions: + serviceName: + description: Name of service to be connected to the custom network (eg + router-1). + type: str + type: list + vlanId: + description: Vlan id for the custom network(eg 4000). + type: int + vlanMode: + description: Network mode (eg Access or Trunk). + type: str + type: list + customTemplate: + description: Nfv Profile's customTemplate. + elements: dict + suboptions: + deviceType: + description: Type of the device(eg Cisco 5400 Enterprise Network Compute + System), 'Cisco Integrated Services Virtual Router', 'Cisco Adaptive Security + Virtual Appliance (ASAv)', 'NFVIS', 'ASAV'. + type: str + template: + description: Name of the template(eg NFVIS template). + type: str + templateType: + description: Name of the template type to which template is associated (eg + Cloud DayN Templates). Allowed values are 'Onboarding Template(s)' and + 'Day-N-Template(s)'. + type: str + type: list + deviceTag: + description: Device Tag name(eg dev1). + type: str + deviceType: + description: Name of the device used in creating nfv profile. Allowed values + are 'Cisco 5400 Enterprise Network Compute System', 'Cisco 5100 Enterprise + Network Compute System'. + type: str + directInternetAccessForFirewall: + description: Direct internet access value should be boolean (eg false or true). + type: bool + serviceProviderProfile: + description: Nfv Profile's serviceProviderProfile. + elements: dict + suboptions: + connect: + description: Connection of service provider and device value should be boolean + (eg true). + type: bool + connectDefaultGatewayOnWan: + description: Connect default gateway connect value as boolean (eg true). + type: bool + linkType: + description: Name of connection type(eg GigabitEthernet). + type: str + serviceProvider: + description: Name of the service provider(eg Airtel). + type: str + type: list + services: + description: Nfv Profile's services. + elements: dict + suboptions: + firewallMode: + description: Firewall mode details example (routed, transparent). + type: str + imageName: + description: Service image name (eg isrv-universalk9.16.12.01a.tar.gz). + type: str + profileType: + description: Profile type of service (eg ISRv-mini). + type: str + serviceName: + description: Name of the service (eg Router-1). + type: str + serviceType: + description: Service type (eg ISRV). + type: str + vNicMapping: + description: Nfv Profile's vNicMapping. + elements: dict + suboptions: + assignIpAddressToNetwork: + description: Assign ip address to network (eg true or false). + type: str + networkType: + description: Type of connection (eg wan, lan or internal). + type: str + type: list + type: list + vlanForL2: + description: Nfv Profile's vlanForL2. + elements: dict + suboptions: + vlanDescription: + description: Vlan description(eg Access 4018). + type: str + vlanId: + description: Vlan id (eg 4018). + type: int + vlanType: + description: Vlan type(eg Access or Trunk). + type: str + type: list + type: list + id: + description: Id path parameter. Id of the NFV profile to be updated. + type: str + name: + description: Name query parameter. Name of the profile to be updated. + type: str + profileName: + description: Name of the profile to create NFV profile. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Site Design CreateNFVProfile + description: Complete reference of the CreateNFVProfile API. + link: https://developer.cisco.com/docs/dna-center/#!create-nfv-profile +- name: Cisco DNA Center documentation for Site Design DeleteNFVProfile + description: Complete reference of the DeleteNFVProfile API. + link: https://developer.cisco.com/docs/dna-center/#!delete-nfv-profile +- name: Cisco DNA Center documentation for Site Design UpdateNFVProfile + description: Complete reference of the UpdateNFVProfile API. + link: https://developer.cisco.com/docs/dna-center/#!update-nfv-profile +notes: + - SDK Method used are + site_design.SiteDesign.create_nfv_profile, + site_design.SiteDesign.delete_nfv_profile, + site_design.SiteDesign.update_nfv_profile, + + - Paths used are + post /dna/intent/api/v1/nfv/network-profile, + delete /dna/intent/api/v1/nfv/network-profile/{id}, + put /dna/intent/api/v1/nfv/network-profile/{id}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.nfv_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + device: + - customNetworks: + - connectionType: string + networkName: string + servicesToConnect: + - serviceName: string + vlanId: 0 + vlanMode: string + customTemplate: + - deviceType: string + template: string + templateType: string + deviceTag: string + deviceType: string + directInternetAccessForFirewall: true + serviceProviderProfile: + - connect: true + connectDefaultGatewayOnWan: true + linkType: string + serviceProvider: string + services: + - firewallMode: string + imageName: string + profileType: string + serviceName: string + serviceType: string + vNicMapping: + - assignIpAddressToNetwork: string + networkType: string + vlanForL2: + - vlanDescription: string + vlanId: 0 + vlanType: string + profileName: string + +- name: Update by id + cisco.dnac.nfv_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + device: + - currentDeviceTag: string + customNetworks: + - connectionType: string + networkName: string + servicesToConnect: + - serviceName: string + vlanId: 0 + vlanMode: string + customTemplate: + - deviceType: string + template: string + templateType: string + deviceTag: string + directInternetAccessForFirewall: true + services: + - firewallMode: string + imageName: string + profileType: string + serviceName: string + serviceType: string + vNicMapping: + - assignIpAddressToNetwork: string + networkType: string + vlanForL2: + - vlanDescription: string + vlanId: 0 + vlanType: string + id: string + name: string + +- name: Delete by id + cisco.dnac.nfv_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + name: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/nfv_profile_info.py b/ansible_collections/cisco/dnac/plugins/modules/nfv_profile_info.py new file mode 100644 index 00000000..b972cea3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/nfv_profile_info.py @@ -0,0 +1,144 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: nfv_profile_info +short_description: Information module for Nfv Profile +description: +- Get Nfv Profile by id. +- API to get NFV network profile. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. ID of network profile to retrieve. + type: str + offset: + description: + - Offset query parameter. Offset/starting row. + type: str + limit: + description: + - Limit query parameter. Number of profile to be retrieved. + type: str + name: + description: + - Name query parameter. Name of network profile to be retrieved. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Site Design GetNFVProfile + description: Complete reference of the GetNFVProfile API. + link: https://developer.cisco.com/docs/dna-center/#!get-nfv-profile +notes: + - SDK Method used are + site_design.SiteDesign.get_nfv_profile, + + - Paths used are + get /dna/intent/api/v1/nfv/network-profile/{id}, + +""" + +EXAMPLES = r""" +- name: Get Nfv Profile by id + cisco.dnac.nfv_profile_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: string + limit: string + name: string + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "profileName": "string", + "id": "string", + "device": [ + { + "deviceType": "string", + "deviceTag": "string", + "serviceProviderProfile": [ + { + "linkType": "string", + "connect": true, + "connectDefaultGatewayOnWan": true, + "serviceProvider": "string" + } + ], + "directInternetAccessForFirewall": true, + "services": [ + { + "serviceType": "string", + "profileType": "string", + "serviceName": "string", + "imageName": "string", + "vNicMapping": [ + { + "networkType": "string", + "assignIpAddressToNetwork": true + } + ], + "firewallMode": "string" + } + ], + "customNetworks": [ + { + "networkName": "string", + "servicesToConnect": [ + { + "serviceName": "string" + } + ], + "connectionType": "string", + "vlanMode": "string", + "vlanId": "string" + } + ], + "vlanForL2": [ + { + "vlanType": "string", + "vlanId": "string", + "vlanDescription": "string" + } + ], + "customTemplate": [ + { + "deviceType": "string", + "template": "string", + "templateType": "string" + } + ] + } + ] + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/nfv_provision.py b/ansible_collections/cisco/dnac/plugins/modules/nfv_provision.py new file mode 100644 index 00000000..23f4269f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/nfv_provision.py @@ -0,0 +1,521 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: nfv_provision +short_description: Resource module for Nfv Provision +description: +- Manage operation create of the resource Nfv Provision. +- Design and Provision single/multi NFV device with given site/area/building/floor . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + provisioning: + description: Nfv Provision's provisioning. + elements: dict + suboptions: + device: + description: Nfv Provision's device. + elements: dict + suboptions: + customNetworks: + description: Nfv Provision's customNetworks. + elements: dict + suboptions: + ipAddressPool: + description: IP address pool of sub pool (eg 175.175.140.1). + type: str + name: + description: Name of custom network (eg cust-1). + type: str + port: + description: Port for custom network (eg 443). + type: str + type: list + deviceSerialNumber: + description: Serial number of device (eg FGL210710QY). + type: str + ip: + description: IP address of the device (eg 172.20.126.90). + type: str + serviceProviders: + description: Nfv Provision's serviceProviders. + elements: dict + suboptions: + serviceProvider: + description: Name of the service provider (eg Airtel). + type: str + wanInterface: + description: Nfv Provision's wanInterface. + suboptions: + bandwidth: + description: Bandwidth limit (eg 100). + type: str + gateway: + description: Gateway (eg 175.175.190.1). + type: str + interfaceName: + description: Name of the interface (eg GE0-0). + type: str + ipAddress: + description: IP address (eg 175.175.190.205). + type: str + subnetmask: + description: Subnet mask (eg 255.255.255.0). + type: str + type: dict + type: list + services: + description: Nfv Provision's services. + elements: dict + suboptions: + adminPasswordHash: + description: Admin password hash. + type: str + centralManagerIP: + description: WAAS Package needs to be installed to populate Central + Manager IP automatically. + type: str + centralRegistrationKey: + description: Central registration key. + type: str + commonKey: + description: Common key. + type: str + disk: + description: Name of disk type (eg internal). + type: str + mode: + description: Mode of firewall (eg transparent). + type: str + systemIp: + description: System IP. + type: str + type: + description: Type of service (eg ISR). + type: str + type: list + subPools: + description: Nfv Provision's subPools. + elements: dict + suboptions: + gateway: + description: IP address for gate way (eg 175.175.140.1). + type: str + ipSubnet: + description: IP pool cidir (eg 175.175.140.0). + type: str + name: + description: Name of the ip sub pool (eg; Lan-65). + type: str + parentPoolName: + description: Name of parent pool (global pool name). + type: str + type: + description: Tyep of ip sub pool (eg Lan). + type: str + type: list + tagName: + description: Name of device tag (eg dev1). + type: str + templateParam: + description: Nfv Provision's templateParam. + suboptions: + asav: + description: Nfv Provision's asav. + suboptions: + var1: + description: Variable for asav template (eg "test" "Hello asav"). + type: str + type: dict + nfvis: + description: Nfv Provision's nfvis. + suboptions: + var1: + description: Variable for nfvis template (eg "test" "Hello nfvis"). + type: str + type: dict + type: dict + vlan: + description: Nfv Provision's vlan. + elements: dict + suboptions: + id: + description: Vlan id(e .4018). + type: str + interfaces: + description: Interface (eg GigabitEathernet1/0). + type: str + network: + description: Network name to connect (eg lan-net). + type: str + type: + description: Vlan type(eg. Access or Trunk). + type: str + type: list + type: list + site: + description: Nfv Provision's site. + suboptions: + area: + description: Nfv Provision's area. + suboptions: + name: + description: Name of the area (eg Area1). + type: str + parentName: + description: Parent name of the area to be created. + type: str + type: dict + building: + description: Nfv Provision's building. + suboptions: + address: + description: Address of the building to be created. + type: str + latitude: + description: Latitude coordinate of the building (eg 37.338). + type: int + longitude: + description: Longitude coordinate of the building (eg -121.832). + type: int + name: + description: Name of the building (eg building1). + type: str + parentName: + description: Address of the building to be created. + type: str + type: dict + floor: + description: Nfv Provision's floor. + suboptions: + height: + description: Height of the floor (eg 15). + type: int + length: + description: Length of the floor (eg 100). + type: int + name: + description: Name of the floor (eg floor-1). + type: str + parentName: + description: Parent name of the floor to be created. + type: str + rfModel: + description: Type of floor (eg Cubes And Walled Offices). + type: str + width: + description: Width of the floor (eg 100). + type: int + type: dict + siteProfileName: + description: Name of site profile to be provision with device. + type: str + type: dict + type: list + siteProfile: + description: Nfv Provision's siteProfile. + elements: dict + suboptions: + device: + description: Nfv Provision's device. + elements: dict + suboptions: + customNetworks: + description: Nfv Provision's customNetworks. + elements: dict + suboptions: + connectionType: + description: Type of network connection from custom network (eg lan). + type: str + name: + description: Name of custom network (eg cust-1). + type: str + networkMode: + description: Network mode (eg Access or Trunk). + type: str + servicesToConnect: + description: Nfv Provision's servicesToConnect. + elements: dict + suboptions: + service: + description: Name of service to be connected to the custom network + (eg router-1). + type: str + type: list + vlan: + description: Vlan id for the custom network(eg 4000). + type: str + type: list + customServices: + description: Nfv Provision's customServices. + elements: dict + suboptions: + applicationType: + description: Application type of custom service (eg LINUX). + type: str + imageName: + description: Image name of custom service (eg redhat7.tar.gz.tar.gz). + type: str + name: + description: Name of custom service (eg LINUX-1). + type: str + profile: + description: Profile type of service (eg rhel7-medium). + type: str + topology: + description: Nfv Provision's topology. + suboptions: + assignIp: + description: Assign ip to network (eg true). + type: str + name: + description: Name of connection from custom service(eg wan-net). + type: str + type: + description: Type of connection from custom service (eg wan, lan + or internal). + type: str + type: dict + type: list + customTemplate: + description: Nfv Provision's customTemplate. + elements: dict + suboptions: + deviceType: + description: Type of the device(eg NFVIS). + type: str + template: + description: Name of the template(eg NFVIS template). + type: str + type: list + deviceType: + description: Name of the device used in creating nfv profile(eg ENCS5400). + type: str + dia: + description: Direct internet access value should be boolean (eg false). + type: bool + serviceProviders: + description: Nfv Provision's serviceProviders. + elements: dict + suboptions: + connect: + description: Connection of service provider and device value should + be boolean (eg true). + type: bool + defaultGateway: + description: Default gateway connect value as boolean (eg true). + type: bool + linkType: + description: Name of connection type(eg GigabitEthernet). + type: str + serviceProvider: + description: Name of the service provider(eg Airtel). + type: str + type: list + services: + description: Nfv Provision's services. + elements: dict + suboptions: + imageName: + description: Name of image (eg isrv-universalk9.16.06.02.tar.gz). + type: str + mode: + description: Mode of firewall (eg routed, transparent). + type: str + name: + description: Name of the service (eg isrv). + type: str + profile: + description: Profile type of service (eg ISRv-mini). + type: str + topology: + description: Nfv Provision's topology. + suboptions: + assignIp: + description: Assign ip address to network (eg true). + type: str + name: + description: Name of connection (eg wan-net). + type: str + type: + description: Type of connection (eg wan, lan or internal). + type: str + type: dict + type: + description: Service type (eg ISRV). + type: str + type: list + tagName: + description: Device Tag name(eg dev1). + type: str + vlan: + description: Nfv Provision's vlan. + elements: dict + suboptions: + id: + description: Vlan id(eg.4018). + type: str + type: + description: Vlan type(eg. Access or Trunk). + type: str + type: list + type: list + siteProfileName: + description: Name of the profile to create site profile profile( eg profile-1). + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Site Design ProvisionNFV + description: Complete reference of the ProvisionNFV API. + link: https://developer.cisco.com/docs/dna-center/#!provision-nfv +notes: + - SDK Method used are + site_design.SiteDesign.provision_nfv, + + - Paths used are + post /dna/intent/api/v1/business/nfv, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.nfv_provision: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + provisioning: + - device: + - customNetworks: + - ipAddressPool: string + name: string + port: string + deviceSerialNumber: string + ip: string + serviceProviders: + - serviceProvider: string + wanInterface: + bandwidth: string + gateway: string + interfaceName: string + ipAddress: string + subnetmask: string + services: + - adminPasswordHash: string + centralManagerIP: string + centralRegistrationKey: string + commonKey: string + disk: string + mode: string + systemIp: string + type: string + subPools: + - gateway: string + ipSubnet: string + name: string + parentPoolName: string + type: string + tagName: string + templateParam: + asav: + var1: string + nfvis: + var1: string + vlan: + - id: string + interfaces: string + network: string + type: string + site: + area: + name: string + parentName: string + building: + address: string + latitude: 0 + longitude: 0 + name: string + parentName: string + floor: + height: 0 + length: 0 + name: string + parentName: string + rfModel: string + width: 0 + siteProfileName: string + siteProfile: + - device: + - customNetworks: + - connectionType: string + name: string + networkMode: string + servicesToConnect: + - service: string + vlan: string + customServices: + - applicationType: string + imageName: string + name: string + profile: string + topology: + assignIp: string + name: string + type: string + customTemplate: + - deviceType: string + template: string + deviceType: string + dia: true + serviceProviders: + - connect: true + defaultGateway: true + linkType: string + serviceProvider: string + services: + - imageName: string + mode: string + name: string + profile: string + topology: + assignIp: string + name: string + type: string + type: string + tagName: string + vlan: + - id: string + type: string + siteProfileName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/nfv_provision_detail_info.py b/ansible_collections/cisco/dnac/plugins/modules/nfv_provision_detail_info.py new file mode 100644 index 00000000..8ad7287a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/nfv_provision_detail_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: nfv_provision_detail_info +short_description: Information module for Nfv Provision Detail +description: +- Get all Nfv Provision Detail. +- Returns provisioning device information for the specified IP address. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceIp: + description: + - DeviceIp query parameter. Device to which the provisioning detail has to be retrieved. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Site Design GetDeviceDetailsByIP + description: Complete reference of the GetDeviceDetailsByIP API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-details-by-ip +notes: + - SDK Method used are + site_design.SiteDesign.get_device_details_by_ip, + + - Paths used are + get /dna/intent/api/v1/business/nfv/provisioningDetail, + +""" + +EXAMPLES = r""" +- name: Get all Nfv Provision Detail + cisco.dnac.nfv_provision_detail_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceIp: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "startTime": "string", + "endTime": "string", + "duration": "string", + "statusMessage": "string", + "status": "string", + "taskNodes": [ + { + "startTime": "string", + "endTime": "string", + "duration": "string", + "status": "string", + "nextTask": "string", + "name": "string", + "target": "string", + "statusMessage": "string", + "payload": "string", + "provisionedNames": {}, + "errorPayload": {}, + "parentTask": {}, + "cliTemplateUserMessageDTO": {}, + "stepRan": "string" + } + ], + "topology": "string", + "beginStep": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/nfv_provision_details.py b/ansible_collections/cisco/dnac/plugins/modules/nfv_provision_details.py new file mode 100644 index 00000000..6f8bc730 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/nfv_provision_details.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: nfv_provision_details +short_description: Resource module for Nfv Provision Details +description: +- Manage operation create of the resource Nfv Provision Details. +- Checks the provisioning detail of an ENCS device including log information. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + device_ip: + description: Device Ip. + type: str + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Site Design NFVProvisioningDetail + description: Complete reference of the NFVProvisioningDetail API. + link: https://developer.cisco.com/docs/dna-center/#!n-fv-provisioning-detail +notes: + - SDK Method used are + site_design.SiteDesign.nfv_provisioning_detail, + + - Paths used are + post /dna/intent/api/v1/nfv-provision-detail, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.nfv_provision_details: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + device_ip: string + headers: '{{my_headers | from_json}}' + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/path_trace.py b/ansible_collections/cisco/dnac/plugins/modules/path_trace.py new file mode 100644 index 00000000..878b2e84 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/path_trace.py @@ -0,0 +1,120 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: path_trace +short_description: Resource module for Path Trace +description: +- Manage operations create and delete of the resource Path Trace. +- > + Initiates a new flow analysis with periodic refresh and stat collection options. Returns a request id and a task + id to get results and follow progress. +- Deletes a flow analysis request by its id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + controlPath: + description: ControlPath flag. + type: bool + destIP: + description: Path Trace's destIP. + type: str + destPort: + description: Path Trace's destPort. + type: str + flowAnalysisId: + description: FlowAnalysisId path parameter. Flow analysis request id. + type: str + inclusions: + description: Path Trace's inclusions. + elements: str + type: list + periodicRefresh: + description: PeriodicRefresh flag. + type: bool + protocol: + description: Path Trace's protocol. + type: str + sourceIP: + description: Path Trace's sourceIP. + type: str + sourcePort: + description: Path Trace's sourcePort. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Path Trace InitiateANewPathtrace + description: Complete reference of the InitiateANewPathtrace API. + link: https://developer.cisco.com/docs/dna-center/#!initiate-a-new-pathtrace +- name: Cisco DNA Center documentation for Path Trace DeletesPathtraceById + description: Complete reference of the DeletesPathtraceById API. + link: https://developer.cisco.com/docs/dna-center/#!deletes-pathtrace-by-id +notes: + - SDK Method used are + path_trace.PathTrace.deletes_pathtrace_by_id, + path_trace.PathTrace.initiate_a_new_pathtrace, + + - Paths used are + post /dna/intent/api/v1/flow-analysis, + delete /dna/intent/api/v1/flow-analysis/{flowAnalysisId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.path_trace: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + controlPath: true + destIP: string + destPort: string + inclusions: + - string + periodicRefresh: true + protocol: string + sourceIP: string + sourcePort: string + +- name: Delete by id + cisco.dnac.path_trace: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + flowAnalysisId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "flowAnalysisId": "string", + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/path_trace_info.py b/ansible_collections/cisco/dnac/plugins/modules/path_trace_info.py new file mode 100644 index 00000000..e7bdc469 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/path_trace_info.py @@ -0,0 +1,1076 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: path_trace_info +short_description: Information module for Path Trace +description: +- Get all Path Trace. +- Get Path Trace by id. +- Returns a summary of all flow analyses stored. Results can be filtered by specified parameters. +- Returns result of a previously requested flow analysis by its Flow Analysis id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + periodicRefresh: + description: + - PeriodicRefresh query parameter. Is analysis periodically refreshed?. + type: bool + sourceIP: + description: + - SourceIP query parameter. Source IP address. + type: str + destIP: + description: + - DestIP query parameter. Destination IP adress. + type: str + sourcePort: + description: + - SourcePort query parameter. Source port. + type: str + destPort: + description: + - DestPort query parameter. Destination port. + type: str + gtCreateTime: + description: + - GtCreateTime query parameter. Analyses requested after this time. + type: str + ltCreateTime: + description: + - LtCreateTime query parameter. Analyses requested before this time. + type: str + protocol: + description: + - Protocol query parameter. + type: str + status: + description: + - Status query parameter. + type: str + taskId: + description: + - TaskId query parameter. Task ID. + type: str + lastUpdateTime: + description: + - LastUpdateTime query parameter. Last update time. + type: str + limit: + description: + - Limit query parameter. Number of resources returned. + type: str + offset: + description: + - Offset query parameter. Start index of resources returned (1-based). + type: str + order: + description: + - Order query parameter. Order by this field. + type: str + sortBy: + description: + - SortBy query parameter. Sort by this field. + type: str + flowAnalysisId: + description: + - FlowAnalysisId path parameter. Flow analysis request id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Path Trace RetrievesPreviousPathtrace + description: Complete reference of the RetrievesPreviousPathtrace API. + link: https://developer.cisco.com/docs/dna-center/#!retrieves-previous-pathtrace +- name: Cisco DNA Center documentation for Path Trace RetrivesAllPreviousPathtracesSummary + description: Complete reference of the RetrivesAllPreviousPathtracesSummary API. + link: https://developer.cisco.com/docs/dna-center/#!retrives-all-previous-pathtraces-summary +notes: + - SDK Method used are + path_trace.PathTrace.retrieves_previous_pathtrace, + path_trace.PathTrace.retrives_all_previous_pathtraces_summary, + + - Paths used are + get /dna/intent/api/v1/flow-analysis, + get /dna/intent/api/v1/flow-analysis/{flowAnalysisId}, + +""" + +EXAMPLES = r""" +- name: Get all Path Trace + cisco.dnac.path_trace_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + periodicRefresh: True + sourceIP: string + destIP: string + sourcePort: string + destPort: string + gtCreateTime: string + ltCreateTime: string + protocol: string + status: string + taskId: string + lastUpdateTime: string + limit: string + offset: string + order: string + sortBy: string + register: result + +- name: Get Path Trace by id + cisco.dnac.path_trace_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + flowAnalysisId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "detailedStatus": { + "aclTraceCalculation": "string", + "aclTraceCalculationFailureReason": "string" + }, + "lastUpdate": "string", + "networkElements": [ + { + "accuracyList": [ + { + "percent": 0, + "reason": "string" + } + ], + "detailedStatus": { + "aclTraceCalculation": "string", + "aclTraceCalculationFailureReason": "string" + }, + "deviceStatistics": { + "cpuStatistics": { + "fiveMinUsageInPercentage": 0, + "fiveSecsUsageInPercentage": 0, + "oneMinUsageInPercentage": 0, + "refreshedAt": 0 + }, + "memoryStatistics": { + "memoryUsage": 0, + "refreshedAt": 0, + "totalMemory": 0 + } + }, + "deviceStatsCollection": "string", + "deviceStatsCollectionFailureReason": "string", + "egressPhysicalInterface": { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + }, + "egressVirtualInterface": { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + }, + "flexConnect": { + "authentication": "string", + "dataSwitching": "string", + "egressAclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "ingressAclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "wirelessLanControllerId": "string", + "wirelessLanControllerName": "string" + }, + "id": "string", + "ingressPhysicalInterface": { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + }, + "ingressVirtualInterface": { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + }, + "ip": "string", + "linkInformationSource": "string", + "name": "string", + "perfMonCollection": "string", + "perfMonCollectionFailureReason": "string", + "perfMonStatistics": [ + { + "byteRate": 0, + "destIpAddress": "string", + "destPort": "string", + "inputInterface": "string", + "ipv4DSCP": "string", + "ipv4TTL": 0, + "outputInterface": "string", + "packetBytes": 0, + "packetCount": 0, + "packetLoss": 0, + "packetLossPercentage": 0, + "protocol": "string", + "refreshedAt": 0, + "rtpJitterMax": 0, + "rtpJitterMean": 0, + "rtpJitterMin": 0, + "sourceIpAddress": "string", + "sourcePort": "string" + } + ], + "role": "string", + "ssid": "string", + "tunnels": [ + "string" + ], + "type": "string", + "wlanId": "string" + } + ], + "networkElementsInfo": [ + { + "accuracyList": [ + { + "percent": 0, + "reason": "string" + } + ], + "detailedStatus": { + "aclTraceCalculation": "string", + "aclTraceCalculationFailureReason": "string" + }, + "deviceStatistics": { + "cpuStatistics": { + "fiveMinUsageInPercentage": 0, + "fiveSecsUsageInPercentage": 0, + "oneMinUsageInPercentage": 0, + "refreshedAt": 0 + }, + "memoryStatistics": { + "memoryUsage": 0, + "refreshedAt": 0, + "totalMemory": 0 + } + }, + "deviceStatsCollection": "string", + "deviceStatsCollectionFailureReason": "string", + "egressInterface": { + "physicalInterface": { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + }, + "virtualInterface": [ + { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + } + ] + }, + "flexConnect": { + "authentication": "string", + "dataSwitching": "string", + "egressAclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "ingressAclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "wirelessLanControllerId": "string", + "wirelessLanControllerName": "string" + }, + "id": "string", + "ingressInterface": { + "physicalInterface": { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + }, + "virtualInterface": [ + { + "aclAnalysis": { + "aclName": "string", + "matchingAces": [ + { + "ace": "string", + "matchingPorts": [ + { + "ports": [ + { + "destPorts": [ + "string" + ], + "sourcePorts": [ + "string" + ] + } + ], + "protocol": "string" + } + ], + "result": "string" + } + ], + "result": "string" + }, + "id": "string", + "interfaceStatistics": { + "adminStatus": "string", + "inputPackets": 0, + "inputQueueCount": 0, + "inputQueueDrops": 0, + "inputQueueFlushes": 0, + "inputQueueMaxDepth": 0, + "inputRatebps": 0, + "operationalStatus": "string", + "outputDrop": 0, + "outputPackets": 0, + "outputQueueCount": 0, + "outputQueueDepth": 0, + "outputRatebps": 0, + "refreshedAt": 0 + }, + "interfaceStatsCollection": "string", + "interfaceStatsCollectionFailureReason": "string", + "name": "string", + "pathOverlayInfo": [ + { + "controlPlane": "string", + "dataPacketEncapsulation": "string", + "destIp": "string", + "destPort": "string", + "protocol": "string", + "sourceIp": "string", + "sourcePort": "string", + "vxlanInfo": { + "dscp": "string", + "vnid": "string" + } + } + ], + "qosStatistics": [ + { + "classMapName": "string", + "dropRate": 0, + "numBytes": 0, + "numPackets": 0, + "offeredRate": 0, + "queueBandwidthbps": "string", + "queueDepth": 0, + "queueNoBufferDrops": 0, + "queueTotalDrops": 0, + "refreshedAt": 0 + } + ], + "qosStatsCollection": "string", + "qosStatsCollectionFailureReason": "string", + "usedVlan": "string", + "vrfName": "string" + } + ] + }, + "ip": "string", + "linkInformationSource": "string", + "name": "string", + "perfMonCollection": "string", + "perfMonCollectionFailureReason": "string", + "perfMonitorStatistics": [ + { + "byteRate": 0, + "destIpAddress": "string", + "destPort": "string", + "inputInterface": "string", + "ipv4DSCP": "string", + "ipv4TTL": 0, + "outputInterface": "string", + "packetBytes": 0, + "packetCount": 0, + "packetLoss": 0, + "packetLossPercentage": 0, + "protocol": "string", + "refreshedAt": 0, + "rtpJitterMax": 0, + "rtpJitterMean": 0, + "rtpJitterMin": 0, + "sourceIpAddress": "string", + "sourcePort": "string" + } + ], + "role": "string", + "ssid": "string", + "tunnels": [ + "string" + ], + "type": "string", + "wlanId": "string" + } + ], + "properties": [ + "string" + ], + "request": { + "controlPath": true, + "createTime": 0, + "destIP": "string", + "destPort": "string", + "failureReason": "string", + "id": "string", + "inclusions": [ + "string" + ], + "lastUpdateTime": 0, + "periodicRefresh": true, + "protocol": "string", + "sourceIP": "string", + "sourcePort": "string", + "status": "string" + } + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/planned_access_points_info.py b/ansible_collections/cisco/dnac/plugins/modules/planned_access_points_info.py new file mode 100644 index 00000000..df323c57 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/planned_access_points_info.py @@ -0,0 +1,129 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: planned_access_points_info +short_description: Information module for Planned Access Points +description: +- Get all Planned Access Points. +- Provides a list of Planned Access Points for the Floor it is requested for. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + floorId: + description: + - FloorId path parameter. Floor Id. + type: str + limit: + description: + - Limit query parameter. + type: int + offset: + description: + - Offset query parameter. + type: int + radios: + description: + - Radios query parameter. Inlcude planned radio details. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetPlannedAccessPointsForFloor + description: Complete reference of the GetPlannedAccessPointsForFloor API. + link: https://developer.cisco.com/docs/dna-center/#!get-planned-access-points-for-floor +notes: + - SDK Method used are + devices.Devices.get_planned_access_points_for_floor, + + - Paths used are + get /dna/intent/api/v1/floors/{floorId}/planned-access-points, + +""" + +EXAMPLES = r""" +- name: Get all Planned Access Points + cisco.dnac.planned_access_points_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + limit: 0 + offset: 0 + radios: True + floorId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "attributes": { + "id": 0, + "instanceUuid": "string", + "name": "string", + "typeString": "string", + "domain": "string", + "heirarchyName": "string", + "source": "string", + "createDate": 0, + "macaddress": {} + }, + "location": {}, + "position": { + "x": 0, + "y": 0, + "z": 0 + }, + "radioCount": 0, + "radios": [ + { + "attributes": { + "id": 0, + "instanceUuid": "string", + "slotId": 0, + "ifTypeString": "string", + "ifTypeSubband": "string", + "channel": {}, + "channelString": {}, + "ifMode": "string" + }, + "antenna": { + "name": "string", + "type": "string", + "mode": "string", + "azimuthAngle": 0, + "elevationAngle": 0, + "gain": 0 + }, + "isSensor": true + } + ], + "isSensor": true + } + ], + "version": 0, + "total": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/platform_nodes_configuration_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/platform_nodes_configuration_summary_info.py new file mode 100644 index 00000000..9e4bad79 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/platform_nodes_configuration_summary_info.py @@ -0,0 +1,118 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: platform_nodes_configuration_summary_info +short_description: Information module for Platform Nodes Configuration Summary +description: +- Get all Platform Nodes Configuration Summary. +- > + Provides details about the current Cisco DNA Center node configuration, such as API version, node name, NTP + server, intracluster link, LACP mode, network static routes, DNS server, subnet mask, host IP, default gateway, + and interface information. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Platform Configuration CiscoDNACenterNodesConfigurationSummary + description: Complete reference of the CiscoDNACenterNodesConfigurationSummary API. + link: https://developer.cisco.com/docs/dna-center/#!cisco-dna-center-nodes-configuration-summary +notes: + - SDK Method used are + platform_configuration.PlatformConfiguration.nodes_configuration_summary, + + - Paths used are + get /dna/intent/api/v1/nodes-config, + +""" + +EXAMPLES = r""" +- name: Get all Platform Nodes Configuration Summary + cisco.dnac.platform_nodes_configuration_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "nodes": [ + { + "ntp": { + "servers": [ + "string" + ] + }, + "network": [ + { + "intra_cluster_link": true, + "lacp_mode": true, + "inet": { + "routes": [ + {} + ], + "gateway": "string", + "dns_servers": [ + {} + ], + "netmask": "string", + "host_ip": "string" + }, + "interface": "string", + "inet6": { + "host_ip": "string", + "netmask": "string" + }, + "lacp_supported": true, + "slave": [ + "string" + ] + } + ], + "proxy": { + "https_proxy": "string", + "no_proxy": [ + "string" + ], + "https_proxy_username": "string", + "http_proxy": "string", + "https_proxy_password": "string" + }, + "platform": { + "vendor": "string", + "product": "string", + "serial": "string" + }, + "id": "string", + "name": "string" + } + ] + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/platform_release_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/platform_release_summary_info.py new file mode 100644 index 00000000..7af697e9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/platform_release_summary_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: platform_release_summary_info +short_description: Information module for Platform Release Summary +description: +- Get all Platform Release Summary. +- > + Provides information such as API version, mandatory core packages for installation or upgrade, optional packages, + Cisco DNA Center name and version, supported direct updates, and tenant ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Platform Configuration CiscoDNACenterReleaseSummary + description: Complete reference of the CiscoDNACenterReleaseSummary API. + link: https://developer.cisco.com/docs/dna-center/#!cisco-dna-center-release-summary +notes: + - SDK Method used are + platform_configuration.PlatformConfiguration.release_summary, + + - Paths used are + get /dna/intent/api/v1/dnac-release, + +""" + +EXAMPLES = r""" +- name: Get all Platform Release Summary + cisco.dnac.platform_release_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "corePackages": [ + "string" + ], + "packages": [ + "string" + ], + "name": "string", + "installedVersion": "string", + "systemVersion": "string", + "supportedDirectUpdates": [ + {} + ], + "tenantId": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device.py new file mode 100644 index 00000000..0f6a736a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device.py @@ -0,0 +1,1747 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device +short_description: Resource module for Pnp Device +description: +- Manage operations create, update and delete of the resource Pnp Device. +- Adds a device to the PnP database. +- Deletes specified device from PnP database. +- Updates device details specified by device id in PnP database. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + _id: + description: Pnp Device's _id. + type: str + deviceInfo: + description: Pnp Device's deviceInfo. + suboptions: + aaaCredentials: + description: Pnp Device's aaaCredentials. + suboptions: + password: + description: Pnp Device's password. + type: str + username: + description: Pnp Device's username. + type: str + type: dict + addedOn: + description: Pnp Device's addedOn. + type: int + addnMacAddrs: + description: Pnp Device's addnMacAddrs. + elements: str + type: list + agentType: + description: Pnp Device's agentType. + type: str + authStatus: + description: Pnp Device's authStatus. + type: str + authenticatedSudiSerialNo: + description: Pnp Device's authenticatedSudiSerialNo. + type: str + capabilitiesSupported: + description: Pnp Device's capabilitiesSupported. + elements: str + type: list + cmState: + description: Pnp Device's cmState. + type: str + description: + description: Pnp Device's description. + type: str + deviceSudiSerialNos: + description: Pnp Device's deviceSudiSerialNos. + elements: str + type: list + deviceType: + description: Pnp Device's deviceType. + type: str + featuresSupported: + description: Pnp Device's featuresSupported. + elements: str + type: list + fileSystemList: + description: Pnp Device's fileSystemList. + elements: dict + suboptions: + freespace: + description: Pnp Device's freespace. + type: int + name: + description: Pnp Device's name. + type: str + readable: + description: Readable flag. + type: bool + size: + description: Pnp Device's size. + type: int + type: + description: Pnp Device's type. + type: str + writeable: + description: Writeable flag. + type: bool + type: list + firstContact: + description: Pnp Device's firstContact. + type: int + hostname: + description: Pnp Device's hostname. + type: str + httpHeaders: + description: Pnp Device's httpHeaders. + elements: dict + suboptions: + key: + description: Pnp Device's key. + type: str + value: + description: Pnp Device's value. + type: str + type: list + imageFile: + description: Pnp Device's imageFile. + type: str + imageVersion: + description: Pnp Device's imageVersion. + type: str + ipInterfaces: + description: Pnp Device's ipInterfaces. + elements: dict + suboptions: + ipv4Address: + description: Pnp Device's ipv4Address. + type: dict + ipv6AddressList: + description: Pnp Device's ipv6AddressList. + elements: dict + type: list + macAddress: + description: Pnp Device's macAddress. + type: str + name: + description: Pnp Device's name. + type: str + status: + description: Pnp Device's status. + type: str + type: list + lastContact: + description: Pnp Device's lastContact. + type: int + lastSyncTime: + description: Pnp Device's lastSyncTime. + type: int + lastUpdateOn: + description: Pnp Device's lastUpdateOn. + type: int + location: + description: Pnp Device's location. + suboptions: + address: + description: Pnp Device's address. + type: str + altitude: + description: Pnp Device's altitude. + type: str + latitude: + description: Pnp Device's latitude. + type: str + longitude: + description: Pnp Device's longitude. + type: str + siteId: + description: Pnp Device's siteId. + type: str + type: dict + macAddress: + description: Pnp Device's macAddress. + type: str + mode: + description: Pnp Device's mode. + type: str + name: + description: Pnp Device's name. + type: str + neighborLinks: + description: Pnp Device's neighborLinks. + elements: dict + suboptions: + localInterfaceName: + description: Pnp Device's localInterfaceName. + type: str + localMacAddress: + description: Pnp Device's localMacAddress. + type: str + localShortInterfaceName: + description: Pnp Device's localShortInterfaceName. + type: str + remoteDeviceName: + description: Pnp Device's remoteDeviceName. + type: str + remoteInterfaceName: + description: Pnp Device's remoteInterfaceName. + type: str + remoteMacAddress: + description: Pnp Device's remoteMacAddress. + type: str + remotePlatform: + description: Pnp Device's remotePlatform. + type: str + remoteShortInterfaceName: + description: Pnp Device's remoteShortInterfaceName. + type: str + remoteVersion: + description: Pnp Device's remoteVersion. + type: str + type: list + onbState: + description: Pnp Device's onbState. + type: str + pid: + description: Pnp Device's pid. + type: str + pnpProfileList: + description: Pnp Device's pnpProfileList. + elements: dict + suboptions: + createdBy: + description: Pnp Device's createdBy. + type: str + discoveryCreated: + description: DiscoveryCreated flag. + type: bool + primaryEndpoint: + description: Pnp Device's primaryEndpoint. + suboptions: + certificate: + description: Pnp Device's certificate. + type: str + fqdn: + description: Pnp Device's fqdn. + type: str + ipv4Address: + description: Pnp Device's ipv4Address. + type: dict + ipv6Address: + description: Pnp Device's ipv6Address. + type: dict + port: + description: Pnp Device's port. + type: int + protocol: + description: Pnp Device's protocol. + type: str + type: dict + profileName: + description: Pnp Device's profileName. + type: str + secondaryEndpoint: + description: Pnp Device's secondaryEndpoint. + suboptions: + certificate: + description: Pnp Device's certificate. + type: str + fqdn: + description: Pnp Device's fqdn. + type: str + ipv4Address: + description: Pnp Device's ipv4Address. + type: dict + ipv6Address: + description: Pnp Device's ipv6Address. + type: dict + port: + description: Pnp Device's port. + type: int + protocol: + description: Pnp Device's protocol. + type: str + type: dict + type: list + populateInventory: + description: PopulateInventory flag. + type: bool + preWorkflowCliOuputs: + description: Pnp Device's preWorkflowCliOuputs. + elements: dict + suboptions: + cli: + description: Pnp Device's cli. + type: str + cliOutput: + description: Pnp Device's cliOutput. + type: str + type: list + projectId: + description: Pnp Device's projectId. + type: str + projectName: + description: Pnp Device's projectName. + type: str + reloadRequested: + description: ReloadRequested flag. + type: bool + serialNumber: + description: Pnp Device's serialNumber. + type: str + smartAccountId: + description: Pnp Device's smartAccountId. + type: str + source: + description: Pnp Device's source. + type: str + stack: + description: Stack flag. + type: bool + stackInfo: + description: Pnp Device's stackInfo. + suboptions: + isFullRing: + description: IsFullRing flag. + type: bool + stackMemberList: + description: Pnp Device's stackMemberList. + elements: dict + suboptions: + hardwareVersion: + description: Pnp Device's hardwareVersion. + type: str + licenseLevel: + description: Pnp Device's licenseLevel. + type: str + licenseType: + description: Pnp Device's licenseType. + type: str + macAddress: + description: Pnp Device's macAddress. + type: str + pid: + description: Pnp Device's pid. + type: str + priority: + description: Pnp Device's priority. + type: int + role: + description: Pnp Device's role. + type: str + serialNumber: + description: Pnp Device's serialNumber. + type: str + softwareVersion: + description: Pnp Device's softwareVersion. + type: str + stackNumber: + description: Pnp Device's stackNumber. + type: int + state: + description: Pnp Device's state. + type: str + sudiSerialNumber: + description: Pnp Device's sudiSerialNumber. + type: str + type: list + stackRingProtocol: + description: Pnp Device's stackRingProtocol. + type: str + supportsStackWorkflows: + description: SupportsStackWorkflows flag. + type: bool + totalMemberCount: + description: Pnp Device's totalMemberCount. + type: int + validLicenseLevels: + description: Pnp Device's validLicenseLevels. + elements: str + type: list + type: dict + state: + description: Pnp Device's state. + type: str + sudiRequired: + description: SudiRequired flag. + type: bool + tags: + description: Pnp Device's tags. + type: dict + userSudiSerialNos: + description: Pnp Device's userSudiSerialNos. + elements: str + type: list + virtualAccountId: + description: Pnp Device's virtualAccountId. + type: str + workflowId: + description: Pnp Device's workflowId. + type: str + workflowName: + description: Pnp Device's workflowName. + type: str + type: dict + id: + description: Id path parameter. + type: str + runSummaryList: + description: Pnp Device's runSummaryList. + elements: dict + suboptions: + details: + description: Pnp Device's details. + type: str + errorFlag: + description: ErrorFlag flag. + type: bool + historyTaskInfo: + description: Pnp Device's historyTaskInfo. + suboptions: + addnDetails: + description: Pnp Device's addnDetails. + elements: dict + suboptions: + key: + description: Pnp Device's key. + type: str + value: + description: Pnp Device's value. + type: str + type: list + name: + description: Pnp Device's name. + type: str + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: + description: Pnp Device's type. + type: str + workItemList: + description: Pnp Device's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device's command. + type: str + endTime: + description: Pnp Device's endTime. + type: int + outputStr: + description: Pnp Device's outputStr. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: list + type: dict + timestamp: + description: Pnp Device's timestamp. + type: int + type: list + systemResetWorkflow: + description: Pnp Device's systemResetWorkflow. + suboptions: + _id: + description: Pnp Device's _id. + type: str + addToInventory: + description: AddToInventory flag. + type: bool + addedOn: + description: Pnp Device's addedOn. + type: int + configId: + description: Pnp Device's configId. + type: str + currTaskIdx: + description: Pnp Device's currTaskIdx. + type: int + description: + description: Pnp Device's description. + type: str + endTime: + description: Pnp Device's endTime. + type: int + execTime: + description: Pnp Device's execTime. + type: int + imageId: + description: Pnp Device's imageId. + type: str + instanceType: + description: Pnp Device's instanceType. + type: str + lastupdateOn: + description: Pnp Device's lastupdateOn. + type: int + name: + description: Pnp Device's name. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + tasks: + description: Pnp Device's tasks. + elements: dict + suboptions: + currWorkItemIdx: + description: Pnp Device's currWorkItemIdx. + type: int + endTime: + description: Pnp Device's endTime. + type: int + name: + description: Pnp Device's name. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + taskSeqNo: + description: Pnp Device's taskSeqNo. + type: int + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: + description: Pnp Device's type. + type: str + workItemList: + description: Pnp Device's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device's command. + type: str + endTime: + description: Pnp Device's endTime. + type: int + outputStr: + description: Pnp Device's outputStr. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: list + type: list + tenantId: + description: Pnp Device's tenantId. + type: str + type: + description: Pnp Device's type. + type: str + useState: + description: Pnp Device's useState. + type: str + version: + description: Pnp Device's version. + type: int + type: dict + systemWorkflow: + description: Pnp Device's systemWorkflow. + suboptions: + _id: + description: Pnp Device's _id. + type: str + addToInventory: + description: AddToInventory flag. + type: bool + addedOn: + description: Pnp Device's addedOn. + type: int + configId: + description: Pnp Device's configId. + type: str + currTaskIdx: + description: Pnp Device's currTaskIdx. + type: int + description: + description: Pnp Device's description. + type: str + endTime: + description: Pnp Device's endTime. + type: int + execTime: + description: Pnp Device's execTime. + type: int + imageId: + description: Pnp Device's imageId. + type: str + instanceType: + description: Pnp Device's instanceType. + type: str + lastupdateOn: + description: Pnp Device's lastupdateOn. + type: int + name: + description: Pnp Device's name. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + tasks: + description: Pnp Device's tasks. + elements: dict + suboptions: + currWorkItemIdx: + description: Pnp Device's currWorkItemIdx. + type: int + endTime: + description: Pnp Device's endTime. + type: int + name: + description: Pnp Device's name. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + taskSeqNo: + description: Pnp Device's taskSeqNo. + type: int + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: + description: Pnp Device's type. + type: str + workItemList: + description: Pnp Device's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device's command. + type: str + endTime: + description: Pnp Device's endTime. + type: int + outputStr: + description: Pnp Device's outputStr. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: list + type: list + tenantId: + description: Pnp Device's tenantId. + type: str + type: + description: Pnp Device's type. + type: str + useState: + description: Pnp Device's useState. + type: str + version: + description: Pnp Device's version. + type: int + type: dict + tenantId: + description: Pnp Device's tenantId. + type: str + version: + description: Pnp Device's version. + type: int + workflow: + description: Pnp Device's workflow. + suboptions: + _id: + description: Pnp Device's _id. + type: str + addToInventory: + description: AddToInventory flag. + type: bool + addedOn: + description: Pnp Device's addedOn. + type: int + configId: + description: Pnp Device's configId. + type: str + currTaskIdx: + description: Pnp Device's currTaskIdx. + type: int + description: + description: Pnp Device's description. + type: str + endTime: + description: Pnp Device's endTime. + type: int + execTime: + description: Pnp Device's execTime. + type: int + imageId: + description: Pnp Device's imageId. + type: str + instanceType: + description: Pnp Device's instanceType. + type: str + lastupdateOn: + description: Pnp Device's lastupdateOn. + type: int + name: + description: Pnp Device's name. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + tasks: + description: Pnp Device's tasks. + elements: dict + suboptions: + currWorkItemIdx: + description: Pnp Device's currWorkItemIdx. + type: int + endTime: + description: Pnp Device's endTime. + type: int + name: + description: Pnp Device's name. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + taskSeqNo: + description: Pnp Device's taskSeqNo. + type: int + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: + description: Pnp Device's type. + type: str + workItemList: + description: Pnp Device's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device's command. + type: str + endTime: + description: Pnp Device's endTime. + type: int + outputStr: + description: Pnp Device's outputStr. + type: str + startTime: + description: Pnp Device's startTime. + type: int + state: + description: Pnp Device's state. + type: str + timeTaken: + description: Pnp Device's timeTaken. + type: int + type: list + type: list + tenantId: + description: Pnp Device's tenantId. + type: str + type: + description: Pnp Device's type. + type: str + useState: + description: Pnp Device's useState. + type: str + version: + description: Pnp Device's version. + type: int + type: dict + workflowParameters: + description: Pnp Device's workflowParameters. + suboptions: + configList: + description: Pnp Device's configList. + elements: dict + suboptions: + configId: + description: Pnp Device's configId. + type: str + configParameters: + description: Pnp Device's configParameters. + elements: dict + suboptions: + key: + description: Pnp Device's key. + type: str + value: + description: Pnp Device's value. + type: str + type: list + type: list + licenseLevel: + description: Pnp Device's licenseLevel. + type: str + licenseType: + description: Pnp Device's licenseType. + type: str + topOfStackSerialNumber: + description: Pnp Device's topOfStackSerialNumber. + type: str + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) AddDevice + description: Complete reference of the AddDevice API. + link: https://developer.cisco.com/docs/dna-center/#!add-device-2 +- name: Cisco DNA Center documentation for Device Onboarding (PnP) DeleteDeviceByIdFromPnP + description: Complete reference of the DeleteDeviceByIdFromPnP API. + link: https://developer.cisco.com/docs/dna-center/#!delete-device-by-id-from-pn-p +- name: Cisco DNA Center documentation for Device Onboarding (PnP) UpdateDevice + description: Complete reference of the UpdateDevice API. + link: https://developer.cisco.com/docs/dna-center/#!update-device +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.add_device, + device_onboarding_pnp.DeviceOnboardingPnp.delete_device_by_id_from_pnp, + device_onboarding_pnp.DeviceOnboardingPnp.update_device, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device, + delete /dna/intent/api/v1/onboarding/pnp-device/{id}, + put /dna/intent/api/v1/onboarding/pnp-device/{id}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + _id: string + deviceInfo: + aaaCredentials: + password: string + username: string + addedOn: 0 + addnMacAddrs: + - string + agentType: string + authStatus: string + authenticatedSudiSerialNo: string + capabilitiesSupported: + - string + cmState: string + description: string + deviceSudiSerialNos: + - string + deviceType: string + featuresSupported: + - string + fileSystemList: + - freespace: 0 + name: string + readable: true + size: 0 + type: string + writeable: true + firstContact: 0 + hostname: string + httpHeaders: + - key: string + value: string + imageFile: string + imageVersion: string + ipInterfaces: + - ipv4Address: {} + ipv6AddressList: + - {} + macAddress: string + name: string + status: string + lastContact: 0 + lastSyncTime: 0 + lastUpdateOn: 0 + location: + address: string + altitude: string + latitude: string + longitude: string + siteId: string + macAddress: string + mode: string + name: string + neighborLinks: + - localInterfaceName: string + localMacAddress: string + localShortInterfaceName: string + remoteDeviceName: string + remoteInterfaceName: string + remoteMacAddress: string + remotePlatform: string + remoteShortInterfaceName: string + remoteVersion: string + onbState: string + pid: string + pnpProfileList: + - createdBy: string + discoveryCreated: true + primaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + profileName: string + secondaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + populateInventory: true + preWorkflowCliOuputs: + - cli: string + cliOutput: string + projectId: string + projectName: string + reloadRequested: true + serialNumber: string + smartAccountId: string + source: string + stack: true + stackInfo: + isFullRing: true + stackMemberList: + - hardwareVersion: string + licenseLevel: string + licenseType: string + macAddress: string + pid: string + priority: 0 + role: string + serialNumber: string + softwareVersion: string + stackNumber: 0 + state: string + sudiSerialNumber: string + stackRingProtocol: string + supportsStackWorkflows: true + totalMemberCount: 0 + validLicenseLevels: + - string + state: string + sudiRequired: true + tags: {} + userSudiSerialNos: + - string + virtualAccountId: string + workflowId: string + workflowName: string + runSummaryList: + - details: string + errorFlag: true + historyTaskInfo: + addnDetails: + - key: string + value: string + name: string + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + timestamp: 0 + systemResetWorkflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + systemWorkflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + tenantId: string + version: 0 + workflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + workflowParameters: + configList: + - configId: string + configParameters: + - key: string + value: string + licenseLevel: string + licenseType: string + topOfStackSerialNumber: string + +- name: Update by id + cisco.dnac.pnp_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + _id: string + deviceInfo: + aaaCredentials: + password: string + username: string + addedOn: 0 + addnMacAddrs: + - string + agentType: string + authStatus: string + authenticatedSudiSerialNo: string + capabilitiesSupported: + - string + cmState: string + description: string + deviceSudiSerialNos: + - string + deviceType: string + featuresSupported: + - string + fileSystemList: + - freespace: 0 + name: string + readable: true + size: 0 + type: string + writeable: true + firstContact: 0 + hostname: string + httpHeaders: + - key: string + value: string + imageFile: string + imageVersion: string + ipInterfaces: + - ipv4Address: {} + ipv6AddressList: + - {} + macAddress: string + name: string + status: string + lastContact: 0 + lastSyncTime: 0 + lastUpdateOn: 0 + location: + address: string + altitude: string + latitude: string + longitude: string + siteId: string + macAddress: string + mode: string + name: string + neighborLinks: + - localInterfaceName: string + localMacAddress: string + localShortInterfaceName: string + remoteDeviceName: string + remoteInterfaceName: string + remoteMacAddress: string + remotePlatform: string + remoteShortInterfaceName: string + remoteVersion: string + onbState: string + pid: string + pnpProfileList: + - createdBy: string + discoveryCreated: true + primaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + profileName: string + secondaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + populateInventory: true + preWorkflowCliOuputs: + - cli: string + cliOutput: string + projectId: string + projectName: string + reloadRequested: true + serialNumber: string + smartAccountId: string + source: string + stack: true + stackInfo: + isFullRing: true + stackMemberList: + - hardwareVersion: string + licenseLevel: string + licenseType: string + macAddress: string + pid: string + priority: 0 + role: string + serialNumber: string + softwareVersion: string + stackNumber: 0 + state: string + sudiSerialNumber: string + stackRingProtocol: string + supportsStackWorkflows: true + totalMemberCount: 0 + validLicenseLevels: + - string + state: string + sudiRequired: true + tags: {} + userSudiSerialNos: + - string + virtualAccountId: string + workflowId: string + workflowName: string + id: string + runSummaryList: + - details: string + errorFlag: true + historyTaskInfo: + addnDetails: + - key: string + value: string + name: string + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + timestamp: 0 + systemResetWorkflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + systemWorkflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + tenantId: string + version: 0 + workflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + workflowParameters: + configList: + - configId: string + configParameters: + - key: string + value: string + licenseLevel: string + licenseType: string + topOfStackSerialNumber: string + +- name: Delete by id + cisco.dnac.pnp_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "_id": "string", + "deviceInfo": { + "source": "string", + "serialNumber": "string", + "stack": true, + "mode": "string", + "state": "string", + "location": { + "siteId": "string", + "address": "string", + "latitude": "string", + "longitude": "string", + "altitude": "string" + }, + "description": "string", + "onbState": "string", + "authenticatedMicNumber": "string", + "authenticatedSudiSerialNo": "string", + "capabilitiesSupported": [ + "string" + ], + "featuresSupported": [ + "string" + ], + "cmState": "string", + "firstContact": 0, + "lastContact": 0, + "macAddress": "string", + "pid": "string", + "deviceSudiSerialNos": [ + "string" + ], + "lastUpdateOn": 0, + "workflowId": "string", + "workflowName": "string", + "projectId": "string", + "projectName": "string", + "deviceType": "string", + "agentType": "string", + "imageVersion": "string", + "fileSystemList": [ + { + "type": "string", + "writeable": true, + "freespace": 0, + "name": "string", + "readable": true, + "size": 0 + } + ], + "pnpProfileList": [ + { + "profileName": "string", + "discoveryCreated": true, + "createdBy": "string", + "primaryEndpoint": { + "port": 0, + "protocol": "string", + "ipv4Address": {}, + "ipv6Address": {}, + "fqdn": "string", + "certificate": "string" + }, + "secondaryEndpoint": { + "port": 0, + "protocol": "string", + "ipv4Address": {}, + "ipv6Address": {}, + "fqdn": "string", + "certificate": "string" + } + } + ], + "imageFile": "string", + "httpHeaders": [ + { + "key": "string", + "value": "string" + } + ], + "neighborLinks": [ + { + "localInterfaceName": "string", + "localShortInterfaceName": "string", + "localMacAddress": "string", + "remoteInterfaceName": "string", + "remoteShortInterfaceName": "string", + "remoteMacAddress": "string", + "remoteDeviceName": "string", + "remotePlatform": "string", + "remoteVersion": "string" + } + ], + "lastSyncTime": 0, + "ipInterfaces": [ + { + "status": "string", + "macAddress": "string", + "ipv4Address": {}, + "ipv6AddressList": [ + {} + ], + "name": "string" + } + ], + "hostname": "string", + "authStatus": "string", + "stackInfo": { + "supportsStackWorkflows": true, + "isFullRing": true, + "stackMemberList": [ + { + "serialNumber": "string", + "state": "string", + "role": "string", + "macAddress": "string", + "pid": "string", + "licenseLevel": "string", + "licenseType": "string", + "sudiSerialNumber": "string", + "hardwareVersion": "string", + "stackNumber": 0, + "softwareVersion": "string", + "priority": 0 + } + ], + "stackRingProtocol": "string", + "validLicenseLevels": [ + "string" + ], + "totalMemberCount": 0 + }, + "reloadRequested": true, + "addedOn": 0, + "siteId": "string", + "aaaCredentials": { + "password": "string", + "username": "string" + }, + "userMicNumbers": [ + "string" + ], + "userSudiSerialNos": [ + "string" + ], + "addnMacAddrs": [ + "string" + ], + "preWorkflowCliOuputs": [ + { + "cli": "string", + "cliOutput": "string" + } + ], + "tags": {}, + "sudiRequired": true, + "smartAccountId": "string", + "virtualAccountId": "string", + "populateInventory": true, + "siteName": "string", + "name": "string" + }, + "systemResetWorkflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "systemWorkflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "workflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "runSummaryList": [ + { + "details": "string", + "historyTaskInfo": { + "type": "string", + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "addnDetails": [ + { + "key": "string", + "value": "string" + } + ], + "name": "string" + }, + "errorFlag": true, + "timestamp": 0 + } + ], + "workflowParameters": { + "topOfStackSerialNumber": "string", + "licenseLevel": "string", + "licenseType": "string", + "configList": [ + { + "configParameters": [ + { + "key": "string", + "value": "string" + } + ], + "configId": "string" + } + ] + }, + "dayZeroConfig": { + "config": "string" + }, + "dayZeroConfigPreview": {}, + "version": 0, + "tenantId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_authorize.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_authorize.py new file mode 100644 index 00000000..c6aa9659 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_authorize.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_authorize +short_description: Resource module for Pnp Device Authorize +description: +- Manage operation create of the resource Pnp Device Authorize. +- Authorizes one of more devices. A device can only be authorized if Authorization is set in Device Settings. +version_added: '6.5.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceIdList: + description: Device Id List. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for AuthorizeDevice + description: Complete reference of the AuthorizeDevice API. + link: https://developer.cisco.com/docs/dna-center/#!authorize-device +notes: + - SDK Method used are + ..authorize_device, + + - Paths used are + post /api/v1/onboarding/pnp-device/authorize, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device_authorize: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceIdList: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "jsonResponse": { + "empty": true + }, + "message": "string", + "statusCode": 0, + "jsonArrayResponse": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim.py new file mode 100644 index 00000000..3a6c668f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim.py @@ -0,0 +1,140 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_claim +short_description: Resource module for Pnp Device Claim +description: +- Manage operation create of the resource Pnp Device Claim. +- Claims one of more devices with specified workflow. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + configFileUrl: + description: Pnp Device Claim's configFileUrl. + type: str + configId: + description: Pnp Device Claim's configId. + type: str + deviceClaimList: + description: Pnp Device Claim's deviceClaimList. + elements: dict + suboptions: + configList: + description: Pnp Device Claim's configList. + elements: dict + suboptions: + configId: + description: Pnp Device Claim's configId. + type: str + configParameters: + description: Pnp Device Claim's configParameters. + elements: dict + suboptions: + key: + description: Pnp Device Claim's key. + type: str + value: + description: Pnp Device Claim's value. + type: str + type: list + type: list + deviceId: + description: Pnp Device Claim's deviceId. + type: str + licenseLevel: + description: Pnp Device Claim's licenseLevel. + type: str + licenseType: + description: Pnp Device Claim's licenseType. + type: str + topOfStackSerialNumber: + description: Pnp Device Claim's topOfStackSerialNumber. + type: str + type: list + fileServiceId: + description: Pnp Device Claim's fileServiceId. + type: str + imageId: + description: Pnp Device Claim's imageId. + type: str + imageUrl: + description: Pnp Device Claim's imageUrl. + type: str + populateInventory: + description: PopulateInventory flag. + type: bool + projectId: + description: Pnp Device Claim's projectId. + type: str + workflowId: + description: Pnp Device Claim's workflowId. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) ClaimDevice + description: Complete reference of the ClaimDevice API. + link: https://developer.cisco.com/docs/dna-center/#!claim-device +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.claim_device, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device/claim, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device_claim: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + configFileUrl: string + configId: string + deviceClaimList: + - configList: + - configId: string + configParameters: + - key: string + value: string + deviceId: string + licenseLevel: string + licenseType: string + topOfStackSerialNumber: string + fileServiceId: string + imageId: string + imageUrl: string + populateInventory: true + projectId: string + workflowId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "jsonArrayResponse": [ + {} + ], + "jsonResponse": {}, + "message": "string", + "statusCode": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim_to_site.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim_to_site.py new file mode 100644 index 00000000..e946b3fd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_claim_to_site.py @@ -0,0 +1,153 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_claim_to_site +short_description: Resource module for Pnp Device Claim To Site +description: +- Manage operation create of the resource Pnp Device Claim To Site. +- > + Claim a device based on DNA-C Site based design process. Different parameters are required for different device + platforms. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + configInfo: + description: Pnp Device Claim To Site's configInfo. + suboptions: + configId: + description: Pnp Device Claim To Site's configId. + type: str + configParameters: + description: Pnp Device Claim To Site's configParameters. + elements: dict + suboptions: + key: + description: Pnp Device Claim To Site's key. + type: str + value: + description: Pnp Device Claim To Site's value. + type: str + type: list + type: dict + version_added: 4.2.0 + deviceId: + description: Pnp Device Claim To Site's deviceId. + type: str + gateway: + description: Pnp Device Claim To Site's gateway. + type: str + version_added: 6.4.0 + hostname: + description: Pnp Device Claim To Site's hostname. + type: str + version_added: 4.2.0 + imageId: + description: Pnp Device Claim To Site's imageId. + type: str + imageInfo: + description: Pnp Device Claim To Site's imageInfo. + suboptions: + imageId: + description: Pnp Device Claim To Site's imageId. + type: str + skip: + description: Skip flag. + type: bool + type: dict + version_added: 4.2.0 + ipInterfaceName: + description: Pnp Device Claim To Site's ipInterfaceName. + type: str + version_added: 6.4.0 + removeInactive: + description: RemoveInactive flag. + type: bool + version_added: 6.4.0 + rfProfile: + description: Pnp Device Claim To Site's rfProfile. + type: str + version_added: 6.1.0 + siteId: + description: Pnp Device Claim To Site's siteId. + type: str + staticIP: + description: Pnp Device Claim To Site's staticIP. + type: str + version_added: 6.4.0 + subnetMask: + description: Pnp Device Claim To Site's subnetMask. + type: str + type: + description: Pnp Device Claim To Site's type. + type: str + vlanId: + description: Pnp Device Claim To Site's vlanId. + type: str + version_added: 6.4.0 +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) ClaimADeviceToASite + description: Complete reference of the ClaimADeviceToASite API. + link: https://developer.cisco.com/docs/dna-center/#!claim-a-device-to-a-site +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.claim_a_device_to_a_site, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device/site-claim, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device_claim_to_site: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + configInfo: + configId: string + configParameters: + - key: string + value: string + deviceId: string + gateway: string + hostname: string + imageId: string + imageInfo: + imageId: string + skip: true + ipInterfaceName: string + removeInactive: true + rfProfile: string + siteId: string + staticIP: string + subnetMask: string + type: string + vlanId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": "string", + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_config_preview.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_config_preview.py new file mode 100644 index 00000000..7007ba3b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_config_preview.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_config_preview +short_description: Resource module for Pnp Device Config Preview +description: +- Manage operation create of the resource Pnp Device Config Preview. +- Triggers a preview for site-based Day 0 Configuration. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceId: + description: Pnp Device Config Preview's deviceId. + type: str + siteId: + description: Pnp Device Config Preview's siteId. + type: str + type: + description: Pnp Device Config Preview's type. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) PreviewConfig + description: Complete reference of the PreviewConfig API. + link: https://developer.cisco.com/docs/dna-center/#!preview-config +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.preview_config, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device/site-config-preview, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device_config_preview: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceId: string + siteId: string + type: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "complete": true, + "config": "string", + "error": true, + "errorMessage": "string", + "expiredTime": 0, + "rfProfile": "string", + "sensorProfile": "string", + "siteId": "string", + "startTime": 0, + "taskId": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_count_info.py new file mode 100644 index 00000000..5b98a91e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_count_info.py @@ -0,0 +1,145 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_count_info +short_description: Information module for Pnp Device Count +description: +- Get all Pnp Device Count. +- Returns the device count based on filter criteria. This is useful for pagination. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + serialNumber: + description: + - SerialNumber query parameter. Device Serial Number. + elements: str + type: list + state_: + description: + - State query parameter. Device State. + elements: str + type: list + onbState: + description: + - OnbState query parameter. Device Onboarding State. + elements: str + type: list + cmState: + description: + - CmState query parameter. Device Connection Manager State. + elements: str + type: list + name: + description: + - Name query parameter. Device Name. + elements: str + type: list + pid: + description: + - Pid query parameter. Device ProductId. + elements: str + type: list + source: + description: + - Source query parameter. Device Source. + elements: str + type: list + projectId: + description: + - ProjectId query parameter. Device Project Id. + elements: str + type: list + workflowId: + description: + - WorkflowId query parameter. Device Workflow Id. + elements: str + type: list + projectName: + description: + - ProjectName query parameter. Device Project Name. + elements: str + type: list + workflowName: + description: + - WorkflowName query parameter. Device Workflow Name. + elements: str + type: list + smartAccountId: + description: + - SmartAccountId query parameter. Device Smart Account. + elements: str + type: list + virtualAccountId: + description: + - VirtualAccountId query parameter. Device Virtual Account. + elements: str + type: list + lastContact: + description: + - LastContact query parameter. Device Has Contacted lastContact > 0. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetDeviceCount + description: Complete reference of the GetDeviceCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-count-2 +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_device_count, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-device/count, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Device Count + cisco.dnac.pnp_device_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + serialNumber: [] + state_: [] + onbState: [] + cmState: [] + name: [] + pid: [] + source: [] + projectId: [] + workflowId: [] + projectName: [] + workflowName: [] + smartAccountId: [] + virtualAccountId: [] + lastContact: True + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_history_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_history_info.py new file mode 100644 index 00000000..662cc694 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_history_info.py @@ -0,0 +1,106 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_history_info +short_description: Information module for Pnp Device History +description: +- Get all Pnp Device History. +- Returns history for a specific device. Serial number is a required parameter. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + serialNumber: + description: + - SerialNumber query parameter. Device Serial Number. + type: str + sort: + description: + - Sort query parameter. Comma seperated list of fields to sort on. + elements: str + type: list + sortOrder: + description: + - SortOrder query parameter. Sort Order Ascending (asc) or Descending (des). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetDeviceHistory + description: Complete reference of the GetDeviceHistory API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-history +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_device_history, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-device/history, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Device History + cisco.dnac.pnp_device_history_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + serialNumber: string + sort: [] + sortOrder: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "timestamp": 0, + "details": "string", + "historyTaskInfo": { + "name": "string", + "type": "string", + "timeTaken": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "startTime": 0, + "endTime": 0, + "timeTaken": 0, + "outputStr": "string" + } + ], + "addnDetails": [ + { + "key": "string", + "value": "string" + } + ] + }, + "errorFlag": true + } + ], + "statusCode": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_import.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_import.py new file mode 100644 index 00000000..874e5818 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_import.py @@ -0,0 +1,1469 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_import +short_description: Resource module for Pnp Device Import +description: +- Manage operation create of the resource Pnp Device Import. +- Add devices to PnP in bulk. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Pnp Device Import's payload. + elements: dict + suboptions: + _id: + description: Pnp Device Import's _id. + type: str + deviceInfo: + description: Pnp Device Import's deviceInfo. + suboptions: + aaaCredentials: + description: Pnp Device Import's aaaCredentials. + suboptions: + password: + description: Pnp Device Import's password. + type: str + username: + description: Pnp Device Import's username. + type: str + type: dict + addedOn: + description: Pnp Device Import's addedOn. + type: int + addnMacAddrs: + description: Pnp Device Import's addnMacAddrs. + elements: str + type: list + agentType: + description: Pnp Device Import's agentType. + type: str + authStatus: + description: Pnp Device Import's authStatus. + type: str + authenticatedSudiSerialNo: + description: Pnp Device Import's authenticatedSudiSerialNo. + type: str + capabilitiesSupported: + description: Pnp Device Import's capabilitiesSupported. + elements: str + type: list + cmState: + description: Pnp Device Import's cmState. + type: str + description: + description: Pnp Device Import's description. + type: str + deviceSudiSerialNos: + description: Pnp Device Import's deviceSudiSerialNos. + elements: str + type: list + deviceType: + description: Pnp Device Import's deviceType. + type: str + featuresSupported: + description: Pnp Device Import's featuresSupported. + elements: str + type: list + fileSystemList: + description: Pnp Device Import's fileSystemList. + elements: dict + suboptions: + freespace: + description: Pnp Device Import's freespace. + type: int + name: + description: Pnp Device Import's name. + type: str + readable: + description: Readable flag. + type: bool + size: + description: Pnp Device Import's size. + type: int + type: + description: Pnp Device Import's type. + type: str + writeable: + description: Writeable flag. + type: bool + type: list + firstContact: + description: Pnp Device Import's firstContact. + type: int + hostname: + description: Pnp Device Import's hostname. + type: str + httpHeaders: + description: Pnp Device Import's httpHeaders. + elements: dict + suboptions: + key: + description: Pnp Device Import's key. + type: str + value: + description: Pnp Device Import's value. + type: str + type: list + imageFile: + description: Pnp Device Import's imageFile. + type: str + imageVersion: + description: Pnp Device Import's imageVersion. + type: str + ipInterfaces: + description: Pnp Device Import's ipInterfaces. + elements: dict + suboptions: + ipv4Address: + description: Pnp Device Import's ipv4Address. + type: dict + ipv6AddressList: + description: Pnp Device Import's ipv6AddressList. + elements: dict + type: list + macAddress: + description: Pnp Device Import's macAddress. + type: str + name: + description: Pnp Device Import's name. + type: str + status: + description: Pnp Device Import's status. + type: str + type: list + lastContact: + description: Pnp Device Import's lastContact. + type: int + lastSyncTime: + description: Pnp Device Import's lastSyncTime. + type: int + lastUpdateOn: + description: Pnp Device Import's lastUpdateOn. + type: int + location: + description: Pnp Device Import's location. + suboptions: + address: + description: Pnp Device Import's address. + type: str + altitude: + description: Pnp Device Import's altitude. + type: str + latitude: + description: Pnp Device Import's latitude. + type: str + longitude: + description: Pnp Device Import's longitude. + type: str + siteId: + description: Pnp Device Import's siteId. + type: str + type: dict + macAddress: + description: Pnp Device Import's macAddress. + type: str + mode: + description: Pnp Device Import's mode. + type: str + name: + description: Pnp Device Import's name. + type: str + neighborLinks: + description: Pnp Device Import's neighborLinks. + elements: dict + suboptions: + localInterfaceName: + description: Pnp Device Import's localInterfaceName. + type: str + localMacAddress: + description: Pnp Device Import's localMacAddress. + type: str + localShortInterfaceName: + description: Pnp Device Import's localShortInterfaceName. + type: str + remoteDeviceName: + description: Pnp Device Import's remoteDeviceName. + type: str + remoteInterfaceName: + description: Pnp Device Import's remoteInterfaceName. + type: str + remoteMacAddress: + description: Pnp Device Import's remoteMacAddress. + type: str + remotePlatform: + description: Pnp Device Import's remotePlatform. + type: str + remoteShortInterfaceName: + description: Pnp Device Import's remoteShortInterfaceName. + type: str + remoteVersion: + description: Pnp Device Import's remoteVersion. + type: str + type: list + onbState: + description: Pnp Device Import's onbState. + type: str + pid: + description: Pnp Device Import's pid. + type: str + pnpProfileList: + description: Pnp Device Import's pnpProfileList. + elements: dict + suboptions: + createdBy: + description: Pnp Device Import's createdBy. + type: str + discoveryCreated: + description: DiscoveryCreated flag. + type: bool + primaryEndpoint: + description: Pnp Device Import's primaryEndpoint. + suboptions: + certificate: + description: Pnp Device Import's certificate. + type: str + fqdn: + description: Pnp Device Import's fqdn. + type: str + ipv4Address: + description: Pnp Device Import's ipv4Address. + type: dict + ipv6Address: + description: Pnp Device Import's ipv6Address. + type: dict + port: + description: Pnp Device Import's port. + type: int + protocol: + description: Pnp Device Import's protocol. + type: str + type: dict + profileName: + description: Pnp Device Import's profileName. + type: str + secondaryEndpoint: + description: Pnp Device Import's secondaryEndpoint. + suboptions: + certificate: + description: Pnp Device Import's certificate. + type: str + fqdn: + description: Pnp Device Import's fqdn. + type: str + ipv4Address: + description: Pnp Device Import's ipv4Address. + type: dict + ipv6Address: + description: Pnp Device Import's ipv6Address. + type: dict + port: + description: Pnp Device Import's port. + type: int + protocol: + description: Pnp Device Import's protocol. + type: str + type: dict + type: list + populateInventory: + description: PopulateInventory flag. + type: bool + preWorkflowCliOuputs: + description: Pnp Device Import's preWorkflowCliOuputs. + elements: dict + suboptions: + cli: + description: Pnp Device Import's cli. + type: str + cliOutput: + description: Pnp Device Import's cliOutput. + type: str + type: list + projectId: + description: Pnp Device Import's projectId. + type: str + projectName: + description: Pnp Device Import's projectName. + type: str + reloadRequested: + description: ReloadRequested flag. + type: bool + serialNumber: + description: Pnp Device Import's serialNumber. + type: str + smartAccountId: + description: Pnp Device Import's smartAccountId. + type: str + source: + description: Pnp Device Import's source. + type: str + stack: + description: Stack flag. + type: bool + stackInfo: + description: Pnp Device Import's stackInfo. + suboptions: + isFullRing: + description: IsFullRing flag. + type: bool + stackMemberList: + description: Pnp Device Import's stackMemberList. + elements: dict + suboptions: + hardwareVersion: + description: Pnp Device Import's hardwareVersion. + type: str + licenseLevel: + description: Pnp Device Import's licenseLevel. + type: str + licenseType: + description: Pnp Device Import's licenseType. + type: str + macAddress: + description: Pnp Device Import's macAddress. + type: str + pid: + description: Pnp Device Import's pid. + type: str + priority: + description: Pnp Device Import's priority. + type: int + role: + description: Pnp Device Import's role. + type: str + serialNumber: + description: Pnp Device Import's serialNumber. + type: str + softwareVersion: + description: Pnp Device Import's softwareVersion. + type: str + stackNumber: + description: Pnp Device Import's stackNumber. + type: int + state: + description: Pnp Device Import's state. + type: str + sudiSerialNumber: + description: Pnp Device Import's sudiSerialNumber. + type: str + type: list + stackRingProtocol: + description: Pnp Device Import's stackRingProtocol. + type: str + supportsStackWorkflows: + description: SupportsStackWorkflows flag. + type: bool + totalMemberCount: + description: Pnp Device Import's totalMemberCount. + type: int + validLicenseLevels: + description: Pnp Device Import's validLicenseLevels. + elements: str + type: list + type: dict + state: + description: Pnp Device Import's state. + type: str + sudiRequired: + description: SudiRequired flag. + type: bool + tags: + description: Pnp Device Import's tags. + type: dict + userSudiSerialNos: + description: Pnp Device Import's userSudiSerialNos. + elements: str + type: list + virtualAccountId: + description: Pnp Device Import's virtualAccountId. + type: str + workflowId: + description: Pnp Device Import's workflowId. + type: str + workflowName: + description: Pnp Device Import's workflowName. + type: str + type: dict + runSummaryList: + description: Pnp Device Import's runSummaryList. + elements: dict + suboptions: + details: + description: Pnp Device Import's details. + type: str + errorFlag: + description: ErrorFlag flag. + type: bool + historyTaskInfo: + description: Pnp Device Import's historyTaskInfo. + suboptions: + addnDetails: + description: Pnp Device Import's addnDetails. + elements: dict + suboptions: + key: + description: Pnp Device Import's key. + type: str + value: + description: Pnp Device Import's value. + type: str + type: list + name: + description: Pnp Device Import's name. + type: str + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: + description: Pnp Device Import's type. + type: str + workItemList: + description: Pnp Device Import's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device Import's command. + type: str + endTime: + description: Pnp Device Import's endTime. + type: int + outputStr: + description: Pnp Device Import's outputStr. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: list + type: dict + timestamp: + description: Pnp Device Import's timestamp. + type: int + type: list + systemResetWorkflow: + description: Pnp Device Import's systemResetWorkflow. + suboptions: + _id: + description: Pnp Device Import's _id. + type: str + addToInventory: + description: AddToInventory flag. + type: bool + addedOn: + description: Pnp Device Import's addedOn. + type: int + configId: + description: Pnp Device Import's configId. + type: str + currTaskIdx: + description: Pnp Device Import's currTaskIdx. + type: int + description: + description: Pnp Device Import's description. + type: str + endTime: + description: Pnp Device Import's endTime. + type: int + execTime: + description: Pnp Device Import's execTime. + type: int + imageId: + description: Pnp Device Import's imageId. + type: str + instanceType: + description: Pnp Device Import's instanceType. + type: str + lastupdateOn: + description: Pnp Device Import's lastupdateOn. + type: int + name: + description: Pnp Device Import's name. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + tasks: + description: Pnp Device Import's tasks. + elements: dict + suboptions: + currWorkItemIdx: + description: Pnp Device Import's currWorkItemIdx. + type: int + endTime: + description: Pnp Device Import's endTime. + type: int + name: + description: Pnp Device Import's name. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + taskSeqNo: + description: Pnp Device Import's taskSeqNo. + type: int + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: + description: Pnp Device Import's type. + type: str + workItemList: + description: Pnp Device Import's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device Import's command. + type: str + endTime: + description: Pnp Device Import's endTime. + type: int + outputStr: + description: Pnp Device Import's outputStr. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: list + type: list + tenantId: + description: Pnp Device Import's tenantId. + type: str + type: + description: Pnp Device Import's type. + type: str + useState: + description: Pnp Device Import's useState. + type: str + version: + description: Pnp Device Import's version. + type: int + type: dict + systemWorkflow: + description: Pnp Device Import's systemWorkflow. + suboptions: + _id: + description: Pnp Device Import's _id. + type: str + addToInventory: + description: AddToInventory flag. + type: bool + addedOn: + description: Pnp Device Import's addedOn. + type: int + configId: + description: Pnp Device Import's configId. + type: str + currTaskIdx: + description: Pnp Device Import's currTaskIdx. + type: int + description: + description: Pnp Device Import's description. + type: str + endTime: + description: Pnp Device Import's endTime. + type: int + execTime: + description: Pnp Device Import's execTime. + type: int + imageId: + description: Pnp Device Import's imageId. + type: str + instanceType: + description: Pnp Device Import's instanceType. + type: str + lastupdateOn: + description: Pnp Device Import's lastupdateOn. + type: int + name: + description: Pnp Device Import's name. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + tasks: + description: Pnp Device Import's tasks. + elements: dict + suboptions: + currWorkItemIdx: + description: Pnp Device Import's currWorkItemIdx. + type: int + endTime: + description: Pnp Device Import's endTime. + type: int + name: + description: Pnp Device Import's name. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + taskSeqNo: + description: Pnp Device Import's taskSeqNo. + type: int + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: + description: Pnp Device Import's type. + type: str + workItemList: + description: Pnp Device Import's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device Import's command. + type: str + endTime: + description: Pnp Device Import's endTime. + type: int + outputStr: + description: Pnp Device Import's outputStr. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: list + type: list + tenantId: + description: Pnp Device Import's tenantId. + type: str + type: + description: Pnp Device Import's type. + type: str + useState: + description: Pnp Device Import's useState. + type: str + version: + description: Pnp Device Import's version. + type: int + type: dict + tenantId: + description: Pnp Device Import's tenantId. + type: str + version: + description: Pnp Device Import's version. + type: int + workflow: + description: Pnp Device Import's workflow. + suboptions: + _id: + description: Pnp Device Import's _id. + type: str + addToInventory: + description: AddToInventory flag. + type: bool + addedOn: + description: Pnp Device Import's addedOn. + type: int + configId: + description: Pnp Device Import's configId. + type: str + currTaskIdx: + description: Pnp Device Import's currTaskIdx. + type: int + description: + description: Pnp Device Import's description. + type: str + endTime: + description: Pnp Device Import's endTime. + type: int + execTime: + description: Pnp Device Import's execTime. + type: int + imageId: + description: Pnp Device Import's imageId. + type: str + instanceType: + description: Pnp Device Import's instanceType. + type: str + lastupdateOn: + description: Pnp Device Import's lastupdateOn. + type: int + name: + description: Pnp Device Import's name. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + tasks: + description: Pnp Device Import's tasks. + elements: dict + suboptions: + currWorkItemIdx: + description: Pnp Device Import's currWorkItemIdx. + type: int + endTime: + description: Pnp Device Import's endTime. + type: int + name: + description: Pnp Device Import's name. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + taskSeqNo: + description: Pnp Device Import's taskSeqNo. + type: int + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: + description: Pnp Device Import's type. + type: str + workItemList: + description: Pnp Device Import's workItemList. + elements: dict + suboptions: + command: + description: Pnp Device Import's command. + type: str + endTime: + description: Pnp Device Import's endTime. + type: int + outputStr: + description: Pnp Device Import's outputStr. + type: str + startTime: + description: Pnp Device Import's startTime. + type: int + state: + description: Pnp Device Import's state. + type: str + timeTaken: + description: Pnp Device Import's timeTaken. + type: int + type: list + type: list + tenantId: + description: Pnp Device Import's tenantId. + type: str + type: + description: Pnp Device Import's type. + type: str + useState: + description: Pnp Device Import's useState. + type: str + version: + description: Pnp Device Import's version. + type: int + type: dict + workflowParameters: + description: Pnp Device Import's workflowParameters. + suboptions: + configList: + description: Pnp Device Import's configList. + elements: dict + suboptions: + configId: + description: Pnp Device Import's configId. + type: str + configParameters: + description: Pnp Device Import's configParameters. + elements: dict + suboptions: + key: + description: Pnp Device Import's key. + type: str + value: + description: Pnp Device Import's value. + type: str + type: list + type: list + licenseLevel: + description: Pnp Device Import's licenseLevel. + type: str + licenseType: + description: Pnp Device Import's licenseType. + type: str + topOfStackSerialNumber: + description: Pnp Device Import's topOfStackSerialNumber. + type: str + type: dict + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) ImportDevicesInBulk + description: Complete reference of the ImportDevicesInBulk API. + link: https://developer.cisco.com/docs/dna-center/#!import-devices-in-bulk +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.import_devices_in_bulk, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device/import, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device_import: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - _id: string + deviceInfo: + aaaCredentials: + password: string + username: string + addedOn: 0 + addnMacAddrs: + - string + agentType: string + authStatus: string + authenticatedSudiSerialNo: string + capabilitiesSupported: + - string + cmState: string + description: string + deviceSudiSerialNos: + - string + deviceType: string + featuresSupported: + - string + fileSystemList: + - freespace: 0 + name: string + readable: true + size: 0 + type: string + writeable: true + firstContact: 0 + hostname: string + httpHeaders: + - key: string + value: string + imageFile: string + imageVersion: string + ipInterfaces: + - ipv4Address: {} + ipv6AddressList: + - {} + macAddress: string + name: string + status: string + lastContact: 0 + lastSyncTime: 0 + lastUpdateOn: 0 + location: + address: string + altitude: string + latitude: string + longitude: string + siteId: string + macAddress: string + mode: string + name: string + neighborLinks: + - localInterfaceName: string + localMacAddress: string + localShortInterfaceName: string + remoteDeviceName: string + remoteInterfaceName: string + remoteMacAddress: string + remotePlatform: string + remoteShortInterfaceName: string + remoteVersion: string + onbState: string + pid: string + pnpProfileList: + - createdBy: string + discoveryCreated: true + primaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + profileName: string + secondaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + populateInventory: true + preWorkflowCliOuputs: + - cli: string + cliOutput: string + projectId: string + projectName: string + reloadRequested: true + serialNumber: string + smartAccountId: string + source: string + stack: true + stackInfo: + isFullRing: true + stackMemberList: + - hardwareVersion: string + licenseLevel: string + licenseType: string + macAddress: string + pid: string + priority: 0 + role: string + serialNumber: string + softwareVersion: string + stackNumber: 0 + state: string + sudiSerialNumber: string + stackRingProtocol: string + supportsStackWorkflows: true + totalMemberCount: 0 + validLicenseLevels: + - string + state: string + sudiRequired: true + tags: {} + userSudiSerialNos: + - string + virtualAccountId: string + workflowId: string + workflowName: string + runSummaryList: + - details: string + errorFlag: true + historyTaskInfo: + addnDetails: + - key: string + value: string + name: string + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + timestamp: 0 + systemResetWorkflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + systemWorkflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + tenantId: string + version: 0 + workflow: + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + workflowParameters: + configList: + - configId: string + configParameters: + - key: string + value: string + licenseLevel: string + licenseType: string + topOfStackSerialNumber: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "successList": [ + { + "_id": "string", + "deviceInfo": { + "source": "string", + "serialNumber": "string", + "stack": true, + "mode": "string", + "state": "string", + "location": { + "siteId": "string", + "address": "string", + "latitude": "string", + "longitude": "string", + "altitude": "string" + }, + "description": "string", + "onbState": "string", + "authenticatedMicNumber": "string", + "authenticatedSudiSerialNo": "string", + "capabilitiesSupported": [ + "string" + ], + "featuresSupported": [ + "string" + ], + "cmState": "string", + "firstContact": 0, + "lastContact": 0, + "macAddress": "string", + "pid": "string", + "deviceSudiSerialNos": [ + "string" + ], + "lastUpdateOn": 0, + "workflowId": "string", + "workflowName": "string", + "projectId": "string", + "projectName": "string", + "deviceType": "string", + "agentType": "string", + "imageVersion": "string", + "fileSystemList": [ + { + "type": "string", + "writeable": true, + "freespace": 0, + "name": "string", + "readable": true, + "size": 0 + } + ], + "pnpProfileList": [ + { + "profileName": "string", + "discoveryCreated": true, + "createdBy": "string", + "primaryEndpoint": { + "port": 0, + "protocol": "string", + "ipv4Address": {}, + "ipv6Address": {}, + "fqdn": "string", + "certificate": "string" + }, + "secondaryEndpoint": { + "port": 0, + "protocol": "string", + "ipv4Address": {}, + "ipv6Address": {}, + "fqdn": "string", + "certificate": "string" + } + } + ], + "imageFile": "string", + "httpHeaders": [ + { + "key": "string", + "value": "string" + } + ], + "neighborLinks": [ + { + "localInterfaceName": "string", + "localShortInterfaceName": "string", + "localMacAddress": "string", + "remoteInterfaceName": "string", + "remoteShortInterfaceName": "string", + "remoteMacAddress": "string", + "remoteDeviceName": "string", + "remotePlatform": "string", + "remoteVersion": "string" + } + ], + "lastSyncTime": 0, + "ipInterfaces": [ + { + "status": "string", + "macAddress": "string", + "ipv4Address": {}, + "ipv6AddressList": [ + {} + ], + "name": "string" + } + ], + "hostname": "string", + "authStatus": "string", + "stackInfo": { + "supportsStackWorkflows": true, + "isFullRing": true, + "stackMemberList": [ + { + "serialNumber": "string", + "state": "string", + "role": "string", + "macAddress": "string", + "pid": "string", + "licenseLevel": "string", + "licenseType": "string", + "sudiSerialNumber": "string", + "hardwareVersion": "string", + "stackNumber": 0, + "softwareVersion": "string", + "priority": 0 + } + ], + "stackRingProtocol": "string", + "validLicenseLevels": [ + "string" + ], + "totalMemberCount": 0 + }, + "reloadRequested": true, + "addedOn": 0, + "siteId": "string", + "aaaCredentials": { + "password": "string", + "username": "string" + }, + "userMicNumbers": [ + "string" + ], + "userSudiSerialNos": [ + "string" + ], + "addnMacAddrs": [ + "string" + ], + "preWorkflowCliOuputs": [ + { + "cli": "string", + "cliOutput": "string" + } + ], + "tags": {}, + "sudiRequired": true, + "smartAccountId": "string", + "virtualAccountId": "string", + "populateInventory": true, + "siteName": "string", + "name": "string" + }, + "systemResetWorkflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "systemWorkflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "workflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "runSummaryList": [ + { + "details": "string", + "historyTaskInfo": { + "type": "string", + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "addnDetails": [ + { + "key": "string", + "value": "string" + } + ], + "name": "string" + }, + "errorFlag": true, + "timestamp": 0 + } + ], + "workflowParameters": { + "topOfStackSerialNumber": "string", + "licenseLevel": "string", + "licenseType": "string", + "configList": [ + { + "configParameters": [ + { + "key": "string", + "value": "string" + } + ], + "configId": "string" + } + ] + }, + "dayZeroConfig": { + "config": "string" + }, + "dayZeroConfigPreview": {}, + "version": 0, + "tenantId": "string" + } + ], + "failureList": [ + { + "index": 0, + "serialNum": "string", + "id": "string", + "msg": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_info.py new file mode 100644 index 00000000..3f0b11be --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_info.py @@ -0,0 +1,544 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_info +short_description: Information module for Pnp Device +description: +- Get all Pnp Device. +- Get Pnp Device by id. +- Returns device details specified by device id. +- > + Returns list of devices based on filter crieteria. If a limit is not specified, it will default to return 50 + devices. Pagination and sorting are also supported by this endpoint. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + limit: + description: + - Limit query parameter. Limits number of results. + type: int + offset: + description: + - Offset query parameter. Index of first result. + type: int + sort: + description: + - Sort query parameter. Comma seperated list of fields to sort on. + elements: str + type: list + sortOrder: + description: + - SortOrder query parameter. Sort Order Ascending (asc) or Descending (des). + type: str + serialNumber: + description: + - SerialNumber query parameter. Device Serial Number. + elements: str + type: list + state_: + description: + - State query parameter. Device State. + elements: str + type: list + onbState: + description: + - OnbState query parameter. Device Onboarding State. + elements: str + type: list + cmState: + description: + - CmState query parameter. Device Connection Manager State. + elements: str + type: list + name: + description: + - Name query parameter. Device Name. + elements: str + type: list + pid: + description: + - Pid query parameter. Device ProductId. + elements: str + type: list + source: + description: + - Source query parameter. Device Source. + elements: str + type: list + projectId: + description: + - ProjectId query parameter. Device Project Id. + elements: str + type: list + workflowId: + description: + - WorkflowId query parameter. Device Workflow Id. + elements: str + type: list + projectName: + description: + - ProjectName query parameter. Device Project Name. + elements: str + type: list + workflowName: + description: + - WorkflowName query parameter. Device Workflow Name. + elements: str + type: list + smartAccountId: + description: + - SmartAccountId query parameter. Device Smart Account. + elements: str + type: list + virtualAccountId: + description: + - VirtualAccountId query parameter. Device Virtual Account. + elements: str + type: list + lastContact: + description: + - LastContact query parameter. Device Has Contacted lastContact > 0. + type: bool + macAddress: + description: + - MacAddress query parameter. Device Mac Address. + type: str + hostname: + description: + - Hostname query parameter. Device Hostname. + type: str + siteName: + description: + - SiteName query parameter. Device Site Name. + type: str + id: + description: + - Id path parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetDeviceById + description: Complete reference of the GetDeviceById API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-by-id +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetDeviceList2 + description: Complete reference of the GetDeviceList2 API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-list-2 +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_device_by_id, + device_onboarding_pnp.DeviceOnboardingPnp.get_device_list, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-device, + get /dna/intent/api/v1/onboarding/pnp-device/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Device + cisco.dnac.pnp_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + limit: 0 + offset: 0 + sort: [] + sortOrder: string + serialNumber: [] + state_: [] + onbState: [] + cmState: [] + name: [] + pid: [] + source: [] + projectId: [] + workflowId: [] + projectName: [] + workflowName: [] + smartAccountId: [] + virtualAccountId: [] + lastContact: True + macAddress: string + hostname: string + siteName: string + register: result + +- name: Get Pnp Device by id + cisco.dnac.pnp_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "_id": "string", + "deviceInfo": { + "source": "string", + "serialNumber": "string", + "stack": true, + "mode": "string", + "state": "string", + "location": { + "siteId": "string", + "address": "string", + "latitude": "string", + "longitude": "string", + "altitude": "string" + }, + "description": "string", + "onbState": "string", + "authenticatedMicNumber": "string", + "authenticatedSudiSerialNo": "string", + "capabilitiesSupported": [ + "string" + ], + "featuresSupported": [ + "string" + ], + "cmState": "string", + "firstContact": 0, + "lastContact": 0, + "macAddress": "string", + "pid": "string", + "deviceSudiSerialNos": [ + "string" + ], + "lastUpdateOn": 0, + "workflowId": "string", + "workflowName": "string", + "projectId": "string", + "projectName": "string", + "deviceType": "string", + "agentType": "string", + "imageVersion": "string", + "fileSystemList": [ + { + "type": "string", + "writeable": true, + "freespace": 0, + "name": "string", + "readable": true, + "size": 0 + } + ], + "pnpProfileList": [ + { + "profileName": "string", + "discoveryCreated": true, + "createdBy": "string", + "primaryEndpoint": { + "port": 0, + "protocol": "string", + "ipv4Address": {}, + "ipv6Address": {}, + "fqdn": "string", + "certificate": "string" + }, + "secondaryEndpoint": { + "port": 0, + "protocol": "string", + "ipv4Address": {}, + "ipv6Address": {}, + "fqdn": "string", + "certificate": "string" + } + } + ], + "imageFile": "string", + "httpHeaders": [ + { + "key": "string", + "value": "string" + } + ], + "neighborLinks": [ + { + "localInterfaceName": "string", + "localShortInterfaceName": "string", + "localMacAddress": "string", + "remoteInterfaceName": "string", + "remoteShortInterfaceName": "string", + "remoteMacAddress": "string", + "remoteDeviceName": "string", + "remotePlatform": "string", + "remoteVersion": "string" + } + ], + "lastSyncTime": 0, + "ipInterfaces": [ + { + "status": "string", + "macAddress": "string", + "ipv4Address": {}, + "ipv6AddressList": [ + {} + ], + "name": "string" + } + ], + "hostname": "string", + "authStatus": "string", + "stackInfo": { + "supportsStackWorkflows": true, + "isFullRing": true, + "stackMemberList": [ + { + "serialNumber": "string", + "state": "string", + "role": "string", + "macAddress": "string", + "pid": "string", + "licenseLevel": "string", + "licenseType": "string", + "sudiSerialNumber": "string", + "hardwareVersion": "string", + "stackNumber": 0, + "softwareVersion": "string", + "priority": 0 + } + ], + "stackRingProtocol": "string", + "validLicenseLevels": [ + "string" + ], + "totalMemberCount": 0 + }, + "reloadRequested": true, + "addedOn": 0, + "siteId": "string", + "aaaCredentials": { + "password": "string", + "username": "string" + }, + "userMicNumbers": [ + "string" + ], + "userSudiSerialNos": [ + "string" + ], + "addnMacAddrs": [ + "string" + ], + "preWorkflowCliOuputs": [ + { + "cli": "string", + "cliOutput": "string" + } + ], + "tags": {}, + "sudiRequired": true, + "smartAccountId": "string", + "virtualAccountId": "string", + "populateInventory": true, + "siteName": "string", + "name": "string" + }, + "systemResetWorkflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "systemWorkflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "workflow": { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + }, + "runSummaryList": [ + { + "details": "string", + "historyTaskInfo": { + "type": "string", + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "addnDetails": [ + { + "key": "string", + "value": "string" + } + ], + "name": "string" + }, + "errorFlag": true, + "timestamp": 0 + } + ], + "workflowParameters": { + "topOfStackSerialNumber": "string", + "licenseLevel": "string", + "licenseType": "string", + "configList": [ + { + "configParameters": [ + { + "key": "string", + "value": "string" + } + ], + "configId": "string" + } + ] + }, + "dayZeroConfig": { + "config": "string" + }, + "dayZeroConfigPreview": {}, + "version": 0, + "tenantId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_reset.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_reset.py new file mode 100644 index 00000000..97d079c4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_reset.py @@ -0,0 +1,116 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_reset +short_description: Resource module for Pnp Device Reset +description: +- Manage operation create of the resource Pnp Device Reset. +- Recovers a device from a Workflow Execution Error state. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceResetList: + description: Pnp Device Reset's deviceResetList. + elements: dict + suboptions: + configList: + description: Pnp Device Reset's configList. + elements: dict + suboptions: + configId: + description: Pnp Device Reset's configId. + type: str + configParameters: + description: Pnp Device Reset's configParameters. + elements: dict + suboptions: + key: + description: Pnp Device Reset's key. + type: str + value: + description: Pnp Device Reset's value. + type: str + type: list + type: list + deviceId: + description: Pnp Device Reset's deviceId. + type: str + licenseLevel: + description: Pnp Device Reset's licenseLevel. + type: str + licenseType: + description: Pnp Device Reset's licenseType. + type: str + topOfStackSerialNumber: + description: Pnp Device Reset's topOfStackSerialNumber. + type: str + type: list + projectId: + description: Pnp Device Reset's projectId. + type: str + workflowId: + description: Pnp Device Reset's workflowId. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) ResetDevice + description: Complete reference of the ResetDevice API. + link: https://developer.cisco.com/docs/dna-center/#!reset-device +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.reset_device, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device/reset, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device_reset: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceResetList: + - configList: + - configId: string + configParameters: + - key: string + value: string + deviceId: string + licenseLevel: string + licenseType: string + topOfStackSerialNumber: string + projectId: string + workflowId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "jsonArrayResponse": [ + {} + ], + "jsonResponse": {}, + "message": "string", + "statusCode": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_device_unclaim.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_unclaim.py new file mode 100644 index 00000000..a1212a68 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_device_unclaim.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_device_unclaim +short_description: Resource module for Pnp Device Unclaim +description: +- Manage operation create of the resource Pnp Device Unclaim. +- Un-Claims one of more devices with specified workflow. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceIdList: + description: Pnp Device Unclaim's deviceIdList. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) UnClaimDevice + description: Complete reference of the UnClaimDevice API. + link: https://developer.cisco.com/docs/dna-center/#!un-claim-device +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.un_claim_device, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device/unclaim, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_device_unclaim: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceIdList: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "jsonArrayResponse": [ + {} + ], + "jsonResponse": {}, + "message": "string", + "statusCode": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings.py new file mode 100644 index 00000000..fa5ff41b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings.py @@ -0,0 +1,305 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_global_settings +short_description: Resource module for Pnp Global Settings +description: +- Manage operation update of the resource Pnp Global Settings. +- Updates the user's list of global PnP settings. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + _id: + description: Pnp Global Settings's _id. + type: str + aaaCredentials: + description: Pnp Global Settings's aaaCredentials. + suboptions: + password: + description: Pnp Global Settings's password. + type: str + username: + description: Pnp Global Settings's username. + type: str + type: dict + acceptEula: + description: AcceptEula flag. + type: bool + defaultProfile: + description: Pnp Global Settings's defaultProfile. + suboptions: + cert: + description: Pnp Global Settings's cert. + type: str + fqdnAddresses: + description: Pnp Global Settings's fqdnAddresses. + elements: str + type: list + ipAddresses: + description: Pnp Global Settings's ipAddresses. + elements: str + type: list + port: + description: Pnp Global Settings's port. + type: int + proxy: + description: Proxy flag. + type: bool + type: dict + savaMappingList: + description: Pnp Global Settings's savaMappingList. + elements: dict + suboptions: + autoSyncPeriod: + description: Pnp Global Settings's autoSyncPeriod. + type: int + ccoUser: + description: Pnp Global Settings's ccoUser. + type: str + expiry: + description: Pnp Global Settings's expiry. + type: int + lastSync: + description: Pnp Global Settings's lastSync. + type: int + profile: + description: Pnp Global Settings's profile. + suboptions: + addressFqdn: + description: Pnp Global Settings's addressFqdn. + type: str + addressIpV4: + description: Pnp Global Settings's addressIpV4. + type: str + cert: + description: Pnp Global Settings's cert. + type: str + makeDefault: + description: MakeDefault flag. + type: bool + name: + description: Pnp Global Settings's name. + type: str + port: + description: Pnp Global Settings's port. + type: int + profileId: + description: Pnp Global Settings's profileId. + type: str + proxy: + description: Proxy flag. + type: bool + type: dict + smartAccountId: + description: Pnp Global Settings's smartAccountId. + type: str + syncResult: + description: Pnp Global Settings's syncResult. + suboptions: + syncList: + description: Pnp Global Settings's syncList. + elements: dict + suboptions: + deviceSnList: + description: Pnp Global Settings's deviceSnList. + elements: str + type: list + syncType: + description: Pnp Global Settings's syncType. + type: str + type: list + syncMsg: + description: Pnp Global Settings's syncMsg. + type: str + type: dict + syncResultStr: + description: Pnp Global Settings's syncResultStr. + type: str + syncStartTime: + description: Pnp Global Settings's syncStartTime. + type: int + syncStatus: + description: Pnp Global Settings's syncStatus. + type: str + tenantId: + description: Pnp Global Settings's tenantId. + type: str + token: + description: Pnp Global Settings's token. + type: str + virtualAccountId: + description: Pnp Global Settings's virtualAccountId. + type: str + type: list + taskTimeOuts: + description: Pnp Global Settings's taskTimeOuts. + suboptions: + configTimeOut: + description: Pnp Global Settings's configTimeOut. + type: int + generalTimeOut: + description: Pnp Global Settings's generalTimeOut. + type: int + imageDownloadTimeOut: + description: Pnp Global Settings's imageDownloadTimeOut. + type: int + type: dict + tenantId: + description: Pnp Global Settings's tenantId. + type: str + version: + description: Pnp Global Settings's version. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) UpdatePnPGlobalSettings + description: Complete reference of the UpdatePnPGlobalSettings API. + link: https://developer.cisco.com/docs/dna-center/#!update-pn-p-global-settings +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.update_pnp_global_settings, + + - Paths used are + put /dna/intent/api/v1/onboarding/pnp-settings, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.pnp_global_settings: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + _id: string + aaaCredentials: + password: string + username: string + acceptEula: true + defaultProfile: + cert: string + fqdnAddresses: + - string + ipAddresses: + - string + port: 0 + proxy: true + savaMappingList: + - autoSyncPeriod: 0 + ccoUser: string + expiry: 0 + lastSync: 0 + profile: + addressFqdn: string + addressIpV4: string + cert: string + makeDefault: true + name: string + port: 0 + profileId: string + proxy: true + smartAccountId: string + syncResult: + syncList: + - deviceSnList: + - string + syncType: string + syncMsg: string + syncResultStr: string + syncStartTime: 0 + syncStatus: string + tenantId: string + token: string + virtualAccountId: string + taskTimeOuts: + configTimeOut: 0 + generalTimeOut: 0 + imageDownloadTimeOut: 0 + tenantId: string + version: 0 + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "savaMappingList": [ + { + "syncStatus": "string", + "syncStartTime": 0, + "syncResult": { + "syncList": [ + { + "syncType": "string", + "deviceSnList": [ + "string" + ] + } + ], + "syncMsg": "string" + }, + "lastSync": 0, + "tenantId": "string", + "profile": { + "port": 0, + "addressIpV4": "string", + "addressFqdn": "string", + "profileId": "string", + "proxy": true, + "makeDefault": true, + "cert": "string", + "name": "string" + }, + "token": "string", + "expiry": 0, + "ccoUser": "string", + "smartAccountId": "string", + "virtualAccountId": "string", + "autoSyncPeriod": 0, + "syncResultStr": "string" + } + ], + "taskTimeOuts": { + "imageDownloadTimeOut": 0, + "configTimeOut": 0, + "generalTimeOut": 0 + }, + "tenantId": "string", + "aaaCredentials": { + "password": "string", + "username": "string" + }, + "defaultProfile": { + "fqdnAddresses": [ + "string" + ], + "proxy": true, + "cert": "string", + "ipAddresses": [ + "string" + ], + "port": 0 + }, + "acceptEula": true, + "id": "string", + "_id": "string", + "version": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings_info.py new file mode 100644 index 00000000..9347be59 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_global_settings_info.py @@ -0,0 +1,122 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_global_settings_info +short_description: Information module for Pnp Global Settings +description: +- Get all Pnp Global Settings. +- Returns global PnP settings of the user. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetPnPGlobalSettings + description: Complete reference of the GetPnPGlobalSettings API. + link: https://developer.cisco.com/docs/dna-center/#!get-pn-p-global-settings +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_pnp_global_settings, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-settings, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Global Settings + cisco.dnac.pnp_global_settings_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "savaMappingList": [ + { + "syncStatus": "string", + "syncStartTime": 0, + "syncResult": { + "syncList": [ + { + "syncType": "string", + "deviceSnList": [ + "string" + ] + } + ], + "syncMsg": "string" + }, + "lastSync": 0, + "tenantId": "string", + "profile": { + "port": 0, + "addressIpV4": "string", + "addressFqdn": "string", + "profileId": "string", + "proxy": true, + "makeDefault": true, + "cert": "string", + "name": "string" + }, + "token": "string", + "expiry": 0, + "ccoUser": "string", + "smartAccountId": "string", + "virtualAccountId": "string", + "autoSyncPeriod": 0, + "syncResultStr": "string" + } + ], + "taskTimeOuts": { + "imageDownloadTimeOut": 0, + "configTimeOut": 0, + "generalTimeOut": 0 + }, + "tenantId": "string", + "aaaCredentials": { + "password": "string", + "username": "string" + }, + "defaultProfile": { + "fqdnAddresses": [ + "string" + ], + "proxy": true, + "cert": "string", + "ipAddresses": [ + "string" + ], + "port": 0 + }, + "acceptEula": true, + "id": "string", + "_id": "string", + "version": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_intent.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_intent.py new file mode 100644 index 00000000..99849664 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_intent.py @@ -0,0 +1,963 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +__author__ = ("Madhan Sankaranarayanan, Rishita Chowdhary") + +DOCUMENTATION = r""" +--- +module: pnp_intent +short_description: Resource module for Site and PnP related functions +description: +- Manage operations add device, claim device and unclaim device of Onboarding Configuration(PnP) resource +- API to add device to pnp inventory and claim it to a site. +- API to delete device from the pnp inventory. +version_added: '6.6.0' +extends_documentation_fragment: + - cisco.dnac.intent_params +author: Madhan Sankaranarayanan (@madhansansel) + Rishita Chowdhary (@rishitachowdhary) +options: + state: + description: The state of DNAC after module completion. + type: str + choices: [ merged, deleted ] + default: merged + config: + description: + - List of details of device being managed. + type: list + elements: dict + required: true + suboptions: + template_name: + description: Name of template to be configured on the device. + type: str + image_name: + description: Name of image to be configured on the device + type: str + golden_image: + description: Is the image to be condifgured tagged as golden image + type: bool + site_name: + description: Name of the site for which device will be claimed. + type: str + deviceInfo: + description: Pnp Device's deviceInfo. + type: dict + suboptions: + aaaCredentials: + description: Pnp Device's aaaCredentials. + type: dict + suboptions: + password: + description: Pnp Device's password. + type: str + username: + description: Pnp Device's username. + type: str + addedOn: + description: Pnp Device's addedOn. + type: int + addnMacAddrs: + description: Pnp Device's addnMacAddrs. + elements: str + type: list + agentType: + description: Pnp Device's agentType. + type: str + authStatus: + description: Pnp Device's authStatus. + type: str + authenticatedSudiSerialNo: + description: Pnp Device's authenticatedSudiSerialNo. + type: str + capabilitiesSupported: + description: Pnp Device's capabilitiesSupported. + elements: str + type: list + cmState: + description: Pnp Device's cmState. + type: str + description: + description: Pnp Device's description. + type: str + deviceSudiSerialNos: + description: Pnp Device's deviceSudiSerialNos. + elements: str + type: list + deviceType: + description: Pnp Device's deviceType. + type: str + featuresSupported: + description: Pnp Device's featuresSupported. + elements: str + type: list + fileSystemList: + description: Pnp Device's fileSystemList. + type: list + elements: dict + suboptions: + freespace: + description: Pnp Device's freespace. + type: int + name: + description: Pnp Device's name. + type: str + readable: + description: Readable flag. + type: bool + size: + description: Pnp Device's size. + type: int + type: + description: Pnp Device's type. + type: str + writeable: + description: Writeable flag. + type: bool + firstContact: + description: Pnp Device's firstContact. + type: int + hostname: + description: Pnp Device's hostname. + type: str + httpHeaders: + description: Pnp Device's httpHeaders. + type: list + elements: dict + suboptions: + key: + description: Pnp Device's key. + type: str + value: + description: Pnp Device's value. + type: str + imageFile: + description: Pnp Device's imageFile. + type: str + imageVersion: + description: Pnp Device's imageVersion. + type: str + ipInterfaces: + description: Pnp Device's ipInterfaces. + elements: dict + type: list + suboptions: + ipv4Address: + description: Pnp Device's ipv4Address. + type: dict + ipv6AddressList: + description: Pnp Device's ipv6AddressList. + elements: dict + type: list + macAddress: + description: Pnp Device's macAddress. + type: str + name: + description: Pnp Device's name. + type: str + status: + description: Pnp Device's status. + type: str + lastContact: + description: Pnp Device's lastContact. + type: int + lastSyncTime: + description: Pnp Device's lastSyncTime. + type: int + lastUpdateOn: + description: Pnp Device's lastUpdateOn. + type: int + location: + description: Pnp Device's location. + type: dict + suboptions: + address: + description: Pnp Device's address. + type: str + altitude: + description: Pnp Device's altitude. + type: str + latitude: + description: Pnp Device's latitude. + type: str + longitude: + description: Pnp Device's longitude. + type: str + siteId: + description: Pnp Device's siteId. + type: str + macAddress: + description: Pnp Device's macAddress. + type: str + mode: + description: Pnp Device's mode. + type: str + name: + description: Pnp Device's name. + type: str + neighborLinks: + description: Pnp Device's neighborLinks. + type: list + elements: dict + suboptions: + localInterfaceName: + description: Pnp Device's localInterfaceName. + type: str + localMacAddress: + description: Pnp Device's localMacAddress. + type: str + localShortInterfaceName: + description: Pnp Device's localShortInterfaceName. + type: str + remoteDeviceName: + description: Pnp Device's remoteDeviceName. + type: str + remoteInterfaceName: + description: Pnp Device's remoteInterfaceName. + type: str + remoteMacAddress: + description: Pnp Device's remoteMacAddress. + type: str + remotePlatform: + description: Pnp Device's remotePlatform. + type: str + remoteShortInterfaceName: + description: Pnp Device's remoteShortInterfaceName. + type: str + remoteVersion: + description: Pnp Device's remoteVersion. + type: str + onbState: + description: Pnp Device's onbState. + type: str + pid: + description: Pnp Device's pid. + type: str + pnpProfileList: + description: Pnp Device's pnpProfileList. + type: list + elements: dict + suboptions: + createdBy: + description: Pnp Device's createdBy. + type: str + discoveryCreated: + description: DiscoveryCreated flag. + type: bool + primaryEndpoint: + description: Pnp Device's primaryEndpoint. + type: dict + suboptions: + certificate: + description: Pnp Device's certificate. + type: str + fqdn: + description: Pnp Device's fqdn. + type: str + ipv4Address: + description: Pnp Device's ipv4Address. + type: dict + ipv6Address: + description: Pnp Device's ipv6Address. + type: dict + port: + description: Pnp Device's port. + type: int + protocol: + description: Pnp Device's protocol. + type: str + profileName: + description: Pnp Device's profileName. + type: str + secondaryEndpoint: + description: Pnp Device's secondaryEndpoint. + type: dict + suboptions: + certificate: + description: Pnp Device's certificate. + type: str + fqdn: + description: Pnp Device's fqdn. + type: str + ipv4Address: + description: Pnp Device's ipv4Address. + type: dict + ipv6Address: + description: Pnp Device's ipv6Address. + type: dict + port: + description: Pnp Device's port. + type: int + protocol: + description: Pnp Device's protocol. + type: str + populateInventory: + description: PopulateInventory flag. + type: bool + preWorkflowCliOuputs: + description: Pnp Device's preWorkflowCliOuputs. + type: list + elements: dict + suboptions: + cli: + description: Pnp Device's cli. + type: str + cliOutput: + description: Pnp Device's cliOutput. + type: str + projectId: + description: Pnp Device's projectId. + type: str + projectName: + description: Pnp Device's projectName. + type: str + reloadRequested: + description: ReloadRequested flag. + type: bool + serialNumber: + description: Pnp Device's serialNumber. + type: str + smartAccountId: + description: Pnp Device's smartAccountId. + type: str + source: + description: Pnp Device's source. + type: str + stack: + description: Stack flag. + type: bool + stackInfo: + description: Pnp Device's stackInfo. + type: dict + suboptions: + isFullRing: + description: IsFullRing flag. + type: bool + stackMemberList: + description: Pnp Device's stackMemberList. + type: list + elements: dict + suboptions: + hardwareVersion: + description: Pnp Device's hardwareVersion. + type: str + licenseLevel: + description: Pnp Device's licenseLevel. + type: str + licenseType: + description: Pnp Device's licenseType. + type: str + macAddress: + description: Pnp Device's macAddress. + type: str + pid: + description: Pnp Device's pid. + type: str + priority: + description: Pnp Device's priority. + type: int + role: + description: Pnp Device's role. + type: str + serialNumber: + description: Pnp Device's serialNumber. + type: str + softwareVersion: + description: Pnp Device's softwareVersion. + type: str + stackNumber: + description: Pnp Device's stackNumber. + type: int + state: + description: Pnp Device's state. + type: str + sudiSerialNumber: + description: Pnp Device's sudiSerialNumber. + type: str + stackRingProtocol: + description: Pnp Device's stackRingProtocol. + type: str + supportsStackWorkflows: + description: SupportsStackWorkflows flag. + type: bool + totalMemberCount: + description: Pnp Device's totalMemberCount. + type: int + validLicenseLevels: + description: Pnp Device's validLicenseLevels. + type: str + state: + description: Pnp Device's state. + type: str + sudiRequired: + description: SudiRequired flag. + type: bool + tags: + description: Pnp Device's tags. + type: dict + userSudiSerialNos: + description: Pnp Device's userSudiSerialNos. + elements: str + type: list + virtualAccountId: + description: Pnp Device's virtualAccountId. + type: str + workflowId: + description: Pnp Device's workflowId. + type: str + workflowName: + description: Pnp Device's workflowName. + type: str + +requirements: +- dnacentersdk == 2.4.5 +- python >= 3.5 +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.add_device, + device_onboarding_pnp.DeviceOnboardingPnp.claim_a_device_to_a_site, + device_onboarding_pnp.DeviceOnboardingPnp.delete_device_by_id_from_pnp, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device + post /dna/intent/api/v1/onboarding/pnp-device/site-claim + post /dna/intent/api/v1/onboarding/pnp-device/{id} + +""" + +EXAMPLES = r""" +- name: Add a new device and claim the device + cisco.dnac.pnp_intent: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + dnac_log: True + state: merged + config: + template_name: string + image_name: string + site_name: string + deviceInfo: + aaaCredentials: + password: string + username: string + addedOn: 0 + addnMacAddrs: + - string + agentType: string + authStatus: string + authenticatedSudiSerialNo: string + capabilitiesSupported: + - string + cmState: string + description: string + deviceSudiSerialNos: + - string + deviceType: string + featuresSupported: + - string + fileSystemList: + - freespace: 0 + name: string + readable: true + size: 0 + type: string + writeable: true + firstContact: 0 + hostname: string + httpHeaders: + - key: string + value: string + imageFile: string + imageVersion: string + ipInterfaces: + - ipv4Address: {} + ipv6AddressList: + - {} + macAddress: string + name: string + status: string + lastContact: 0 + lastSyncTime: 0 + lastUpdateOn: 0 + location: + address: string + altitude: string + latitude: string + longitude: string + siteId: string + macAddress: string + mode: string + name: string + neighborLinks: + - localInterfaceName: string + localMacAddress: string + localShortInterfaceName: string + remoteDeviceName: string + remoteInterfaceName: string + remoteMacAddress: string + remotePlatform: string + remoteShortInterfaceName: string + remoteVersion: string + onbState: string + pid: string + pnpProfileList: + - createdBy: string + discoveryCreated: true + primaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + profileName: string + secondaryEndpoint: + certificate: string + fqdn: string + ipv4Address: {} + ipv6Address: {} + port: 0 + protocol: string + populateInventory: true + preWorkflowCliOuputs: + - cli: string + cliOutput: string + projectId: string + projectName: string + reloadRequested: true + serialNumber: string + smartAccountId: string + source: string + stack: true + stackInfo: + isFullRing: true + stackMemberList: + - hardwareVersion: string + licenseLevel: string + licenseType: string + macAddress: string + pid: string + priority: 0 + role: string + serialNumber: string + softwareVersion: string + stackNumber: 0 + state: string + sudiSerialNumber: string + stackRingProtocol: string + supportsStackWorkflows: true + totalMemberCount: 0 + validLicenseLevels: string + state: string + sudiRequired: true + tags: {} + userSudiSerialNos: + - string + virtualAccountId: string + workflowId: string + workflowName: string +""" + +RETURN = r""" +#Case_1: When the device is claimed successfully. +response_1: + description: A dictionary with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": + { + "response": String, + "version": String + }, + "msg": String + } + +#Case_2: Given site/image/template/project not found or Device is not found for deletion +response_2: + description: A list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + sample: > + { + "response": [], + "msg": String + } + +#Case_3: Error while deleting/claiming a device +response_3: + description: A string with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": String, + "msg": String + } +""" + +import copy +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.module_utils.basic import AnsibleModule +from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( + DNACSDK, + validate_list_of_dicts, + log, + get_dict_result, +) + + +class DnacPnp: + def __init__(self, module): + self.module = module + self.params = module.params + self.config = copy.deepcopy(module.params.get("config")) + self.have = [] + self.want = [] + self.diff = [] + self.validated = [] + dnac_params = self.get_dnac_params(self.params) + log(str(dnac_params)) + self.dnac = DNACSDK(params=dnac_params) + self.log = dnac_params.get("dnac_log") + + self.result = dict(changed=False, diff=[], response=[], warnings=[]) + + def get_state(self): + return self.params.get("state") + + def validate_input(self): + pnp_spec = dict( + template_name=dict(required=True, type='str'), + project_name=dict(required=False, type='str', default="Onboarding Configuration"), + site_name=dict(required=True, type='str'), + image_name=dict(required=True, type='str'), + golden_image=dict(required=False, type='bool'), + deviceInfo=dict(required=True, type='dict'), + pnp_type=dict(required=False, type=str, default="Default") + ) + + if self.config: + msg = None + + # Validate template params + if self.log: + log(str(self.config)) + valid_pnp, invalid_params = validate_list_of_dicts( + self.config, pnp_spec + ) + + if invalid_params: + msg = "Invalid parameters in playbook: {0}".format( + "\n".join(invalid_params) + ) + self.module.fail_json(msg=msg) + + self.validated = valid_pnp + + if self.log: + log(str(valid_pnp)) + log(str(self.validated)) + + def get_dnac_params(self, params): + dnac_params = dict( + dnac_host=params.get("dnac_host"), + dnac_port=params.get("dnac_port"), + dnac_username=params.get("dnac_username"), + dnac_password=params.get("dnac_password"), + dnac_verify=params.get("dnac_verify"), + dnac_debug=params.get("dnac_debug"), + dnac_log=params.get("dnac_log") + ) + return dnac_params + + def site_exists(self): + site_exists = False + site_id = None + response = None + try: + response = self.dnac.exec( + family="sites", + function='get_site', + params={"name": self.want.get("site_name")}, + ) + except Exception as e: + self.module.fail_json(msg="Site not found", response=[]) + + if response: + if self.log: + log(str(response)) + + site = response.get("response") + site_id = site[0].get("id") + site_exists = True + + return (site_exists, site_id) + + def get_pnp_params(self, params): + pnp_params = {} + pnp_params['_id'] = params.get('_id') + pnp_params['deviceInfo'] = params.get('deviceInfo') + pnp_params['runSummaryList'] = params.get('runSummaryList') + pnp_params['systemResetWorkflow'] = params.get('systemResetWorkflow') + pnp_params['systemWorkflow'] = params.get('systemWorkflow') + pnp_params['tenantId'] = params.get('tenantId') + pnp_params['version'] = params.get('device_version') + pnp_params['workflow'] = params.get('workflow') + pnp_params['workflowParameters'] = params.get('workflowParameters') + + return pnp_params + + def get_image_params(self, params): + image_params = dict( + image_name=params.get("image_name"), + is_tagged_golden=params.get("golden_image"), + ) + + return image_params + + def get_claim_params(self): + imageinfo = dict( + imageId=self.have.get("image_id") + ) + configinfo = dict( + configId=self.have.get("template_id"), + configParameters=[dict( + key="", + value="" + )] + ) + claim_params = dict( + deviceId=self.have.get("device_id"), + siteId=self.have.get("site_id"), + type=self.want.get("pnp_type"), + hostname=self.want.get("hostname"), + imageInfo=imageinfo, + configInfo=configinfo, + ) + + return claim_params + + def get_have(self): + have = {} + + if self.params.get("state") == "merged": + # check if given image exists, if exists store image_id + image_response = self.dnac.exec( + family="software_image_management_swim", + function='get_software_image_details', + params=self.want.get("image_params"), + ) + + if self.log: + log(str(image_response)) + + image_list = image_response.get("response") + + if len(image_list) == 1: + have["image_id"] = image_list[0].get("imageUuid") + if self.log: + log("Image Id: " + str(have["image_id"])) + else: + self.module.fail_json(msg="Image not found", response=[]) + + # check if given template exists, if exists store template id + template_list = self.dnac.exec( + family="configuration_templates", + function='gets_the_templates_available', + params={"project_names": self.want.get("project_name")}, + ) + + if self.log: + log(str(template_list)) + + if template_list and isinstance(template_list, list): + # API execution error returns a dict + template_details = get_dict_result(template_list, 'name', self.want.get("template_name")) + if template_details: + have["template_id"] = template_details.get("templateId") + + if self.log: + log("Template Id: " + str(have["template_id"])) + else: + self.module.fail_json(msg="Template not found", response=[]) + else: + self.module.fail_json(msg="Project Not Found", response=[]) + + # check if given site exits, if exists store current site info + site_name = self.want.get("site_name") + + site_exists = False + (site_exists, site_id) = self.site_exists() + + if site_exists: + have["site_id"] = site_id + if self.log: + log("Site Exists: " + str(site_exists) + "\n Site_id:" + str(site_id)) + log("Site Name:" + str(site_name)) + + # check if given device exists in pnp inventory, store device Id + device_response = self.dnac.exec( + family="device_onboarding_pnp", + function='get_device_list', + params={"serial_number": self.want.get("serial_number")} + ) + + if self.log: + log(str(device_response)) + + if device_response and (len(device_response) == 1): + have["device_id"] = device_response[0].get("id") + have["device_found"] = True + + if self.log: + log("Device Id: " + str(have["device_id"])) + else: + have["device_found"] = False + + self.have = have + + def get_want(self): + for params in self.validated: + want = dict( + image_params=self.get_image_params(params), + pnp_params=self.get_pnp_params(params), + pnp_type=params.get("pnp_type"), + site_name=params.get("site_name"), + serial_number=params.get("deviceInfo").get("serialNumber"), + hostname=params.get("deviceInfo").get("hostname"), + project_name=params.get("project_name"), + template_name=params.get("template_name") + ) + + self.want = want + + def get_diff_merge(self): + + # if given device doesnot exist then add it to pnp database and get the device id + if not self.have.get("device_found"): + log("Adding device to pnp database") + response = self.dnac.exec( + family="device_onboarding_pnp", + function="add_device", + params=self.want.get("pnp_params"), + op_modifies=True, + ) + self.have["device_id"] = response.get("id") + + if self.log: + log(str(response)) + log(self.have.get("device_id")) + + claim_params = self.get_claim_params() + claim_response = self.dnac.exec( + family="device_onboarding_pnp", + function='claim_a_device_to_a_site', + op_modifies=True, + params=claim_params, + ) + + if self.log: + log(str(claim_response)) + + if claim_response.get("response") == "Device Claimed": + self.result['changed'] = True + self.result['msg'] = "Device Claimed Successfully" + self.result['response'] = claim_response + self.result['diff'] = self.validated + else: + self.module.fail_json(msg="Device Claim Failed", response=claim_response) + + def get_diff_delete(self): + if self.have.get("device_found"): + + try: + response = self.dnac.exec( + family="device_onboarding_pnp", + function="delete_device_by_id_from_pnp", + op_modifies=True, + params={"id": self.have.get("device_id")}, + ) + + if self.log: + log(str(response)) + + if response.get("deviceInfo").get("state") == "Deleted": + self.result['changed'] = True + self.result['response'] = response + self.result['diff'] = self.validated + self.result['msg'] = "Device Deleted Successfully" + else: + self.result['response'] = response + self.result['msg'] = "Error while deleting the device" + + except Exception as errorstr: + response = str(errorstr) + msg = "Device Deletion Failed" + self.module.fail_json(msg=msg, response=response) + + else: + self.module.fail_json(msg="Device Not Found", response=[]) + + +def main(): + """ main entry point for module execution + """ + + element_spec = dict( + dnac_host=dict(required=True, type='str'), + dnac_port=dict(type='str', default='443'), + dnac_username=dict(type='str', default='admin', aliases=["user"]), + dnac_password=dict(type='str', no_log=True), + dnac_verify=dict(type='bool', default='True'), + dnac_version=dict(type="str", default="2.2.3.3"), + dnac_debug=dict(type='bool', default=False), + dnac_log=dict(type='bool', default=False), + validate_response_schema=dict(type="bool", default=True), + config=dict(required=True, type='list', elements='dict'), + state=dict( + default='merged', + choices=['merged', 'deleted'] + ) + ) + + module = AnsibleModule(argument_spec=element_spec, + supports_check_mode=False) + dnac_pnp = DnacPnp(module) + dnac_pnp.validate_input() + state = dnac_pnp.get_state() + + dnac_pnp.get_want() + dnac_pnp.get_have() + + if state == "merged": + dnac_pnp.get_diff_merge() + + elif state == "deleted": + dnac_pnp.get_diff_delete() + + module.exit_json(**dnac_pnp.result) + + +if __name__ == '__main__': + main() diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_server_profile_update.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_server_profile_update.py new file mode 100644 index 00000000..b6528b96 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_server_profile_update.py @@ -0,0 +1,196 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_server_profile_update +short_description: Resource module for Pnp Server Profile Update +description: +- Manage operation update of the resource Pnp Server Profile Update. +- > + Updates the PnP Server profile in a registered Virtual Account in the PnP database. The response payload returns + the updated smart & virtual account info. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + autoSyncPeriod: + description: Pnp Server Profile Update's autoSyncPeriod. + type: int + ccoUser: + description: Pnp Server Profile Update's ccoUser. + type: str + expiry: + description: Pnp Server Profile Update's expiry. + type: int + lastSync: + description: Pnp Server Profile Update's lastSync. + type: int + profile: + description: Pnp Server Profile Update's profile. + suboptions: + addressFqdn: + description: Pnp Server Profile Update's addressFqdn. + type: str + addressIpV4: + description: Pnp Server Profile Update's addressIpV4. + type: str + cert: + description: Pnp Server Profile Update's cert. + type: str + makeDefault: + description: MakeDefault flag. + type: bool + name: + description: Pnp Server Profile Update's name. + type: str + port: + description: Pnp Server Profile Update's port. + type: int + profileId: + description: Pnp Server Profile Update's profileId. + type: str + proxy: + description: Proxy flag. + type: bool + type: dict + smartAccountId: + description: Pnp Server Profile Update's smartAccountId. + type: str + syncResult: + description: Pnp Server Profile Update's syncResult. + suboptions: + syncList: + description: Pnp Server Profile Update's syncList. + elements: dict + suboptions: + deviceSnList: + description: Pnp Server Profile Update's deviceSnList. + elements: str + type: list + syncType: + description: Pnp Server Profile Update's syncType. + type: str + type: list + syncMsg: + description: Pnp Server Profile Update's syncMsg. + type: str + type: dict + syncResultStr: + description: Pnp Server Profile Update's syncResultStr. + type: str + syncStartTime: + description: Pnp Server Profile Update's syncStartTime. + type: int + syncStatus: + description: Pnp Server Profile Update's syncStatus. + type: str + tenantId: + description: Pnp Server Profile Update's tenantId. + type: str + token: + description: Pnp Server Profile Update's token. + type: str + virtualAccountId: + description: Pnp Server Profile Update's virtualAccountId. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) UpdatePnPServerProfile + description: Complete reference of the UpdatePnPServerProfile API. + link: https://developer.cisco.com/docs/dna-center/#!update-pn-p-server-profile +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.update_pnp_server_profile, + + - Paths used are + put /dna/intent/api/v1/onboarding/pnp-settings/savacct, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.pnp_server_profile_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + autoSyncPeriod: 0 + ccoUser: string + expiry: 0 + lastSync: 0 + profile: + addressFqdn: string + addressIpV4: string + cert: string + makeDefault: true + name: string + port: 0 + profileId: string + proxy: true + smartAccountId: string + syncResult: + syncList: + - deviceSnList: + - string + syncType: string + syncMsg: string + syncResultStr: string + syncStartTime: 0 + syncStatus: string + tenantId: string + token: string + virtualAccountId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "virtualAccountId": "string", + "autoSyncPeriod": 0, + "syncResultStr": "string", + "profile": { + "proxy": true, + "makeDefault": true, + "port": 0, + "profileId": "string", + "name": "string", + "addressIpV4": "string", + "cert": "string", + "addressFqdn": "string" + }, + "ccoUser": "string", + "syncResult": { + "syncList": [ + { + "syncType": "string", + "deviceSnList": [ + "string" + ] + } + ], + "syncMsg": "string" + }, + "token": "string", + "syncStartTime": 0, + "lastSync": 0, + "tenantId": "string", + "smartAccountId": "string", + "expiry": 0, + "syncStatus": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_smart_account_domains_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_smart_account_domains_info.py new file mode 100644 index 00000000..6f57ce11 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_smart_account_domains_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_smart_account_domains_info +short_description: Information module for Pnp Smart Account Domains +description: +- Get all Pnp Smart Account Domains. +- Returns the list of Smart Account domains. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetSmartAccountList + description: Complete reference of the GetSmartAccountList API. + link: https://developer.cisco.com/docs/dna-center/#!get-smart-account-list +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_smart_account_list, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-settings/sacct, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Smart Account Domains + cisco.dnac.pnp_smart_account_domains_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: str + sample: > + [ + "string" + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_add.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_add.py new file mode 100644 index 00000000..0f814082 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_add.py @@ -0,0 +1,197 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_virtual_account_add +short_description: Resource module for Pnp Virtual Account Add +description: +- Manage operation create of the resource Pnp Virtual Account Add. +- > + Registers a Smart Account, Virtual Account and the relevant server profile info with the PnP System & database. + The devices present in the registered virtual account are synced with the PnP database as well. The response + payload returns the new profile. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + autoSyncPeriod: + description: Pnp Virtual Account Add's autoSyncPeriod. + type: int + ccoUser: + description: Pnp Virtual Account Add's ccoUser. + type: str + expiry: + description: Pnp Virtual Account Add's expiry. + type: int + lastSync: + description: Pnp Virtual Account Add's lastSync. + type: int + profile: + description: Pnp Virtual Account Add's profile. + suboptions: + addressFqdn: + description: Pnp Virtual Account Add's addressFqdn. + type: str + addressIpV4: + description: Pnp Virtual Account Add's addressIpV4. + type: str + cert: + description: Pnp Virtual Account Add's cert. + type: str + makeDefault: + description: MakeDefault flag. + type: bool + name: + description: Pnp Virtual Account Add's name. + type: str + port: + description: Pnp Virtual Account Add's port. + type: int + profileId: + description: Pnp Virtual Account Add's profileId. + type: str + proxy: + description: Proxy flag. + type: bool + type: dict + smartAccountId: + description: Pnp Virtual Account Add's smartAccountId. + type: str + syncResult: + description: Pnp Virtual Account Add's syncResult. + suboptions: + syncList: + description: Pnp Virtual Account Add's syncList. + elements: dict + suboptions: + deviceSnList: + description: Pnp Virtual Account Add's deviceSnList. + elements: str + type: list + syncType: + description: Pnp Virtual Account Add's syncType. + type: str + type: list + syncMsg: + description: Pnp Virtual Account Add's syncMsg. + type: str + type: dict + syncResultStr: + description: Pnp Virtual Account Add's syncResultStr. + type: str + syncStartTime: + description: Pnp Virtual Account Add's syncStartTime. + type: int + syncStatus: + description: Pnp Virtual Account Add's syncStatus. + type: str + tenantId: + description: Pnp Virtual Account Add's tenantId. + type: str + token: + description: Pnp Virtual Account Add's token. + type: str + virtualAccountId: + description: Pnp Virtual Account Add's virtualAccountId. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) AddVirtualAccount + description: Complete reference of the AddVirtualAccount API. + link: https://developer.cisco.com/docs/dna-center/#!add-virtual-account +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.add_virtual_account, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-settings/savacct, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_virtual_account_add: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + autoSyncPeriod: 0 + ccoUser: string + expiry: 0 + lastSync: 0 + profile: + addressFqdn: string + addressIpV4: string + cert: string + makeDefault: true + name: string + port: 0 + profileId: string + proxy: true + smartAccountId: string + syncResult: + syncList: + - deviceSnList: + - string + syncType: string + syncMsg: string + syncResultStr: string + syncStartTime: 0 + syncStatus: string + tenantId: string + token: string + virtualAccountId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "virtualAccountId": "string", + "autoSyncPeriod": 0, + "syncResultStr": "string", + "profile": { + "proxy": true, + "makeDefault": true, + "port": 0, + "profileId": "string", + "name": "string", + "addressIpV4": "string", + "cert": "string", + "addressFqdn": "string" + }, + "ccoUser": "string", + "syncResult": { + "syncList": [ + { + "syncType": "string", + "deviceSnList": [ + "string" + ] + } + ], + "syncMsg": "string" + }, + "token": "string", + "syncStartTime": 0, + "lastSync": 0, + "tenantId": "string", + "smartAccountId": "string", + "expiry": 0, + "syncStatus": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_deregister.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_deregister.py new file mode 100644 index 00000000..8f0d9d43 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_deregister.py @@ -0,0 +1,99 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_virtual_account_deregister +short_description: Resource module for Pnp Virtual Account Deregister +description: +- Manage operation delete of the resource Pnp Virtual Account Deregister. +- > + Deregisters the specified smart account & virtual account info and the associated device information from the PnP + System & database. The devices associated with the deregistered virtual account are removed from the PnP database + as well. The response payload contains the deregistered smart & virtual account information. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + domain: + description: Domain query parameter. Smart Account Domain. + type: str + name: + description: Name query parameter. Virtual Account Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) DeregisterVirtualAccount + description: Complete reference of the DeregisterVirtualAccount API. + link: https://developer.cisco.com/docs/dna-center/#!deregister-virtual-account +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.deregister_virtual_account, + + - Paths used are + delete /dna/intent/api/v1/onboarding/pnp-settings/vacct, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.pnp_virtual_account_deregister: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + domain: string + name: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "virtualAccountId": "string", + "autoSyncPeriod": 0, + "syncResultStr": "string", + "profile": { + "proxy": true, + "makeDefault": true, + "port": 0, + "profileId": "string", + "name": "string", + "addressIpV4": "string", + "cert": "string", + "addressFqdn": "string" + }, + "ccoUser": "string", + "syncResult": { + "syncList": [ + { + "syncType": "string", + "deviceSnList": [ + "string" + ] + } + ], + "syncMsg": "string" + }, + "token": "string", + "syncStartTime": 0, + "lastSync": 0, + "tenantId": "string", + "smartAccountId": "string", + "expiry": 0, + "syncStatus": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_devices_sync.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_devices_sync.py new file mode 100644 index 00000000..6a1c0da0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_devices_sync.py @@ -0,0 +1,196 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_virtual_account_devices_sync +short_description: Resource module for Pnp Virtual Account Devices Sync +description: +- Manage operation create of the resource Pnp Virtual Account Devices Sync. +- > + Synchronizes the device info from the given smart account & virtual account with the PnP database. The response + payload returns a list of synced devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + autoSyncPeriod: + description: Pnp Virtual Account Devices Sync's autoSyncPeriod. + type: int + ccoUser: + description: Pnp Virtual Account Devices Sync's ccoUser. + type: str + expiry: + description: Pnp Virtual Account Devices Sync's expiry. + type: int + lastSync: + description: Pnp Virtual Account Devices Sync's lastSync. + type: int + profile: + description: Pnp Virtual Account Devices Sync's profile. + suboptions: + addressFqdn: + description: Pnp Virtual Account Devices Sync's addressFqdn. + type: str + addressIpV4: + description: Pnp Virtual Account Devices Sync's addressIpV4. + type: str + cert: + description: Pnp Virtual Account Devices Sync's cert. + type: str + makeDefault: + description: MakeDefault flag. + type: bool + name: + description: Pnp Virtual Account Devices Sync's name. + type: str + port: + description: Pnp Virtual Account Devices Sync's port. + type: int + profileId: + description: Pnp Virtual Account Devices Sync's profileId. + type: str + proxy: + description: Proxy flag. + type: bool + type: dict + smartAccountId: + description: Pnp Virtual Account Devices Sync's smartAccountId. + type: str + syncResult: + description: Pnp Virtual Account Devices Sync's syncResult. + suboptions: + syncList: + description: Pnp Virtual Account Devices Sync's syncList. + elements: dict + suboptions: + deviceSnList: + description: Pnp Virtual Account Devices Sync's deviceSnList. + elements: str + type: list + syncType: + description: Pnp Virtual Account Devices Sync's syncType. + type: str + type: list + syncMsg: + description: Pnp Virtual Account Devices Sync's syncMsg. + type: str + type: dict + syncResultStr: + description: Pnp Virtual Account Devices Sync's syncResultStr. + type: str + syncStartTime: + description: Pnp Virtual Account Devices Sync's syncStartTime. + type: int + syncStatus: + description: Pnp Virtual Account Devices Sync's syncStatus. + type: str + tenantId: + description: Pnp Virtual Account Devices Sync's tenantId. + type: str + token: + description: Pnp Virtual Account Devices Sync's token. + type: str + virtualAccountId: + description: Pnp Virtual Account Devices Sync's virtualAccountId. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) SyncVirtualAccountDevices + description: Complete reference of the SyncVirtualAccountDevices API. + link: https://developer.cisco.com/docs/dna-center/#!sync-virtual-account-devices +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.sync_virtual_account_devices, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-device/vacct-sync, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_virtual_account_devices_sync: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + autoSyncPeriod: 0 + ccoUser: string + expiry: 0 + lastSync: 0 + profile: + addressFqdn: string + addressIpV4: string + cert: string + makeDefault: true + name: string + port: 0 + profileId: string + proxy: true + smartAccountId: string + syncResult: + syncList: + - deviceSnList: + - string + syncType: string + syncMsg: string + syncResultStr: string + syncStartTime: 0 + syncStatus: string + tenantId: string + token: string + virtualAccountId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "virtualAccountId": "string", + "autoSyncPeriod": 0, + "syncResultStr": "string", + "profile": { + "proxy": true, + "makeDefault": true, + "port": 0, + "profileId": "string", + "name": "string", + "addressIpV4": "string", + "cert": "string", + "addressFqdn": "string" + }, + "ccoUser": "string", + "syncResult": { + "syncList": [ + { + "syncType": "string", + "deviceSnList": [ + "string" + ] + } + ], + "syncMsg": "string" + }, + "token": "string", + "syncStartTime": 0, + "lastSync": 0, + "tenantId": "string", + "smartAccountId": "string", + "expiry": 0, + "syncStatus": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_sync_result_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_sync_result_info.py new file mode 100644 index 00000000..e3c37abe --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_account_sync_result_info.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_virtual_account_sync_result_info +short_description: Information module for Pnp Virtual Account Sync Result +description: +- Get all Pnp Virtual Account Sync Result. +- Returns the summary of devices synced from the given smart account & virtual account with PnP. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + domain: + description: + - Domain path parameter. Smart Account Domain. + type: str + name: + description: + - Name path parameter. Virtual Account Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetSyncResultForVirtualAccount + description: Complete reference of the GetSyncResultForVirtualAccount API. + link: https://developer.cisco.com/docs/dna-center/#!get-sync-result-for-virtual-account +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_sync_result_for_virtual_account, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-device/sacct/{domain}/vacct/{name}/sync-result, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Virtual Account Sync Result + cisco.dnac.pnp_virtual_account_sync_result_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + domain: string + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "virtualAccountId": "string", + "autoSyncPeriod": 0, + "syncResultStr": "string", + "profile": { + "proxy": true, + "makeDefault": true, + "port": 0, + "profileId": "string", + "name": "string", + "addressIpV4": "string", + "cert": "string", + "addressFqdn": "string" + }, + "ccoUser": "string", + "syncResult": { + "syncList": [ + { + "syncType": "string", + "deviceSnList": [ + "string" + ] + } + ], + "syncMsg": "string" + }, + "token": "string", + "syncStartTime": 0, + "lastSync": 0, + "tenantId": "string", + "smartAccountId": "string", + "expiry": 0, + "syncStatus": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_accounts_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_accounts_info.py new file mode 100644 index 00000000..40ed3ac7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_virtual_accounts_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_virtual_accounts_info +short_description: Information module for Pnp Virtual Accounts +description: +- Get all Pnp Virtual Accounts. +- Returns list of virtual accounts associated with the specified smart account. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + domain: + description: + - Domain path parameter. Smart Account Domain. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetVirtualAccountList + description: Complete reference of the GetVirtualAccountList API. + link: https://developer.cisco.com/docs/dna-center/#!get-virtual-account-list +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_virtual_account_list, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-settings/sacct/{domain}/vacct, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Virtual Accounts + cisco.dnac.pnp_virtual_accounts_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + domain: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: str + sample: > + [ + "string" + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow.py new file mode 100644 index 00000000..5a585095 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow.py @@ -0,0 +1,310 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_workflow +short_description: Resource module for Pnp Workflow +description: +- Manage operations create, update and delete of the resource Pnp Workflow. +- Adds a PnP Workflow along with the relevant tasks in the workflow into the PnP database. +- Deletes a workflow specified by id. +- Updates an existing workflow. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + _id: + description: Pnp Workflow's _id. + type: str + addToInventory: + description: AddToInventory flag. + type: bool + addedOn: + description: Pnp Workflow's addedOn. + type: int + configId: + description: Pnp Workflow's configId. + type: str + currTaskIdx: + description: Pnp Workflow's currTaskIdx. + type: int + description: + description: Pnp Workflow's description. + type: str + endTime: + description: Pnp Workflow's endTime. + type: int + execTime: + description: Pnp Workflow's execTime. + type: int + id: + description: Id path parameter. + type: str + imageId: + description: Pnp Workflow's imageId. + type: str + instanceType: + description: Pnp Workflow's instanceType. + type: str + lastupdateOn: + description: Pnp Workflow's lastupdateOn. + type: int + name: + description: Pnp Workflow's name. + type: str + startTime: + description: Pnp Workflow's startTime. + type: int + state_: + description: Pnp Workflow's state. + type: str + tasks: + description: Pnp Workflow's tasks. + elements: dict + suboptions: + currWorkItemIdx: + description: Pnp Workflow's currWorkItemIdx. + type: int + endTime: + description: Pnp Workflow's endTime. + type: int + name: + description: Pnp Workflow's name. + type: str + startTime: + description: Pnp Workflow's startTime. + type: int + state: + description: Pnp Workflow's state. + type: str + taskSeqNo: + description: Pnp Workflow's taskSeqNo. + type: int + timeTaken: + description: Pnp Workflow's timeTaken. + type: int + type: + description: Pnp Workflow's type. + type: str + workItemList: + description: Pnp Workflow's workItemList. + elements: dict + suboptions: + command: + description: Pnp Workflow's command. + type: str + endTime: + description: Pnp Workflow's endTime. + type: int + outputStr: + description: Pnp Workflow's outputStr. + type: str + startTime: + description: Pnp Workflow's startTime. + type: int + state: + description: Pnp Workflow's state. + type: str + timeTaken: + description: Pnp Workflow's timeTaken. + type: int + type: list + type: list + tenantId: + description: Pnp Workflow's tenantId. + type: str + type: + description: Pnp Workflow's type. + type: str + useState: + description: Pnp Workflow's useState. + type: str + version: + description: Pnp Workflow's version. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) AddAWorkflow + description: Complete reference of the AddAWorkflow API. + link: https://developer.cisco.com/docs/dna-center/#!add-a-workflow +- name: Cisco DNA Center documentation for Device Onboarding (PnP) DeleteWorkflowById + description: Complete reference of the DeleteWorkflowById API. + link: https://developer.cisco.com/docs/dna-center/#!delete-workflow-by-id +- name: Cisco DNA Center documentation for Device Onboarding (PnP) UpdateWorkflow + description: Complete reference of the UpdateWorkflow API. + link: https://developer.cisco.com/docs/dna-center/#!update-workflow +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.add_a_workflow, + device_onboarding_pnp.DeviceOnboardingPnp.delete_workflow_by_id, + device_onboarding_pnp.DeviceOnboardingPnp.update_workflow, + + - Paths used are + post /dna/intent/api/v1/onboarding/pnp-workflow, + delete /dna/intent/api/v1/onboarding/pnp-workflow/{id}, + put /dna/intent/api/v1/onboarding/pnp-workflow/{id}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.pnp_workflow: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state_: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + +- name: Delete by id + cisco.dnac.pnp_workflow: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +- name: Update by id + cisco.dnac.pnp_workflow: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + _id: string + addToInventory: true + addedOn: 0 + configId: string + currTaskIdx: 0 + description: string + endTime: 0 + execTime: 0 + id: string + imageId: string + instanceType: string + lastupdateOn: 0 + name: string + startTime: 0 + state_: string + tasks: + - currWorkItemIdx: 0 + endTime: 0 + name: string + startTime: 0 + state: string + taskSeqNo: 0 + timeTaken: 0 + type: string + workItemList: + - command: string + endTime: 0 + outputStr: string + startTime: 0 + state: string + timeTaken: 0 + tenantId: string + type: string + useState: string + version: 0 + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_count_info.py new file mode 100644 index 00000000..215330a7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_count_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_workflow_count_info +short_description: Information module for Pnp Workflow Count +description: +- Get all Pnp Workflow Count. +- Returns the workflow count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. Workflow Name. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetWorkflowCount + description: Complete reference of the GetWorkflowCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-workflow-count +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_workflow_count, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-workflow/count, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Workflow Count + cisco.dnac.pnp_workflow_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: [] + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_info.py b/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_info.py new file mode 100644 index 00000000..7a00e17b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/pnp_workflow_info.py @@ -0,0 +1,160 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: pnp_workflow_info +short_description: Information module for Pnp Workflow +description: +- Get all Pnp Workflow. +- Get Pnp Workflow by id. +- Returns a workflow specified by id. +- > + Returns the list of workflows based on filter criteria. If a limit is not specified, it will default to return 50 + workflows. Pagination and sorting are also supported by this endpoint. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + limit: + description: + - Limit query parameter. Limits number of results. + type: int + offset: + description: + - Offset query parameter. Index of first result. + type: int + sort: + description: + - Sort query parameter. Comma seperated lost of fields to sort on. + elements: str + type: list + sortOrder: + description: + - SortOrder query parameter. Sort Order Ascending (asc) or Descending (des). + type: str + type: + description: + - Type query parameter. Workflow Type. + elements: str + type: list + name: + description: + - Name query parameter. Workflow Name. + elements: str + type: list + id: + description: + - Id path parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetWorkflowById + description: Complete reference of the GetWorkflowById API. + link: https://developer.cisco.com/docs/dna-center/#!get-workflow-by-id +- name: Cisco DNA Center documentation for Device Onboarding (PnP) GetWorkflows + description: Complete reference of the GetWorkflows API. + link: https://developer.cisco.com/docs/dna-center/#!get-workflows +notes: + - SDK Method used are + device_onboarding_pnp.DeviceOnboardingPnp.get_workflow_by_id, + device_onboarding_pnp.DeviceOnboardingPnp.get_workflows, + + - Paths used are + get /dna/intent/api/v1/onboarding/pnp-workflow, + get /dna/intent/api/v1/onboarding/pnp-workflow/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Pnp Workflow + cisco.dnac.pnp_workflow_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + limit: 0 + offset: 0 + sort: [] + sortOrder: string + type: [] + name: [] + register: result + +- name: Get Pnp Workflow by id + cisco.dnac.pnp_workflow_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "_id": "string", + "state": "string", + "type": "string", + "description": "string", + "lastupdateOn": 0, + "imageId": "string", + "currTaskIdx": 0, + "addedOn": 0, + "tasks": [ + { + "state": "string", + "type": "string", + "currWorkItemIdx": 0, + "taskSeqNo": 0, + "endTime": 0, + "startTime": 0, + "workItemList": [ + { + "state": "string", + "command": "string", + "outputStr": "string", + "endTime": 0, + "startTime": 0, + "timeTaken": 0 + } + ], + "timeTaken": 0, + "name": "string" + } + ], + "addToInventory": true, + "instanceType": "string", + "endTime": 0, + "execTime": 0, + "startTime": 0, + "useState": "string", + "configId": "string", + "name": "string", + "version": 0, + "tenantId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/profiling_rules_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/profiling_rules_count_info.py new file mode 100644 index 00000000..947cc223 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/profiling_rules_count_info.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: profiling_rules_count_info +short_description: Information module for Profiling Rules Count +description: +- Get all Profiling Rules Count. +- This API fetches the count of profiling rules based on the filter values provided in the query parameters. + The filter parameters are same as that of 'GET /profiling-rules' API, excluding the pagination and sort parameters. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + ruleType: + description: + - RuleType query parameter. Use comma-separated list of rule types to filter the data. Defaults to 'Custom Rule'. + type: str + includeDeleted: + description: + - IncludeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. + type: bool +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + policy.Policy.get_count_of_profiling_rules, + + - Paths used are + get /dna/intent/api/v1/endpoint-analytics/profiling-rules/count, + +""" + +EXAMPLES = r""" +- name: Get all Profiling Rules Count + cisco.dnac.profiling_rules_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + ruleType: string + includeDeleted: True + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "count": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/profiling_rules_in_bulk_create.py b/ansible_collections/cisco/dnac/plugins/modules/profiling_rules_in_bulk_create.py new file mode 100644 index 00000000..1c5b7ec8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/profiling_rules_in_bulk_create.py @@ -0,0 +1,189 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: profiling_rules_in_bulk_create +short_description: Resource module for Profiling Rules In Bulk Create +description: +- Manage operation create of the resource Profiling Rules In Bulk Create. +- This API imports the given list of profiling rules. For each record, + 1) If 'ruleType' for a record is not 'Custom Rule', then it is rejected. + 2) If 'ruleId' is provided in the input record, +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + profilingRules: + description: Profiling Rules In Bulk Create's profilingRules. + elements: dict + suboptions: + clusterId: + description: Unique identifier for ML cluster. Only applicable for 'ML Rule'. + type: str + conditionGroups: + description: Profiling Rules In Bulk Create's conditionGroups. + suboptions: + condition: + description: Profiling Rules In Bulk Create's condition. + suboptions: + attribute: + description: Profiling Rules In Bulk Create's attribute. + type: str + attributeDictionary: + description: Profiling Rules In Bulk Create's attributeDictionary. + type: str + operator: + description: Profiling Rules In Bulk Create's operator. + type: str + value: + description: Profiling Rules In Bulk Create's value. + type: str + type: dict + conditionGroup: + description: Profiling Rules In Bulk Create's conditionGroup. + elements: dict + type: list + operator: + description: Profiling Rules In Bulk Create's operator. + type: str + type: + description: Profiling Rules In Bulk Create's type. + type: str + type: dict + isDeleted: + description: Flag to indicate whether the rule was deleted. + type: bool + lastModifiedBy: + description: User that last modified the rule. It is read-only, and is ignored + if provided as part of input request. + type: str + lastModifiedOn: + description: Timestamp (in epoch milliseconds) of last modification. It is read-only, + and is ignored if provided as part of input request. + type: int + pluginId: + description: Plugin for the rule. Only applicable for 'Cisco Default' rules. + type: str + rejected: + description: Flag to indicate whether rule has been rejected by user or not. + Only applicable for 'ML Rule'. + type: bool + result: + description: Profiling Rules In Bulk Create's result. + suboptions: + deviceType: + description: List of device types determined by the current rule. + elements: str + type: list + hardwareManufacturer: + description: List of hardware manufacturers determined by the current rule. + elements: str + type: list + hardwareModel: + description: List of hardware models determined by the current rule. + elements: str + type: list + operatingSystem: + description: List of operating systems determined by the current rule. + elements: str + type: list + type: dict + ruleId: + description: Unique identifier for the rule. This is normally generated by the + system, and client does not need to provide it for rules that need to be newly + created. + type: str + ruleName: + description: Human readable name for the rule. + type: str + rulePriority: + description: Priority for the rule. + type: int + ruleType: + description: Type of the rule. Allowed values are 'Cisco Default - Static', + 'Cisco Default - Dynamic', 'Custom Rule', 'ML Rule'. + type: str + ruleVersion: + description: Version of the rule. + type: int + sourcePriority: + description: Source priority for the rule. + type: int + usedAttributes: + description: List of attributes used in the rule. Only applicable for 'Cisco + Default' rules. + elements: str + type: list + type: list +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + policy.Policy.import_profiling_rules_in_bulk, + + - Paths used are + post /dna/intent/api/v1/endpoint-analytics/profiling-rules/bulk, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.profiling_rules_in_bulk_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + profilingRules: + - clusterId: string + conditionGroups: + condition: + attribute: string + attributeDictionary: string + operator: string + value: string + conditionGroup: + - {} + operator: string + type: string + isDeleted: true + lastModifiedBy: string + lastModifiedOn: 0 + pluginId: string + rejected: true + result: + deviceType: + - string + hardwareManufacturer: + - string + hardwareModel: + - string + operatingSystem: + - string + ruleId: string + ruleName: string + rulePriority: 0 + ruleType: string + ruleVersion: 0 + sourcePriority: 0 + usedAttributes: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + {} +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/projects_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/projects_details_info.py new file mode 100644 index 00000000..23cf7c28 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/projects_details_info.py @@ -0,0 +1,315 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: projects_details_info +short_description: Information module for Projects Details +description: +- Get all Projects Details. +- Get projects details. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id query parameter. Id of project to be searched. + type: str + name: + description: + - Name query parameter. Name of project to be searched. + type: str + offset: + description: + - Offset query parameter. Index of first result. + type: int + limit: + description: + - Limit query parameter. Limits number of results. + type: int + sortOrder: + description: + - SortOrder query parameter. Sort Order Ascending (asc) or Descending (dsc). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates GetProjectsDetails + description: Complete reference of the GetProjectsDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-project-s-details +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.get_projects_details, + + - Paths used are + get /dna/intent/api/v2/template-programmer/project, + +""" + +EXAMPLES = r""" +- name: Get all Projects Details + cisco.dnac.projects_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + name: string + offset: 0 + limit: 0 + sortOrder: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "createTime": 0, + "description": "string", + "id": "string", + "isDeletable": true, + "lastUpdateTime": 0, + "name": "string", + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "templates": [ + { + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "author": "string", + "composite": true, + "containingTemplates": [ + { + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "composite": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "id": "string", + "language": "string", + "name": "string", + "projectName": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "version": "string" + } + ], + "createTime": 0, + "customParamsOrder": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "failurePolicy": "string", + "id": "string", + "language": "string", + "lastUpdateTime": 0, + "latestVersionTime": 0, + "name": "string", + "parentTemplateId": "string", + "projectId": "string", + "projectName": "string", + "rollbackTemplateContent": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "softwareType": "string", + "softwareVariant": "string", + "softwareVersion": "string", + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "validationErrors": { + "rollbackTemplateErrors": [ + {} + ], + "templateErrors": [ + {} + ], + "templateId": "string", + "templateVersion": "string" + }, + "version": "string" + } + ] + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface.py b/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface.py new file mode 100644 index 00000000..2c7881cb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface.py @@ -0,0 +1,176 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: qos_device_interface +short_description: Resource module for Qos Device Interface +description: +- Manage operations create, update and delete of the resource Qos Device Interface. +- > + Create qos device interface infos associate with network device id to allow the user to mark specific interfaces + as WAN, to associate WAN interfaces with specific SP Profile and to be able to define a shaper on WAN interfaces. +- Delete all qos device interface infos associate with network device id. +- Update existing qos device interface infos associate with network device id. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. Id of the qos device info, this object holds all + qos device interface infos associate with network device id. + type: str + payload: + description: Qos Device Interface's payload. + elements: dict + suboptions: + excludedInterfaces: + description: Excluded interfaces ids. + elements: str + type: list + id: + description: Id of Qos device info. + type: str + name: + description: Device name. + type: str + networkDeviceId: + description: Network device id. + type: str + qosDeviceInterfaceInfo: + description: Qos Device Interface's qosDeviceInterfaceInfo. + elements: dict + suboptions: + dmvpnRemoteSitesBw: + description: Dmvpn remote sites bandwidth. + elements: int + type: list + instanceId: + description: Instance id. + type: int + interfaceId: + description: Interface id. + type: str + interfaceName: + description: Interface name. + type: str + label: + description: SP Profile name. + type: str + role: + description: Interface role. + type: str + uploadBW: + description: Upload bandwidth. + type: int + type: list + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy CreateQosDeviceInterfaceInfo + description: Complete reference of the CreateQosDeviceInterfaceInfo API. + link: https://developer.cisco.com/docs/dna-center/#!create-qos-device-interface-info +- name: Cisco DNA Center documentation for Application Policy DeleteQosDeviceInterfaceInfo + description: Complete reference of the DeleteQosDeviceInterfaceInfo API. + link: https://developer.cisco.com/docs/dna-center/#!delete-qos-device-interface-info +- name: Cisco DNA Center documentation for Application Policy UpdateQosDeviceInterfaceInfo + description: Complete reference of the UpdateQosDeviceInterfaceInfo API. + link: https://developer.cisco.com/docs/dna-center/#!update-qos-device-interface-info +notes: + - SDK Method used are + application_policy.ApplicationPolicy.create_qos_device_interface_info, + application_policy.ApplicationPolicy.delete_qos_device_interface_info, + application_policy.ApplicationPolicy.update_qos_device_interface_info, + + - Paths used are + post /dna/intent/api/v1/qos-device-interface-info, + delete /dna/intent/api/v1/qos-device-interface-info/{id}, + put /dna/intent/api/v1/qos-device-interface-info, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.qos_device_interface: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - excludedInterfaces: + - string + id: string + name: string + networkDeviceId: string + qosDeviceInterfaceInfo: + - dmvpnRemoteSitesBw: + - 0 + instanceId: 0 + interfaceId: string + interfaceName: string + label: string + role: string + uploadBW: 0 + +- name: Create + cisco.dnac.qos_device_interface: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - excludedInterfaces: + - string + name: string + networkDeviceId: string + qosDeviceInterfaceInfo: + - dmvpnRemoteSitesBw: + - 0 + interfaceId: string + interfaceName: string + label: string + role: string + uploadBW: 0 + +- name: Delete by id + cisco.dnac.qos_device_interface: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info.py b/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info.py new file mode 100644 index 00000000..98f070c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info.py @@ -0,0 +1,121 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: qos_device_interface_info +short_description: Information module for Qos Device Interface +description: +- Get all Qos Device Interface. +- Get all or by network device id, existing qos device interface infos. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + networkDeviceId: + description: + - NetworkDeviceId query parameter. Network device id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetQosDeviceInterfaceInfo + description: Complete reference of the GetQosDeviceInterfaceInfo API. + link: https://developer.cisco.com/docs/dna-center/#!get-qos-device-interface-info +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_qos_device_interface_info, + + - Paths used are + get /dna/intent/api/v1/qos-device-interface-info, + +""" + +EXAMPLES = r""" +- name: Get all Qos Device Interface + cisco.dnac.qos_device_interface_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + networkDeviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "createTime": 0, + "deployed": true, + "isSeeded": true, + "isStale": true, + "lastUpdateTime": 0, + "name": "string", + "namespace": "string", + "provisioningState": "string", + "qualifier": "string", + "resourceVersion": 0, + "targetIdList": [ + {} + ], + "type": "string", + "cfsChangeInfo": [ + {} + ], + "customProvisions": [ + {} + ], + "excludedInterfaces": [ + "string" + ], + "isExcluded": true, + "networkDeviceId": "string", + "qosDeviceInterfaceInfo": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceCreatedOn": 0, + "instanceUpdatedOn": 0, + "instanceVersion": 0, + "dmvpnRemoteSitesBw": [ + 0 + ], + "downloadBW": 0, + "interfaceId": "string", + "interfaceName": "string", + "label": "string", + "role": "string", + "uploadBW": 0 + } + ] + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info_count_info.py new file mode 100644 index 00000000..fd872ab6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/qos_device_interface_info_count_info.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: qos_device_interface_info_count_info +short_description: Information module for Qos Device Interface Info Count +description: +- Get all Qos Device Interface Info Count. +- Get the number of all existing qos device interface infos group by network device id. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Application Policy GetQosDeviceInterfaceInfoCount + description: Complete reference of the GetQosDeviceInterfaceInfoCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-qos-device-interface-info-count +notes: + - SDK Method used are + application_policy.ApplicationPolicy.get_qos_device_interface_info_count, + + - Paths used are + get /dna/intent/api/v1/qos-device-interface-info-count, + +""" + +EXAMPLES = r""" +- name: Get all Qos Device Interface Info Count + cisco.dnac.qos_device_interface_info_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reports.py b/ansible_collections/cisco/dnac/plugins/modules/reports.py new file mode 100644 index 00000000..039746e7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reports.py @@ -0,0 +1,244 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reports +short_description: Resource module for Reports +description: +- Manage operations create and delete of the resource Reports. +- > + Create/Schedule a report configuration. Use "Get view details for a given view group & view" API to get the + metadata required to configure a report. +- Delete a scheduled report configuration. Deletes the report executions also. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deliveries: + description: Array of available delivery channels. + elements: dict + type: list + name: + description: Report name. + type: str + reportId: + description: ReportId path parameter. ReportId of report. + type: str + schedule: + description: Reports's schedule. + type: dict + tags: + description: Array of tags for report. + elements: str + type: list + view: + description: Reports's view. + suboptions: + fieldGroups: + description: Reports's fieldGroups. + elements: dict + suboptions: + fieldGroupDisplayName: + description: Field group label/displayname for user. + type: str + fieldGroupName: + description: Field group name. + type: str + fields: + description: Reports's fields. + elements: dict + suboptions: + displayName: + description: Field label/displayname. + type: str + name: + description: Field name. + type: str + type: list + type: list + filters: + description: Reports's filters. + elements: dict + suboptions: + displayName: + description: Filter label/displayname. + type: str + name: + description: Filter name. + type: str + type: + description: Filter type. + type: str + value: + description: Value of filter. Data type is based on the filter type. Use + the filter definitions from the view to fetch the options for a filter. + type: dict + type: list + format: + description: Reports's format. + suboptions: + formatType: + description: Format type of report. + type: str + name: + description: Format name of report. + type: str + type: dict + name: + description: View name. + type: str + viewId: + description: View Id. + type: str + type: dict + viewGroupId: + description: ViewGroupId of the viewgroup for the report. + type: str + viewGroupVersion: + description: Version of viewgroup for the report. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Reports CreateOrScheduleAReport + description: Complete reference of the CreateOrScheduleAReport API. + link: https://developer.cisco.com/docs/dna-center/#!create-or-schedule-a-report +- name: Cisco DNA Center documentation for Reports DeleteAScheduledReport + description: Complete reference of the DeleteAScheduledReport API. + link: https://developer.cisco.com/docs/dna-center/#!delete-a-scheduled-report +notes: + - SDK Method used are + reports.Reports.create_or_schedule_a_report, + reports.Reports.delete_a_scheduled_report, + + - Paths used are + post /dna/intent/api/v1/data/reports, + delete /dna/intent/api/v1/data/reports/{reportId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.reports: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + deliveries: + - {} + name: string + schedule: {} + tags: + - string + view: + fieldGroups: + - fieldGroupDisplayName: string + fieldGroupName: string + fields: + - displayName: string + name: string + filters: + - displayName: string + name: string + type: string + value: {} + format: + formatType: string + name: string + name: string + viewId: string + viewGroupId: string + viewGroupVersion: string + +- name: Delete by id + cisco.dnac.reports: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + reportId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "tags": [ + "string" + ], + "dataCategory": "string", + "deliveries": [ + {} + ], + "executionCount": 0, + "executions": [ + { + "endTime": 0, + "errors": [ + "string" + ], + "executionId": "string", + "processStatus": "string", + "requestStatus": "string", + "startTime": 0, + "warnings": [ + "string" + ] + } + ], + "name": "string", + "reportId": "string", + "reportWasExecuted": true, + "schedule": {}, + "view": { + "fieldGroups": [ + { + "fieldGroupDisplayName": "string", + "fieldGroupName": "string", + "fields": [ + { + "displayName": "string", + "name": "string" + } + ] + } + ], + "filters": [ + { + "displayName": "string", + "name": "string", + "type": "string", + "value": {} + } + ], + "format": { + "formatType": "string", + "name": "string" + }, + "name": "string", + "viewId": "string", + "description": "string", + "viewInfo": "string" + }, + "viewGroupId": "string", + "viewGroupVersion": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reports_executions_info.py b/ansible_collections/cisco/dnac/plugins/modules/reports_executions_info.py new file mode 100644 index 00000000..2002682d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reports_executions_info.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reports_executions_info +short_description: Information module for Reports Executions +description: +- Get all Reports Executions. +- Get Reports Executions by id. +- Get details of all executions for a given report. +- > + Returns report content. Save the response to a file by converting the response data as a blob and setting the file + format available from content-disposition response header. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + reportId: + description: + - ReportId path parameter. ReportId of report. + type: str + executionId: + description: + - ExecutionId path parameter. ExecutionId of report execution. + type: str + dirPath: + description: + - Directory absolute path. Defaults to the current working directory. + type: str + saveFile: + description: + - Enable or disable automatic file creation of raw response. + type: bool + filename: + description: + - The filename used to save the download file. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Reports DownloadReportContent + description: Complete reference of the DownloadReportContent API. + link: https://developer.cisco.com/docs/dna-center/#!download-report-content +- name: Cisco DNA Center documentation for Reports GetAllExecutionDetailsForAGivenReport + description: Complete reference of the GetAllExecutionDetailsForAGivenReport API. + link: https://developer.cisco.com/docs/dna-center/#!get-all-execution-details-for-a-given-report +notes: + - SDK Method used are + reports.Reports.download_report_content, + reports.Reports.get_all_execution_details_for_a_given_report, + + - Paths used are + get /dna/intent/api/v1/data/reports/{reportId}/executions, + get /dna/intent/api/v1/data/reports/{reportId}/executions/{executionId}, + +""" + +EXAMPLES = r""" +- name: Get all Reports Executions + cisco.dnac.reports_executions_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + reportId: string + register: result + +- name: Get Reports Executions by id + cisco.dnac.reports_executions_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + reportId: string + executionId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "data": "filecontent", + "filename": "filename", + "dirpath": "download/directory", + "path": "download/directory/filename" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reports_info.py b/ansible_collections/cisco/dnac/plugins/modules/reports_info.py new file mode 100644 index 00000000..963b6bb1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reports_info.py @@ -0,0 +1,155 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reports_info +short_description: Information module for Reports +description: +- Get all Reports. +- Get Reports by id. +- Get list of scheduled report configurations. +- Get scheduled report configuration by reportId. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + viewGroupId: + description: + - ViewGroupId query parameter. ViewGroupId of viewgroup for report. + type: str + viewId: + description: + - ViewId query parameter. ViewId of view for report. + type: str + reportId: + description: + - ReportId path parameter. ReportId of report. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Reports GetAScheduledReport + description: Complete reference of the GetAScheduledReport API. + link: https://developer.cisco.com/docs/dna-center/#!get-a-scheduled-report +- name: Cisco DNA Center documentation for Reports GetListOfScheduledReports + description: Complete reference of the GetListOfScheduledReports API. + link: https://developer.cisco.com/docs/dna-center/#!get-list-of-scheduled-reports +notes: + - SDK Method used are + reports.Reports.get_a_scheduled_report, + reports.Reports.get_list_of_scheduled_reports, + + - Paths used are + get /dna/intent/api/v1/data/reports, + get /dna/intent/api/v1/data/reports/{reportId}, + +""" + +EXAMPLES = r""" +- name: Get all Reports + cisco.dnac.reports_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + viewGroupId: string + viewId: string + register: result + +- name: Get Reports by id + cisco.dnac.reports_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + reportId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "tags": [ + "string" + ], + "dataCategory": "string", + "deliveries": [ + {} + ], + "executionCount": 0, + "executions": [ + { + "endTime": 0, + "errors": [ + "string" + ], + "executionId": "string", + "processStatus": "string", + "requestStatus": "string", + "startTime": 0, + "warnings": [ + "string" + ] + } + ], + "name": "string", + "reportId": "string", + "reportWasExecuted": true, + "schedule": {}, + "view": { + "fieldGroups": [ + { + "fieldGroupDisplayName": "string", + "fieldGroupName": "string", + "fields": [ + { + "displayName": "string", + "name": "string" + } + ] + } + ], + "filters": [ + { + "displayName": "string", + "name": "string", + "type": "string", + "value": {} + } + ], + "format": { + "formatType": "string", + "name": "string", + "default": true + }, + "name": "string", + "viewId": "string", + "description": "string", + "viewInfo": "string" + }, + "viewGroupId": "string", + "viewGroupVersion": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reports_view_group_info.py b/ansible_collections/cisco/dnac/plugins/modules/reports_view_group_info.py new file mode 100644 index 00000000..71fd405a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reports_view_group_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reports_view_group_info +short_description: Information module for Reports View Group +description: +- Get all Reports View Group. +- Get Reports View Group by id. +- Gives a list of summary of all view groups. +- > + Gives a list of summary of all views in a viewgroup. Use "Get all view groups" API to get the viewGroupIds + required as a query param for this API for available viewgroups. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + viewGroupId: + description: + - ViewGroupId path parameter. ViewGroupId of viewgroup. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Reports GetAllViewGroups + description: Complete reference of the GetAllViewGroups API. + link: https://developer.cisco.com/docs/dna-center/#!get-all-view-groups +- name: Cisco DNA Center documentation for Reports GetViewsForAGivenViewGroup + description: Complete reference of the GetViewsForAGivenViewGroup API. + link: https://developer.cisco.com/docs/dna-center/#!get-views-for-a-given-view-group +notes: + - SDK Method used are + reports.Reports.get_all_view_groups, + reports.Reports.get_views_for_a_given_view_group, + + - Paths used are + get /dna/intent/api/v1/data/view-groups, + get /dna/intent/api/v1/data/view-groups/{viewGroupId}, + +""" + +EXAMPLES = r""" +- name: Get all Reports View Group + cisco.dnac.reports_view_group_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +- name: Get Reports View Group by id + cisco.dnac.reports_view_group_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + viewGroupId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "viewGroupId": "string", + "views": [ + { + "description": "string", + "viewId": "string", + "viewName": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reports_view_group_view_info.py b/ansible_collections/cisco/dnac/plugins/modules/reports_view_group_view_info.py new file mode 100644 index 00000000..791e4a0d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reports_view_group_view_info.py @@ -0,0 +1,138 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reports_view_group_view_info +short_description: Information module for Reports View Group View +description: +- Get Reports View Group View by id. +- > + Gives complete information of the view that is required to configure a report. Use "Get views for a given view + group" API to get the viewIds required as a query param for this API for available views. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + viewGroupId: + description: + - ViewGroupId path parameter. ViewGroupId of viewgroup. + type: str + viewId: + description: + - ViewId path parameter. View id of view. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Reports GetViewDetailsForAGivenViewGroup_View + description: Complete reference of the GetViewDetailsForAGivenViewGroup_View API. + link: https://developer.cisco.com/docs/dna-center/#!get-view-details-for-a-given-view-group-view +notes: + - SDK Method used are + reports.Reports.get_view_details_for_a_given_view_group_and_view, + + - Paths used are + get /dna/intent/api/v1/data/view-groups/{viewGroupId}/views/{viewId}, + +""" + +EXAMPLES = r""" +- name: Get Reports View Group View by id + cisco.dnac.reports_view_group_view_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + viewGroupId: string + viewId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "deliveries": [ + { + "type": "string", + "default": true + } + ], + "description": "string", + "fieldGroups": [ + { + "fieldGroupDisplayName": "string", + "fieldGroupName": "string", + "fields": [ + { + "displayName": "string", + "name": "string" + } + ], + "tableId": "string" + } + ], + "filters": [ + { + "additionalInfo": {}, + "cacheFilter": true, + "dataType": "string", + "displayName": "string", + "filterSource": { + "dataSource": {}, + "displayValuePath": "string", + "rootPath": "string", + "valuePath": "string" + }, + "name": "string", + "required": true, + "timeOptions": [ + { + "info": "string", + "maxValue": 0, + "minValue": 0, + "name": "string", + "value": "string" + } + ], + "type": "string" + } + ], + "formats": [ + { + "format": "string", + "name": "string", + "default": true, + "template": { + "jsTemplateId": "string" + } + } + ], + "schedules": [ + { + "type": "string", + "default": true + } + ], + "viewId": "string", + "viewInfo": "string", + "viewName": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool.py b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool.py new file mode 100644 index 00000000..8d0d7529 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool.py @@ -0,0 +1,215 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reserve_ip_subpool +short_description: Resource module for Reserve Ip Subpool +description: +- Manage operations create, update and delete of the resource Reserve Ip Subpool. +- API to reserve an ip subpool from the global pool. +- API to delete the reserved ip subpool. +- API to update ip subpool from the global pool. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. Id of reserve ip subpool to be deleted. + type: str + ipv4DhcpServers: + description: IPv4 input for dhcp server ip example 1.1.1.1. + elements: str + type: list + ipv4DnsServers: + description: IPv4 input for dns server ip example 4.4.4.4. + elements: str + type: list + ipv4GateWay: + description: Gateway ip address details, example 175.175.0.1. + type: str + version_added: 4.0.0 + ipv4GlobalPool: + description: IP v4 Global pool address with cidr, example 175.175.0.0/16. + type: str + ipv4Prefix: + description: IPv4 prefix value is true, the ip4 prefix length input field is enabled + , if it is false ipv4 total Host input is enable. + type: bool + ipv4PrefixLength: + description: The ipv4 prefix length is required when ipv4prefix value is true. + type: int + ipv4Subnet: + description: IPv4 Subnet address, example 175.175.0.0. + type: str + ipv4TotalHost: + description: IPv4 total host is required when ipv4prefix value is false. + type: int + ipv6AddressSpace: + description: If the value is false only ipv4 input are required, otherwise both + ipv6 and ipv4 are required. + type: bool + ipv6DhcpServers: + description: IPv6 format dhcp server as input example 2001 db8 1234. + elements: str + type: list + ipv6DnsServers: + description: IPv6 format dns server input example 2001 db8 1234. + elements: str + type: list + ipv6GateWay: + description: Gateway ip address details, example 2001 db8 85a3 0 100 1. + type: str + ipv6GlobalPool: + description: IPv6 Global pool address with cidr this is required when Ipv6AddressSpace + value is true, example 2001 db8 85a3 /64. + type: str + ipv6Prefix: + description: Ipv6 prefix value is true, the ip6 prefix length input field is enabled + , if it is false ipv6 total Host input is enable. + type: bool + ipv6PrefixLength: + description: IPv6 prefix length is required when the ipv6prefix value is true. + type: int + ipv6Subnet: + description: IPv6 Subnet address, example 2001 db8 85a3 0 100. + type: str + ipv6TotalHost: + description: IPv6 total host is required when ipv6prefix value is false. + type: int + name: + description: Name of the reserve ip sub pool. + type: str + siteId: + description: SiteId path parameter. Site id to reserve the ip sub pool. + type: str + slaacSupport: + description: Slaac Support. + type: bool + type: + description: Type of the reserve ip sub pool. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings ReserveIPSubpool + description: Complete reference of the ReserveIPSubpool API. + link: https://developer.cisco.com/docs/dna-center/#!reserve-ip-subpool +- name: Cisco DNA Center documentation for Network Settings ReleaseReserveIPSubpool + description: Complete reference of the ReleaseReserveIPSubpool API. + link: https://developer.cisco.com/docs/dna-center/#!release-reserve-ip-subpool +- name: Cisco DNA Center documentation for Network Settings UpdateReserveIPSubpool + description: Complete reference of the UpdateReserveIPSubpool API. + link: https://developer.cisco.com/docs/dna-center/#!update-reserve-ip-subpool +notes: + - SDK Method used are + network_settings.NetworkSettings.release_reserve_ip_subpool, + network_settings.NetworkSettings.reserve_ip_subpool, + network_settings.NetworkSettings.update_reserve_ip_subpool, + + - Paths used are + post /dna/intent/api/v1/reserve-ip-subpool/{siteId}, + delete /dna/intent/api/v1/reserve-ip-subpool/{id}, + put /dna/intent/api/v1/reserve-ip-subpool/{siteId}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.reserve_ip_subpool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +- name: Create + cisco.dnac.reserve_ip_subpool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + ipv4DhcpServers: + - string + ipv4DnsServers: + - string + ipv4GateWay: string + ipv4GlobalPool: string + ipv4Prefix: true + ipv4PrefixLength: 0 + ipv4Subnet: string + ipv4TotalHost: 0 + ipv6AddressSpace: true + ipv6DhcpServers: + - string + ipv6DnsServers: + - string + ipv6GateWay: string + ipv6GlobalPool: string + ipv6Prefix: true + ipv6PrefixLength: 0 + ipv6Subnet: string + ipv6TotalHost: 0 + name: string + siteId: string + slaacSupport: true + type: string + +- name: Update by id + cisco.dnac.reserve_ip_subpool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + id: string + ipv4DhcpServers: + - string + ipv4DnsServers: + - string + ipv4GateWay: string + ipv6AddressSpace: true + ipv6DhcpServers: + - string + ipv6DnsServers: + - string + ipv6GateWay: string + ipv6GlobalPool: string + ipv6Prefix: true + ipv6PrefixLength: 0 + ipv6Subnet: string + ipv6TotalHost: 0 + name: string + siteId: string + slaacSupport: true + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_create.py b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_create.py new file mode 100644 index 00000000..ad78c5f9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_create.py @@ -0,0 +1,155 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reserve_ip_subpool_create +short_description: Resource module for Reserve Ip Subpool Create +description: +- Manage operation create of the resource Reserve Ip Subpool Create. +- API to reserve an ip subpool from the global pool. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + ipv4DhcpServers: + description: IPv4 input for dhcp server ip example 1.1.1.1. + elements: str + type: list + ipv4DnsServers: + description: IPv4 input for dns server ip example 4.4.4.4. + elements: str + type: list + ipv4GateWay: + description: Gateway ip address details, example 175.175.0.1. + type: str + ipv4GlobalPool: + description: IP v4 Global pool address with cidr, example 175.175.0.0/16. + type: str + ipv4Prefix: + description: IPv4 prefix value is true, the ip4 prefix length input field is enabled + , if it is false ipv4 total Host input is enable. + type: bool + ipv4PrefixLength: + description: The ipv4 prefix length is required when ipv4prefix value is true. + type: int + ipv4Subnet: + description: IPv4 Subnet address, example 175.175.0.0. + type: str + ipv4TotalHost: + description: IPv4 total host is required when ipv4prefix value is false. + type: int + ipv6AddressSpace: + description: If the value is false only ipv4 input are required, otherwise both + ipv6 and ipv4 are required. + type: bool + ipv6DhcpServers: + description: IPv6 format dhcp server as input example 2001 db8 1234. + elements: str + type: list + ipv6DnsServers: + description: IPv6 format dns server input example 2001 db8 1234. + elements: str + type: list + ipv6GateWay: + description: Gateway ip address details, example 2001 db8 85a3 0 100 1. + type: str + ipv6GlobalPool: + description: IPv6 Global pool address with cidr this is required when Ipv6AddressSpace + value is true, example 2001 db8 85a3 /64. + type: str + ipv6Prefix: + description: Ipv6 prefix value is true, the ip6 prefix length input field is enabled + , if it is false ipv6 total Host input is enable. + type: bool + ipv6PrefixLength: + description: IPv6 prefix length is required when the ipv6prefix value is true. + type: int + ipv6Subnet: + description: IPv6 Subnet address, example 2001 db8 85a3 0 100. + type: str + ipv6TotalHost: + description: IPv6 total host is required when ipv6prefix value is false. + type: int + name: + description: Name of the reserve ip sub pool. + type: str + siteId: + description: SiteId path parameter. Site id to reserve the ip sub pool. + type: str + slaacSupport: + description: Slaac Support. + type: bool + type: + description: Type of the reserve ip sub pool. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings ReserveIPSubpool + description: Complete reference of the ReserveIPSubpool API. + link: https://developer.cisco.com/docs/dna-center/#!reserve-ip-subpool +notes: + - SDK Method used are + network_settings.NetworkSettings.reserve_ip_subpool, + + - Paths used are + post /dna/intent/api/v1/reserve-ip-subpool/{siteId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.reserve_ip_subpool_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + ipv4DhcpServers: + - string + ipv4DnsServers: + - string + ipv4GateWay: string + ipv4GlobalPool: string + ipv4Prefix: true + ipv4PrefixLength: 0 + ipv4Subnet: string + ipv4TotalHost: 0 + ipv6AddressSpace: true + ipv6DhcpServers: + - string + ipv6DnsServers: + - string + ipv6GateWay: string + ipv6GlobalPool: string + ipv6Prefix: true + ipv6PrefixLength: 0 + ipv6Subnet: string + ipv6TotalHost: 0 + name: string + siteId: string + slaacSupport: true + type: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_delete.py b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_delete.py new file mode 100644 index 00000000..d4471c2a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_delete.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reserve_ip_subpool_delete +short_description: Resource module for Reserve Ip Subpool Delete +description: +- Manage operation delete of the resource Reserve Ip Subpool Delete. +- API to delete the reserved ip subpool. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. Id of reserve ip subpool to be deleted. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings ReleaseReserveIPSubpool + description: Complete reference of the ReleaseReserveIPSubpool API. + link: https://developer.cisco.com/docs/dna-center/#!release-reserve-ip-subpool +notes: + - SDK Method used are + network_settings.NetworkSettings.release_reserve_ip_subpool, + + - Paths used are + delete /dna/intent/api/v1/reserve-ip-subpool/{id}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.reserve_ip_subpool_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_info.py b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_info.py new file mode 100644 index 00000000..e27b53eb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_info.py @@ -0,0 +1,123 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reserve_ip_subpool_info +short_description: Information module for Reserve Ip Subpool +description: +- Get all Reserve Ip Subpool. +- API to get the ip subpool info. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. Site id to get the reserve ip associated with the site. + type: str + offset: + description: + - Offset query parameter. Offset/starting row. + type: str + limit: + description: + - Limit query parameter. No of Global Pools to be retrieved. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings GetReserveIPSubpool + description: Complete reference of the GetReserveIPSubpool API. + link: https://developer.cisco.com/docs/dna-center/#!get-reserve-ip-subpool +notes: + - SDK Method used are + network_settings.NetworkSettings.get_reserve_ip_subpool, + + - Paths used are + get /dna/intent/api/v1/reserve-ip-subpool, + +""" + +EXAMPLES = r""" +- name: Get all Reserve Ip Subpool + cisco.dnac.reserve_ip_subpool_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + offset: string + limit: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "groupName": "string", + "ipPools": [ + { + "ipPoolName": "string", + "dhcpServerIps": [ + {} + ], + "gateways": [ + "string" + ], + "createTime": 0, + "lastUpdateTime": 0, + "totalIpAddressCount": 0, + "usedIpAddressCount": 0, + "parentUuid": "string", + "owner": "string", + "shared": true, + "overlapping": true, + "configureExternalDhcp": true, + "usedPercentage": "string", + "clientOptions": {}, + "groupUuid": "string", + "dnsServerIps": [ + {} + ], + "context": [ + { + "owner": "string", + "contextKey": "string", + "contextValue": "string" + } + ], + "ipv6": true, + "id": "string", + "ipPoolCidr": "string" + } + ], + "siteId": "string", + "siteHierarchy": "string", + "type": "string", + "groupOwner": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_update.py b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_update.py new file mode 100644 index 00000000..3e960395 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/reserve_ip_subpool_update.py @@ -0,0 +1,137 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: reserve_ip_subpool_update +short_description: Resource module for Reserve Ip Subpool Update +description: +- Manage operation update of the resource Reserve Ip Subpool Update. +- API to update ip subpool from the global pool. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id query parameter. Id of subpool to be associated with the site. + type: str + ipv4DhcpServers: + description: IPv4 input for dhcp server ip example 1.1.1.1. + elements: str + type: list + ipv4DnsServers: + description: IPv4 input for dns server ip example 4.4.4.4. + elements: str + type: list + ipv4GateWay: + description: Ipv4 Gate Way. + type: str + ipv6AddressSpace: + description: If the value is false only ipv4 input are required, otherwise both + ipv6 and ipv4 are required. + type: bool + ipv6DhcpServers: + description: IPv6 format dhcp server as input example 2001 db8 1234. + elements: str + type: list + ipv6DnsServers: + description: IPv6 format dns server input example 2001 db8 1234. + elements: str + type: list + ipv6GateWay: + description: Gateway ip address details, example 2001 db8 85a3 0 100 1. + type: str + ipv6GlobalPool: + description: IP v6 Global pool address with cidr this is required when Ipv6AddressSpace + value is true, example 2001 db8 85a3 /64. + type: str + ipv6Prefix: + description: IPv6 prefix value is true, the ip6 prefix length input field is enabled + , if it is false ipv6 total Host input is enable. + type: bool + ipv6PrefixLength: + description: IPv6 prefix length is required when the ipv6prefix value is true. + type: int + ipv6Subnet: + description: IPv6 Subnet address, example 2001 db8 85a3 0 100. + type: str + ipv6TotalHost: + description: IPv6 total host is required when ipv6prefix value is false. + type: int + name: + description: Name of the reserve ip sub pool. + type: str + siteId: + description: SiteId path parameter. Site id of site to update sub pool. + type: str + slaacSupport: + description: Slaac Support. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings UpdateReserveIPSubpool + description: Complete reference of the UpdateReserveIPSubpool API. + link: https://developer.cisco.com/docs/dna-center/#!update-reserve-ip-subpool +notes: + - SDK Method used are + network_settings.NetworkSettings.update_reserve_ip_subpool, + + - Paths used are + put /dna/intent/api/v1/reserve-ip-subpool/{siteId}, + + - > + Removed 'type', 'ipv4GlobalPool', 'ipv4Prefix', 'ipv4PrefixLength', 'ipv4Subnet' and 'ipv4TotalHost' options + in v4.3.0. +""" + +EXAMPLES = r""" +- name: Update by id + cisco.dnac.reserve_ip_subpool_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + id: string + ipv4DhcpServers: + - string + ipv4DnsServers: + - string + ipv4GateWay: string + ipv6AddressSpace: true + ipv6DhcpServers: + - string + ipv6DnsServers: + - string + ipv6GateWay: string + ipv6GlobalPool: string + ipv6Prefix: true + ipv6PrefixLength: 0 + ipv6Subnet: string + ipv6TotalHost: 0 + name: string + siteId: string + slaacSupport: true + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_count_info.py new file mode 100644 index 00000000..cb0e4e6d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_count_info.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_count_info +short_description: Information module for Sda Count +description: +- Get all Sda Count. +- Get SDA Fabric Count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + sda.Sda.get_sda_fabric_count, + + - Paths used are + get /dna/intent/api/v1/business/sda/fabric/count, + +""" + +EXAMPLES = r""" +- name: Get all Sda Count + cisco.dnac.sda_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "status": "string", + "description": "string", + "fabricCount": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_device_info.py new file mode 100644 index 00000000..db40c572 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_device_info.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_device_info +short_description: Information module for Sda Device +description: +- Get all Sda Device. +- Get device info from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + description: + - DeviceManagementIpAddress query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetDeviceInfoFromSDAFabric + description: Complete reference of the GetDeviceInfoFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-info-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_device_info, + + - Paths used are + get /dna/intent/api/v1/business/sda/device, + +""" + +EXAMPLES = r""" +- name: Get all Sda Device + cisco.dnac.sda_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "name": "string", + "roles": [ + "string" + ], + "deviceManagementIpAddress": "string", + "siteHierarchy": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_device_role_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_device_role_info.py new file mode 100644 index 00000000..2a857d80 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_device_role_info.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_device_role_info +short_description: Information module for Sda Device Role +description: +- Get all Sda Device Role. +- Get device role in SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + description: + - DeviceManagementIpAddress query parameter. Device Management IP Address. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetDeviceRoleInSDAFabric + description: Complete reference of the GetDeviceRoleInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-device-role-in-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_device_role_in_sda_fabric, + + - Paths used are + get /dna/intent/api/v1/business/sda/device/role, + +""" + +EXAMPLES = r""" +- name: Get all Sda Device Role + cisco.dnac.sda_device_role_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "status": "string", + "description": "string", + "roles": [ + "string" + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric.py new file mode 100644 index 00000000..a28b2d87 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric +short_description: Resource module for Sda Fabric +description: +- Manage operations create and delete of the resource Sda Fabric. +- Add SDA Fabric. +- Delete SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + fabricName: + description: FabricName query parameter. Fabric Name. + type: str +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + sda.Sda.add_fabric, + sda.Sda.delete_sda_fabric, + + - Paths used are + post /dna/intent/api/v1/business/sda/fabric, + delete /dna/intent/api/v1/business/sda/fabric, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.sda_fabric: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + fabricName: string + +- name: Create + cisco.dnac.sda_fabric: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + fabricName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile.py new file mode 100644 index 00000000..51b32887 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile.py @@ -0,0 +1,123 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_authentication_profile +short_description: Resource module for Sda Fabric Authentication Profile +description: +- Manage operations create, update and delete of the resource Sda Fabric Authentication Profile. +- Add default authentication template in SDA Fabric. +- Delete default authentication profile in SDA Fabric. +- Update default authentication profile in SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Sda Fabric Authentication Profile's payload. + elements: dict + suboptions: + authenticateTemplateName: + description: Authenticate Template Name. + type: str + version_added: 4.0.0 + siteNameHierarchy: + description: Path of sda Fabric Site. + type: str + type: list + siteNameHierarchy: + description: SiteNameHierarchy query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddDefaultAuthenticationTemplateInSDAFabric + description: Complete reference of the AddDefaultAuthenticationTemplateInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-default-authentication-template-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeleteDefaultAuthenticationProfileFromSDAFabric + description: Complete reference of the DeleteDefaultAuthenticationProfileFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-default-authentication-profile-from-sda-fabric +- name: Cisco DNA Center documentation for SDA UpdateDefaultAuthenticationProfileInSDAFabric + description: Complete reference of the UpdateDefaultAuthenticationProfileInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!update-default-authentication-profile-in-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_default_authentication_profile, + sda.Sda.delete_default_authentication_profile, + sda.Sda.update_default_authentication_profile, + + - Paths used are + post /dna/intent/api/v1/business/sda/authentication-profile, + delete /dna/intent/api/v1/business/sda/authentication-profile, + put /dna/intent/api/v1/business/sda/authentication-profile, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.sda_fabric_authentication_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - authenticateTemplateName: string + siteNameHierarchy: string + +- name: Update all + cisco.dnac.sda_fabric_authentication_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - authenticateTemplateName: string + authenticationOrder: string + dot1xToMabFallbackTimeout: string + numberOfHosts: string + siteNameHierarchy: string + wakeOnLan: true + +- name: Delete all + cisco.dnac.sda_fabric_authentication_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + siteNameHierarchy: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile_info.py new file mode 100644 index 00000000..c861488f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_authentication_profile_info.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_authentication_profile_info +short_description: Information module for Sda Fabric Authentication Profile +description: +- Get all Sda Fabric Authentication Profile. +- Get default authentication profile from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteNameHierarchy: + description: + - SiteNameHierarchy query parameter. + type: str + authenticateTemplateName: + version_added: "4.0.0" + description: + - AuthenticateTemplateName query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetDefaultAuthenticationProfileFromSDAFabric + description: Complete reference of the GetDefaultAuthenticationProfileFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-default-authentication-profile-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_default_authentication_profile, + + - Paths used are + get /dna/intent/api/v1/business/sda/authentication-profile, + +""" + +EXAMPLES = r""" +- name: Get all Sda Fabric Authentication Profile + cisco.dnac.sda_fabric_authentication_profile_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteNameHierarchy: string + authenticateTemplateName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "siteNameHierarchy": "string", + "authenticateTemplateName": "string", + "authenticateTemplateId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device.py new file mode 100644 index 00000000..3099cd0e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device.py @@ -0,0 +1,203 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_border_device +short_description: Resource module for Sda Fabric Border Device +description: +- Manage operations create and delete of the resource Sda Fabric Border Device. +- Add border device in SDA Fabric. +- Delete border device from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceManagementIpAddress: + description: DeviceManagementIpAddress query parameter. + type: str + version_added: 4.0.0 + payload: + description: Sda Fabric Border Device's payload. + elements: dict + suboptions: + borderSessionType: + description: Border Session Type. + type: str + version_added: 4.0.0 + borderWithExternalConnectivity: + description: Border With External Connectivity (Note True for transit and False + for non-transit border). + type: bool + connectedToInternet: + description: Connected to Internet. + type: bool + version_added: 4.0.0 + deviceManagementIpAddress: + description: Management Ip Address of the provisioned Device. + type: str + version_added: 4.0.0 + deviceRole: + description: Supported Device Roles in SD-Access fabric. Allowed roles are "Border_Node","Control_Plane_Nod... + E.g. "Border_Node" or "Border_Node", "Control_Plane_Node" or "Border_Node", + "Control_Plane_Node","Edge_Node". + elements: str + type: list + externalConnectivityIpPoolName: + description: External Connectivity IpPool Name. + type: str + version_added: 4.0.0 + externalConnectivitySettings: + description: Sda Fabric Border Device's externalConnectivitySettings. + elements: dict + suboptions: + externalAutonomouSystemNumber: + description: External Autonomous System Number peer (e.g.,1-65535). + type: str + version_added: 4.0.0 + interfaceDescription: + description: Interface Description. + type: str + interfaceName: + description: Interface Name. + type: str + version_added: 4.0.0 + l2Handoff: + description: Sda Fabric Border Device's l2Handoff. + elements: dict + suboptions: + virtualNetworkName: + description: Virtual Network Name, that is associated to Fabric Site. + type: str + version_added: 4.0.0 + vlanName: + description: Vlan Name of L2 Handoff. + type: str + type: list + l3Handoff: + description: Sda Fabric Border Device's l3Handoff. + elements: dict + suboptions: + virtualNetwork: + description: Sda Fabric Border Device's virtualNetwork. + elements: dict + suboptions: + virtualNetworkName: + description: Virtual Network Name, that is associated to Fabric + Site. + type: str + version_added: 4.0.0 + vlanId: + description: Vlan Id (e.g.,2-4096 except for reserved VLANs (1002-1005, + 2046, 4095)). + type: str + version_added: 4.0.0 + type: list + version_added: 4.0.0 + type: list + version_added: 4.0.0 + type: list + version_added: 4.0.0 + externalDomainRoutingProtocolName: + description: External Domain Routing Protocol Name. + type: str + internalAutonomouSystemNumber: + description: Internal Autonomouns System Number (e.g.,1-65535). + type: str + sdaTransitNetworkName: + description: SD-Access Transit Network Name. + type: str + siteNameHierarchy: + description: Site Name Hierarchy of provisioned Device(site should be part of + Fabric Site). + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddBorderDeviceInSDAFabric + description: Complete reference of the AddBorderDeviceInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-border-device-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeleteBorderDeviceFromSDAFabric + description: Complete reference of the DeleteBorderDeviceFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-border-device-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.adds_border_device, + sda.Sda.deletes_border_device, + + - Paths used are + post /dna/intent/api/v1/business/sda/border-device, + delete /dna/intent/api/v1/business/sda/border-device, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.sda_fabric_border_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - borderSessionType: string + borderWithExternalConnectivity: true + connectedToInternet: true + deviceManagementIpAddress: string + deviceRole: + - string + externalConnectivityIpPoolName: string + externalConnectivitySettings: + - externalAutonomouSystemNumber: string + interfaceDescription: string + interfaceName: string + l2Handoff: + - virtualNetworkName: string + vlanName: string + l3Handoff: + - virtualNetwork: + virtualNetworkName: string + vlanId: string + externalDomainRoutingProtocolName: string + internalAutonomouSystemNumber: string + sdaTransitNetworkName: string + siteNameHierarchy: string + +- name: Delete all + cisco.dnac.sda_fabric_border_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + deviceManagementIpAddress: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device_info.py new file mode 100644 index 00000000..32904020 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_border_device_info.py @@ -0,0 +1,239 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_border_device_info +short_description: Information module for Sda Fabric Border Device +description: +- Get all Sda Fabric Border Device. +- Get border device detail from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + version_added: "4.0.0" + description: + - DeviceManagementIpAddress query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetBorderDeviceDetailFromSDAFabric + description: Complete reference of the GetBorderDeviceDetailFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-border-device-detail-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.gets_border_device_detail, + + - Paths used are + get /dna/intent/api/v1/business/sda/border-device, + +""" + +EXAMPLES = r""" +- name: Get all Sda Fabric Border Device + cisco.dnac.sda_fabric_border_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "payload": { + "id": "string", + "instanceId": 0, + "authEntityId": 0, + "displayName": "string", + "authEntityClass": 0, + "instanceTenantId": "string", + "deployPending": "string", + "instanceVersion": 0, + "createTime": 0, + "deployed": true, + "isSeeded": true, + "isStale": true, + "lastUpdateTime": 0, + "name": "string", + "namespace": "string", + "provisioningState": "string", + "resourceVersion": 0, + "targetIdList": [ + {} + ], + "type": "string", + "cfsChangeInfo": [ + {} + ], + "customProvisions": [ + {} + ], + "configs": [ + {} + ], + "managedSites": [ + {} + ], + "networkDeviceId": "string", + "roles": [ + "string" + ], + "saveWanConnectivityDetailsOnly": true, + "siteId": "string", + "akcSettingsCfs": [ + {} + ], + "deviceInterfaceInfo": [ + {} + ], + "deviceSettings": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceTenantId": "string", + "deployPending": "string", + "instanceVersion": 0, + "connectedTo": [ + {} + ], + "cpu": 0, + "dhcpEnabled": true, + "externalConnectivityIpPool": "string", + "externalDomainRoutingProtocol": "string", + "internalDomainProtocolNumber": "string", + "memory": 0, + "nodeType": [ + "string" + ], + "storage": 0, + "extConnectivitySettings": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceTenantId": "string", + "deployPending": "string", + "instanceVersion": 0, + "externalDomainProtocolNumber": "string", + "interfaceUuid": "string", + "policyPropagationEnabled": true, + "policySgtTag": 0, + "l2Handoff": [ + {} + ], + "l3Handoff": [ + { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceTenantId": "string", + "deployPending": "string", + "instanceVersion": 0, + "localIpAddress": "string", + "remoteIpAddress": "string", + "vlanId": 0, + "virtualNetwork": { + "idRef": "string" + } + } + ] + } + ] + }, + "networkWideSettings": { + "id": "string", + "instanceId": 0, + "displayName": "string", + "instanceTenantId": "string", + "deployPending": "string", + "instanceVersion": 0, + "aaa": [ + {} + ], + "cmx": [ + {} + ], + "dhcp": [ + { + "id": "string", + "ipAddress": { + "id": "string", + "paddedAddress": "string", + "addressType": "string", + "address": "string" + } + } + ], + "dns": [ + { + "id": "string", + "domainName": "string", + "ip": { + "id": "string", + "paddedAddress": "string", + "addressType": "string", + "address": "string" + } + } + ], + "ldap": [ + {} + ], + "nativeVlan": [ + {} + ], + "netflow": [ + {} + ], + "ntp": [ + {} + ], + "snmp": [ + {} + ], + "syslogs": [ + {} + ] + }, + "otherDevice": [ + {} + ], + "transitNetworks": [ + { + "idRef": "string" + } + ], + "virtualNetwork": [ + {} + ], + "wlan": [ + {} + ] + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device.py new file mode 100644 index 00000000..dec6f831 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_control_plane_device +short_description: Resource module for Sda Fabric Control Plane Device +description: +- Manage operations create and delete of the resource Sda Fabric Control Plane Device. +- Add control plane device in SDA Fabric. +- Delete control plane device in SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceManagementIpAddress: + description: DeviceManagementIpAddress query parameter. + type: str + version_added: 4.0.0 + payload: + description: Sda Fabric Control Plane Device's payload. + elements: dict + suboptions: + deviceManagementIpAddress: + description: Management Ip Address of the Device which is provisioned successfully. + type: str + version_added: 4.0.0 + siteNameHierarchy: + description: SiteNameHierarchy of the Provisioned Device(site should be part + of Fabric Site(site should be part of Fabric Site). + type: str + version_added: 4.0.0 + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddControlPlaneDeviceInSDAFabric + description: Complete reference of the AddControlPlaneDeviceInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-control-plane-device-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeleteControlPlaneDeviceInSDAFabric + description: Complete reference of the DeleteControlPlaneDeviceInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-control-plane-device-in-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_control_plane_device, + sda.Sda.delete_control_plane_device, + + - Paths used are + post /dna/intent/api/v1/business/sda/control-plane-device, + delete /dna/intent/api/v1/business/sda/control-plane-device, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.sda_fabric_control_plane_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + deviceManagementIpAddress: string + +- name: Create + cisco.dnac.sda_fabric_control_plane_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - deviceManagementIpAddress: string + siteNameHierarchy: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device_info.py new file mode 100644 index 00000000..ddab671f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_control_plane_device_info.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_control_plane_device_info +short_description: Information module for Sda Fabric Control Plane Device +description: +- Get all Sda Fabric Control Plane Device. +- Get control plane device from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + version_added: "4.0.0" + description: + - DeviceManagementIpAddress query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetControlPlaneDeviceFromSDAFabric + description: Complete reference of the GetControlPlaneDeviceFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-control-plane-device-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_control_plane_device, + + - Paths used are + get /dna/intent/api/v1/business/sda/control-plane-device, + +""" + +EXAMPLES = r""" +- name: Get all Sda Fabric Control Plane Device + cisco.dnac.sda_fabric_control_plane_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "name": "string", + "roles": [ + "string" + ], + "deviceManagementIpAddress": "string", + "siteHierarchy": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device.py new file mode 100644 index 00000000..aa7e9972 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device.py @@ -0,0 +1,100 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_edge_device +short_description: Resource module for Sda Fabric Edge Device +description: +- Manage operations create and delete of the resource Sda Fabric Edge Device. +- Add edge device in SDA Fabric. +- Delete edge device from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceManagementIpAddress: + description: DeviceManagementIpAddress query parameter. + type: str + payload: + description: Sda Fabric Edge Device's payload. + elements: dict + suboptions: + deviceManagementIpAddress: + description: Management Ip Address of the Device which is provisioned successfully. + type: str + siteNameHierarchy: + description: SiteNameHierarchy of the Provisioned Device(site should be part + of Fabric Site). + type: str + version_added: 4.0.0 + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddEdgeDeviceInSDAFabric + description: Complete reference of the AddEdgeDeviceInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-edge-device-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeleteEdgeDeviceFromSDAFabric + description: Complete reference of the DeleteEdgeDeviceFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-edge-device-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_edge_device, + sda.Sda.delete_edge_device, + + - Paths used are + post /dna/intent/api/v1/business/sda/edge-device, + delete /dna/intent/api/v1/business/sda/edge-device, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.sda_fabric_edge_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - deviceManagementIpAddress: string + siteNameHierarchy: string + +- name: Delete all + cisco.dnac.sda_fabric_edge_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + deviceManagementIpAddress: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device_info.py new file mode 100644 index 00000000..0bd1a388 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_edge_device_info.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_edge_device_info +short_description: Information module for Sda Fabric Edge Device +description: +- Get all Sda Fabric Edge Device. +- Get edge device from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + description: + - DeviceManagementIpAddress query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetEdgeDeviceFromSDAFabric + description: Complete reference of the GetEdgeDeviceFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-edge-device-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_edge_device, + + - Paths used are + get /dna/intent/api/v1/business/sda/edge-device, + +""" + +EXAMPLES = r""" +- name: Get all Sda Fabric Edge Device + cisco.dnac.sda_fabric_edge_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "name": "string", + "roles": [ + "string" + ], + "deviceManagementIpAddress": "string", + "siteHierarchy": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_info.py new file mode 100644 index 00000000..cbfe51e8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_info.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_info +short_description: Information module for Sda Fabric +description: +- Get all Sda Fabric. +- Get SDA Fabric Info. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + fabricName: + description: + - FabricName query parameter. Fabric Name. + type: str +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + sda.Sda.get_sda_fabric_info, + + - Paths used are + get /dna/intent/api/v1/business/sda/fabric, + +""" + +EXAMPLES = r""" +- name: Get all Sda Fabric + cisco.dnac.sda_fabric_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + fabricName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "executionId": "string", + "fabricName": "string", + "fabricType": "string", + "fabricDomainType": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site.py new file mode 100644 index 00000000..51f9ff0a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_site +short_description: Resource module for Sda Fabric Site +description: +- Manage operations create and delete of the resource Sda Fabric Site. +- Add Site in SDA Fabric. +- Delete Site from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + fabricName: + description: Warning - Starting DNA Center 2.2.3.5 release, this field has been + deprecated. SD-Access Fabric does not need it anymore. It will be removed in future + DNA Center releases. + type: str + version_added: 4.0.0 + siteNameHierarchy: + description: SiteNameHierarchy query parameter. Site Name Hierarchy. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddSiteInSDAFabric + description: Complete reference of the AddSiteInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-site-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeleteSiteFromSDAFabric + description: Complete reference of the DeleteSiteFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-site-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_site, + sda.Sda.delete_site, + + - Paths used are + post /dna/intent/api/v1/business/sda/fabric-site, + delete /dna/intent/api/v1/business/sda/fabric-site, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.sda_fabric_site: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + siteNameHierarchy: string + +- name: Create + cisco.dnac.sda_fabric_site: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + fabricName: string + siteNameHierarchy: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site_info.py new file mode 100644 index 00000000..44feb7cf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_fabric_site_info.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_fabric_site_info +short_description: Information module for Sda Fabric Site +description: +- Get all Sda Fabric Site. +- Get Site info from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteNameHierarchy: + description: + - SiteNameHierarchy query parameter. Site Name Hierarchy. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetSiteFromSDAFabric + description: Complete reference of the GetSiteFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-site-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_site, + + - Paths used are + get /dna/intent/api/v1/business/sda/fabric-site, + +""" + +EXAMPLES = r""" +- name: Get all Sda Fabric Site + cisco.dnac.sda_fabric_site_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteNameHierarchy: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "executionStatusUrl": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_multicast.py b/ansible_collections/cisco/dnac/plugins/modules/sda_multicast.py new file mode 100644 index 00000000..bd5e0893 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_multicast.py @@ -0,0 +1,130 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_multicast +short_description: Resource module for Sda Multicast +description: +- Manage operations create and delete of the resource Sda Multicast. +- Add multicast in SDA fabric. +- Delete multicast from SDA fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + multicastMethod: + description: Multicast Method. + type: str + multicastType: + description: Multicast Type. + type: str + multicastVnInfo: + description: Sda Multicast's multicastVnInfo. + elements: dict + suboptions: + externalRpIpAddress: + description: ExternalRpIpAddress, required if multicastType is asm_with_external_rp. + type: str + internalRpIpAddress: + description: InternalRpIpAddress, required if multicastType is asm_with_internal_rp. + elements: str + type: list + ipPoolName: + description: Ip Pool Name, that is reserved to Fabric Site. + type: str + ssmInfo: + description: Sda Multicast's ssmInfo. + suboptions: + ssmGroupRange: + description: Valid SSM group range ip address(e.g., 230.0.0.0). + type: str + ssmWildcardMask: + description: Valid SSM Wildcard Mask ip address(e.g.,0.255.255.255). + type: str + type: dict + virtualNetworkName: + description: Virtual Network Name, that is associated to Fabric Site. + type: str + type: list + siteNameHierarchy: + description: Full path of sda Fabric Site. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddMulticastInSDAFabric + description: Complete reference of the AddMulticastInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-multicast-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeleteMulticastFromSDAFabric + description: Complete reference of the DeleteMulticastFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-multicast-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_multicast_in_sda_fabric, + sda.Sda.delete_multicast_from_sda_fabric, + + - Paths used are + post /dna/intent/api/v1/business/sda/multicast, + delete /dna/intent/api/v1/business/sda/multicast, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.sda_multicast: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + multicastMethod: string + multicastType: string + multicastVnInfo: + - externalRpIpAddress: string + internalRpIpAddress: + - string + ipPoolName: string + ssmInfo: + ssmGroupRange: string + ssmWildcardMask: string + virtualNetworkName: string + siteNameHierarchy: string + +- name: Delete all + cisco.dnac.sda_multicast: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + siteNameHierarchy: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_multicast_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_multicast_info.py new file mode 100644 index 00000000..2df58000 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_multicast_info.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_multicast_info +short_description: Information module for Sda Multicast +description: +- Get all Sda Multicast. +- Get multicast details from SDA fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteNameHierarchy: + description: + - SiteNameHierarchy query parameter. Fabric site name hierarchy. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetMulticastDetailsFromSDAFabric + description: Complete reference of the GetMulticastDetailsFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-multicast-details-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_multicast_details_from_sda_fabric, + + - Paths used are + get /dna/intent/api/v1/business/sda/multicast, + +""" + +EXAMPLES = r""" +- name: Get all Sda Multicast + cisco.dnac.sda_multicast_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteNameHierarchy: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "siteNameHierarchy": "string", + "multicastMethod": "string", + "multicastType": "string", + "multicastVnInfo": [ + { + "virtualNetworkName": "string", + "ipPoolName": "string", + "internalRpIpAddress": [ + "string" + ], + "externalRpIpAddress": "string", + "ssmInfo": { + "ssmGroupRange": "string", + "ssmWildcardMask": "string" + } + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point.py b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point.py new file mode 100644 index 00000000..39b7df6e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_port_assignment_for_access_point +short_description: Resource module for Sda Port Assignment For Access Point +description: +- Manage operations create and delete of the resource Sda Port Assignment For Access Point. +- Add Port assignment for access point in SDA Fabric. +- Delete Port assignment for access point in SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + authenticateTemplateName: + description: Authenticate TemplateName associated to Fabric Site. + type: str + version_added: 4.0.0 + dataIpAddressPoolName: + description: Ip Pool Name, that is assigned to INFRA_VN. + type: str + version_added: 4.0.0 + deviceManagementIpAddress: + description: Management Ip Address of the edge device. + type: str + version_added: 4.0.0 + interfaceDescription: + description: Details or note of interface port assignment. + type: str + version_added: 4.0.0 + interfaceName: + description: Interface Name of the edge device. + type: str + siteNameHierarchy: + description: Path of sda Fabric Site. + type: str + version_added: 4.0.0 +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddPortAssignmentForAccessPointInSDAFabric + description: Complete reference of the AddPortAssignmentForAccessPointInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-port-assignment-for-access-point-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeletePortAssignmentForAccessPointInSDAFabric + description: Complete reference of the DeletePortAssignmentForAccessPointInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-port-assignment-for-access-point-in-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_port_assignment_for_access_point, + sda.Sda.delete_port_assignment_for_access_point, + + - Paths used are + post /dna/intent/api/v1/business/sda/hostonboarding/access-point, + delete /dna/intent/api/v1/business/sda/hostonboarding/access-point, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.sda_port_assignment_for_access_point: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + authenticateTemplateName: string + dataIpAddressPoolName: string + deviceManagementIpAddress: string + interfaceDescription: string + interfaceName: string + siteNameHierarchy: string + +- name: Delete all + cisco.dnac.sda_port_assignment_for_access_point: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + deviceManagementIpAddress: string + interfaceName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point_info.py new file mode 100644 index 00000000..45dc1ea3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_access_point_info.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_port_assignment_for_access_point_info +short_description: Information module for Sda Port Assignment For Access Point +description: +- Get all Sda Port Assignment For Access Point. +- Get Port assignment for access point in SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + version_added: "4.0.0" + description: + - DeviceManagementIpAddress query parameter. + type: str + interfaceName: + description: + - InterfaceName query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetPortAssignmentForAccessPointInSDAFabric + description: Complete reference of the GetPortAssignmentForAccessPointInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-port-assignment-for-access-point-in-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_port_assignment_for_access_point, + + - Paths used are + get /dna/intent/api/v1/business/sda/hostonboarding/access-point, + +""" + +EXAMPLES = r""" +- name: Get all Sda Port Assignment For Access Point + cisco.dnac.sda_port_assignment_for_access_point_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + interfaceName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "siteNameHierarchy": "string", + "deviceManagementIpAddress": "string", + "interfaceName": "string", + "dataIpAddressPoolName": "string", + "voiceIpAddressPoolName": "string", + "scalableGroupName": "string", + "authenticateTemplateName": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device.py b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device.py new file mode 100644 index 00000000..d1b2220c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device.py @@ -0,0 +1,122 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_port_assignment_for_user_device +short_description: Resource module for Sda Port Assignment For User Device +description: +- Manage operations create and delete of the resource Sda Port Assignment For User Device. +- Add Port assignment for user device in SDA Fabric. +- Delete Port assignment for user device in SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + authenticateTemplateName: + description: Authenticate TemplateName associated with siteNameHierarchy. + type: str + version_added: 4.0.0 + dataIpAddressPoolName: + description: Ip Pool Name, that is assigned to virtual network with traffic type + as DATA(can't be empty if voiceIpAddressPoolName is empty). + type: str + version_added: 4.0.0 + deviceManagementIpAddress: + description: DeviceManagementIpAddress query parameter. + type: str + interfaceDescription: + description: User defined text message for this port. + type: str + version_added: 4.0.0 + interfaceName: + description: InterfaceName query parameter. + type: str + scalableGroupName: + description: Scalable Group name associated with VN. + type: str + version_added: 4.0.0 + siteNameHierarchy: + description: Complete Path of SD-Access Fabric Site. + type: str + version_added: 4.0.0 + voiceIpAddressPoolName: + description: Ip Pool Name, that is assigned to virtual network with traffic type + as VOICE(can't be empty if dataIpAddressPoolName is empty). + type: str + version_added: 4.0.0 +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddPortAssignmentForUserDeviceInSDAFabric + description: Complete reference of the AddPortAssignmentForUserDeviceInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-port-assignment-for-user-device-in-sda-fabric +- name: Cisco DNA Center documentation for SDA DeletePortAssignmentForUserDeviceInSDAFabric + description: Complete reference of the DeletePortAssignmentForUserDeviceInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-port-assignment-for-user-device-in-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_port_assignment_for_user_device, + sda.Sda.delete_port_assignment_for_user_device, + + - Paths used are + post /dna/intent/api/v1/business/sda/hostonboarding/user-device, + delete /dna/intent/api/v1/business/sda/hostonboarding/user-device, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.sda_port_assignment_for_user_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + deviceManagementIpAddress: string + interfaceName: string + +- name: Create + cisco.dnac.sda_port_assignment_for_user_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + authenticateTemplateName: string + dataIpAddressPoolName: string + deviceManagementIpAddress: string + interfaceDescription: string + interfaceName: string + scalableGroupName: string + siteNameHierarchy: string + voiceIpAddressPoolName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device_info.py new file mode 100644 index 00000000..e62e9ae3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_port_assignment_for_user_device_info.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_port_assignment_for_user_device_info +short_description: Information module for Sda Port Assignment For User Device +description: +- Get all Sda Port Assignment For User Device. +- Get Port assignment for user device in SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + description: + - DeviceManagementIpAddress query parameter. + type: str + interfaceName: + description: + - InterfaceName query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetPortAssignmentForUserDeviceInSDAFabric + description: Complete reference of the GetPortAssignmentForUserDeviceInSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-port-assignment-for-user-device-in-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_port_assignment_for_user_device, + + - Paths used are + get /dna/intent/api/v1/business/sda/hostonboarding/user-device, + +""" + +EXAMPLES = r""" +- name: Get all Sda Port Assignment For User Device + cisco.dnac.sda_port_assignment_for_user_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + interfaceName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "siteNameHierarchy": "string", + "deviceManagementIpAddress": "string", + "interfaceName": "string", + "dataIpAddressPoolName": "string", + "voiceIpAddressPoolName": "string", + "scalableGroupName": "string", + "authenticateTemplateName": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_provision_device.py b/ansible_collections/cisco/dnac/plugins/modules/sda_provision_device.py new file mode 100644 index 00000000..97c12fae --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_provision_device.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_provision_device +short_description: Resource module for Sda Provision Device +description: +- Manage operations create, update and delete of the resource Sda Provision Device. +- Provision Wired Device. +- Delete provisioned Wired Device. +- Re-Provision Wired Device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceManagementIpAddress: + description: DeviceManagementIpAddress query parameter. Valid IP address of the + device currently provisioned in a fabric site. + type: str + siteNameHierarchy: + description: SiteNameHierarchy of the provisioned device. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA ProvisionWiredDevice + description: Complete reference of the ProvisionWiredDevice API. + link: https://developer.cisco.com/docs/dna-center/#!provision-wired-device +- name: Cisco DNA Center documentation for SDA DeleteProvisionedWiredDevice + description: Complete reference of the DeleteProvisionedWiredDevice API. + link: https://developer.cisco.com/docs/dna-center/#!delete-provisioned-wired-device +- name: Cisco DNA Center documentation for SDA ReProvisionWiredDevice + description: Complete reference of the ReProvisionWiredDevice API. + link: https://developer.cisco.com/docs/dna-center/#!re-provision-wired-device +notes: + - SDK Method used are + sda.Sda.delete_provisioned_wired_device, + sda.Sda.provision_wired_device, + sda.Sda.re_provision_wired_device, + + - Paths used are + post /dna/intent/api/v1/business/sda/provision-device, + delete /dna/intent/api/v1/business/sda/provision-device, + put /dna/intent/api/v1/business/sda/provision-device, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.sda_provision_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + deviceManagementIpAddress: string + +- name: Update all + cisco.dnac.sda_provision_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + deviceManagementIpAddress: string + siteNameHierarchy: string + +- name: Create + cisco.dnac.sda_provision_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + deviceManagementIpAddress: string + siteNameHierarchy: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_provision_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_provision_device_info.py new file mode 100644 index 00000000..01bf3e3d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_provision_device_info.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_provision_device_info +short_description: Information module for Sda Provision Device +description: +- Get all Sda Provision Device. +- Get Provisioned Wired Device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceManagementIpAddress: + description: + - DeviceManagementIpAddress query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetProvisionedWiredDevice + description: Complete reference of the GetProvisionedWiredDevice API. + link: https://developer.cisco.com/docs/dna-center/#!get-provisioned-wired-device +notes: + - SDK Method used are + sda.Sda.get_provisioned_wired_device, + + - Paths used are + get /dna/intent/api/v1/business/sda/provision-device, + +""" + +EXAMPLES = r""" +- name: Get all Sda Provision Device + cisco.dnac.sda_provision_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceManagementIpAddress: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "deviceManagementIpAddress": "string", + "siteNameHierarchy": "string", + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network.py b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network.py new file mode 100644 index 00000000..617a0005 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_virtual_network +short_description: Resource module for Sda Virtual Network +description: +- Manage operations create and delete of the resource Sda Virtual Network. +- Add virtual network VN in SDA Fabric. +- Delete virtual network VN from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Sda Virtual Network's payload. + elements: dict + suboptions: + siteNameHierarchy: + description: Path of sda Fabric Site. + type: str + virtualNetworkName: + description: Virtual Network Name, that is created at Global level. + type: str + type: list + siteNameHierarchy: + description: SiteNameHierarchy query parameter. + type: str + virtualNetworkName: + description: VirtualNetworkName query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddVNInFabric + description: Complete reference of the AddVNInFabric API. + link: https://developer.cisco.com/docs/dna-center/#!add-vn-in-fabric +- name: Cisco DNA Center documentation for SDA DeleteVNFromSDAFabric + description: Complete reference of the DeleteVNFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!delete-vn-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.add_vn, + sda.Sda.delete_vn, + + - Paths used are + post /dna/intent/api/v1/business/sda/virtual-network, + delete /dna/intent/api/v1/business/sda/virtual-network, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.sda_virtual_network: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + siteNameHierarchy: string + virtualNetworkName: string + +- name: Create + cisco.dnac.sda_virtual_network: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - siteNameHierarchy: string + virtualNetworkName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_info.py new file mode 100644 index 00000000..bd83c9b0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_virtual_network_info +short_description: Information module for Sda Virtual Network +description: +- Get all Sda Virtual Network. +- Get virtual network VN from SDA Fabric. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + virtualNetworkName: + description: + - VirtualNetworkName query parameter. + type: str + siteNameHierarchy: + description: + - SiteNameHierarchy query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetVNFromSDAFabric + description: Complete reference of the GetVNFromSDAFabric API. + link: https://developer.cisco.com/docs/dna-center/#!get-vn-from-sda-fabric +notes: + - SDK Method used are + sda.Sda.get_vn, + + - Paths used are + get /dna/intent/api/v1/business/sda/virtual-network, + +""" + +EXAMPLES = r""" +- name: Get all Sda Virtual Network + cisco.dnac.sda_virtual_network_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + virtualNetworkName: string + siteNameHierarchy: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "name": "string", + "roles": [ + "string" + ], + "deviceManagementIpAddress": "string", + "siteHierarchy": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool.py b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool.py new file mode 100644 index 00000000..3da9b2de --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool.py @@ -0,0 +1,159 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_virtual_network_ip_pool +short_description: Resource module for Sda Virtual Network Ip Pool +description: +- Manage operations create and delete of the resource Sda Virtual Network Ip Pool. +- Add IP Pool in SDA Virtual Network. +- Delete IP Pool from SDA Virtual Network. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + autoGenerateVlanName: + description: It will auto generate vlanName, if vlanName is empty(applicable for + L3 and INFRA_VN). + type: bool + ipPoolName: + description: IpPoolName query parameter. + type: str + version_added: 4.0.0 + isCommonPool: + description: Common Pool enablement flag(applicable for L3 and L2 and default value + is False ). + type: bool + isIpDirectedBroadcast: + description: Ip Directed Broadcast enablement flag(applicable for L3 and default + value is False ). + type: bool + isL2FloodingEnabled: + description: Layer2 flooding enablement flag(applicable for L3 , L2 and always true + for L2 and default value is False ). + type: bool + version_added: 4.0.0 + isLayer2Only: + description: Layer2 Only enablement flag and default value is False. + type: bool + isThisCriticalPool: + description: Critical pool enablement(applicable for L3 and default value is False + ). + type: bool + version_added: 4.0.0 + isWirelessPool: + description: Wireless Pool enablement flag(applicable for L3 and L2 and default + value is False ). + type: bool + version_added: 4.0.0 + poolType: + description: Pool Type (applicable for INFRA_VN). + type: str + version_added: 4.0.0 + scalableGroupName: + description: Scalable Group Name(applicable for L3). + type: str + version_added: 4.0.0 + siteNameHierarchy: + description: SiteNameHierarchy query parameter. + type: str + version_added: 4.0.0 + trafficType: + description: Traffic type(applicable for L3 and L2). + type: str + version_added: 4.0.0 + virtualNetworkName: + description: VirtualNetworkName query parameter. + type: str + vlanId: + description: Vlan Id(applicable for L3 , L2 and INFRA_VN). + type: str + vlanName: + description: Vlan name represent the segment name, if empty, vlanName would be auto + generated by API. + type: str + version_added: 4.0.0 +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddIPPoolInSDAVirtualNetwork + description: Complete reference of the AddIPPoolInSDAVirtualNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!add-ip-pool-in-sda-virtual-network +- name: Cisco DNA Center documentation for SDA DeleteIPPoolFromSDAVirtualNetwork + description: Complete reference of the DeleteIPPoolFromSDAVirtualNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!delete-ip-pool-from-sda-virtual-network +notes: + - SDK Method used are + sda.Sda.add_ip_pool_in_sda_virtual_network, + sda.Sda.delete_ip_pool_from_sda_virtual_network, + + - Paths used are + post /dna/intent/api/v1/business/sda/virtualnetwork/ippool, + delete /dna/intent/api/v1/business/sda/virtualnetwork/ippool, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.sda_virtual_network_ip_pool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + ipPoolName: string + siteNameHierarchy: string + virtualNetworkName: string + +- name: Create + cisco.dnac.sda_virtual_network_ip_pool: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + autoGenerateVlanName: true + ipPoolName: string + isCommonPool: true + isIpDirectedBroadcast: true + isL2FloodingEnabled: true + isLayer2Only: true + isThisCriticalPool: true + isWirelessPool: true + poolType: string + scalableGroupName: string + siteNameHierarchy: string + trafficType: string + virtualNetworkName: string + vlanId: string + vlanName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool_info.py new file mode 100644 index 00000000..205199cf --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_ip_pool_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_virtual_network_ip_pool_info +short_description: Information module for Sda Virtual Network Ip Pool +description: +- Get all Sda Virtual Network Ip Pool. +- Get IP Pool from SDA Virtual Network. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteNameHierarchy: + version_added: "4.0.0" + description: + - SiteNameHierarchy query parameter. + type: str + virtualNetworkName: + description: + - VirtualNetworkName query parameter. + type: str + ipPoolName: + version_added: "4.0.0" + description: + - IpPoolName query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetIPPoolFromSDAVirtualNetwork + description: Complete reference of the GetIPPoolFromSDAVirtualNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!get-ip-pool-from-sda-virtual-network +notes: + - SDK Method used are + sda.Sda.get_ip_pool_from_sda_virtual_network, + + - Paths used are + get /dna/intent/api/v1/business/sda/virtualnetwork/ippool, + +""" + +EXAMPLES = r""" +- name: Get all Sda Virtual Network Ip Pool + cisco.dnac.sda_virtual_network_ip_pool_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteNameHierarchy: string + virtualNetworkName: string + ipPoolName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "virtualNetworkName": "string", + "ipPoolName": "string", + "authenticationPolicyName": "string", + "trafficType": "string", + "scalableGroupName": "string", + "isL2FloodingEnabled": true, + "isThisCriticalPool": true + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2.py b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2.py new file mode 100644 index 00000000..3c993340 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2.py @@ -0,0 +1,116 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_virtual_network_v2 +short_description: Resource module for Sda Virtual Network V2 +description: +- Manage operations create, update and delete of the resource Sda Virtual Network V2. +- Add virtual network with scalable groups at global level. +- Delete virtual network with scalable groups. +- Update virtual network with scalable groups. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + isGuestVirtualNetwork: + description: To create guest virtual network. + type: bool + scalableGroupNames: + description: Scalable Group to be associated to virtual network. + elements: str + type: list + virtualNetworkName: + description: Virtual Network Name to be assigned at global level. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA AddVirtualNetworkWithScalableGroups + description: Complete reference of the AddVirtualNetworkWithScalableGroups API. + link: https://developer.cisco.com/docs/dna-center/#!add-virtual-network-with-scalable-groups +- name: Cisco DNA Center documentation for SDA DeleteVirtualNetworkWithScalableGroups + description: Complete reference of the DeleteVirtualNetworkWithScalableGroups API. + link: https://developer.cisco.com/docs/dna-center/#!delete-virtual-network-with-scalable-groups +- name: Cisco DNA Center documentation for SDA UpdateVirtualNetworkWithScalableGroups + description: Complete reference of the UpdateVirtualNetworkWithScalableGroups API. + link: https://developer.cisco.com/docs/dna-center/#!update-virtual-network-with-scalable-groups +notes: + - SDK Method used are + sda.Sda.add_virtual_network_with_scalable_groups, + sda.Sda.delete_virtual_network_with_scalable_groups, + sda.Sda.update_virtual_network_with_scalable_groups, + + - Paths used are + post /dna/intent/api/v1/virtual-network, + delete /dna/intent/api/v1/virtual-network, + put /dna/intent/api/v1/virtual-network, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.sda_virtual_network_v2: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + isGuestVirtualNetwork: true + scalableGroupNames: + - string + virtualNetworkName: string + +- name: Delete all + cisco.dnac.sda_virtual_network_v2: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + virtualNetworkName: string + +- name: Update all + cisco.dnac.sda_virtual_network_v2: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + isGuestVirtualNetwork: true + scalableGroupNames: + - string + virtualNetworkName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2_info.py b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2_info.py new file mode 100644 index 00000000..6a9c6f63 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sda_virtual_network_v2_info.py @@ -0,0 +1,76 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sda_virtual_network_v2_info +short_description: Information module for Sda Virtual Network V2 +description: +- Get all Sda Virtual Network V2. +- Get virtual network with scalable groups. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + virtualNetworkName: + description: + - VirtualNetworkName query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for SDA GetVirtualNetworkWithScalableGroups + description: Complete reference of the GetVirtualNetworkWithScalableGroups API. + link: https://developer.cisco.com/docs/dna-center/#!get-virtual-network-with-scalable-groups +notes: + - SDK Method used are + sda.Sda.get_virtual_network_with_scalable_groups, + + - Paths used are + get /dna/intent/api/v1/virtual-network, + +""" + +EXAMPLES = r""" +- name: Get all Sda Virtual Network V2 + cisco.dnac.sda_virtual_network_v2_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + virtualNetworkName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "virtualNetworkName": "string", + "isGuestVirtualNetwork": true, + "scalableGroupNames": [ + "string" + ], + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/security_advisories_devices_info.py b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_devices_info.py new file mode 100644 index 00000000..0a0bf0c9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_devices_info.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: security_advisories_devices_info +short_description: Information module for Security Advisories Devices +description: +- Get all Security Advisories Devices. +- Retrieves list of devices for an advisory. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + advisoryId: + description: + - AdvisoryId path parameter. Advisory ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Security Advisories GetDevicesPerAdvisory + description: Complete reference of the GetDevicesPerAdvisory API. + link: https://developer.cisco.com/docs/dna-center/#!get-devices-per-advisory +notes: + - SDK Method used are + security_advisories.SecurityAdvisories.get_devices_per_advisory, + + - Paths used are + get /dna/intent/api/v1/security-advisory/advisory/{advisoryId}/device, + +""" + +EXAMPLES = r""" +- name: Get all Security Advisories Devices + cisco.dnac.security_advisories_devices_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + advisoryId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + "string" + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/security_advisories_ids_per_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_ids_per_device_info.py new file mode 100644 index 00000000..8bf7638d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_ids_per_device_info.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: security_advisories_ids_per_device_info +short_description: Information module for Security Advisories Ids Per Device +description: +- Get Security Advisories Ids Per Device by id. +- Retrieves list of advisory IDs for a device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device instance UUID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Security Advisories GetAdvisoryIDsPerDevice + description: Complete reference of the GetAdvisoryIDsPerDevice API. + link: https://developer.cisco.com/docs/dna-center/#!get-advisory-i-ds-per-device +notes: + - SDK Method used are + security_advisories.SecurityAdvisories.get_advisory_ids_per_device, + + - Paths used are + get /dna/intent/api/v1/security-advisory/device/{deviceId}, + +""" + +EXAMPLES = r""" +- name: Get Security Advisories Ids Per Device by id + cisco.dnac.security_advisories_ids_per_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "deviceId": "string", + "advisoryIds": [ + "string" + ] + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/security_advisories_info.py b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_info.py new file mode 100644 index 00000000..b0b551cd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_info.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: security_advisories_info +short_description: Information module for Security Advisories +description: +- Get all Security Advisories. +- Retrieves list of advisories on the network. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Security Advisories GetAdvisoriesList + description: Complete reference of the GetAdvisoriesList API. + link: https://developer.cisco.com/docs/dna-center/#!get-advisories-list +notes: + - SDK Method used are + security_advisories.SecurityAdvisories.get_advisories_list, + + - Paths used are + get /dna/intent/api/v1/security-advisory/advisory, + +""" + +EXAMPLES = r""" +- name: Get all Security Advisories + cisco.dnac.security_advisories_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "advisoryId": "string", + "deviceCount": 0, + "hiddenDeviceCount": 0, + "cves": [ + "string" + ], + "publicationUrl": "string", + "sir": "string", + "detectionType": "string", + "defaultDetectionType": "string", + "defaultConfigMatchPattern": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/security_advisories_per_device_info.py b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_per_device_info.py new file mode 100644 index 00000000..54735ee1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_per_device_info.py @@ -0,0 +1,82 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: security_advisories_per_device_info +short_description: Information module for Security Advisories Per Device +description: +- Get all Security Advisories Per Device. +- Retrieves list of advisories for a device. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device instance UUID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Security Advisories GetAdvisoriesPerDevice + description: Complete reference of the GetAdvisoriesPerDevice API. + link: https://developer.cisco.com/docs/dna-center/#!get-advisories-per-device +notes: + - SDK Method used are + security_advisories.SecurityAdvisories.get_advisories_per_device, + + - Paths used are + get /dna/intent/api/v1/security-advisory/device/{deviceId}/advisory, + +""" + +EXAMPLES = r""" +- name: Get all Security Advisories Per Device + cisco.dnac.security_advisories_per_device_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "advisoryId": "string", + "deviceCount": 0, + "hiddenDeviceCount": 0, + "cves": [ + "string" + ], + "publicationUrl": "string", + "sir": "string", + "detectionType": "string", + "defaultDetectionType": "string", + "defaultConfigMatchPattern": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/security_advisories_summary_info.py b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_summary_info.py new file mode 100644 index 00000000..4709ca6b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/security_advisories_summary_info.py @@ -0,0 +1,94 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: security_advisories_summary_info +short_description: Information module for Security Advisories Summary +description: +- Get all Security Advisories Summary. +- Retrieves summary of advisories on the network. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Security Advisories GetAdvisoriesSummary + description: Complete reference of the GetAdvisoriesSummary API. + link: https://developer.cisco.com/docs/dna-center/#!get-advisories-summary +notes: + - SDK Method used are + security_advisories.SecurityAdvisories.get_advisories_summary, + + - Paths used are + get /dna/intent/api/v1/security-advisory/advisory/aggregate, + +""" + +EXAMPLES = r""" +- name: Get all Security Advisories Summary + cisco.dnac.security_advisories_summary_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "NA": { + "CONFIG": 0, + "VERSION": 0, + "TOTAL": 0 + }, + "INFORMATIONAL": { + "CONFIG": 0, + "VERSION": 0, + "TOTAL": 0 + }, + "LOW": { + "CONFIG": 0, + "VERSION": 0, + "TOTAL": 0 + }, + "MEDIUM": { + "CONFIG": 0, + "VERSION": 0, + "TOTAL": 0 + }, + "HIGH": { + "CONFIG": 0, + "VERSION": 0, + "TOTAL": 0 + }, + "CRITICAL": { + "CONFIG": 0, + "VERSION": 0, + "TOTAL": 0 + } + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sensor.py b/ansible_collections/cisco/dnac/plugins/modules/sensor.py new file mode 100644 index 00000000..4ac0fc8b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sensor.py @@ -0,0 +1,262 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sensor +short_description: Resource module for Sensor +description: +- Manage operations create and delete of the resource Sensor. +- Intent API to create a SENSOR test template with a new SSID, existing SSID, or both new and existing SSID. +- Intent API to delete an existing SENSOR test template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + apCoverage: + description: Sensor's apCoverage. + elements: dict + suboptions: + bands: + description: Bands. + type: str + numberOfApsToTest: + description: Number Of Aps To Test. + type: str + rssiThreshold: + description: Rssi Threshold. + type: str + type: list + connection: + description: Connection. + type: str + modelVersion: + description: Model Version. + type: int + name: + description: Name. + type: str + ssids: + description: Sensor's ssids. + elements: dict + suboptions: + authType: + description: Auth Type. + type: str + categories: + description: Categories. + elements: str + type: list + profileName: + description: Profile Name. + type: str + psk: + description: Psk. + type: str + qosPolicy: + description: Qos Policy. + type: str + ssid: + description: Ssid. + type: str + tests: + description: Sensor's tests. + elements: dict + suboptions: + config: + description: Config. + elements: dict + type: list + name: + description: Name. + type: str + type: list + thirdParty: + description: Sensor's thirdParty. + suboptions: + selected: + description: Selected. + type: bool + type: dict + type: list + templateName: + description: TemplateName query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sensors CreateSensorTestTemplate + description: Complete reference of the CreateSensorTestTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!create-sensor-test-template +- name: Cisco DNA Center documentation for Sensors DeleteSensorTest + description: Complete reference of the DeleteSensorTest API. + link: https://developer.cisco.com/docs/dna-center/#!delete-sensor-test +notes: + - SDK Method used are + sensors.Sensors.create_sensor_test_template, + sensors.Sensors.delete_sensor_test, + + - Paths used are + post /dna/intent/api/v1/sensor, + delete /dna/intent/api/v1/sensor, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.sensor: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + apCoverage: + - bands: string + numberOfApsToTest: string + rssiThreshold: string + connection: string + modelVersion: 0 + name: string + ssids: + - authType: string + categories: + - string + profileName: string + psk: string + qosPolicy: string + ssid: string + tests: + - config: + - {} + name: string + thirdParty: + selected: true + +- name: Delete all + cisco.dnac.sensor: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + templateName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "_id": "string", + "name": "string", + "version": 0, + "modelVersion": 0, + "startTime": 0, + "lastModifiedTime": 0, + "numAssociatedSensor": 0, + "location": {}, + "siteHierarchy": {}, + "status": "string", + "connection": "string", + "frequency": {}, + "rssiThreshold": 0, + "numNeighborAPThreshold": 0, + "scheduleInDays": 0, + "wlans": [ + {} + ], + "ssids": [ + { + "bands": {}, + "ssid": "string", + "profileName": "string", + "authType": "string", + "authTypeRcvd": {}, + "psk": "string", + "username": {}, + "password": {}, + "eapMethod": {}, + "scep": true, + "authProtocol": {}, + "certfilename": {}, + "certxferprotocol": "string", + "certstatus": "string", + "certpassphrase": {}, + "certdownloadurl": {}, + "numAps": 0, + "numSensors": 0, + "layer3webAuthsecurity": {}, + "layer3webAuthuserName": {}, + "layer3webAuthpassword": {}, + "extWebAuthVirtualIp": {}, + "layer3webAuthEmailAddress": {}, + "qosPolicy": "string", + "extWebAuth": true, + "whiteList": true, + "extWebAuthPortal": {}, + "extWebAuthAccessUrl": {}, + "extWebAuthHtmlTag": [ + {} + ], + "thirdParty": { + "selected": true + }, + "id": 0, + "wlanId": 0, + "wlc": {}, + "validFrom": 0, + "validTo": 0, + "status": "string", + "tests": [ + { + "name": "string", + "config": [ + {} + ] + } + ] + } + ], + "testScheduleMode": "string", + "showWlcUpgradeBanner": true, + "radioAsSensorRemoved": true, + "encryptionMode": "string", + "runNow": "string", + "locationInfoList": [ + {} + ], + "schedule": {}, + "tests": {}, + "sensors": [ + {} + ], + "apCoverage": [ + { + "bands": "string", + "numberOfApsToTest": 0, + "rssiThreshold": 0 + } + ], + "testDurationEstimate": 0, + "testTemplate": true, + "legacyTestSuite": true, + "tenantId": {} + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sensor_info.py b/ansible_collections/cisco/dnac/plugins/modules/sensor_info.py new file mode 100644 index 00000000..20bbeae0 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sensor_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sensor_info +short_description: Information module for Sensor +description: +- Get all Sensor. +- Intent API to get a list of SENSOR devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sensors Sensors + description: Complete reference of the Sensors API. + link: https://developer.cisco.com/docs/dna-center/#!sensors-sensors +notes: + - SDK Method used are + sensors.Sensors.sensors, + + - Paths used are + get /dna/intent/api/v1/sensor, + +""" + +EXAMPLES = r""" +- name: Get all Sensor + cisco.dnac.sensor_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": [ + { + "name": "string", + "status": "string", + "radioMacAddress": "string", + "ethernetMacAddress": "string", + "location": "string", + "backhaulType": "string", + "serialNumber": "string", + "ipAddress": "string", + "version": "string", + "lastSeen": 0, + "type": "string", + "sshConfig": { + "sshState": "string", + "sshUserName": "string", + "sshPassword": "string", + "enablePassword": "string" + }, + "isLEDEnabled": true + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sensor_test_run.py b/ansible_collections/cisco/dnac/plugins/modules/sensor_test_run.py new file mode 100644 index 00000000..ac13177e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sensor_test_run.py @@ -0,0 +1,59 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sensor_test_run +short_description: Resource module for Sensor Test Run +description: +- Manage operation update of the resource Sensor Test Run. +- Intent API to run a deployed SENSOR test. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + templateName: + description: Template Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sensors RunNowSensorTest + description: Complete reference of the RunNowSensorTest API. + link: https://developer.cisco.com/docs/dna-center/#!run-now-sensor-test +notes: + - SDK Method used are + sensors.Sensors.run_now_sensor_test, + + - Paths used are + put /dna/intent/api/v1/sensor-run-now, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.sensor_test_run: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + templateName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + {} +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_duplicate.py b/ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_duplicate.py new file mode 100644 index 00000000..513178c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_duplicate.py @@ -0,0 +1,191 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sensor_test_template_duplicate +short_description: Resource module for Sensor Test Template Duplicate +description: +- Manage operation update of the resource Sensor Test Template Duplicate. +- Intent API to duplicate an existing SENSOR test template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + newTemplateName: + description: New Template Name. + type: str + templateName: + description: Template Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sensors DuplicateSensorTestTemplate + description: Complete reference of the DuplicateSensorTestTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!duplicate-sensor-test-template +notes: + - SDK Method used are + sensors.Sensors.duplicate_sensor_test_template, + + - Paths used are + put /dna/intent/api/v1/sensorTestTemplate, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.sensor_test_template_duplicate: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + newTemplateName: string + templateName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "_id": "string", + "name": "string", + "version": 0, + "modelVersion": 0, + "startTime": 0, + "lastModifiedTime": 0, + "numAssociatedSensor": 0, + "location": {}, + "siteHierarchy": {}, + "status": "string", + "connection": "string", + "frequency": {}, + "rssiThreshold": 0, + "numNeighborAPThreshold": 0, + "scheduleInDays": 0, + "wlans": [ + {} + ], + "ssids": [ + { + "bands": {}, + "ssid": "string", + "profileName": "string", + "authType": "string", + "authTypeRcvd": {}, + "psk": "string", + "username": {}, + "password": {}, + "eapMethod": {}, + "scep": true, + "authProtocol": {}, + "certfilename": {}, + "certxferprotocol": "string", + "certstatus": "string", + "certpassphrase": {}, + "certdownloadurl": {}, + "numAps": 0, + "numSensors": 0, + "layer3webAuthsecurity": {}, + "layer3webAuthuserName": {}, + "layer3webAuthpassword": {}, + "extWebAuthVirtualIp": {}, + "layer3webAuthEmailAddress": {}, + "qosPolicy": "string", + "extWebAuth": true, + "whiteList": true, + "extWebAuthPortal": {}, + "extWebAuthAccessUrl": {}, + "extWebAuthHtmlTag": [ + {} + ], + "thirdParty": { + "selected": true + }, + "id": 0, + "wlanId": 0, + "wlc": {}, + "validFrom": 0, + "validTo": 0, + "status": "string", + "tests": [ + { + "name": "string", + "config": [ + {} + ] + } + ] + } + ], + "testScheduleMode": "string", + "showWlcUpgradeBanner": true, + "radioAsSensorRemoved": true, + "encryptionMode": "string", + "runNow": "string", + "locationInfoList": [ + { + "locationId": "string", + "locationType": "string", + "allSensors": true, + "siteHierarchy": "string", + "macAddressList": [ + {} + ] + } + ], + "schedule": { + "testScheduleMode": "string", + "scheduleRange": [ + { + "timeRange": [ + { + "from": "string", + "to": "string", + "frequency": { + "value": 0, + "unit": "string" + } + } + ], + "day": "string" + } + ], + "startTime": 0, + "frequency": { + "value": 0, + "unit": "string" + } + }, + "tests": {}, + "sensors": [ + {} + ], + "apCoverage": [ + { + "bands": "string", + "numberOfApsToTest": 0, + "rssiThreshold": 0 + } + ], + "testDurationEstimate": 0, + "testTemplate": true, + "legacyTestSuite": true, + "tenantId": {} + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_edit.py b/ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_edit.py new file mode 100644 index 00000000..aa993bd1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/sensor_test_template_edit.py @@ -0,0 +1,268 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sensor_test_template_edit +short_description: Resource module for Sensor Test Template Edit +description: +- Manage operation update of the resource Sensor Test Template Edit. +- Intent API to deploy, schedule, or edit and existing SENSOR test template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + locationInfoList: + description: Sensor Test Template Edit's locationInfoList. + elements: dict + suboptions: + allSensors: + description: All Sensors. + type: bool + locationId: + description: Location Id. + type: str + locationType: + description: Location Type. + type: str + siteHierarchy: + description: Site Hierarchy. + type: str + type: list + schedule: + description: Sensor Test Template Edit's schedule. + suboptions: + frequency: + description: Sensor Test Template Edit's frequency. + suboptions: + unit: + description: Unit. + type: str + value: + description: Value. + type: int + type: dict + scheduleRange: + description: Sensor Test Template Edit's scheduleRange. + elements: dict + suboptions: + day: + description: Day. + type: str + timeRange: + description: Sensor Test Template Edit's timeRange. + elements: dict + suboptions: + frequency: + description: Sensor Test Template Edit's frequency. + suboptions: + unit: + description: Unit. + type: str + value: + description: Value. + type: int + type: dict + from: + description: From. + type: str + to: + description: To. + type: str + type: list + type: list + testScheduleMode: + description: Test Schedule Mode. + type: str + type: dict + templateName: + description: Template Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sensors EditSensorTestTemplate + description: Complete reference of the EditSensorTestTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!edit-sensor-test-template +notes: + - SDK Method used are + sensors.Sensors.edit_sensor_test_template, + + - Paths used are + put /dna/intent/api/v1/AssuranceScheduleSensorTest, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.sensor_test_template_edit: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + locationInfoList: + - allSensors: true + locationId: string + locationType: string + siteHierarchy: string + schedule: + frequency: + unit: string + value: 0 + scheduleRange: + - day: string + timeRange: + - frequency: + unit: string + value: 0 + from: string + to: string + testScheduleMode: string + templateName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "_id": "string", + "name": "string", + "version": 0, + "modelVersion": 0, + "startTime": 0, + "lastModifiedTime": 0, + "numAssociatedSensor": 0, + "location": {}, + "siteHierarchy": {}, + "status": "string", + "connection": "string", + "frequency": {}, + "rssiThreshold": 0, + "numNeighborAPThreshold": 0, + "scheduleInDays": 0, + "wlans": [ + {} + ], + "ssids": [ + { + "bands": {}, + "ssid": "string", + "profileName": "string", + "authType": "string", + "authTypeRcvd": {}, + "psk": "string", + "username": {}, + "password": {}, + "eapMethod": {}, + "scep": true, + "authProtocol": {}, + "certfilename": {}, + "certxferprotocol": "string", + "certstatus": "string", + "certpassphrase": {}, + "certdownloadurl": {}, + "numAps": 0, + "numSensors": 0, + "layer3webAuthsecurity": {}, + "layer3webAuthuserName": {}, + "layer3webAuthpassword": {}, + "extWebAuthVirtualIp": {}, + "layer3webAuthEmailAddress": {}, + "qosPolicy": "string", + "extWebAuth": true, + "whiteList": true, + "extWebAuthPortal": {}, + "extWebAuthAccessUrl": {}, + "extWebAuthHtmlTag": [ + {} + ], + "thirdParty": { + "selected": true + }, + "id": 0, + "wlanId": 0, + "wlc": {}, + "validFrom": 0, + "validTo": 0, + "status": "string", + "tests": [ + { + "name": "string", + "config": [ + {} + ] + } + ] + } + ], + "testScheduleMode": "string", + "showWlcUpgradeBanner": true, + "radioAsSensorRemoved": true, + "encryptionMode": "string", + "runNow": "string", + "locationInfoList": [ + { + "locationId": "string", + "locationType": "string", + "allSensors": true, + "siteHierarchy": "string", + "macAddressList": [ + {} + ] + } + ], + "schedule": { + "testScheduleMode": "string", + "scheduleRange": [ + { + "timeRange": [ + { + "from": "string", + "to": "string", + "frequency": { + "value": 0, + "unit": "string" + } + } + ], + "day": "string" + } + ], + "startTime": 0, + "frequency": { + "value": 0, + "unit": "string" + } + }, + "tests": {}, + "sensors": [ + {} + ], + "apCoverage": [ + { + "bands": "string", + "numberOfApsToTest": 0, + "rssiThreshold": 0 + } + ], + "testDurationEstimate": 0, + "testTemplate": true, + "legacyTestSuite": true, + "tenantId": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/service_provider_create.py b/ansible_collections/cisco/dnac/plugins/modules/service_provider_create.py new file mode 100644 index 00000000..760d81b9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/service_provider_create.py @@ -0,0 +1,82 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: service_provider_create +short_description: Resource module for Service Provider Create +description: +- Manage operation create of the resource Service Provider Create. +- API to create service provider profile QOS . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + settings: + description: Service Provider Create's settings. + suboptions: + qos: + description: Service Provider Create's qos. + elements: dict + suboptions: + model: + description: Model. + type: str + profileName: + description: Profile Name. + type: str + wanProvider: + description: Wan Provider. + type: str + type: list + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings CreateSPProfile + description: Complete reference of the CreateSPProfile API. + link: https://developer.cisco.com/docs/dna-center/#!create-sp-profile +notes: + - SDK Method used are + network_settings.NetworkSettings.create_sp_profile, + + - Paths used are + post /dna/intent/api/v1/service-provider, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.service_provider_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + settings: + qos: + - model: string + profileName: string + wanProvider: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/service_provider_info.py b/ansible_collections/cisco/dnac/plugins/modules/service_provider_info.py new file mode 100644 index 00000000..363cdffa --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/service_provider_info.py @@ -0,0 +1,82 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: service_provider_info +short_description: Information module for Service Provider +description: +- Get all Service Provider. +- API to get service provider details QoS . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings GetServiceProviderDetails + description: Complete reference of the GetServiceProviderDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-service-provider-details +notes: + - SDK Method used are + network_settings.NetworkSettings.get_service_provider_details, + + - Paths used are + get /dna/intent/api/v1/service-provider, + +""" + +EXAMPLES = r""" +- name: Get all Service Provider + cisco.dnac.service_provider_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "instanceType": "string", + "instanceUuid": "string", + "namespace": "string", + "type": "string", + "key": "string", + "version": 0, + "value": [ + { + "wanProvider": "string", + "spProfileName": "string", + "slaProfileName": "string" + } + ], + "groupUuid": "string", + "inheritedGroupUuid": "string", + "inheritedGroupName": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/service_provider_profile_delete.py b/ansible_collections/cisco/dnac/plugins/modules/service_provider_profile_delete.py new file mode 100644 index 00000000..99bee605 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/service_provider_profile_delete.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: service_provider_profile_delete +short_description: Resource module for Service Provider Profile Delete +description: +- Manage operation delete of the resource Service Provider Profile Delete. +- API to delete Service Provider profile QoS . +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + spProfileName: + description: SpProfileName path parameter. Sp profile name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings DeleteSPProfile + description: Complete reference of the DeleteSPProfile API. + link: https://developer.cisco.com/docs/dna-center/#!delete-sp-profile +notes: + - SDK Method used are + network_settings.NetworkSettings.delete_sp_profile, + + - Paths used are + delete /dna/intent/api/v1/sp-profile/{spProfileName}, + +""" + +EXAMPLES = r""" +- name: Delete by name + cisco.dnac.service_provider_profile_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + spProfileName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/service_provider_update.py b/ansible_collections/cisco/dnac/plugins/modules/service_provider_update.py new file mode 100644 index 00000000..136597d8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/service_provider_update.py @@ -0,0 +1,86 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: service_provider_update +short_description: Resource module for Service Provider Update +description: +- Manage operation update of the resource Service Provider Update. +- API to update SP profile. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + settings: + description: Service Provider Update's settings. + suboptions: + qos: + description: Service Provider Update's qos. + elements: dict + suboptions: + model: + description: Model. + type: str + oldProfileName: + description: Old Profile Name. + type: str + profileName: + description: Profile Name. + type: str + wanProvider: + description: Wan Provider. + type: str + type: list + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings UpdateSPProfile + description: Complete reference of the UpdateSPProfile API. + link: https://developer.cisco.com/docs/dna-center/#!update-sp-profile +notes: + - SDK Method used are + network_settings.NetworkSettings.update_sp_profile, + + - Paths used are + put /dna/intent/api/v1/service-provider, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.service_provider_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + settings: + qos: + - model: string + oldProfileName: string + profileName: string + wanProvider: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_assign_credential.py b/ansible_collections/cisco/dnac/plugins/modules/site_assign_credential.py new file mode 100644 index 00000000..779602a6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_assign_credential.py @@ -0,0 +1,91 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_assign_credential +short_description: Resource module for Site Assign Credential +description: +- Manage operation create of the resource Site Assign Credential. +- Assign Device Credential To Site. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + cliId: + description: Cli Id. + type: str + headers: + description: Additional headers. + type: dict + httpRead: + description: Http Read. + type: str + httpWrite: + description: Http Write. + type: str + siteId: + description: SiteId path parameter. Site id to assign credential. + type: str + snmpV2ReadId: + description: Snmp V2 Read Id. + type: str + snmpV2WriteId: + description: Snmp V2 Write Id. + type: str + snmpV3Id: + description: Snmp V3 Id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings AssignCredentialToSite + description: Complete reference of the AssignCredentialToSite API. + link: https://developer.cisco.com/docs/dna-center/#!assign-credential-to-site +notes: + - SDK Method used are + network_settings.NetworkSettings.assign_credential_to_site, + + - Paths used are + post /dna/intent/api/v1/credential-to-site/{siteId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.site_assign_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + cliId: string + headers: '{{my_headers | from_json}}' + httpRead: string + httpWrite: string + siteId: string + snmpV2ReadId: string + snmpV2WriteId: string + snmpV3Id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_assign_device.py b/ansible_collections/cisco/dnac/plugins/modules/site_assign_device.py new file mode 100644 index 00000000..2bc3f79b --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_assign_device.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_assign_device +short_description: Resource module for Site Assign Device +description: +- Manage operation create of the resource Site Assign Device. +- Assigns list of devices to a site. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + device: + description: Site Assign Device's device. + elements: dict + suboptions: + ip: + description: Device ip (eg 10.104.240.64). + type: str + type: list + siteId: + description: SiteId path parameter. Site id to which site the device to assign. + type: str +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + sites.Sites.assign_device_to_site, + + - Paths used are + post /dna/system/api/v1/site/{siteId}/device, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.site_assign_device: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + device: + - ip: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/site_count_info.py new file mode 100644 index 00000000..85b57d94 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_count_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_count_info +short_description: Information module for Site Count +description: +- Get all Site Count. +- API to get site count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. Site id to retrieve site count. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sites GetSiteCount + description: Complete reference of the GetSiteCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-site-count +notes: + - SDK Method used are + sites.Sites.get_site_count, + + - Paths used are + get /dna/intent/api/v1/site/count, + +""" + +EXAMPLES = r""" +- name: Get all Site Count + cisco.dnac.site_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_create.py b/ansible_collections/cisco/dnac/plugins/modules/site_create.py new file mode 100644 index 00000000..31f357ae --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_create.py @@ -0,0 +1,147 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_create +short_description: Resource module for Site Create +description: +- Manage operation create of the resource Site Create. +- Creates site with area/building/floor with specified hierarchy. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + site: + description: Site Create's site. + suboptions: + area: + description: Site Create's area. + suboptions: + name: + description: Name of the area (eg Area1). + type: str + parentName: + description: Parent name of the area to be created. + type: str + type: dict + building: + description: Site Create's building. + suboptions: + address: + description: Address of the building to be created. + type: str + country: + description: Country (eg United States). + type: str + latitude: + description: Latitude coordinate of the building (eg 37.338). + type: int + longitude: + description: Longitude coordinate of the building (eg -121.832). + type: int + name: + description: Name of the building (eg building1). + type: str + parentName: + description: Parent name of building to be created. + type: str + type: dict + floor: + description: Site Create's floor. + suboptions: + floorNumber: + description: Floor number. (eg 5). + type: int + height: + description: Height of the floor. Unit of measure is ft. (eg 15). + type: int + length: + description: Length of the floor. Unit of measure is ft. (eg 100). + type: int + name: + description: Name of the floor (eg floor-1). + type: str + parentName: + description: Parent name of the floor to be created. + type: str + rfModel: + description: Type of floor (eg Cubes And Walled Offices0. + type: str + width: + description: Width of the floor. Unit of measure is ft. (eg 100). + type: int + type: dict + type: dict + type: + description: Type of site to create (eg area, building, floor). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sites CreateSite + description: Complete reference of the CreateSite API. + link: https://developer.cisco.com/docs/dna-center/#!create-site +notes: + - SDK Method used are + sites.Sites.create_site, + + - Paths used are + post /dna/intent/api/v1/site, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.site_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + site: + area: + name: string + parentName: string + building: + address: string + country: string + latitude: 0 + longitude: 0 + name: string + parentName: string + floor: + floorNumber: 0 + height: 0 + length: 0 + name: string + parentName: string + rfModel: string + width: 0 + type: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_delete.py b/ansible_collections/cisco/dnac/plugins/modules/site_delete.py new file mode 100644 index 00000000..c9ef7a26 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_delete.py @@ -0,0 +1,62 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_delete +short_description: Resource module for Site Delete +description: +- Manage operation delete of the resource Site Delete. +- Delete site with area/building/floor by siteId. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + siteId: + description: SiteId path parameter. Site id to which site details to be deleted. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sites DeleteSite + description: Complete reference of the DeleteSite API. + link: https://developer.cisco.com/docs/dna-center/#!delete-site +notes: + - SDK Method used are + sites.Sites.delete_site, + + - Paths used are + delete /dna/intent/api/v1/site/{siteId}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.site_delete: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_design_floormap.py b/ansible_collections/cisco/dnac/plugins/modules/site_design_floormap.py new file mode 100644 index 00000000..f7dee8a7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_design_floormap.py @@ -0,0 +1,88 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_design_floormap +short_description: Resource module for Site Design Floormap +description: +- Manage operations create, update and delete of the resource Site Design Floormap. +- Service to create a floor map with callback. +- Service to delete an empty floor map with callback. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + floorId: + description: FloorId path parameter. Group ID of floor to be deleted. + type: str + payload: + description: Site Design Floormap's payload + type: dict +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + site_design.SiteDesign.create_floormap, + site_design.SiteDesign.delete_floormap, + site_design.SiteDesign.update_floormap, + + - Paths used are + post /dna/intent/api/v1/wireless/floormap, + delete /dna/intent/api/v1/wireless/floormap/{floorId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.site_design_floormap: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + +- name: Delete by id + cisco.dnac.site_design_floormap: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + floorId: string + +- name: Update by id + cisco.dnac.site_design_floormap: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + floorId: string + payload: + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + {} +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_design_floormap_info.py b/ansible_collections/cisco/dnac/plugins/modules/site_design_floormap_info.py new file mode 100644 index 00000000..fe90d3c2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_design_floormap_info.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_design_floormap_info +short_description: Information module for Site Design Floormap +description: +- Get all Site Design Floormap. +- Get Site Design Floormap by id. +- List all floor maps. +- List specified floor map(s). +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + floorId: + description: + - FloorId path parameter. Group Id of the specified floormap. + type: str +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + site_design.SiteDesign.get_floormap, + site_design.SiteDesign.get_floormaps, + + - Paths used are + get /dna/intent/api/v1/wireless/floormap/all, + get /dna/intent/api/v1/wireless/floormap/{floorId}, + +""" + +EXAMPLES = r""" +- name: Get all Site Design Floormap + cisco.dnac.site_design_floormap_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + register: result + +- name: Get Site Design Floormap by id + cisco.dnac.site_design_floormap_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: + custom: value + floorId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: + - {} +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_health_info.py b/ansible_collections/cisco/dnac/plugins/modules/site_health_info.py new file mode 100644 index 00000000..9614b6eb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_health_info.py @@ -0,0 +1,144 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_health_info +short_description: Information module for Site Health +description: +- Get all Site Health. +- Returns Overall Health information for all sites. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + timestamp: + description: + - Timestamp query parameter. Epoch time(in milliseconds) when the Site Hierarchy data is required. + type: str + siteType: + description: + - SiteType query parameter. Type of the site to return. AREA or BUILDING. Default to AREA. + type: str + offset: + description: + - Offset query parameter. The offset value, starting from 1, of the first returned site entry. Default is 1. + type: int + limit: + description: + - Limit query parameter. The max number of sites in the returned data set. Default is 25, and max at 50. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sites GetSiteHealth + description: Complete reference of the GetSiteHealth API. + link: https://developer.cisco.com/docs/dna-center/#!get-site-health +notes: + - SDK Method used are + sites.Sites.get_site_health, + + - Paths used are + get /dna/intent/api/v1/site-health, + +""" + +EXAMPLES = r""" +- name: Get all Site Health + cisco.dnac.site_health_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + timestamp: string + siteType: string + offset: 0 + limit: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "siteName": "string", + "siteId": "string", + "parentSiteId": "string", + "parentSiteName": "string", + "siteType": "string", + "latitude": 0, + "longitude": 0, + "healthyNetworkDevicePercentage": {}, + "healthyClientsPercentage": {}, + "clientHealthWired": {}, + "clientHealthWireless": {}, + "numberOfClients": {}, + "numberOfNetworkDevice": {}, + "networkHealthAverage": {}, + "networkHealthAccess": {}, + "networkHealthCore": {}, + "networkHealthDistribution": {}, + "networkHealthRouter": {}, + "networkHealthWireless": {}, + "networkHealthOthers": {}, + "numberOfWiredClients": {}, + "numberOfWirelessClients": {}, + "totalNumberOfConnectedWiredClients": {}, + "totalNumberOfActiveWirelessClients": {}, + "wiredGoodClients": {}, + "wirelessGoodClients": {}, + "overallGoodDevices": {}, + "accessGoodCount": {}, + "accessTotalCount": {}, + "coreGoodCount": {}, + "coreTotalCount": {}, + "distributionGoodCount": {}, + "distributionTotalCount": {}, + "routerGoodCount": {}, + "routerTotalCount": {}, + "wirelessDeviceGoodCount": {}, + "wirelessDeviceTotalCount": {}, + "applicationHealth": {}, + "applicationGoodCount": {}, + "applicationTotalCount": {}, + "applicationBytesTotalCount": {}, + "dnacInfo": {}, + "applicationHealthStats": { + "appTotalCount": 0, + "businessRelevantAppCount": { + "poor": 0, + "fair": 0, + "good": 0 + }, + "businessIrrelevantAppCount": { + "poor": 0, + "fair": 0, + "good": 0 + }, + "defaultHealthAppCount": { + "poor": 0, + "fair": 0, + "good": 0 + } + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_info.py b/ansible_collections/cisco/dnac/plugins/modules/site_info.py new file mode 100644 index 00000000..aa00b134 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_info.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_info +short_description: Information module for Site +description: +- Get all Site. +- Get site using siteNameHierarchy/siteId/type ,return all sites if these parameters are not given as input. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. SiteNameHierarchy (ex global/groupName). + type: str + siteId: + description: + - SiteId query parameter. Site id to which site details to retrieve. + type: str + type: + description: + - Type query parameter. Type (ex area, building, floor). + type: str + offset: + description: + - Offset query parameter. Offset/starting row. The default value is 1. + type: str + limit: + description: + - Limit query parameter. Number of sites to be retrieved. The default value is 500. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sites GetSite + description: Complete reference of the GetSite API. + link: https://developer.cisco.com/docs/dna-center/#!get-site +notes: + - SDK Method used are + sites.Sites.get_site, + + - Paths used are + get /dna/intent/api/v1/site, + +""" + +EXAMPLES = r""" +- name: Get all Site + cisco.dnac.site_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + siteId: string + type: string + offset: string + limit: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "parentId": "string", + "name": "string", + "additionalInfo": [ + { + "nameSpace": "string", + "attributes": { + "country": "string", + "address": "string", + "latitude": "string", + "addressInheritedFrom": "string", + "type": "string", + "longitude": "string", + "offsetX": "string", + "offsetY": "string", + "length": "string", + "width": "string", + "height": "string", + "rfModel": "string", + "floorIndex": "string" + } + } + ], + "siteHierarchy": "string", + "siteNameHierarchy": "string", + "instanceTenantId": "string", + "id": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_intent.py b/ansible_collections/cisco/dnac/plugins/modules/site_intent.py new file mode 100644 index 00000000..a9dbb109 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_intent.py @@ -0,0 +1,592 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +__author__ = ("Madhan Sankaranarayanan, Rishita Chowdhary") + +DOCUMENTATION = r""" +--- +module: site_intent +short_description: Resource module for Site operations +description: +- Manage operation create, update and delete of the resource Sites. +- Creates site with area/building/floor with specified hierarchy. +- Updates site with area/building/floor with specified hierarchy. +- Deletes site with area/building/floor with specified hierarchy. +version_added: '6.6.0' +extends_documentation_fragment: + - cisco.dnac.intent_params +author: Madhan Sankaranarayanan (@madhansansel) + Rishita Chowdhary (@rishitachowdhary) +options: + state: + description: The state of DNAC after module completion. + type: str + choices: [ merged, deleted ] + default: merged + config: + description: + - List of details of site being managed. + type: list + elements: dict + required: true + suboptions: + type: + description: Type of site to create/update/delete (eg area, building, floor). + type: str + site: + description: Site Details. + type: dict + suboptions: + area: + description: Site Create's area. + type: dict + suboptions: + name: + description: Name of the area (eg Area1). + type: str + parentName: + description: Parent name of the area to be created. + type: str + building: + description: Building Details. + type: dict + suboptions: + address: + description: Address of the building to be created. + type: str + latitude: + description: Latitude coordinate of the building (eg 37.338). + type: int + longitude: + description: Longitude coordinate of the building (eg -121.832). + type: int + name: + description: Name of the building (eg building1). + type: str + parentName: + description: Parent name of building to be created. + type: str + floor: + description: Site Create's floor. + type: dict + suboptions: + height: + description: Height of the floor (eg 15). + type: int + length: + description: Length of the floor (eg 100). + type: int + name: + description: Name of the floor (eg floor-1). + type: str + parentName: + description: Parent name of the floor to be created. + type: str + rfModel: + description: Type of floor. Allowed values are 'Cubes And Walled Offices', + 'Drywall Office Only', 'Indoor High Ceiling', 'Outdoor Open Space'. + type: str + width: + description: Width of the floor (eg 100). + type: int + +requirements: +- dnacentersdk == 2.4.5 +- python >= 3.5 +notes: + - SDK Method used are + sites.Sites.create_site, + sites.Sites.update_site, + sites.Sites.delete_site + + - Paths used are + post /dna/intent/api/v1/site, + put dna/intent/api/v1/site/{siteId}, + delete dna/intent/api/v1/site/{siteId} +""" + +EXAMPLES = r""" +- name: Create a new building site + cisco.dnac.site_intent: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + dnac_log: "{{dnac_log}}" + config: + site: + building: + address: string + latitude: 0 + longitude: 0 + name: string + parentName: string + type: string +""" + +RETURN = r""" +#Case_1: Site is successfully created/updated/deleted +response_1: + description: A dictionary with API execution details as returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": + { + "bapiExecutionId": String, + "bapiKey": String, + "bapiName": String, + "endTime": String, + "endTimeEpoch": 0, + "runtimeInstanceId": String, + "siteId": String, + "startTime": String, + "startTimeEpoch": 0, + "status": String, + "timeDuration": 0 + + }, + "msg": "string" + } + +#Case_2: Site exits and does not need an update +response_2: + description: A dictionary with existing site details. + returned: always + type: dict + sample: > + { + "response": + { + "site": {}, + "siteId": String, + "type": String + }, + "msg": String + } + +#Case_3: Error while creating/updating/deleting site +response_3: + description: A dictionary with API execution details as returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": + { + "bapiError": String, + "bapiExecutionId": String, + "bapiKey": String, + "bapiName": String, + "endTime": String, + "endTimeEpoch": 0, + "runtimeInstanceId": String, + "startTime": String, + "startTimeEpoch": 0, + "status": String, + "timeDuration": 0 + + }, + "msg": "string" + } + +#Case_4: Site not found when atempting to delete site +response_4: + description: A list with the response returned by the Cisco DNAC Python + returned: always + type: list + sample: > + { + "response": [], + "msg": String + } +""" + +from ansible.module_utils.basic import AnsibleModule +from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( + DNACSDK, + validate_list_of_dicts, + log, + get_dict_result, + dnac_compare_equality, +) +import copy + +floor_plan = { + '57057': 'CUBES AND WALLED OFFICES', + '57058': 'DRYWELL OFFICE ONLY', + '41541500': 'FREE SPACE', + '57060': 'INDOOR HIGH CEILING', + '57059': 'OUTDOOR OPEN SPACE' +} + + +class DnacSite: + + def __init__(self, module): + self.module = module + self.params = module.params + self.config = copy.deepcopy(module.params.get("config")) + self.have = {} + self.want_create = {} + self.diff_create = [] + self.validated = [] + dnac_params = self.get_dnac_params(self.params) + log(str(dnac_params)) + self.dnac = DNACSDK(params=dnac_params) + self.log = dnac_params.get("dnac_log") + + self.result = dict(changed=False, diff=[], response=[], warnings=[]) + + def get_state(self): + return self.params.get("state") + + def validate_input(self): + temp_spec = dict( + type=dict(required=False, type='str'), + site=dict(required=True, type='dict'), + ) + + if self.config: + msg = None + # Validate site params + valid_temp, invalid_params = validate_list_of_dicts( + self.config, temp_spec + ) + + if invalid_params: + msg = "Invalid parameters in playbook: {0}".format( + "\n".join(invalid_params) + ) + self.module.fail_json(msg=msg) + + self.validated = valid_temp + + if self.log: + log(str(valid_temp)) + log(str(self.validated)) + + def get_dnac_params(self, params): + dnac_params = dict( + dnac_host=params.get("dnac_host"), + dnac_port=params.get("dnac_port"), + dnac_username=params.get("dnac_username"), + dnac_password=params.get("dnac_password"), + dnac_verify=params.get("dnac_verify"), + dnac_debug=params.get("dnac_debug"), + dnac_log=params.get("dnac_log") + ) + return dnac_params + + def get_current_site(self, site): + site_info = {} + + location = get_dict_result(site[0].get("additionalInfo"), 'nameSpace', "Location") + typeinfo = location.get("attributes").get("type") + + if typeinfo == "area": + site_info = dict( + area=dict( + name=site[0].get("name"), + parentName=site[0].get("siteNameHierarchy").split("/" + site[0].get("name"))[0] + ) + ) + + elif typeinfo == "building": + site_info = dict( + building=dict( + name=site[0].get("name"), + parentName=site[0].get("siteNameHierarchy").split("/" + site[0].get("name"))[0], + address=location.get("attributes").get("address", ""), + latitude=location.get("attributes").get("latitude"), + longitude=location.get("attributes").get("longitude"), + ) + ) + + elif typeinfo == "floor": + map_geometry = get_dict_result(site[0].get("additionalInfo"), 'nameSpace', "mapGeometry") + map_summary = get_dict_result(site[0].get("additionalInfo"), 'nameSpace', "mapsSummary") + rf_model = map_summary.get("attributes").get("rfModel") + + site_info = dict( + floor=dict( + name=site[0].get("name"), + parentName=site[0].get("siteNameHierarchy").split("/" + site[0].get("name"))[0], + rfModel=floor_plan.get(rf_model), + width=map_geometry.get("attributes").get("width"), + length=map_geometry.get("attributes").get("length"), + height=map_geometry.get("attributes").get("height") + ) + ) + + current_site = dict( + type=typeinfo, + site=site_info, + siteId=site[0].get("id") + ) + + if self.log: + log(str(current_site)) + + return current_site + + def site_exists(self): + site_exists = False + current_site = {} + response = None + try: + response = self.dnac.exec( + family="sites", + function='get_site', + params={"name": self.want.get("site_name")}, + ) + + except Exception as e: + if self.log: + log("The input site is not valid or site is not present.") + + if response: + if self.log: + log(str(response)) + + response = response.get("response") + current_site = self.get_current_site(response) + site_exists = True + + if self.log: + log(str(self.validated)) + + return (site_exists, current_site) + + def get_site_params(self, params): + site = params.get("site") + typeinfo = params.get("type") + + if typeinfo == "floor": + site["floor"]["rfModel"] = site.get("floor").get("rfModel").upper() + + site_params = dict( + type=typeinfo, + site=site, + ) + + return site_params + + def get_site_name(self, site): + site_type = site.get("type") + parent_name = site.get("site").get(site_type).get("parentName") + name = site.get("site").get(site_type).get("name") + site_name = '/'.join([parent_name, name]) + + if self.log: + log(site_name) + + return site_name + + def site_requires_update(self): + requested_site = self.want.get("site_params") + current_site = self.have.get("current_site") + + if self.log: + log("Current Site: " + str(current_site)) + log("Requested Site: " + str(requested_site)) + + obj_params = [ + ("type", "type"), + ("site", "site") + ] + + return any(not dnac_compare_equality(current_site.get(dnac_param), + requested_site.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def get_execution_details(self, execid): + response = None + response = self.dnac.exec( + family="task", + function='get_business_api_execution_details', + params={"execution_id": execid} + ) + + if self.log: + log(str(response)) + + if response and isinstance(response, dict): + return response + + def get_have(self): + site_exists = False + current_site = None + have = {} + + # check if given site exits, if exists store current site info + (site_exists, current_site) = self.site_exists() + + if self.log: + log("Site Exists: " + str(site_exists) + "\n Current Site:" + str(current_site)) + + if site_exists: + have["site_id"] = current_site.get("siteId") + have["site_exists"] = site_exists + have["current_site"] = current_site + + self.have = have + + def get_want(self): + want = {} + + for site in self.validated: + want = dict( + site_params=self.get_site_params(site), + site_name=self.get_site_name(site), + ) + + self.want = want + + def get_diff_merge(self): + site_updated = False + site_created = False + + # check if the given site exists and/or needs to be updated/created. + if self.have.get("site_exists"): + if self.site_requires_update(): + # Existing Site requires update + site_params = self.want.get("site_params") + site_params["site_id"] = self.have.get("site_id") + response = self.dnac.exec( + family="sites", + function='update_site', + op_modifies=True, + params=site_params, + ) + site_updated = True + + else: + # Site does not neet update + self.result['response'] = self.have.get("current_site") + self.result['msg'] = "Site does not need update" + self.module.exit_json(**self.result) + + else: + # Creating New Site + response = self.dnac.exec( + family="sites", + function='create_site', + op_modifies=True, + params=self.want.get("site_params"), + ) + + log(str(response)) + site_created = True + + if site_created or site_updated: + if response and isinstance(response, dict): + executionid = response.get("executionId") + while True: + execution_details = self.get_execution_details(executionid) + if execution_details.get("status") == "SUCCESS": + self.result['changed'] = True + self.result['response'] = execution_details + break + + elif execution_details.get("bapiError"): + self.module.fail_json(msg=execution_details.get("bapiError"), + response=execution_details) + break + + if site_updated: + log("Site Updated Successfully") + self.result['msg'] = "Site Updated Successfully" + self.result['response'].update({"siteId": self.have.get("site_id")}) + + else: + # Get the site id of the newly created site. + (site_exists, current_site) = self.site_exists() + + if site_exists: + log("Site Created Successfully") + log("Current site:" + str(current_site)) + self.result['msg'] = "Site Created Successfully" + self.result['response'].update({"siteId": current_site.get('site_id')}) + + def get_diff_delete(self): + site_exists = self.have.get("site_exists") + + if site_exists: + response = self.dnac.exec( + family="sites", + function="delete_site", + params={"site_id": self.have.get("site_id")}, + ) + + if response and isinstance(response, dict): + executionid = response.get("executionId") + while True: + execution_details = self.get_execution_details(executionid) + if execution_details.get("status") == "SUCCESS": + self.result['changed'] = True + self.result['response'] = execution_details + self.result['response'].update({"siteId": self.have.get("site_id")}) + self.result['msg'] = "Site deleted successfully" + break + + elif execution_details.get("bapiError"): + self.module.fail_json(msg=execution_details.get("bapiError"), + response=execution_details) + break + + else: + self.module.fail_json(msg="Site Not Found", response=[]) + + +def main(): + """ main entry point for module execution + """ + + element_spec = dict( + dnac_host=dict(required=True, type='str'), + dnac_port=dict(type='str', default='443'), + dnac_username=dict(type='str', default='admin', aliases=["user"]), + dnac_password=dict(type='str', no_log=True), + dnac_verify=dict(type='bool', default='True'), + dnac_version=dict(type="str", default="2.2.3.3"), + dnac_debug=dict(type='bool', default=False), + dnac_log=dict(type='bool', default=False), + validate_response_schema=dict(type="bool", default=True), + config=dict(required=True, type='list', elements='dict'), + state=dict( + default='merged', + choices=['merged', 'deleted']), + ) + + module = AnsibleModule(argument_spec=element_spec, + supports_check_mode=False) + + dnac_site = DnacSite(module) + dnac_site.validate_input() + state = dnac_site.get_state() + + dnac_site.get_want() + dnac_site.get_have() + + if state == "merged": + dnac_site.get_diff_merge() + + elif state == "deleted": + dnac_site.get_diff_delete() + + module.exit_json(**dnac_site.result) + + +if __name__ == '__main__': + main() diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_membership_info.py b/ansible_collections/cisco/dnac/plugins/modules/site_membership_info.py new file mode 100644 index 00000000..201cf077 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_membership_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_membership_info +short_description: Information module for Site Membership +description: +- Get Site Membership by id. +- Getting the site children details and device details. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId path parameter. Site id to retrieve device associated with the site. + type: str + offset: + description: + - Offset query parameter. Offset/starting row. + type: str + limit: + description: + - Limit query parameter. Number of sites to be retrieved. + type: str + deviceFamily: + description: + - DeviceFamily query parameter. Device family name. + type: str + serialNumber: + description: + - SerialNumber query parameter. Device serial number. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sites GetMembership + description: Complete reference of the GetMembership API. + link: https://developer.cisco.com/docs/dna-center/#!get-membership +notes: + - SDK Method used are + sites.Sites.get_membership, + + - Paths used are + get /dna/intent/api/v1/membership/{siteId}, + +""" + +EXAMPLES = r""" +- name: Get Site Membership by id + cisco.dnac.site_membership_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + offset: string + limit: string + deviceFamily: string + serialNumber: string + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "site": { + "response": [ + {} + ], + "version": "string" + }, + "device": [ + { + "response": [ + {} + ], + "version": "string", + "siteId": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/site_update.py b/ansible_collections/cisco/dnac/plugins/modules/site_update.py new file mode 100644 index 00000000..83f52968 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/site_update.py @@ -0,0 +1,154 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: site_update +short_description: Resource module for Site Update +description: +- Manage operation update of the resource Site Update. +- Update site area/building/floor with specified hierarchy and new values. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + site: + description: Site Update's site. + suboptions: + area: + description: Site Update's area. + suboptions: + name: + description: Name. + type: str + parentName: + description: Parent Name. + type: str + type: dict + building: + description: Site Update's building. + suboptions: + address: + description: Address. + type: str + latitude: + description: Latitude. + type: int + longitude: + description: Longitude. + type: int + name: + description: Name. + type: str + parentName: + description: Parent Name. + type: str + type: dict + floor: + description: Site Update's floor. + suboptions: + height: + description: Height. + type: int + length: + description: Length. + type: int + name: + description: Name. + type: str + rfModel: + description: Rf Model. Allowed values are 'Cubes And Walled Offices', 'Drywall + Office Only', 'Indoor High Ceiling', 'Outdoor Open Space'. + type: str + width: + description: Width. + type: int + type: dict + type: dict + siteId: + description: SiteId path parameter. Site id to which site details to be updated. + type: str + type: + description: Type. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Sites UpdateSite + description: Complete reference of the UpdateSite API. + link: https://developer.cisco.com/docs/dna-center/#!update-site +notes: + - SDK Method used are + sites.Sites.update_site, + + - Paths used are + put /dna/intent/api/v1/site/{siteId}, + +""" + +EXAMPLES = r""" +- name: Update by id + cisco.dnac.site_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + site: + area: + name: string + parentName: string + building: + address: string + latitude: 0 + longitude: 0 + name: string + parentName: string + floor: + height: 0 + length: 0 + name: string + rfModel: string + width: 0 + siteId: string + type: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "result": "string", + "response": { + "endTime": "string", + "version": "string", + "startTime": "string", + "progress": "string", + "data": "string", + "serviceType": "string", + "operationIdList": [ + "string" + ], + "isError": "string", + "rootId": "string", + "instanceTenantId": "string", + "id": "string" + }, + "status": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/snmp_properties.py b/ansible_collections/cisco/dnac/plugins/modules/snmp_properties.py new file mode 100644 index 00000000..0ea733b2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/snmp_properties.py @@ -0,0 +1,88 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: snmp_properties +short_description: Resource module for Snmp Properties +description: +- Manage operation create of the resource Snmp Properties. +- Adds SNMP properties. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Snmp Properties's payload. + elements: dict + suboptions: + id: + description: Snmp Properties's id. + type: str + instanceTenantId: + description: Snmp Properties's instanceTenantId. + type: str + instanceUuid: + description: Snmp Properties's instanceUuid. + type: str + intValue: + description: Snmp Properties's intValue. + type: int + systemPropertyName: + description: Snmp Properties's systemPropertyName. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateUpdateSNMPProperties + description: Complete reference of the CreateUpdateSNMPProperties API. + link: https://developer.cisco.com/docs/dna-center/#!create-update-snmp-properties +notes: + - SDK Method used are + discovery.Discovery.create_update_snmp_properties, + + - Paths used are + post /dna/intent/api/v1/snmp-property, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.snmp_properties: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + payload: + - id: string + instanceTenantId: string + instanceUuid: string + intValue: 0 + systemPropertyName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/snmp_properties_info.py b/ansible_collections/cisco/dnac/plugins/modules/snmp_properties_info.py new file mode 100644 index 00000000..9300eaa8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/snmp_properties_info.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: snmp_properties_info +short_description: Information module for Snmp Properties +description: +- Get all Snmp Properties. +- Returns SNMP properties. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetSNMPProperties + description: Complete reference of the GetSNMPProperties API. + link: https://developer.cisco.com/docs/dna-center/#!get-snmp-properties +notes: + - SDK Method used are + discovery.Discovery.get_snmp_properties, + + - Paths used are + get /dna/intent/api/v1/snmp-property, + +""" + +EXAMPLES = r""" +- name: Get all Snmp Properties + cisco.dnac.snmp_properties_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "intValue": 0, + "systemPropertyName": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/snmpv2_read_community_credential.py b/ansible_collections/cisco/dnac/plugins/modules/snmpv2_read_community_credential.py new file mode 100644 index 00000000..69da389e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/snmpv2_read_community_credential.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: snmpv2_read_community_credential +short_description: Resource module for Snmpv2 Read Community Credential +description: +- Manage operations create and update of the resource Snmpv2 Read Community Credential. +- Adds global SNMP read community. +- Updates global SNMP read community. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + comments: + description: Comments to identify the credential. + type: str + credentialType: + description: Credential type to identify the application that uses the credential. + type: str + description: + description: Name/Description of the credential. + type: str + instanceUuid: + description: Snmpv2 Read Community Credential's instanceUuid. + type: str + readCommunity: + description: SNMP read community. NO!$DATA!$ for no value change. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateSNMPReadCommunity + description: Complete reference of the CreateSNMPReadCommunity API. + link: https://developer.cisco.com/docs/dna-center/#!create-snmp-read-community +- name: Cisco DNA Center documentation for Discovery UpdateSNMPReadCommunity + description: Complete reference of the UpdateSNMPReadCommunity API. + link: https://developer.cisco.com/docs/dna-center/#!update-snmp-read-community +notes: + - SDK Method used are + discovery.Discovery.create_snmp_read_community, + discovery.Discovery.update_snmp_read_community, + + - Paths used are + post /dna/intent/api/v1/global-credential/snmpv2-read-community, + put /dna/intent/api/v1/global-credential/snmpv2-read-community, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.snmpv2_read_community_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + instanceUuid: string + readCommunity: string + +- name: Create + cisco.dnac.snmpv2_read_community_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + readCommunity: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/snmpv2_write_community_credential.py b/ansible_collections/cisco/dnac/plugins/modules/snmpv2_write_community_credential.py new file mode 100644 index 00000000..2fbfbbc6 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/snmpv2_write_community_credential.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: snmpv2_write_community_credential +short_description: Resource module for Snmpv2 Write Community Credential +description: +- Manage operations create and update of the resource Snmpv2 Write Community Credential. +- Adds global SNMP write community. +- Updates global SNMP write community. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + comments: + description: Comments to identify the credential. + type: str + credentialType: + description: Credential type to identify the application that uses the credential. + type: str + description: + description: Name/Description of the credential. + type: str + instanceUuid: + description: Snmpv2 Write Community Credential's instanceUuid. + type: str + writeCommunity: + description: SNMP write community. NO!$DATA!$ for no value change. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateSNMPWriteCommunity + description: Complete reference of the CreateSNMPWriteCommunity API. + link: https://developer.cisco.com/docs/dna-center/#!create-snmp-write-community +- name: Cisco DNA Center documentation for Discovery UpdateSNMPWriteCommunity + description: Complete reference of the UpdateSNMPWriteCommunity API. + link: https://developer.cisco.com/docs/dna-center/#!update-snmp-write-community +notes: + - SDK Method used are + discovery.Discovery.create_snmp_write_community, + discovery.Discovery.update_snmp_write_community, + + - Paths used are + post /dna/intent/api/v1/global-credential/snmpv2-write-community, + put /dna/intent/api/v1/global-credential/snmpv2-write-community, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.snmpv2_write_community_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + writeCommunity: string + +- name: Update all + cisco.dnac.snmpv2_write_community_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + comments: string + credentialType: string + description: string + instanceUuid: string + writeCommunity: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/snmpv3_credential.py b/ansible_collections/cisco/dnac/plugins/modules/snmpv3_credential.py new file mode 100644 index 00000000..d48c693d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/snmpv3_credential.py @@ -0,0 +1,139 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: snmpv3_credential +short_description: Resource module for Snmpv3 Credential +description: +- Manage operations create and update of the resource Snmpv3 Credential. +- Adds global SNMPv3 credentials. +- Updates global SNMPv3 credential. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + authPassword: + description: Snmpv3 Credential's authPassword. + type: str + authType: + description: Snmpv3 Credential's authType. + type: str + comments: + description: Snmpv3 Credential's comments. + type: str + credentialType: + description: Snmpv3 Credential's credentialType. + type: str + description: + description: Snmpv3 Credential's description. + type: str + id: + description: Snmpv3 Credential's id. + type: str + instanceTenantId: + description: Snmpv3 Credential's instanceTenantId. + type: str + instanceUuid: + description: Snmpv3 Credential's instanceUuid. + type: str + privacyPassword: + description: Snmpv3 Credential's privacyPassword. + type: str + privacyType: + description: Snmpv3 Credential's privacyType. + type: str + snmpMode: + description: Snmpv3 Credential's snmpMode. + type: str + username: + description: Snmpv3 Credential's username. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateSNMPv3Credentials + description: Complete reference of the CreateSNMPv3Credentials API. + link: https://developer.cisco.com/docs/dna-center/#!create-snm-pv-3-credentials +- name: Cisco DNA Center documentation for Discovery UpdateSNMPv3Credentials + description: Complete reference of the UpdateSNMPv3Credentials API. + link: https://developer.cisco.com/docs/dna-center/#!update-snm-pv-3-credentials +notes: + - SDK Method used are + discovery.Discovery.create_snmpv3_credentials, + discovery.Discovery.update_snmpv3_credentials, + + - Paths used are + post /dna/intent/api/v1/global-credential/snmpv3, + put /dna/intent/api/v1/global-credential/snmpv3, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.snmpv3_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + authPassword: string + authType: string + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + privacyPassword: string + privacyType: string + snmpMode: string + username: string + +- name: Create + cisco.dnac.snmpv3_credential: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + authPassword: string + authType: string + comments: string + credentialType: string + description: string + id: string + instanceTenantId: string + instanceUuid: string + privacyPassword: string + privacyType: string + snmpMode: string + username: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/swim_image_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/swim_image_details_info.py new file mode 100644 index 00000000..b9ed467e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/swim_image_details_info.py @@ -0,0 +1,198 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: swim_image_details_info +short_description: Information module for Swim Image Details +description: +- Get all Swim Image Details. +- Returns software image list based on a filter criteria. For example "filterbyName = cat3k%". +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + imageUuid: + description: + - ImageUuid query parameter. + type: str + name: + description: + - Name query parameter. + type: str + family: + description: + - Family query parameter. + type: str + applicationType: + description: + - ApplicationType query parameter. + type: str + imageIntegrityStatus: + description: + - ImageIntegrityStatus query parameter. ImageIntegrityStatus - FAILURE, UNKNOWN, VERIFIED. + type: str + version: + description: + - Version query parameter. Software Image Version. + type: str + imageSeries: + description: + - ImageSeries query parameter. Image Series. + type: str + imageName: + description: + - ImageName query parameter. Image Name. + type: str + isTaggedGolden: + description: + - IsTaggedGolden query parameter. Is Tagged Golden. + type: bool + isCCORecommended: + description: + - IsCCORecommended query parameter. Is recommended from cisco.com. + type: bool + isCCOLatest: + description: + - IsCCOLatest query parameter. Is latest from cisco.com. + type: bool + createdTime: + description: + - CreatedTime query parameter. Time in milliseconds (epoch format). + type: int + imageSizeGreaterThan: + description: + - ImageSizeGreaterThan query parameter. Size in bytes. + type: int + imageSizeLesserThan: + description: + - ImageSizeLesserThan query parameter. Size in bytes. + type: int + sortBy: + description: + - SortBy query parameter. Sort results by this field. + type: str + sortOrder: + description: + - SortOrder query parameter. Sort order - 'asc' or 'des'. Default is asc. + type: str + limit: + description: + - Limit query parameter. + type: int + offset: + description: + - Offset query parameter. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) GetSoftwareImageDetails + description: Complete reference of the GetSoftwareImageDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-software-image-details +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.get_software_image_details, + + - Paths used are + get /dna/intent/api/v1/image/importation, + +""" + +EXAMPLES = r""" +- name: Get all Swim Image Details + cisco.dnac.swim_image_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + imageUuid: string + name: string + family: string + applicationType: string + imageIntegrityStatus: string + version: string + imageSeries: string + imageName: string + isTaggedGolden: True + isCCORecommended: True + isCCOLatest: True + createdTime: 0 + imageSizeGreaterThan: 0 + imageSizeLesserThan: 0 + sortBy: string + sortOrder: string + limit: 0 + offset: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "applicableDevicesForImage": [ + { + "mdfId": "string", + "productId": [ + "string" + ], + "productName": "string" + } + ], + "applicationType": "string", + "createdTime": "string", + "extendedAttributes": {}, + "family": "string", + "feature": "string", + "fileServiceId": "string", + "fileSize": "string", + "imageIntegrityStatus": "string", + "imageName": "string", + "imageSeries": [ + "string" + ], + "imageSource": "string", + "imageType": "string", + "imageUuid": "string", + "importSourceType": "string", + "isTaggedGolden": true, + "md5Checksum": "string", + "name": "string", + "profileInfo": [ + { + "description": "string", + "extendedAttributes": {}, + "memory": 0, + "productType": "string", + "profileName": "string", + "shares": 0, + "vCpu": 0 + } + ], + "shaCheckSum": "string", + "vendor": "string", + "version": "string" + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/swim_import_local.py b/ansible_collections/cisco/dnac/plugins/modules/swim_import_local.py new file mode 100644 index 00000000..6ea0d9b9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/swim_import_local.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: swim_import_local +short_description: Resource module for Swim Import Local +description: +- Manage operation create of the resource Swim Import Local. +- > + Fetches a software image from local file system and uploads to DNA Center. Supported software image files + extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + filePath: + description: File absolute path. + type: str + isThirdParty: + description: IsThirdParty query parameter. Third party Image check. + type: bool + thirdPartyApplicationType: + description: ThirdPartyApplicationType query parameter. Third Party Application + Type. + type: str + thirdPartyImageFamily: + description: ThirdPartyImageFamily query parameter. Third Party image family. + type: str + thirdPartyVendor: + description: ThirdPartyVendor query parameter. Third Party Vendor. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) ImportLocalSoftwareImage + description: Complete reference of the ImportLocalSoftwareImage API. + link: https://developer.cisco.com/docs/dna-center/#!import-local-software-image +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.import_local_software_image, + + - Paths used are + post /dna/intent/api/v1/image/importation/source/file, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.swim_import_local: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + filePath: /tmp/uploads/Test-242.bin + isThirdParty: true + thirdPartyApplicationType: string + thirdPartyImageFamily: string + thirdPartyVendor: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/swim_import_via_url.py b/ansible_collections/cisco/dnac/plugins/modules/swim_import_via_url.py new file mode 100644 index 00000000..3f86cc04 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/swim_import_via_url.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: swim_import_via_url +short_description: Resource module for Swim Import Via Url +description: +- Manage operation create of the resource Swim Import Via Url. +- > + Fetches a software image from remote file system using URL for HTTP/FTP and uploads to DNA Center. Supported image + files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Swim Import Via Url's payload. + elements: dict + suboptions: + applicationType: + description: Swim Import Via Url's applicationType. + type: str + imageFamily: + description: Swim Import Via Url's imageFamily. + type: str + sourceURL: + description: Swim Import Via Url's sourceURL. + type: str + thirdParty: + description: ThirdParty flag. + type: bool + vendor: + description: Swim Import Via Url's vendor. + type: str + type: list + scheduleAt: + description: ScheduleAt query parameter. Epoch Time (The number of milli-seconds + since January 1 1970 UTC) at which the distribution should be scheduled (Optional). + type: str + scheduleDesc: + description: ScheduleDesc query parameter. Custom Description (Optional). + type: str + scheduleOrigin: + description: ScheduleOrigin query parameter. Originator of this call (Optional). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) ImportSoftwareImageViaURL + description: Complete reference of the ImportSoftwareImageViaURL API. + link: https://developer.cisco.com/docs/dna-center/#!import-software-image-via-url +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.import_software_image_via_url, + + - Paths used are + post /dna/intent/api/v1/image/importation/source/url, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.swim_import_via_url: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - applicationType: string + imageFamily: string + sourceURL: string + thirdParty: true + vendor: string + scheduleAt: string + scheduleDesc: string + scheduleOrigin: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/swim_intent.py b/ansible_collections/cisco/dnac/plugins/modules/swim_intent.py new file mode 100644 index 00000000..ce9cb4f7 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/swim_intent.py @@ -0,0 +1,718 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +__author__ = ("Madhan Sankaranarayanan, Rishita Chowdhary") + +DOCUMENTATION = r""" +--- +module: swim_intent +short_description: Intent module for SWIM related functions +description: +- Manage operation related to image importation, distribution, activation and tagging image as golden +- API to fetch a software image from remote file system using URL for HTTP/FTP and uploads to DNA Center. + Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2. +- API to tag/untag image as golen for a given family of devices +- API to distribute a software image on a given device. Software image must be imported successfully into + DNA Center before it can be distributed. +- API to activate a software image on a given device. Software image must be present in the device flash. +version_added: '6.6.0' +extends_documentation_fragment: + - cisco.dnac.intent_params +author: Madhan Sankaranarayanan (@madhansansel) + Rishita Chowdhary (@rishitachowdhary) +options: + config: + description: List of details of SWIM image being managed + type: list + elements: dict + required: True + suboptions: + importImageDetails: + description: Details of image being imported + type: dict + suboptions: + type: + description: The source of import (Currently support vis URL). + type: str + urlDetails: + description: URL details for SWIM import + type: dict + suboptions: + payload: + description: Swim Import Via Url's payload. + type: list + elements: dict + suboptions: + applicationType: + description: Swim Import Via Url's applicationType. + type: str + imageFamily: + description: Swim Import Via Url's imageFamily. + type: str + sourceURL: + description: Swim Import Via Url's sourceURL. + type: str + thirdParty: + description: ThirdParty flag. + type: bool + vendor: + description: Swim Import Via Url's vendor. + type: str + scheduleAt: + description: ScheduleAt query parameter. Epoch Time (The number of milli-seconds since + January 1 1970 UTC) at which the distribution should be scheduled (Optional). + type: str + scheduleDesc: + description: ScheduleDesc query parameter. Custom Description (Optional). + type: str + scheduleOrigin: + description: ScheduleOrigin query parameter. Originator of this call (Optional). + type: str + taggingDetails: + description: Details for tagging or untagging an image as golden + type: dict + suboptions: + imageName: + description: SWIM image name which will be tagged or untagged as golden. + type: str + deviceRole: + description: Device Role. Permissible Values ALL, UNKNOWN, ACCESS, BORDER ROUTER, + DISTRIBUTION and CORE. + type: str + deviceFamilyName: + description: Device family name + type: str + siteName: + description: Site name for which SWIM image will be tagged/untagged as golden. + If not provided, SWIM image will be mapped to global site. + type: str + tagging: + description: Booelan value to tag/untag SWIM image as golden + If True then the given image will be tagged as golden. + If False then the given image will be un-tagged as golden. + type: bool + imageDistributionDetails: + description: Details for SWIM image distribution. Device on which the image needs to distributed + can be speciifed using any of the following parameters - deviceSerialNumber, + deviceIPAddress, deviceHostname or deviceMacAddress. + type: dict + suboptions: + imageName: + description: SWIM image's name + type: str + deviceSerialNumber: + description: Device serial number where the image needs to be distributed + type: str + deviceIPAddress: + description: Device IP address where the image needs to be distributed + type: str + deviceHostname: + description: Device hostname where the image needs to be distributed + type: str + deviceMacAddress: + description: Device MAC address where the image needs to be distributed + type: str + imageActivationDetails: + description: Details for SWIM image activation. Device on which the image needs to activated + can be speciifed using any of the following parameters - deviceSerialNumber, + deviceIPAddress, deviceHostname or deviceMacAddress. + type: dict + suboptions: + activateLowerImageVersion: + description: ActivateLowerImageVersion flag. + type: bool + deviceUpgradeMode: + description: Swim Trigger Activation's deviceUpgradeMode. + type: str + distributeIfNeeded: + description: DistributeIfNeeded flag. + type: bool + imageName: + description: SWIM image's name + type: str + deviceSerialNumber: + description: Device serial number where the image needs to be activated + type: str + deviceIPAddress: + description: Device IP address where the image needs to be activated + type: str + deviceHostname: + description: Device hostname where the image needs to be activated + type: str + deviceMacAddress: + description: Device MAC address where the image needs to be activated + type: str + scheduleValidate: + description: ScheduleValidate query parameter. ScheduleValidate, validates data + before schedule (Optional). + type: bool +requirements: +- dnacentersdk == 2.4.5 +- python >= 3.5 +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.import_software_image_via_url, + software_image_management_swim.SoftwareImageManagementSwim.tag_as_golden_image, + software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_distribution, + software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_activation, + + - Paths used are + post /dna/intent/api/v1/image/importation/source/url, + post /dna/intent/api/v1/image/importation/golden, + post /dna/intent/api/v1/image/distribution, + post /dna/intent/api/v1/image/activation/device, + +""" + +EXAMPLES = r""" +- name: Import an image, tag it as golden and load it on device + cisco.dnac.swim_intent: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + dnac_log: True + config: + - importImageDetails: + type: string + urlDetails: + payload: + - sourceURL: string + isThirdParty: bool + imageFamily: string + vendor: string + applicationType: string + scheduleAt: string + scheduleDesc: string + scheduleOrigin: string + taggingDetails: + imageName: string + deviceRole: string + deviceFamilyName: string + siteName: string + tagging: bool + imageDistributionDetails: + imageName: string + deviceSerialNumber: string + imageActivationDetails: + scheduleValidate: bool + activateLowerImageVersion: bool + distributeIfNeeded: bool + deviceSerialNumber: string + imageName: string +""" + +RETURN = r""" +#Case: SWIM image is successfully imported, tagged as golden, distributed and activated on a device +response: + description: A dictionary with activation details as returned by the DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "additionalStatusURL": String, + "data": String, + "endTime": 0, + "id": String, + "instanceTenantId": String, + "isError": bool, + "lastUpdate": 0, + "progress": String, + "rootId": String, + "serviceType": String, + "startTime": 0, + "version": 0 + }, + "msg": String + } + +""" + +import copy +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( + DNACSDK, + validate_list_of_dicts, + log, + get_dict_result, +) +from ansible.module_utils.basic import AnsibleModule + + +class DnacSwims: + + def __init__(self, module): + self.module = module + self.params = module.params + self.config = copy.deepcopy(module.params.get("config")) + self.have = {} + self.want_create = {} + self.diff_create = [] + self.validated = [] + dnac_params = self.get_dnac_params(self.params) + log(str(dnac_params)) + self.dnac = DNACSDK(params=dnac_params) + self.log = dnac_params.get("dnac_log") + + self.result = dict(changed=False, diff=[], response=[], warnings=[]) + + def validate_input(self): + temp_spec = dict( + importImageDetails=dict(type='dict'), + taggingDetails=dict(type='dict'), + imageDistributionDetails=dict(type='dict'), + imageActivationDetails=dict(type='dict'), + ) + if self.config: + msg = None + # Validate site params + valid_temp, invalid_params = validate_list_of_dicts( + self.config, temp_spec + ) + if invalid_params: + msg = "Invalid parameters in playbook: {0}".format( + "\n".join(invalid_params) + ) + self.module.fail_json(msg=msg) + + self.validated = valid_temp + if self.log: + log(str(valid_temp)) + log(str(self.validated)) + + def get_dnac_params(self, params): + dnac_params = dict( + dnac_host=params.get("dnac_host"), + dnac_port=params.get("dnac_port"), + dnac_username=params.get("dnac_username"), + dnac_password=params.get("dnac_password"), + dnac_verify=params.get("dnac_verify"), + dnac_debug=params.get("dnac_debug"), + dnac_log=params.get("dnac_log") + ) + return dnac_params + + def get_task_details(self, id): + result = None + response = self.dnac.exec( + family="task", + function='get_task_by_id', + params={"task_id": id}, + ) + if self.log: + log(str(response)) + + if isinstance(response, dict): + result = response.get("response") + + return result + + def site_exists(self): + site_exists = False + site_id = None + response = None + try: + response = self.dnac.exec( + family="sites", + function='get_site', + params={"name": self.want.get("site_name")}, + ) + except Exception as e: + self.module.fail_json(msg="Site not found") + + if response: + if self.log: + log(str(response)) + + site = response.get("response") + site_id = site[0].get("id") + site_exists = True + + return (site_exists, site_id) + + def get_image_id(self, name): + # check if given image exists, if exists store image_id + image_response = self.dnac.exec( + family="software_image_management_swim", + function='get_software_image_details', + params={"image_name": name}, + ) + + if self.log: + log(str(image_response)) + + image_list = image_response.get("response") + if (len(image_list) == 1): + image_id = image_list[0].get("imageUuid") + if self.log: + log("Image Id: " + str(image_id)) + else: + self.module.fail_json(msg="Image not found", response=image_response) + + return image_id + + def get_device_id(self, params): + response = self.dnac.exec( + family="devices", + function='get_device_list', + params=params, + ) + if self.log: + log(str(response)) + + device_list = response.get("response") + if (len(device_list) == 1): + device_id = device_list[0].get("id") + if self.log: + log("Device Id: " + str(device_id)) + else: + self.module.fail_json(msg="Device not found", response=response) + + return device_id + + def get_device_family_identifier(self, family_name): + have = {} + response = self.dnac.exec( + family="software_image_management_swim", + function='get_device_family_identifiers', + ) + if self.log: + log(str(response)) + device_family_db = response.get("response") + if device_family_db: + device_family_details = get_dict_result(device_family_db, 'deviceFamily', family_name) + if device_family_details: + device_family_identifier = device_family_details.get("deviceFamilyIdentifier") + have["device_family_identifier"] = device_family_identifier + if self.log: + log("Family device indentifier:" + str(device_family_identifier)) + else: + self.module.fail_json(msg="Family Device Name not found", response=[]) + self.have.update(have) + + def get_have(self): + if self.want.get("tagging_details"): + have = {} + tagging_details = self.want.get("tagging_details") + if tagging_details.get("imageName"): + image_id = self.get_image_id(tagging_details.get("imageName")) + have["tagging_image_id"] = image_id + + elif self.have.get("imported_image_id"): + have["tagging_image_id"] = self.have.get("imported_image_id") + + else: + self.module.fail_json(msg="Image details for tagging not provided", response=[]) + + # check if given site exists, store siteid + # if not then use global site + site_name = tagging_details.get("siteName") + if site_name: + site_exists = False + (site_exists, site_id) = self.site_exists() + if site_exists: + have["site_id"] = site_id + if self.log: + log("Site Exists: " + str(site_exists) + "\n Site_id:" + str(site_id)) + else: + # For global site, use -1 as siteId + have["site_id"] = "-1" + if self.log: + log("Site Name not given by user. Using global site.") + + self.have.update(have) + # check if given device family name exists, store indentifier value + family_name = tagging_details.get("deviceFamilyName") + self.get_device_family_identifier(family_name) + + if self.want.get("distribution_details"): + have = {} + distribution_details = self.want.get("distribution_details") + # check if image for distributon is available + if distribution_details.get("imageName"): + image_id = self.get_image_id(distribution_details.get("imageName")) + have["distribution_image_id"] = image_id + + elif self.have.get("imported_image_id"): + have["distribution_image_id"] = self.have.get("imported_image_id") + + else: + self.module.fail_json(msg="Image details for distribution not provided", response=[]) + + device_params = dict( + hostname=distribution_details.get("deviceHostname"), + serial_number=distribution_details.get("deviceSerialNumber"), + management_ip_address=distribution_details.get("deviceIpAddress"), + mac_address=distribution_details.get("deviceMacAddress"), + ) + device_id = self.get_device_id(device_params) + have["distribution_device_id"] = device_id + self.have.update(have) + + if self.want.get("activation_details"): + have = {} + activation_details = self.want.get("activation_details") + # check if image for activation is available + if activation_details.get("imageName"): + image_id = self.get_image_id(activation_details.get("imageName")) + have["activation_image_id"] = image_id + + elif self.have.get("imported_image_id"): + have["activation_image_id"] = self.have.get("imported_image_id") + + else: + self.module.fail_json(msg="Image details for activation not provided", response=[]) + + device_params = dict( + hostname=activation_details.get("deviceHostname"), + serial_number=activation_details.get("deviceSerialNumber"), + management_ip_address=activation_details.get("deviceIpAddress"), + mac_address=activation_details.get("deviceMacAddress"), + ) + device_id = self.get_device_id(device_params) + have["activation_device_id"] = device_id + self.have.update(have) + + def get_want(self): + want = {} + for image in self.validated: + if image.get("importImageDetails"): + want["import_type"] = image.get("importImageDetails").get("type") + if want["import_type"].lower() == "url": + want["url_import_details"] = image.get("importImageDetails").get("urlDetails") + + want["tagging_details"] = image.get("taggingDetails") + want["distribution_details"] = image.get("imageDistributionDetails") + want["activation_details"] = image.get("imageActivationDetails") + + self.want = want + if self.log: + log(str(self.want)) + + def get_diff_import(self): + if not self.want.get("url_import_details"): + return + + url_import_params = dict( + payload=self.want.get("url_import_details").get("payload"), + schedule_at=self.want.get("url_import_details").get("scheduleAt"), + schedule_desc=self.want.get("url_import_details").get("scheduleDesc"), + schedule_origin=self.want.get("url_import_details").get("scheduleOrigin"), + ) + response = self.dnac.exec( + family="software_image_management_swim", + function='import_software_image_via_url', + op_modifies=True, + params=url_import_params, + ) + if self.log: + log(str(response)) + + task_details = {} + task_id = response.get("response").get("taskId") + while (True): + task_details = self.get_task_details(task_id) + if task_details and \ + ("completed successfully" in task_details.get("progress")): + self.result['changed'] = True + self.result['msg'] = "Image imported successfully" + break + + if task_details and task_details.get("isError"): + if "Image already exists" in task_details.get("failureReason"): + self.result['msg'] = "Image already exists." + break + else: + self.module.fail_json(msg=task_details.get("failureReason"), + response=task_details) + + self.result['response'] = task_details if task_details else response + if not (self.want.get("tagging_details") or self.want.get("distribution_details") + or self.want.get("activation_details")): + return + # Fetch image_id for the imported image for further use + image_name = self.want.get("url_import_details").get("payload")[0].get("sourceURL") + image_name = image_name.split('/')[-1] + image_id = self.get_image_id(image_name) + self.have["imported_image_id"] = image_id + + def get_diff_tagging(self): + tagging_details = self.want.get("tagging_details") + tag_image_golden = tagging_details.get("tagging") + + if tag_image_golden: + image_params = dict( + imageId=self.have.get("tagging_image_id"), + siteId=self.have.get("site_id"), + deviceFamilyIdentifier=self.have.get("device_family_identifier"), + deviceRole=tagging_details.get("deviceRole") + ) + if self.log: + log("Image params for tagging image as golden:" + str(image_params)) + + response = self.dnac.exec( + family="software_image_management_swim", + function='tag_as_golden_image', + op_modifies=True, + params=image_params + ) + + else: + image_params = dict( + image_id=self.have.get("tagging_image_id"), + site_id=self.have.get("site_id"), + device_family_identifier=self.have.get("device_family_identifier"), + device_role=tagging_details.get("deviceRole") + ) + if self.log: + log("Image params for un-tagging image as golden:" + str(image_params)) + + response = self.dnac.exec( + family="software_image_management_swim", + function='remove_golden_tag_for_image', + op_modifies=True, + params=image_params + ) + + if response: + task_details = {} + task_id = response.get("response").get("taskId") + task_details = self.get_task_details(task_id) + if not task_details.get("isError"): + self.result['changed'] = True + self.result['msg'] = task_details.get("progress") + + self.result['response'] = task_details if task_details else response + + def get_diff_distribution(self): + distribution_details = self.want.get("distribution_details") + distribution_params = dict( + payload=[dict( + deviceUuid=self.have.get("distribution_device_id"), + imageUuid=self.have.get("distribution_image_id") + )] + ) + if self.log: + log("Distribution Params: " + str(distribution_params)) + + response = self.dnac.exec( + family="software_image_management_swim", + function='trigger_software_image_distribution', + op_modifies=True, + params=distribution_params, + ) + if response: + task_details = {} + task_id = response.get("response").get("taskId") + while (True): + task_details = self.get_task_details(task_id) + if not task_details.get("isError") and \ + ("completed successfully" in task_details.get("progress")): + self.result['changed'] = True + self.result['msg'] = "Image Distributed Successfully" + break + + if task_details.get("isError"): + self.module.fail_json(msg="Image Distribution Failed", + response=task_details) + + self.result['response'] = task_details if task_details else response + + def get_diff_activation(self): + activation_details = self.want.get("activation_details") + payload = [dict( + activateLowerImageVersion=activation_details.get("activateLowerImageVersion"), + deviceUpgradeMode=activation_details.get("deviceUpgradeMode"), + distributeIfNeeded=activation_details.get("distributeIfNeeded"), + deviceUuid=self.have.get("activation_device_id"), + imageUuidList=[self.have.get("activation_image_id")] + )] + activation_params = dict( + schedule_validate=activation_details.get("scehduleValidate"), + payload=payload + ) + if self.log: + log("Activation Params: " + str(activation_params)) + + response = self.dnac.exec( + family="software_image_management_swim", + function='trigger_software_image_activation', + op_modifies=True, + params=activation_params, + ) + task_details = {} + task_id = response.get("response").get("taskId") + while (True): + task_details = self.get_task_details(task_id) + if not task_details.get("isError") and \ + ("completed successfully" in task_details.get("progress")): + self.result['changed'] = True + self.result['msg'] = "Image activated successfully" + break + + if task_details.get("isError"): + self.module.fail_json(msg="Image Activation Failed", + response=task_details) + + self.result['response'] = task_details if task_details else response + + def get_diff(self): + if self.want.get("tagging_details"): + self.get_diff_tagging() + + if self.want.get("distribution_details"): + self.get_diff_distribution() + + if self.want.get("activation_details"): + self.get_diff_activation() + + +def main(): + """ main entry point for module execution + """ + + element_spec = dict( + dnac_host=dict(required=True, type='str'), + dnac_port=dict(type='str', default='443'), + dnac_username=dict(type='str', default='admin', aliases=["user"]), + dnac_password=dict(type='str', no_log=True), + dnac_verify=dict(type='bool', default='True'), + dnac_version=dict(type="str", default="2.2.3.3"), + dnac_debug=dict(type='bool', default=False), + dnac_log=dict(type='bool', default=False), + config=dict(required=True, type='list', elements='dict'), + validate_response_schema=dict(type="bool", default=True), + ) + + module = AnsibleModule(argument_spec=element_spec, + supports_check_mode=False) + + dnac_swims = DnacSwims(module) + dnac_swims.validate_input() + dnac_swims.get_want() + dnac_swims.get_diff_import() + dnac_swims.get_have() + dnac_swims.get_diff() + + module.exit_json(**dnac_swims.result) + + +if __name__ == '__main__': + main() diff --git a/ansible_collections/cisco/dnac/plugins/modules/swim_trigger_activation.py b/ansible_collections/cisco/dnac/plugins/modules/swim_trigger_activation.py new file mode 100644 index 00000000..ec9ca0e5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/swim_trigger_activation.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: swim_trigger_activation +short_description: Resource module for Swim Trigger Activation +description: +- Manage operation create of the resource Swim Trigger Activation. +- Activates a software image on a given device. Software image must be present in the device flash. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + payload: + description: Swim Trigger Activation's payload. + elements: dict + suboptions: + activateLowerImageVersion: + description: ActivateLowerImageVersion flag. + type: bool + deviceUpgradeMode: + description: Swim Trigger Activation's deviceUpgradeMode. + type: str + deviceUuid: + description: Swim Trigger Activation's deviceUuid. + type: str + distributeIfNeeded: + description: DistributeIfNeeded flag. + type: bool + imageUuidList: + description: Swim Trigger Activation's imageUuidList. + elements: str + type: list + smuImageUuidList: + description: Swim Trigger Activation's smuImageUuidList. + elements: str + type: list + type: list + scheduleValidate: + description: ScheduleValidate query parameter. ScheduleValidate, validates data + before schedule (Optional). + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) TriggerSoftwareImageActivation + description: Complete reference of the TriggerSoftwareImageActivation API. + link: https://developer.cisco.com/docs/dna-center/#!trigger-software-image-activation +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_activation, + + - Paths used are + post /dna/intent/api/v1/image/activation/device, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.swim_trigger_activation: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + payload: + - activateLowerImageVersion: true + deviceUpgradeMode: string + deviceUuid: string + distributeIfNeeded: true + imageUuidList: + - string + smuImageUuidList: + - string + scheduleValidate: true + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/swim_trigger_distribution.py b/ansible_collections/cisco/dnac/plugins/modules/swim_trigger_distribution.py new file mode 100644 index 00000000..cad143cb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/swim_trigger_distribution.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: swim_trigger_distribution +short_description: Resource module for Swim Trigger Distribution +description: +- Manage operation create of the resource Swim Trigger Distribution. +- > + Distributes a software image on a given device. Software image must be imported successfully into DNA Center + before it can be distributed. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Swim Trigger Distribution's payload. + elements: dict + suboptions: + deviceUuid: + description: Swim Trigger Distribution's deviceUuid. + type: str + imageUuid: + description: Swim Trigger Distribution's imageUuid. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Software Image Management (SWIM) TriggerSoftwareImageDistribution + description: Complete reference of the TriggerSoftwareImageDistribution API. + link: https://developer.cisco.com/docs/dna-center/#!trigger-software-image-distribution +notes: + - SDK Method used are + software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_distribution, + + - Paths used are + post /dna/intent/api/v1/image/distribution, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.swim_trigger_distribution: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - deviceUuid: string + imageUuid: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/syslog_config_create.py b/ansible_collections/cisco/dnac/plugins/modules/syslog_config_create.py new file mode 100644 index 00000000..d9058d44 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/syslog_config_create.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: syslog_config_create +short_description: Resource module for Syslog Config Create +description: +- Manage operation create of the resource Syslog Config Create. +- Create Syslog Destination. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + configId: + description: Required only for update syslog configuration. + type: str + description: + description: Description. + type: str + host: + description: Host. + type: str + name: + description: Name. + type: str + port: + description: Port. + type: str + protocol: + description: Protocol. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateSyslogDestination + description: Complete reference of the CreateSyslogDestination API. + link: https://developer.cisco.com/docs/dna-center/#!create-syslog-destination +notes: + - SDK Method used are + event_management.EventManagement.create_syslog_destination, + + - Paths used are + post /dna/intent/api/v1/event/syslogConfig, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.syslog_config_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + configId: string + description: string + host: string + name: string + port: string + protocol: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": { + "errors": [ + "string" + ] + }, + "apiStatus": "string", + "statusMessage": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/syslog_config_update.py b/ansible_collections/cisco/dnac/plugins/modules/syslog_config_update.py new file mode 100644 index 00000000..79d319fe --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/syslog_config_update.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: syslog_config_update +short_description: Resource module for Syslog Config Update +description: +- Manage operation update of the resource Syslog Config Update. +- Update Syslog Destination. +version_added: '6.0.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + configId: + description: Required only for update syslog configuration. + type: str + description: + description: Description. + type: str + host: + description: Host. + type: str + name: + description: Name. + type: str + port: + description: Port. + type: str + protocol: + description: Protocol. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management UpdateSyslogDestination + description: Complete reference of the UpdateSyslogDestination API. + link: https://developer.cisco.com/docs/dna-center/#!update-syslog-destination +notes: + - SDK Method used are + event_management.EventManagement.update_syslog_destination, + + - Paths used are + put /dna/intent/api/v1/event/syslogConfig, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.syslog_config_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + configId: string + description: string + host: string + name: string + port: string + protocol: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": { + "errors": [ + "string" + ] + }, + "apiStatus": "string", + "statusMessage": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/system_health_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/system_health_count_info.py new file mode 100644 index 00000000..b8e6b135 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/system_health_count_info.py @@ -0,0 +1,76 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: system_health_count_info +short_description: Information module for System Health Count +description: +- Get all System Health Count. +- This API gives the count of the latest system events. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + domain: + description: + - > + Domain query parameter. Fetch system events with this domain. Possible values of domain are listed here + /dna/platform/app/consumer-portal/developer-toolkit/events. + type: str + subdomain: + description: + - > + Subdomain query parameter. Fetch system events with this subdomain. Possible values of subdomain are listed + here /dna/platform/app/consumer-portal/developer-toolkit/events. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Health and Performance SystemHealthCountAPI + description: Complete reference of the SystemHealthCountAPI API. + link: https://developer.cisco.com/docs/dna-center/#!system-health-count-api +notes: + - SDK Method used are + health_and_performance.HealthAndPerformance.system_health_count, + + - Paths used are + get /dna/intent/api/v1/diagnostics/system/health/count, + +""" + +EXAMPLES = r""" +- name: Get all System Health Count + cisco.dnac.system_health_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + domain: string + subdomain: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "count": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/system_health_info.py b/ansible_collections/cisco/dnac/plugins/modules/system_health_info.py new file mode 100644 index 00000000..c0d2ea88 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/system_health_info.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: system_health_info +short_description: Information module for System Health +description: +- Get all System Health. +- This API retrieves the latest system events. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + summary: + description: + - Summary query parameter. Fetch the latest high severity event. + type: bool + domain: + description: + - > + Domain query parameter. Fetch system events with this domain. Possible values of domain are listed here + /dna/platform/app/consumer-portal/developer-toolkit/events. + type: str + subdomain: + description: + - > + Subdomain query parameter. Fetch system events with this subdomain. Possible values of subdomain are listed + here /dna/platform/app/consumer-portal/developer-toolkit/events. + type: str + limit: + description: + - Limit query parameter. + type: int + offset: + description: + - Offset query parameter. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Health and Performance SystemHealthAPI + description: Complete reference of the SystemHealthAPI API. + link: https://developer.cisco.com/docs/dna-center/#!system-health-api +notes: + - SDK Method used are + health_and_performance.HealthAndPerformance.system_health, + + - Paths used are + get /dna/intent/api/v1/diagnostics/system/health, + +""" + +EXAMPLES = r""" +- name: Get all System Health + cisco.dnac.system_health_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + summary: True + domain: string + subdomain: string + limit: 0 + offset: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "healthEvents": [ + { + "severity": "string", + "hostname": "string", + "instance": "string", + "subDomain": "string", + "domain": "string", + "description": "string", + "state": "string", + "timestamp": "string", + "status": "string" + } + ], + "version": "string", + "hostName": "string", + "cimcaddress": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/system_performance_historical_info.py b/ansible_collections/cisco/dnac/plugins/modules/system_performance_historical_info.py new file mode 100644 index 00000000..9cdbef7d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/system_performance_historical_info.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: system_performance_historical_info +short_description: Information module for System Performance Historical +description: +- Get all System Performance Historical. +- This API retrieves the historical performance indicators. The data can be retrieved for the last 3 months. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + kpi: + description: + - Kpi query parameter. Fetch historical data for this kpi. Valid values cpu,memory,network. + type: str + startTime: + description: + - > + StartTime query parameter. This is the epoch start time in milliseconds from which performance indicator + need to be fetched. + type: int + endTime: + description: + - > + EndTime query parameter. This is the epoch end time in milliseconds upto which performance indicator need to + be fetched. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Health and Performance SystemPerformanceHistoricalAPI + description: Complete reference of the SystemPerformanceHistoricalAPI API. + link: https://developer.cisco.com/docs/dna-center/#!system-performance-historical-api +notes: + - SDK Method used are + health_and_performance.HealthAndPerformance.system_performance_historical, + + - Paths used are + get /dna/intent/api/v1/diagnostics/system/performance/history, + +""" + +EXAMPLES = r""" +- name: Get all System Performance Historical + cisco.dnac.system_performance_historical_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + kpi: string + startTime: 0 + endTime: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "hostName": "string", + "version": "string", + "kpis": { + "legends": { + "cpu": { + "units": "string" + }, + "memory": { + "units": "string" + }, + "network tx_rate": { + "units": "string" + }, + "network rx_rate": { + "units": "string" + } + }, + "data": { + "t1": [ + "string" + ] + } + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/system_performance_info.py b/ansible_collections/cisco/dnac/plugins/modules/system_performance_info.py new file mode 100644 index 00000000..8460d726 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/system_performance_info.py @@ -0,0 +1,105 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: system_performance_info +short_description: Information module for System Performance +description: +- Get all System Performance. +- This API gives the aggregated performance indicators. The data can be retrieved for the last 3 months. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + kpi: + description: + - Kpi query parameter. Valid values cpu,memory,network. + type: str + function: + description: + - Function query parameter. Valid values sum,average,max. + type: str + startTime: + description: + - > + StartTime query parameter. This is the epoch start time in milliseconds from which performance indicator + need to be fetched. + type: int + endTime: + description: + - > + EndTime query parameter. This is the epoch end time in milliseconds upto which performance indicator need to + be fetched. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Health and Performance SystemPerformanceAPI + description: Complete reference of the SystemPerformanceAPI API. + link: https://developer.cisco.com/docs/dna-center/#!system-performance-api +notes: + - SDK Method used are + health_and_performance.HealthAndPerformance.system_performance, + + - Paths used are + get /dna/intent/api/v1/diagnostics/system/performance, + +""" + +EXAMPLES = r""" +- name: Get all System Performance + cisco.dnac.system_performance_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + kpi: string + function: string + startTime: 0 + endTime: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "hostName": "string", + "version": "string", + "kpis": { + "cpu": { + "units": "string", + "utilization": "string" + }, + "memory": { + "units": "string", + "utilization": "string" + }, + "network tx_rate": { + "units": "string", + "utilization": "string" + }, + "network rx_rate": { + "units": "string", + "utilization": "string" + } + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag.py b/ansible_collections/cisco/dnac/plugins/modules/tag.py new file mode 100644 index 00000000..53d6cb7e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag.py @@ -0,0 +1,171 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag +short_description: Resource module for Tag +description: +- Manage operations create, update and delete of the resource Tag. +- Creates tag with specified tag attributes. +- Deletes a tag specified by id. +- Updates a tag specified by id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + description: + description: Tag's description. + type: str + dynamicRules: + description: Tag's dynamicRules. + elements: dict + suboptions: + memberType: + description: Tag's memberType. + type: str + rules: + description: Tag's rules. + suboptions: + items: + description: Tag's items. + elements: dict + type: list + name: + description: Tag's name. + type: str + operation: + description: Tag's operation. + type: str + value: + description: Tag's value. + type: str + values: + description: Tag's values. + elements: str + type: list + type: dict + type: list + id: + description: Tag's id. + type: str + instanceTenantId: + description: Tag's instanceTenantId. + type: str + name: + description: Tag's name. + type: str + systemTag: + description: SystemTag flag. + type: bool +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag CreateTag + description: Complete reference of the CreateTag API. + link: https://developer.cisco.com/docs/dna-center/#!create-tag +- name: Cisco DNA Center documentation for Tag DeleteTag + description: Complete reference of the DeleteTag API. + link: https://developer.cisco.com/docs/dna-center/#!delete-tag +- name: Cisco DNA Center documentation for Tag UpdateTag + description: Complete reference of the UpdateTag API. + link: https://developer.cisco.com/docs/dna-center/#!update-tag +notes: + - SDK Method used are + tag.Tag.create_tag, + tag.Tag.delete_tag, + tag.Tag.update_tag, + + - Paths used are + post /dna/intent/api/v1/tag, + delete /dna/intent/api/v1/tag/{id}, + put /dna/intent/api/v1/tag, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.tag: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + description: string + dynamicRules: + - memberType: string + rules: + items: + - {} + name: string + operation: string + value: string + values: + - string + id: string + instanceTenantId: string + name: string + systemTag: true + +- name: Create + cisco.dnac.tag: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + description: string + dynamicRules: + - memberType: string + rules: + items: + - {} + name: string + operation: string + value: string + values: + - string + id: string + instanceTenantId: string + name: string + systemTag: true + +- name: Delete by id + cisco.dnac.tag: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/tag_count_info.py new file mode 100644 index 00000000..4624d65e --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag_count_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag_count_info +short_description: Information module for Tag Count +description: +- Get all Tag Count. +- Returns tag count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. + type: str + nameSpace: + description: + - NameSpace query parameter. + type: str + attributeName: + description: + - AttributeName query parameter. + type: str + level: + description: + - Level query parameter. + type: str + size: + description: + - Size query parameter. Size in kilobytes(KB). + type: str + systemTag: + description: + - SystemTag query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag GetTagCount + description: Complete reference of the GetTagCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-tag-count +notes: + - SDK Method used are + tag.Tag.get_tag_count, + + - Paths used are + get /dna/intent/api/v1/tag/count, + +""" + +EXAMPLES = r""" +- name: Get all Tag Count + cisco.dnac.tag_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + nameSpace: string + attributeName: string + level: string + size: string + systemTag: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag_info.py b/ansible_collections/cisco/dnac/plugins/modules/tag_info.py new file mode 100644 index 00000000..b0888c51 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag_info.py @@ -0,0 +1,166 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag_info +short_description: Information module for Tag +description: +- Get all Tag. +- Get Tag by id. +- Returns tag specified by Id. +- Returns the tags for given filter criteria. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + name: + description: + - Name query parameter. Tag name is mandatory when filter operation is used. + type: str + additionalInfo_nameSpace: + description: + - AdditionalInfo.nameSpace query parameter. + type: str + additionalInfo_attributes: + description: + - AdditionalInfo.attributes query parameter. + type: str + level: + description: + - Level query parameter. + type: str + offset: + description: + - Offset query parameter. + type: str + limit: + description: + - Limit query parameter. + type: str + size: + description: + - Size query parameter. Size in kilobytes(KB). + type: str + field: + description: + - > + Field query parameter. Available field names are + 'name,id,parentId,type,additionalInfo.nameSpace,additionalInfo.attributes'. + type: str + sortBy: + description: + - SortBy query parameter. Only supported attribute is name. SortyBy is mandatory when order is used. + type: str + order: + description: + - Order query parameter. Available values are asc and des. + type: str + systemTag: + description: + - SystemTag query parameter. + type: str + id: + description: + - Id path parameter. Tag ID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag GetTag + description: Complete reference of the GetTag API. + link: https://developer.cisco.com/docs/dna-center/#!get-tag +- name: Cisco DNA Center documentation for Tag GetTagById + description: Complete reference of the GetTagById API. + link: https://developer.cisco.com/docs/dna-center/#!get-tag-by-id +notes: + - SDK Method used are + tag.Tag.get_tag, + tag.Tag.get_tag_by_id, + + - Paths used are + get /dna/intent/api/v1/tag, + get /dna/intent/api/v1/tag/{id}, + +""" + +EXAMPLES = r""" +- name: Get all Tag + cisco.dnac.tag_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + name: string + additionalInfo_nameSpace: string + additionalInfo_attributes: string + level: string + offset: string + limit: string + size: string + field: string + sortBy: string + order: string + systemTag: string + register: result + +- name: Get Tag by id + cisco.dnac.tag_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "systemTag": true, + "description": "string", + "dynamicRules": [ + { + "memberType": "string", + "rules": { + "values": [ + "string" + ], + "items": [ + {} + ], + "operation": "string", + "name": "string", + "value": "string" + } + } + ], + "name": "string", + "id": "string", + "instanceTenantId": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag_member.py b/ansible_collections/cisco/dnac/plugins/modules/tag_member.py new file mode 100644 index 00000000..528caf30 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag_member.py @@ -0,0 +1,98 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag_member +short_description: Resource module for Tag Member +description: +- Manage operations create and delete of the resource Tag Member. +- Adds members to the tag specified by id. +- Removes Tag member from the tag specified by id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + id: + description: Id path parameter. Tag ID. + type: str + memberId: + description: MemberId path parameter. TagMember id to be removed from tag. + type: str + object: + description: Object. + type: str + payload: + description: Map of member type and member ids. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag AddMembersToTheTag + description: Complete reference of the AddMembersToTheTag API. + link: https://developer.cisco.com/docs/dna-center/#!add-members-to-the-tag +- name: Cisco DNA Center documentation for Tag RemoveTagMember + description: Complete reference of the RemoveTagMember API. + link: https://developer.cisco.com/docs/dna-center/#!remove-tag-member +notes: + - SDK Method used are + tag.Tag.add_members_to_the_tag, + tag.Tag.remove_tag_member, + + - Paths used are + post /dna/intent/api/v1/tag/{id}/member, + delete /dna/intent/api/v1/tag/{id}/member/{memberId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.tag_member: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + id: string + object: string + payload: + networkinterface: + - string + +- name: Delete by id + cisco.dnac.tag_member: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + id: string + memberId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag_member_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/tag_member_count_info.py new file mode 100644 index 00000000..13bfd2c4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag_member_count_info.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag_member_count_info +short_description: Information module for Tag Member Count +description: +- Get all Tag Member Count. +- Returns the number of members in a given tag. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Tag ID. + type: str + memberType: + description: + - MemberType query parameter. + type: str + memberAssociationType: + description: + - MemberAssociationType query parameter. + type: str + level: + description: + - Level query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag GetTagMemberCount + description: Complete reference of the GetTagMemberCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-tag-member-count +notes: + - SDK Method used are + tag.Tag.get_tag_member_count, + + - Paths used are + get /dna/intent/api/v1/tag/{id}/member/count, + +""" + +EXAMPLES = r""" +- name: Get all Tag Member Count + cisco.dnac.tag_member_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + memberType: string + memberAssociationType: string + level: string + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": 0 + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag_member_info.py b/ansible_collections/cisco/dnac/plugins/modules/tag_member_info.py new file mode 100644 index 00000000..07711413 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag_member_info.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag_member_info +short_description: Information module for Tag Member +description: +- Get all Tag Member. +- Returns tag members specified by id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. Tag ID. + type: str + memberType: + description: + - > + MemberType query parameter. Entity type of the member. Possible values can be retrieved by using + /tag/member/type API. + type: str + offset: + description: + - Offset query parameter. Used for pagination. It indicates the starting row number out of available member records. + type: str + limit: + description: + - Limit query parameter. Used to Number of maximum members to return in the result. + type: str + memberAssociationType: + description: + - > + MemberAssociationType query parameter. Indicates how the member is associated with the tag. Possible values + and description. 1) DYNAMIC The member is associated to the tag through rules. 2) STATIC – The member is + associated to the tag manually. 3) MIXED – The member is associated manually and also satisfies the rule + defined for the tag. + type: str + level: + description: + - Level query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag GetTagMembersById + description: Complete reference of the GetTagMembersById API. + link: https://developer.cisco.com/docs/dna-center/#!get-tag-members-by-id +notes: + - SDK Method used are + tag.Tag.get_tag_members_by_id, + + - Paths used are + get /dna/intent/api/v1/tag/{id}/member, + +""" + +EXAMPLES = r""" +- name: Get all Tag Member + cisco.dnac.tag_member_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + memberType: string + offset: string + limit: string + memberAssociationType: string + level: string + id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": [ + { + "instanceUuid": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag_member_type_info.py b/ansible_collections/cisco/dnac/plugins/modules/tag_member_type_info.py new file mode 100644 index 00000000..4fcb8ca4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag_member_type_info.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag_member_type_info +short_description: Information module for Tag Member Type +description: +- Get all Tag Member Type. +- Returns list of supported resource types. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag GetTagResourceTypes + description: Complete reference of the GetTagResourceTypes API. + link: https://developer.cisco.com/docs/dna-center/#!get-tag-resource-types +notes: + - SDK Method used are + tag.Tag.get_tag_resource_types, + + - Paths used are + get /dna/intent/api/v1/tag/member/type, + +""" + +EXAMPLES = r""" +- name: Get all Tag Member Type + cisco.dnac.tag_member_type_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": [ + "string" + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/tag_membership.py b/ansible_collections/cisco/dnac/plugins/modules/tag_membership.py new file mode 100644 index 00000000..e7516549 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/tag_membership.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: tag_membership +short_description: Resource module for Tag Membership +description: +- Manage operation update of the resource Tag Membership. +- > + Updates tag membership. As part of the request payload through this API, only the specified members are added / + retained to the given input tags. Possible values of memberType attribute in the request payload can be queried by + using the /tag/member/type API. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + memberToTags: + description: Tag Membership's memberToTags. + elements: dict + suboptions: + key: + description: Tag Membership's key. + elements: str + type: list + type: list + memberType: + description: Tag Membership's memberType. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Tag UpdatesTagMembership + description: Complete reference of the UpdatesTagMembership API. + link: https://developer.cisco.com/docs/dna-center/#!updates-tag-membership +notes: + - SDK Method used are + tag.Tag.updates_tag_membership, + + - Paths used are + put /dna/intent/api/v1/tag/member, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.tag_membership: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + memberToTags: + - key: + - string + memberType: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": { + "taskId": "string", + "url": "string" + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/task_count_info.py b/ansible_collections/cisco/dnac/plugins/modules/task_count_info.py new file mode 100644 index 00000000..bb95a22f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/task_count_info.py @@ -0,0 +1,113 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: task_count_info +short_description: Information module for Task Count +description: +- Get all Task Count. +- Returns Task count. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + startTime: + description: + - StartTime query parameter. This is the epoch start time from which tasks need to be fetched. + type: str + endTime: + description: + - EndTime query parameter. This is the epoch end time upto which audit records need to be fetched. + type: str + data: + description: + - Data query parameter. Fetch tasks that contains this data. + type: str + errorCode: + description: + - ErrorCode query parameter. Fetch tasks that have this error code. + type: str + serviceType: + description: + - ServiceType query parameter. Fetch tasks with this service type. + type: str + username: + description: + - Username query parameter. Fetch tasks with this username. + type: str + progress: + description: + - Progress query parameter. Fetch tasks that contains this progress. + type: str + isError: + description: + - IsError query parameter. Fetch tasks ended as success or failure. Valid values true, false. + type: str + failureReason: + description: + - FailureReason query parameter. Fetch tasks that contains this failure reason. + type: str + parentId: + description: + - ParentId query parameter. Fetch tasks that have this parent Id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Task GetTaskCount + description: Complete reference of the GetTaskCount API. + link: https://developer.cisco.com/docs/dna-center/#!get-task-count +notes: + - SDK Method used are + task.Task.get_task_count, + + - Paths used are + get /dna/intent/api/v1/task/count, + +""" + +EXAMPLES = r""" +- name: Get all Task Count + cisco.dnac.task_count_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + startTime: string + endTime: string + data: string + errorCode: string + serviceType: string + username: string + progress: string + isError: string + failureReason: string + parentId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/task_info.py b/ansible_collections/cisco/dnac/plugins/modules/task_info.py new file mode 100644 index 00000000..594997d5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/task_info.py @@ -0,0 +1,176 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: task_info +short_description: Information module for Task +description: +- Get all Task. +- Get Task by id. +- Returns a task by specified id. +- Returns tasks based on filter criteria. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + startTime: + description: + - StartTime query parameter. This is the epoch start time from which tasks need to be fetched. + type: str + endTime: + description: + - EndTime query parameter. This is the epoch end time upto which audit records need to be fetched. + type: str + data: + description: + - Data query parameter. Fetch tasks that contains this data. + type: str + errorCode: + description: + - ErrorCode query parameter. Fetch tasks that have this error code. + type: str + serviceType: + description: + - ServiceType query parameter. Fetch tasks with this service type. + type: str + username: + description: + - Username query parameter. Fetch tasks with this username. + type: str + progress: + description: + - Progress query parameter. Fetch tasks that contains this progress. + type: str + isError: + description: + - IsError query parameter. Fetch tasks ended as success or failure. Valid values true, false. + type: str + failureReason: + description: + - FailureReason query parameter. Fetch tasks that contains this failure reason. + type: str + parentId: + description: + - ParentId query parameter. Fetch tasks that have this parent Id. + type: str + offset: + description: + - Offset query parameter. + type: str + limit: + description: + - Limit query parameter. + type: str + sortBy: + description: + - SortBy query parameter. Sort results by this field. + type: str + order: + description: + - Order query parameter. Sort order - asc or dsc. + type: str + taskId: + description: + - TaskId path parameter. UUID of the Task. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Task GetTaskById + description: Complete reference of the GetTaskById API. + link: https://developer.cisco.com/docs/dna-center/#!get-task-by-id +- name: Cisco DNA Center documentation for Task GetTasks + description: Complete reference of the GetTasks API. + link: https://developer.cisco.com/docs/dna-center/#!get-tasks +notes: + - SDK Method used are + task.Task.get_task_by_id, + task.Task.get_tasks, + + - Paths used are + get /dna/intent/api/v1/task, + get /dna/intent/api/v1/task/{taskId}, + +""" + +EXAMPLES = r""" +- name: Get all Task + cisco.dnac.task_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + startTime: string + endTime: string + data: string + errorCode: string + serviceType: string + username: string + progress: string + isError: string + failureReason: string + parentId: string + offset: string + limit: string + sortBy: string + order: string + register: result + +- name: Get Task by id + cisco.dnac.task_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + taskId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "additionalStatusURL": "string", + "data": "string", + "endTime": 0, + "errorCode": "string", + "errorKey": "string", + "failureReason": "string", + "id": "string", + "instanceTenantId": "string", + "isError": true, + "lastUpdate": 0, + "operationIdList": {}, + "parentId": "string", + "progress": "string", + "rootId": "string", + "serviceType": "string", + "startTime": 0, + "username": "string", + "version": 0 + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/task_operation_info.py b/ansible_collections/cisco/dnac/plugins/modules/task_operation_info.py new file mode 100644 index 00000000..f5578940 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/task_operation_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: task_operation_info +short_description: Information module for Task Operation +description: +- Get Task Operation by id. +- Returns root tasks associated with an Operationid. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + operationId: + description: + - OperationId path parameter. + type: str + offset: + description: + - Offset path parameter. Index, minimum value is 0. + type: int + limit: + description: + - > + Limit path parameter. The maximum value of {limit} supported is 500. Base 1 indexing for {limit}, minimum + value is 1. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Task GetTaskByOperationId + description: Complete reference of the GetTaskByOperationId API. + link: https://developer.cisco.com/docs/dna-center/#!get-task-by-operation-id +notes: + - SDK Method used are + task.Task.get_task_by_operationid, + + - Paths used are + get /dna/intent/api/v1/task/operation/{operationId}/{offset}/{limit}, + +""" + +EXAMPLES = r""" +- name: Get Task Operation by id + cisco.dnac.task_operation_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + operationId: string + offset: 0 + limit: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "additionalStatusURL": "string", + "data": "string", + "endTime": "string", + "errorCode": "string", + "errorKey": "string", + "failureReason": "string", + "id": "string", + "instanceTenantId": "string", + "isError": true, + "lastUpdate": "string", + "operationIdList": {}, + "parentId": "string", + "progress": "string", + "rootId": "string", + "serviceType": "string", + "startTime": "string", + "username": "string", + "version": 0 + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/task_tree_info.py b/ansible_collections/cisco/dnac/plugins/modules/task_tree_info.py new file mode 100644 index 00000000..bda7d8c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/task_tree_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: task_tree_info +short_description: Information module for Task Tree +description: +- Get all Task Tree. +- Returns a task with its children tasks by based on their id. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + taskId: + description: + - TaskId path parameter. UUID of the Task. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Task GetTaskTree + description: Complete reference of the GetTaskTree API. + link: https://developer.cisco.com/docs/dna-center/#!get-task-tree +notes: + - SDK Method used are + task.Task.get_task_tree, + + - Paths used are + get /dna/intent/api/v1/task/{taskId}/tree, + +""" + +EXAMPLES = r""" +- name: Get all Task Tree + cisco.dnac.task_tree_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + taskId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "additionalStatusURL": "string", + "data": "string", + "endTime": "string", + "errorCode": "string", + "errorKey": "string", + "failureReason": "string", + "id": "string", + "instanceTenantId": "string", + "isError": true, + "lastUpdate": "string", + "operationIdList": {}, + "parentId": "string", + "progress": "string", + "rootId": "string", + "serviceType": "string", + "startTime": "string", + "username": "string", + "version": 0 + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/template_intent.py b/ansible_collections/cisco/dnac/plugins/modules/template_intent.py new file mode 100644 index 00000000..14f5b646 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/template_intent.py @@ -0,0 +1,1065 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +__author__ = ("Madhan Sankaranarayanan, Rishita Chowdhary") + +DOCUMENTATION = r""" +--- +module: template_intent +short_description: Resource module for Template functions +description: +- Manage operations create, update and delete of the resource Configuration Template. +- API to create a template by project name and template name. +- API to update a template by template name and project name. +- API to delete a template by template name and project name. +version_added: '6.6.0' +extends_documentation_fragment: + - cisco.dnac.intent_params +author: Madhan Sankaranarayanan (@madhansansel) + Rishita Chowdhary (@rishitachowdhary) +options: + state: + description: The state of DNAC after module completion. + type: str + choices: [ merged, deleted ] + default: merged + config: + description: + - List of details of templates being managed. + type: list + elements: dict + required: true + suboptions: + author: + description: Author of template. + type: str + composite: + description: Is it composite template. + type: bool + containingTemplates: + description: Configuration Template Create's containingTemplates. + suboptions: + composite: + description: Is it composite template. + type: bool + description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Create's deviceTypes. + type: list + elements: dict + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + id: + description: UUID of template. + type: str + language: + description: Template language + choices: + - JINJA + - VELOCITY + type: str + name: + description: Name of template. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateParams: + description: Configuration Template Create's rollbackTemplateParams. + type: list + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + type: list + elements: dict + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + tags: + description: Configuration Template Create's tags. + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + elements: dict + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Create's templateParams. + elements: dict + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + elements: dict + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + version: + description: Current version of template. + type: str + type: list + elements: dict + createTime: + description: Create time of template. + type: int + customParamsOrder: + description: Custom Params Order. + type: bool + template_description: + description: Description of template. + type: str + deviceTypes: + description: Configuration Template Create's deviceTypes. + suboptions: + productFamily: + description: Device family. + type: str + productSeries: + description: Device series. + type: str + productType: + description: Device type. + type: str + type: list + elements: dict + failurePolicy: + description: Define failure policy if template provisioning fails. + type: str + language: + description: Template language + choices: + - JINJA + - VELOCITY + type: str + lastUpdateTime: + description: Update time of template. + type: int + latestVersionTime: + description: Latest versioned template time. + type: int + templateName: + description: Name of template. + type: str + parentTemplateId: + description: Parent templateID. + type: str + projectId: + description: Project UUID. + type: str + projectName: + description: Project name. + type: str + rollbackTemplateContent: + description: Rollback template content. + type: str + rollbackTemplateParams: + description: Configuration Template Create's rollbackTemplateParams. + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + elements: dict + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + elements: dict + softwareType: + description: Applicable device software type. + type: str + softwareVariant: + description: Applicable device software variant. + type: str + softwareVersion: + description: Applicable device software version. + type: str + template_tag: + description: Configuration Template Create's tags. + suboptions: + id: + description: UUID of tag. + type: str + name: + description: Name of tag. + type: str + type: list + elements: dict + templateContent: + description: Template content. + type: str + templateParams: + description: Configuration Template Create's templateParams. + suboptions: + binding: + description: Bind to source. + type: str + customOrder: + description: CustomOrder of template param. + type: int + dataType: + description: Datatype of template param. + type: str + defaultValue: + description: Default value of template param. + type: str + description: + description: Description of template param. + type: str + displayName: + description: Display name of param. + type: str + group: + description: Group. + type: str + id: + description: UUID of template param. + type: str + instructionText: + description: Instruction text for param. + type: str + key: + description: Key. + type: str + notParam: + description: Is it not a variable. + type: bool + order: + description: Order of template param. + type: int + paramArray: + description: Is it an array. + type: bool + parameterName: + description: Name of template param. + type: str + provider: + description: Provider. + type: str + range: + description: Configuration Template Create's range. + suboptions: + id: + description: UUID of range. + type: str + maxValue: + description: Max value of range. + type: int + minValue: + description: Min value of range. + type: int + type: list + elements: dict + required: + description: Is param required. + type: bool + selection: + description: Configuration Template Create's selection. + suboptions: + defaultSelectedValues: + description: Default selection values. + elements: str + type: list + id: + description: UUID of selection. + type: str + selectionType: + description: Type of selection(SINGLE_SELECT or MULTI_SELECT). + type: str + selectionValues: + description: Selection values. + type: dict + type: dict + type: list + elements: dict + validationErrors: + description: Configuration Template Create's validationErrors. + suboptions: + rollbackTemplateErrors: + description: Validation or design conflicts errors of rollback template. + elements: dict + type: list + templateErrors: + description: Validation or design conflicts errors. + elements: dict + type: list + templateId: + description: UUID of template. + type: str + templateVersion: + description: Current version of template. + type: str + type: dict + version: + description: Current version of template. + type: str + versionDescription: + description: Template version comments. + type: str +requirements: +- dnacentersdk == 2.4.5 +- python >= 3.5 +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.create_template, + configuration_templates.ConfigurationTemplates.deletes_the_template, + configuration_templates.ConfigurationTemplates.update_template, + + - Paths used are + post /dna/intent/api/v1/template-programmer/project/{projectId}/template, + delete /dna/intent/api/v1/template-programmer/template/{templateId}, + put /dna/intent/api/v1/template-programmer/template, + +""" + +EXAMPLES = r""" +- name: Create a new template + cisco.dnac.template_intent: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + dnac_log: True + state: merged + config: + author: string + composite: true + createTime: 0 + customParamsOrder: true + description: string + deviceTypes: + - productFamily: string + productSeries: string + productType: string + failurePolicy: string + id: string + language: string + lastUpdateTime: 0 + latestVersionTime: 0 + name: string + parentTemplateId: string + projectId: string + projectName: string + rollbackTemplateContent: string + softwareType: string + softwareVariant: string + softwareVersion: string + tags: + - id: string + name: string + templateContent: string + validationErrors: + rollbackTemplateErrors: + - {} + templateErrors: + - {} + templateId: string + templateVersion: string + version: string + +""" + +RETURN = r""" +#Case_1: Successful creation/updation/deletion of template +response_1: + description: A dictionary with versioning details of the template as returned by the DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "endTime": 0, + "version": 0, + "data": String, + "startTime": 0, + "username": String, + "progress": String, + "serviceType": String, "rootId": String, + "isError": bool, + "instanceTenantId": String, + "id": String + "version": 0 + }, + "msg": String + } + +#Case_2: Error while deleting a template or when given project is not found +response_2: + description: A list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + sample: > + { + "response": [], + "msg": String + } + +#Case_3: Given template already exists and requires no udpate +response_3: + description: A dictionary with the exisiting template deatails as returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": {}, + "msg": String + } +""" + +import copy +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + validate_list_of_dicts, + log, + get_dict_result, + dnac_compare_equality, +) +from ansible.module_utils.basic import AnsibleModule + + +class DnacTemplate: + + def __init__(self, module): + self.module = module + self.params = module.params + self.config = copy.deepcopy(module.params.get("config")) + self.have_create = {} + self.want_create = {} + self.validated = [] + dnac_params = self.get_dnac_params(self.params) + log(str(dnac_params)) + self.dnac = DNACSDK(params=dnac_params) + self.log = dnac_params.get("dnac_log") + + self.result = dict(changed=False, diff=[], response=[], warnings=[]) + + def get_state(self): + return self.params.get("state") + + def validate_input(self): + temp_spec = dict( + tags=dict(type="list"), + author=dict(type="str"), + composite=dict(type="bool"), + containingTemplates=dict(type="list"), + createTime=dict(type="int"), + customParamsOrder=dict(type="bool"), + description=dict(type="str"), + deviceTypes=dict(type="list", elements='dict'), + failurePolicy=dict(type="str"), + id=dict(type="str"), + language=dict(required=False, choices=['velocity', 'jinja']), + lastUpdateTime=dict(type="int"), + latestVersionTime=dict(type="int"), + name=dict(type="str"), + parentTemplateId=dict(type="str"), + projectId=dict(type="str"), + projectName=dict(required=True, type="str"), + rollbackTemplateContent=dict(type="str"), + rollbackTemplateParams=dict(type="list"), + softwareType=dict(type="str"), + softwareVariant=dict(type="str"), + softwareVersion=dict(type="str"), + templateContent=dict(type="str"), + templateParams=dict(type="list"), + templateName=dict(required=True, type='str'), + validationErrors=dict(type="dict"), + version=dict(type="str"), + versionDescription=dict(type='str'), + ) + + if self.config: + msg = None + # Validate template params + valid_temp, invalid_params = validate_list_of_dicts( + self.config, temp_spec + ) + + if invalid_params: + msg = "Invalid parameters in playbook: {0}".format( + "\n".join(invalid_params) + ) + self.module.fail_json(msg=msg) + + self.validated = valid_temp + + if self.log: + log(str(valid_temp)) + log(str(self.validated)) + + if self.params.get("state") == "merged": + for temp in self.validated: + if not temp.get("language") or not temp.get("deviceTypes") \ + or not temp.get("softwareType"): + msg = "missing required arguments: language or deviceTypes or softwareType" + self.module.fail_json(msg=msg) + + def get_dnac_params(self, params): + dnac_params = dict( + dnac_host=params.get("dnac_host"), + dnac_port=params.get("dnac_port"), + dnac_username=params.get("dnac_username"), + dnac_password=params.get("dnac_password"), + dnac_verify=params.get("dnac_verify"), + dnac_debug=params.get("dnac_debug"), + dnac_log=params.get("dnac_log") + ) + return dnac_params + + def get_template_params(self, params): + temp_params = dict( + tags=params.get("template_tag"), + author=params.get("author"), + composite=params.get("composite"), + containingTemplates=params.get("containingTemplates"), + createTime=params.get("createTime"), + customParamsOrder=params.get("customParamsOrder"), + description=params.get("template_description"), + deviceTypes=params.get("deviceTypes"), + failurePolicy=params.get("failurePolicy"), + id=params.get("templateId"), + language=params.get("language").upper(), + lastUpdateTime=params.get("lastUpdateTime"), + latestVersionTime=params.get("latestVersionTime"), + name=params.get("templateName"), + parentTemplateId=params.get("parentTemplateId"), + projectId=params.get("projectId"), + projectName=params.get("projectName"), + rollbackTemplateContent=params.get("rollbackTemplateContent"), + rollbackTemplateParams=params.get("rollbackTemplateParams"), + softwareType=params.get("softwareType"), + softwareVariant=params.get("softwareVariant"), + softwareVersion=params.get("softwareVersion"), + templateContent=params.get("templateContent"), + templateParams=params.get("templateParams"), + validationErrors=params.get("validationErrors"), + version=params.get("version"), + project_id=params.get("projectId"), + ) + return temp_params + + def get_template(self): + result = None + + for temp in self.validated: + items = self.dnac.exec( + family="configuration_templates", + function="get_template_details", + params={"template_id": temp.get("templateId")} + ) + + if items: + result = items + + if self.log: + log(str(items)) + + self.result['response'] = items + return result + + def get_have(self): + prev_template = None + template_exists = False + have_create = {} + + # Get available templates. Filter templates based on provided projectName + for temp in self.validated: + template_list = self.dnac.exec( + family="configuration_templates", + function='gets_the_templates_available', + params={"project_names": temp.get("projectName")}, + ) + # API execution error returns a dict + if template_list and isinstance(template_list, list): + template_details = get_dict_result(template_list, 'name', temp.get("templateName")) + + if template_details: + temp["templateId"] = template_details.get("templateId") + have_create["templateId"] = template_details.get("templateId") + prev_template = self.get_template() + + if self.log: + log(str(prev_template)) + + template_exists = prev_template is not None and isinstance(prev_template, dict) + else: + self.module.fail_json(msg="Project Not Found", response=[]) + + have_create['template'] = prev_template + have_create['template_found'] = template_exists + self.have_create = have_create + + def get_want(self): + want_create = {} + + for temp in self.validated: + template_params = self.get_template_params(temp) + version_comments = temp.get("versionDescription") + + if self.params.get("state") == "merged" and \ + not self.have_create.get("template_found"): + # ProjectId is required for creating a new template. + # Store it with other template parameters. + items = self.dnac.exec( + family="configuration_templates", + function='get_projects', + params={"name": temp.get("projectName")}, + ) + template_params["projectId"] = items[0].get("id") + template_params["project_id"] = items[0].get("id") + + want_create["template_params"] = template_params + want_create["comments"] = version_comments + + self.want_create = want_create + + def requires_update(self): + current_obj = self.have_create.get("template") + requested_obj = self.want_create.get("template_params") + obj_params = [ + ("tags", "tags", ""), + ("author", "author", ""), + ("composite", "composite", False), + ("containingTemplates", "containingTemplates", []), + ("createTime", "createTime", ""), + ("customParamsOrder", "customParamsOrder", False), + ("description", "description", ""), + ("deviceTypes", "deviceTypes", []), + ("failurePolicy", "failurePolicy", ""), + ("id", "id", ""), + ("language", "language", "VELOCITY"), + ("lastUpdateTime", "lastUpdateTime", ""), + ("latestVersionTime", "latestVersionTime", ""), + ("name", "name", ""), + ("parentTemplateId", "parentTemplateId", ""), + ("projectId", "projectId", ""), + ("projectName", "projectName", ""), + ("rollbackTemplateContent", "rollbackTemplateContent", ""), + ("rollbackTemplateParams", "rollbackTemplateParams", []), + ("softwareType", "softwareType", ""), + ("softwareVariant", "softwareVariant", ""), + ("softwareVersion", "softwareVersion", ""), + ("templateContent", "templateContent", ""), + ("templateParams", "templateParams", []), + ("validationErrors", "validationErrors", {}), + ("version", "version", ""), + ] + + return any(not dnac_compare_equality(current_obj.get(dnac_param, default), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param, default) in obj_params) + + def get_task_details(self, id): + result = None + response = self.dnac.exec( + family="task", + function='get_task_by_id', + params={"task_id": id}, + ) + + if self.log: + log(str(response)) + + if isinstance(response, dict): + result = response.get("response") + + return result + + def get_diff_merge(self): + template_id = None + template_ceated = False + template_updated = False + template_exists = self.have_create.get("template_found") + + if template_exists: + if self.requires_update(): + response = self.dnac.exec( + family="configuration_templates", + function="update_template", + params=self.want_create.get("template_params"), + op_modifies=True, + ) + template_updated = True + template_id = self.have_create.get("templateId") + + if self.log: + log("Updating Existing Template") + else: + # Template does not need update + self.result['response'] = self.have_create.get("template") + self.result['msg'] = "Template does not need update" + self.module.exit_json(**self.result) + else: + response = self.dnac.exec( + family="configuration_templates", + function='create_template', + op_modifies=True, + params=self.want_create.get("template_params"), + ) + + if self.log: + log("Template created. Get template_id for versioning") + if isinstance(response, dict): + create_error = False + task_details = {} + task_id = response.get("response").get("taskId") + + if task_id: + while (True): + task_details = self.get_task_details(task_id) + if task_details and task_details.get("isError"): + create_error = True + break + + if task_details and ("Successfully created template" in task_details.get("progress")): + break + if not create_error: + template_id = task_details.get("data") + if template_id: + template_created = True + + if template_updated or template_created: + # Template needs to be versioned + version_params = dict( + comments=self.want_create.get("comments"), + templateId=template_id + ) + response = self.dnac.exec( + family="configuration_templates", + function='version_template', + op_modifies=True, + params=version_params + ) + task_details = {} + task_id = response.get("response").get("taskId") + + if task_id: + task_details = self.get_task_details(task_id) + self.result['changed'] = True + self.result['msg'] = task_details.get('progress') + self.result['diff'] = self.validated + if self.log: + log(str(task_details)) + self.result['response'] = task_details if task_details else response + + if not self.result.get('msg'): + self.result['msg'] = "Error while versioning the template" + + def get_diff_delete(self): + template_exists = self.have_create.get("template_found") + + if template_exists: + response = self.dnac.exec( + family="configuration_templates", + function="deletes_the_template", + params={"template_id": self.have_create.get("templateId")}, + ) + task_details = {} + task_id = response.get("response").get("taskId") + + if task_id: + task_details = self.get_task_details(task_id) + self.result['changed'] = True + self.result['msg'] = task_details.get('progress') + self.result['diff'] = self.validated + + if self.log: + log(str(task_details)) + + self.result['response'] = task_details if task_details else response + + if not self.result['msg']: + self.result['msg'] = "Error while deleting template" + else: + self.module.fail_json(msg="Template not found", response=[]) + + +def main(): + """ main entry point for module execution + """ + + element_spec = dict( + dnac_host=dict(required=True, type='str'), + dnac_port=dict(type='str', default='443'), + dnac_username=dict(type='str', default='admin', aliases=["user"]), + dnac_password=dict(type='str', no_log=True), + dnac_verify=dict(type='bool', default='True'), + dnac_version=dict(type="str", default="2.2.3.3"), + dnac_debug=dict(type='bool', default=False), + dnac_log=dict(type='bool', default=False), + validate_response_schema=dict(type="bool", default=True), + config=dict(required=True, type='list', elements='dict'), + state=dict( + default='merged', + choices=['merged', 'deleted']), + ) + module = AnsibleModule(argument_spec=element_spec, + supports_check_mode=False) + dnac_template = DnacTemplate(module) + dnac_template.validate_input() + state = dnac_template.get_state() + dnac_template.get_have() + dnac_template.get_want() + + if state == "merged": + dnac_template.get_diff_merge() + + elif state == "deleted": + dnac_template.get_diff_delete() + + module.exit_json(**dnac_template.result) + + +if __name__ == '__main__': + main() diff --git a/ansible_collections/cisco/dnac/plugins/modules/template_preview.py b/ansible_collections/cisco/dnac/plugins/modules/template_preview.py new file mode 100644 index 00000000..9a6fab33 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/template_preview.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: template_preview +short_description: Resource module for Template Preview +description: +- Manage operation update of the resource Template Preview. +- API to preview a template. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + deviceId: + description: UUID of device to get template preview. + type: str + params: + description: Params to render preview. + type: dict + resourceParams: + description: Resource params to render preview. + elements: dict + type: list + templateId: + description: UUID of template to get template preview. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates PreviewTemplate + description: Complete reference of the PreviewTemplate API. + link: https://developer.cisco.com/docs/dna-center/#!preview-template +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.preview_template, + + - Paths used are + put /dna/intent/api/v1/template-programmer/template/preview, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.template_preview: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + deviceId: string + params: {} + resourceParams: + - {} + templateId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "cliPreview": "string", + "deviceId": "string", + "templateId": "string", + "validationErrors": {} + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/templates_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/templates_details_info.py new file mode 100644 index 00000000..82eeaebe --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/templates_details_info.py @@ -0,0 +1,372 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: templates_details_info +short_description: Information module for Templates Details +description: +- Get all Templates Details. +- Get templates details. +version_added: '4.0.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id query parameter. Id of template to be searched. + type: str + name: + description: + - Name query parameter. Name of template to be searched. + type: str + projectId: + description: + - ProjectId query parameter. Filter template(s) based on project id. + type: str + projectName: + description: + - ProjectName query parameter. Filter template(s) based on project name. + type: str + softwareType: + description: + - SoftwareType query parameter. Filter template(s) based software type. + type: str + softwareVersion: + description: + - SoftwareVersion query parameter. Filter template(s) based softwareVersion. + type: str + productFamily: + description: + - ProductFamily query parameter. Filter template(s) based on device family. + type: str + productSeries: + description: + - ProductSeries query parameter. Filter template(s) based on device series. + type: str + productType: + description: + - ProductType query parameter. Filter template(s) based on device type. + type: str + filterConflictingTemplates: + description: + - FilterConflictingTemplates query parameter. Filter template(s) based on confliting templates. + type: bool + tags: + description: + - Tags query parameter. Filter template(s) based on tags. + elements: str + type: list + unCommitted: + description: + - UnCommitted query parameter. Return uncommitted template. + type: bool + sortOrder: + description: + - SortOrder query parameter. Sort Order Ascending (asc) or Descending (dsc). + type: str + allTemplateAttributes: + description: + - AllTemplateAttributes query parameter. Return all template attributes. + type: bool + includeVersionDetails: + description: + - IncludeVersionDetails query parameter. Include template version details. + type: bool + offset: + description: + - Offset query parameter. Index of first result. + type: int + limit: + description: + - Limit query parameter. Limits number of results. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Configuration Templates GetTemplatesDetails + description: Complete reference of the GetTemplatesDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-template-s-details +notes: + - SDK Method used are + configuration_templates.ConfigurationTemplates.get_templates_details, + + - Paths used are + get /dna/intent/api/v2/template-programmer/template, + +""" + +EXAMPLES = r""" +- name: Get all Templates Details + cisco.dnac.templates_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + id: string + name: string + projectId: string + projectName: string + softwareType: string + softwareVersion: string + productFamily: string + productSeries: string + productType: string + filterConflictingTemplates: True + tags: [] + unCommitted: True + sortOrder: string + allTemplateAttributes: True + includeVersionDetails: True + offset: 0 + limit: 0 + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "author": "string", + "composite": true, + "containingTemplates": [ + { + "composite": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "id": "string", + "language": "string", + "name": "string", + "projectName": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "version": "string" + } + ], + "createTime": 0, + "customParamsOrder": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "documentDatabase": true, + "failurePolicy": "string", + "id": "string", + "language": "string", + "lastUpdateTime": 0, + "latestVersionTime": 0, + "name": "string", + "parentTemplateId": "string", + "projectAssociated": true, + "projectId": "string", + "projectName": "string", + "rollbackTemplateContent": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "softwareType": "string", + "softwareVariant": "string", + "softwareVersion": "string", + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "validationErrors": { + "rollbackTemplateErrors": [ + {} + ], + "templateErrors": [ + {} + ], + "templateId": "string", + "templateVersion": "string" + }, + "version": "string", + "versionsInfo": [ + { + "author": "string", + "description": "string", + "id": "string", + "version": "string", + "versionComment": "string", + "versionTime": 0 + } + ] + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/threat_detail.py b/ansible_collections/cisco/dnac/plugins/modules/threat_detail.py new file mode 100644 index 00000000..110d0415 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/threat_detail.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: threat_detail +short_description: Resource module for Threat Detail +description: +- Manage operation create of the resource Threat Detail. +- The details for the Rogue and aWIPS threats. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + endTime: + description: End Time. + type: int + isNewThreat: + description: Is New Threat. + type: bool + limit: + description: Limit. + type: int + offset: + description: Offset. + type: int + siteId: + description: Site Id. + elements: str + type: list + startTime: + description: Start Time. + type: int + threatLevel: + description: Threat Level. + elements: str + type: list + threatType: + description: Threat Type. + elements: str + type: list +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + devices.Devices.threat_details, + + - Paths used are + post /dna/intent/api/v1/security/threats/details, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.threat_detail: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + endTime: 0 + isNewThreat: true + limit: 0 + offset: 0 + siteId: + - string + startTime: 0 + threatLevel: + - string + threatType: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "macAddress": "string", + "updatedTime": 0, + "vendor": "string", + "threatType": "string", + "threatLevel": "string", + "apName": "string", + "ssid": "string", + "siteNameHierarchy": "string" + } + ], + "totalCount": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/threat_detail_count.py b/ansible_collections/cisco/dnac/plugins/modules/threat_detail_count.py new file mode 100644 index 00000000..a329faed --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/threat_detail_count.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: threat_detail_count +short_description: Resource module for Threat Detail Count +description: +- Manage operation create of the resource Threat Detail Count. +- The details count for the Rogue and aWIPS threats. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + endTime: + description: End Time. + type: int + isNewThreat: + description: Is New Threat. + type: bool + limit: + description: Limit. + type: int + offset: + description: Offset. + type: int + siteId: + description: Site Id. + elements: str + type: list + startTime: + description: Start Time. + type: int + threatLevel: + description: Threat Level. + elements: str + type: list + threatType: + description: Threat Type. + elements: str + type: list +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + devices.Devices.threat_detail_count, + + - Paths used are + post /dna/intent/api/v1/security/threats/details/count, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.threat_detail_count: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + endTime: 0 + isNewThreat: true + limit: 0 + offset: 0 + siteId: + - string + startTime: 0 + threatLevel: + - string + threatType: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": 0, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/threat_summary.py b/ansible_collections/cisco/dnac/plugins/modules/threat_summary.py new file mode 100644 index 00000000..66c4613c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/threat_summary.py @@ -0,0 +1,91 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: threat_summary +short_description: Resource module for Threat Summary +description: +- Manage operation create of the resource Threat Summary. +- The Threat Summary for the Rogues and aWIPS. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + endTime: + description: End Time. + type: int + siteId: + description: Site Id. + elements: str + type: list + startTime: + description: Start Time. + type: int + threatLevel: + description: Threat Level. + elements: str + type: list + threatType: + description: Threat Type. + elements: str + type: list +requirements: +- dnacentersdk >= 2.4.9 +- python >= 3.5 +notes: + - SDK Method used are + devices.Devices.threat_summary, + + - Paths used are + post /dna/intent/api/v1/security/threats/summary, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.threat_summary: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + endTime: 0 + siteId: + - string + startTime: 0 + threatLevel: + - string + threatType: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "timestamp": 0, + "threatData": [ + { + "threatType": "string", + "threatLevel": "string", + "threatCount": 0 + } + ] + } + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/topology_layer_2_info.py b/ansible_collections/cisco/dnac/plugins/modules/topology_layer_2_info.py new file mode 100644 index 00000000..2d932400 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/topology_layer_2_info.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: topology_layer_2_info +short_description: Information module for Topology Layer 2 +description: +- Get Topology Layer 2 by id. +- Returns Layer 2 network topology by specified VLAN ID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + vlanID: + description: + - VlanID path parameter. Vlan Name for e.g Vlan1, Vlan23 etc. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Topology GetTopologyDetails + description: Complete reference of the GetTopologyDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-topology-details +notes: + - SDK Method used are + topology.Topology.get_topology_details, + + - Paths used are + get /dna/intent/api/v1/topology/l2/{vlanID}, + +""" + +EXAMPLES = r""" +- name: Get Topology Layer 2 by id + cisco.dnac.topology_layer_2_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + vlanID: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "id": "string", + "links": [ + { + "additionalInfo": {}, + "endPortID": "string", + "endPortIpv4Address": "string", + "endPortIpv4Mask": "string", + "endPortName": "string", + "endPortSpeed": "string", + "greyOut": true, + "id": "string", + "linkStatus": "string", + "source": "string", + "startPortID": "string", + "startPortIpv4Address": "string", + "startPortIpv4Mask": "string", + "startPortName": "string", + "startPortSpeed": "string", + "tag": "string", + "target": "string" + } + ], + "nodes": [ + { + "aclApplied": true, + "additionalInfo": {}, + "customParam": { + "id": "string", + "label": "string", + "parentNodeId": "string", + "x": 0, + "y": 0 + }, + "dataPathId": "string", + "deviceType": "string", + "family": "string", + "fixed": true, + "greyOut": true, + "id": "string", + "ip": "string", + "label": "string", + "networkType": "string", + "nodeType": "string", + "order": 0, + "osType": "string", + "platformId": "string", + "role": "string", + "roleSource": "string", + "softwareVersion": "string", + "tags": [ + "string" + ], + "upperNode": "string", + "userId": "string", + "vlanId": "string", + "x": 0, + "y": 0 + } + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/topology_layer_3_info.py b/ansible_collections/cisco/dnac/plugins/modules/topology_layer_3_info.py new file mode 100644 index 00000000..fc09e3f5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/topology_layer_3_info.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: topology_layer_3_info +short_description: Information module for Topology Layer 3 +description: +- Get Topology Layer 3 by id. +- Returns the Layer 3 network topology by routing protocol. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + topologyType: + description: + - TopologyType path parameter. Type of topology(OSPF,ISIS,etc). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Topology GetL3TopologyDetails + description: Complete reference of the GetL3TopologyDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-l-3-topology-details +notes: + - SDK Method used are + topology.Topology.get_l3_topology_details, + + - Paths used are + get /dna/intent/api/v1/topology/l3/{topologyType}, + +""" + +EXAMPLES = r""" +- name: Get Topology Layer 3 by id + cisco.dnac.topology_layer_3_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + topologyType: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "id": "string", + "links": [ + { + "additionalInfo": {}, + "endPortID": "string", + "endPortIpv4Address": "string", + "endPortIpv4Mask": "string", + "endPortName": "string", + "endPortSpeed": "string", + "greyOut": true, + "id": "string", + "linkStatus": "string", + "source": "string", + "startPortID": "string", + "startPortIpv4Address": "string", + "startPortIpv4Mask": "string", + "startPortName": "string", + "startPortSpeed": "string", + "tag": "string", + "target": "string" + } + ], + "nodes": [ + { + "aclApplied": true, + "additionalInfo": {}, + "customParam": { + "id": "string", + "label": "string", + "parentNodeId": "string", + "x": 0, + "y": 0 + }, + "dataPathId": "string", + "deviceType": "string", + "family": "string", + "fixed": true, + "greyOut": true, + "id": "string", + "ip": "string", + "label": "string", + "networkType": "string", + "nodeType": "string", + "order": 0, + "osType": "string", + "platformId": "string", + "role": "string", + "roleSource": "string", + "softwareVersion": "string", + "tags": [ + "string" + ], + "upperNode": "string", + "userId": "string", + "vlanId": "string", + "x": 0, + "y": 0 + } + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/topology_network_health_info.py b/ansible_collections/cisco/dnac/plugins/modules/topology_network_health_info.py new file mode 100644 index 00000000..907a87c5 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/topology_network_health_info.py @@ -0,0 +1,107 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: topology_network_health_info +short_description: Information module for Topology Network Health +description: +- Get all Topology Network Health. +- > + Returns Overall Network Health information by Device category Access, Distribution, Core, Router, Wireless for any + given point of time. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + timestamp: + description: + - Timestamp query parameter. Epoch time(in milliseconds) when the Network health data is required. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Topology GetOverallNetworkHealth + description: Complete reference of the GetOverallNetworkHealth API. + link: https://developer.cisco.com/docs/dna-center/#!get-overall-network-health +notes: + - SDK Method used are + topology.Topology.get_overall_network_health, + + - Paths used are + get /dna/intent/api/v1/network-health, + +""" + +EXAMPLES = r""" +- name: Get all Topology Network Health + cisco.dnac.topology_network_health_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + timestamp: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "version": "string", + "response": [ + { + "time": "string", + "healthScore": 0, + "totalCount": 0, + "goodCount": 0, + "unmonCount": 0, + "fairCount": 0, + "badCount": 0, + "entity": {}, + "timeinMillis": 0 + } + ], + "measuredBy": "string", + "latestMeasuredByEntity": {}, + "latestHealthScore": 0, + "monitoredDevices": 0, + "monitoredHealthyDevices": 0, + "monitoredUnHealthyDevices": 0, + "unMonitoredDevices": 0, + "healthDistirubution": [ + { + "category": "string", + "totalCount": 0, + "healthScore": 0, + "goodPercentage": 0, + "badPercentage": 0, + "fairPercentage": 0, + "unmonPercentage": 0, + "goodCount": 0, + "badCount": 0, + "fairCount": 0, + "unmonCount": 0, + "kpiMetrics": [ + {} + ] + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/topology_physical_info.py b/ansible_collections/cisco/dnac/plugins/modules/topology_physical_info.py new file mode 100644 index 00000000..89afc87f --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/topology_physical_info.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: topology_physical_info +short_description: Information module for Topology Physical +description: +- Get all Topology Physical. +- Returns the raw physical topology by specified criteria of nodeType. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + nodeType: + description: + - NodeType query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Topology GetPhysicalTopology + description: Complete reference of the GetPhysicalTopology API. + link: https://developer.cisco.com/docs/dna-center/#!get-physical-topology +notes: + - SDK Method used are + topology.Topology.get_physical_topology, + + - Paths used are + get /dna/intent/api/v1/topology/physical-topology, + +""" + +EXAMPLES = r""" +- name: Get all Topology Physical + cisco.dnac.topology_physical_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + nodeType: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "id": "string", + "links": [ + { + "additionalInfo": {}, + "endPortID": "string", + "endPortIpv4Address": "string", + "endPortIpv4Mask": "string", + "endPortName": "string", + "endPortSpeed": "string", + "greyOut": true, + "id": "string", + "linkStatus": "string", + "source": "string", + "startPortID": "string", + "startPortIpv4Address": "string", + "startPortIpv4Mask": "string", + "startPortName": "string", + "startPortSpeed": "string", + "tag": "string", + "target": "string" + } + ], + "nodes": [ + { + "aclApplied": true, + "additionalInfo": {}, + "customParam": { + "id": "string", + "label": "string", + "parentNodeId": "string", + "x": 0, + "y": 0 + }, + "dataPathId": "string", + "deviceType": "string", + "family": "string", + "fixed": true, + "greyOut": true, + "id": "string", + "ip": "string", + "label": "string", + "networkType": "string", + "nodeType": "string", + "order": 0, + "osType": "string", + "platformId": "string", + "role": "string", + "roleSource": "string", + "softwareVersion": "string", + "tags": [ + "string" + ], + "upperNode": "string", + "userId": "string", + "vlanId": "string", + "x": 0, + "y": 0 + } + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/topology_site_info.py b/ansible_collections/cisco/dnac/plugins/modules/topology_site_info.py new file mode 100644 index 00000000..034c84c9 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/topology_site_info.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: topology_site_info +short_description: Information module for Topology Site +description: +- Get all Topology Site. +- Returns site topology. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Topology GetSiteTopology + description: Complete reference of the GetSiteTopology API. + link: https://developer.cisco.com/docs/dna-center/#!get-site-topology +notes: + - SDK Method used are + topology.Topology.get_site_topology, + + - Paths used are + get /dna/intent/api/v1/topology/site-topology, + +""" + +EXAMPLES = r""" +- name: Get all Topology Site + cisco.dnac.topology_site_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "sites": [ + { + "displayName": "string", + "groupNameHierarchy": "string", + "id": "string", + "latitude": "string", + "locationAddress": "string", + "locationCountry": "string", + "locationType": "string", + "longitude": "string", + "name": "string", + "parentId": "string" + } + ] + }, + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/topology_vlan_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/topology_vlan_details_info.py new file mode 100644 index 00000000..c8585d26 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/topology_vlan_details_info.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: topology_vlan_details_info +short_description: Information module for Topology Vlan Details +description: +- Get all Topology Vlan Details. +- Returns the list of VLAN names. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Topology GetVLANDetails + description: Complete reference of the GetVLANDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-vlan-details +notes: + - SDK Method used are + topology.Topology.get_vlan_details, + + - Paths used are + get /dna/intent/api/v1/topology/vlan/vlan-names, + +""" + +EXAMPLES = r""" +- name: Get all Topology Vlan Details + cisco.dnac.topology_vlan_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + "string" + ], + "version": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/transit_peer_network.py b/ansible_collections/cisco/dnac/plugins/modules/transit_peer_network.py new file mode 100644 index 00000000..29c9889c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/transit_peer_network.py @@ -0,0 +1,121 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: transit_peer_network +short_description: Resource module for Transit Peer Network +description: +- Manage operations create and delete of the resource Transit Peer Network. +- Add Transit Peer Network in SD-Access. +- Delete Transit Peer Network from SD-Access. +version_added: '6.5.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + ipTransitSettings: + description: Transit Peer Network's ipTransitSettings. + suboptions: + autonomousSystemNumber: + description: Autonomous System Number (e.g.,1-65535). + type: str + routingProtocolName: + description: Routing Protocol Name. + type: str + type: dict + sdaTransitSettings: + description: Transit Peer Network's sdaTransitSettings. + suboptions: + transitControlPlaneSettings: + description: Transit Peer Network's transitControlPlaneSettings. + elements: dict + suboptions: + deviceManagementIpAddress: + description: Device Management Ip Address of provisioned device. + type: str + siteNameHierarchy: + description: Site Name Hierarchy where device is provisioned. + type: str + type: list + type: dict + transitPeerNetworkName: + description: TransitPeerNetworkName query parameter. Transit Peer Network Name. + type: str + transitPeerNetworkType: + description: Transit Peer Network Type. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for AddTransitPeerNetwork + description: Complete reference of the AddTransitPeerNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!add-transit-peer-network +- name: Cisco DNA Center documentation for DeleteTransitPeerNetwork + description: Complete reference of the DeleteTransitPeerNetwork API. + link: https://developer.cisco.com/docs/dna-center/#!delete-transit-peer-network +notes: + - SDK Method used are + ..add_transit_peer_network, + ..delete_transit_peer_network, + + - Paths used are + post /dna/intent/api/v1/business/sda/transit-peer-network, + delete /dna/intent/api/v1/business/sda/transit-peer-network, + +""" + +EXAMPLES = r""" +- name: Delete all + cisco.dnac.transit_peer_network: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + transitPeerNetworkName: string + +- name: Create + cisco.dnac.transit_peer_network: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + ipTransitSettings: + autonomousSystemNumber: string + routingProtocolName: string + sdaTransitSettings: + transitControlPlaneSettings: + - deviceManagementIpAddress: string + siteNameHierarchy: string + transitPeerNetworkName: string + transitPeerNetworkType: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "status": "string", + "description": "string", + "taskId": "string", + "taskStatusUrl": "string", + "executionStatusUrl": "string", + "executionId": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/transit_peer_network_info.py b/ansible_collections/cisco/dnac/plugins/modules/transit_peer_network_info.py new file mode 100644 index 00000000..0f3e053d --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/transit_peer_network_info.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: transit_peer_network_info +short_description: Information module for Transit Peer Network +description: +- Get all Transit Peer Network. +- Get Transit Peer Network Info from SD-Access. +version_added: '6.5.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + transitPeerNetworkName: + description: + - TransitPeerNetworkName query parameter. Transit or Peer Network Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for GetTransitPeerNetworkInfo + description: Complete reference of the GetTransitPeerNetworkInfo API. + link: https://developer.cisco.com/docs/dna-center/#!get-transit-peer-network-info +notes: + - SDK Method used are + ..get_transit_peer_network_info, + + - Paths used are + get /dna/intent/api/v1/business/sda/transit-peer-network, + +""" + +EXAMPLES = r""" +- name: Get all Transit Peer Network + cisco.dnac.transit_peer_network_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + transitPeerNetworkName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "transitPeerNetworkName": "string", + "transitPeerNetworkType": "string", + "ipTransitSettings": { + "routingProtocolName": "string", + "autonomousSystemNumber": "string" + }, + "sdaTransitSettings": { + "transitControlPlaneSettings": [ + { + "siteNameHierarchy": "string", + "deviceManagementIpAddress": "string" + } + ] + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/user_enrichment_details_info.py b/ansible_collections/cisco/dnac/plugins/modules/user_enrichment_details_info.py new file mode 100644 index 00000000..246dd7a8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/user_enrichment_details_info.py @@ -0,0 +1,174 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: user_enrichment_details_info +short_description: Information module for User Enrichment Details +description: +- Get all User Enrichment Details. +- > + Enriches a given network End User context a network user-id or end user's device Mac Address with details about + the user and devices that the user is connected to. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Users GetUserEnrichmentDetails + description: Complete reference of the GetUserEnrichmentDetails API. + link: https://developer.cisco.com/docs/dna-center/#!get-user-enrichment-details +notes: + - SDK Method used are + users.Users.get_user_enrichment_details, + + - Paths used are + get /dna/intent/api/v1/user-enrichment-details, + +""" + +EXAMPLES = r""" +- name: Get all User Enrichment Details + cisco.dnac.user_enrichment_details_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "userDetails": { + "id": "string", + "connectionStatus": "string", + "hostType": "string", + "userId": {}, + "hostName": {}, + "hostOs": {}, + "hostVersion": {}, + "subType": "string", + "lastUpdated": 0, + "healthScore": [ + { + "healthType": "string", + "reason": "string", + "score": 0 + } + ], + "hostMac": "string", + "hostIpV4": "string", + "hostIpV6": [ + {} + ], + "authType": {}, + "vlanId": "string", + "ssid": {}, + "frequency": {}, + "channel": {}, + "apGroup": {}, + "location": {}, + "clientConnection": "string", + "connectedDevice": [ + {} + ], + "issueCount": 0, + "rssi": {}, + "avgRssi": {}, + "snr": {}, + "avgSnr": {}, + "dataRate": {}, + "txBytes": {}, + "rxBytes": {}, + "dnsSuccess": {}, + "dnsFailure": {}, + "onboarding": { + "averageRunDuration": {}, + "maxRunDuration": {}, + "averageAssocDuration": {}, + "maxAssocDuration": {}, + "averageAuthDuration": {}, + "maxAuthDuration": {}, + "averageDhcpDuration": {}, + "maxDhcpDuration": {}, + "aaaServerIp": {}, + "dhcpServerIp": {} + }, + "onboardingTime": {}, + "port": {} + }, + "connectedDevice": [ + { + "deviceDetails": { + "family": "string", + "type": "string", + "location": {}, + "errorCode": {}, + "macAddress": "string", + "role": "string", + "apManagerInterfaceIp": "string", + "associatedWlcIp": "string", + "bootDateTime": "string", + "collectionStatus": "string", + "interfaceCount": "string", + "lineCardCount": "string", + "lineCardId": "string", + "managementIpAddress": "string", + "memorySize": "string", + "platformId": "string", + "reachabilityFailureReason": "string", + "reachabilityStatus": "string", + "snmpContact": "string", + "snmpLocation": "string", + "tunnelUdpPort": {}, + "waasDeviceMode": {}, + "series": "string", + "inventoryStatusDetail": "string", + "collectionInterval": "string", + "serialNumber": "string", + "softwareVersion": "string", + "roleSource": "string", + "hostname": "string", + "upTime": "string", + "lastUpdateTime": 0, + "errorDescription": {}, + "locationName": {}, + "tagCount": "string", + "lastUpdated": "string", + "instanceUuid": "string", + "id": "string", + "neighborTopology": [ + { + "errorCode": 0, + "message": "string", + "detail": "string" + } + ] + } + } + ] + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface.py new file mode 100644 index 00000000..fa60de9c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface.py @@ -0,0 +1,91 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_dynamic_interface +short_description: Resource module for Wireless Dynamic Interface +description: +- Manage operations create and delete of the resource Wireless Dynamic Interface. +- API to create or update an dynamic interface. +- Delete a dynamic interface. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + interfaceName: + description: Dynamic-interface name. + type: str + vlanId: + description: Vlan Id. + type: int +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless CreateUpdateDynamicInterface + description: Complete reference of the CreateUpdateDynamicInterface API. + link: https://developer.cisco.com/docs/dna-center/#!create-update-dynamic-interface +- name: Cisco DNA Center documentation for Wireless DeleteDynamicInterface + description: Complete reference of the DeleteDynamicInterface API. + link: https://developer.cisco.com/docs/dna-center/#!delete-dynamic-interface +notes: + - SDK Method used are + wireless.Wireless.create_update_dynamic_interface, + wireless.Wireless.delete_dynamic_interface, + + - Paths used are + post /dna/intent/api/v1/wireless/dynamic-interface, + delete /dna/intent/api/v1/wireless/dynamic-interface/{interfaceName}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_dynamic_interface: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + headers: '{{my_headers | from_json}}' + interfaceName: string + vlanId: 0 + +- name: Delete by name + cisco.dnac.wireless_dynamic_interface: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + headers: '{{my_headers | from_json}}' + interfaceName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface_info.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface_info.py new file mode 100644 index 00000000..d1736fb2 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_dynamic_interface_info.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_dynamic_interface_info +short_description: Information module for Wireless Dynamic Interface +description: +- Get all Wireless Dynamic Interface. +- Get one or all dynamic interfaces. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + interface_name: + description: + - > + Interface-name query parameter. Dynamic-interface name, if not specified all the existing dynamic interfaces + will be retrieved. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless GetDynamicInterface + description: Complete reference of the GetDynamicInterface API. + link: https://developer.cisco.com/docs/dna-center/#!get-dynamic-interface +notes: + - SDK Method used are + wireless.Wireless.get_dynamic_interface, + + - Paths used are + get /dna/intent/api/v1/wireless/dynamic-interface, + +""" + +EXAMPLES = r""" +- name: Get all Wireless Dynamic Interface + cisco.dnac.wireless_dynamic_interface_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + interface_name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "interfaceName": "string", + "vlanId": 0 + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid.py new file mode 100644 index 00000000..eb879038 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid.py @@ -0,0 +1,197 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_enterprise_ssid +short_description: Resource module for Wireless Enterprise Ssid +description: +- Manage operations create, update and delete of the resource Wireless Enterprise Ssid. +- Creates enterprise SSID. +- Deletes given enterprise SSID. +- Update enterprise SSID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + basicServiceSetClientIdleTimeout: + description: Basic Service Set Client Idle Timeout. + type: int + clientExclusionTimeout: + description: Client Exclusion Timeout. + type: int + enableBasicServiceSetMaxIdle: + description: Enable Basic Service Set Max Idle. + type: bool + enableBroadcastSSID: + description: Enable Broadcase SSID. + type: bool + enableClientExclusion: + description: Enable Client Exclusion. + type: bool + enableDirectedMulticastService: + description: Enable Directed Multicast Service. + type: bool + enableFastLane: + description: Enable FastLane. + type: bool + enableMACFiltering: + description: Enable MAC Filtering. + type: bool + enableNeighborList: + description: Enable Neighbor List. + type: bool + enableSessionTimeOut: + description: Enable Session Timeout. + type: bool + fastTransition: + description: Fast Transition. + type: str + mfpClientProtection: + description: Management Frame Protection Client. + type: str + name: + description: SSID NAME. + type: str + nasOptions: + description: Nas Options. + elements: str + type: list + passphrase: + description: Passphrase. + type: str + radioPolicy: + description: Radio Policy Enum (enum Triple band operation (2.4GHz, 5GHz and 6GHz), + Triple band operation with band select, 5GHz only, 2.4GHz only, 6GHz only). + type: str + securityLevel: + description: Security Level. + type: str + sessionTimeOut: + description: Session Time Out. + type: int + ssidName: + description: SsidName path parameter. Enter the SSID name to be deleted. + type: str + trafficType: + description: Traffic Type Enum (voicedata or data ). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless CreateEnterpriseSSID + description: Complete reference of the CreateEnterpriseSSID API. + link: https://developer.cisco.com/docs/dna-center/#!create-enterprise-ssid +- name: Cisco DNA Center documentation for Wireless DeleteEnterpriseSSID + description: Complete reference of the DeleteEnterpriseSSID API. + link: https://developer.cisco.com/docs/dna-center/#!delete-enterprise-ssid +- name: Cisco DNA Center documentation for Wireless UpdateEnterpriseSSID + description: Complete reference of the UpdateEnterpriseSSID API. + link: https://developer.cisco.com/docs/dna-center/#!update-enterprise-ssid +notes: + - SDK Method used are + wireless.Wireless.create_enterprise_ssid, + wireless.Wireless.delete_enterprise_ssid, + wireless.Wireless.update_enterprise_ssid, + + - Paths used are + post /dna/intent/api/v1/enterprise-ssid, + delete /dna/intent/api/v1/enterprise-ssid/{ssidName}, + put /dna/intent/api/v1/enterprise-ssid, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_enterprise_ssid: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + basicServiceSetClientIdleTimeout: 0 + clientExclusionTimeout: 0 + enableBasicServiceSetMaxIdle: true + enableBroadcastSSID: true + enableClientExclusion: true + enableDirectedMulticastService: true + enableFastLane: true + enableMACFiltering: true + enableNeighborList: true + enableSessionTimeOut: true + fastTransition: string + mfpClientProtection: string + name: string + nasOptions: + - string + passphrase: string + radioPolicy: string + securityLevel: string + sessionTimeOut: 0 + trafficType: string + +- name: Update all + cisco.dnac.wireless_enterprise_ssid: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + basicServiceSetClientIdleTimeout: 0 + clientExclusionTimeout: 0 + enableBasicServiceSetMaxIdle: true + enableBroadcastSSID: true + enableClientExclusion: true + enableDirectedMulticastService: true + enableFastLane: true + enableMACFiltering: true + enableNeighborList: true + enableSessionTimeOut: true + fastTransition: string + mfpClientProtection: string + name: string + nasOptions: + - string + passphrase: string + radioPolicy: string + securityLevel: string + sessionTimeOut: 0 + trafficType: string + +- name: Delete by name + cisco.dnac.wireless_enterprise_ssid: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + ssidName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid_info.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid_info.py new file mode 100644 index 00000000..8e4a9b52 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_enterprise_ssid_info.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_enterprise_ssid_info +short_description: Information module for Wireless Enterprise Ssid +description: +- Get all Wireless Enterprise Ssid. +- Gets either one or all the enterprise SSID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + ssidName: + description: + - > + SsidName query parameter. Enter the enterprise SSID name that needs to be retrieved. If not entered, all the + enterprise SSIDs will be retrieved. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless GetEnterpriseSSID + description: Complete reference of the GetEnterpriseSSID API. + link: https://developer.cisco.com/docs/dna-center/#!get-enterprise-ssid +notes: + - SDK Method used are + wireless.Wireless.get_enterprise_ssid, + + - Paths used are + get /dna/intent/api/v1/enterprise-ssid, + +""" + +EXAMPLES = r""" +- name: Get all Wireless Enterprise Ssid + cisco.dnac.wireless_enterprise_ssid_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + ssidName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "instanceUuid": "string", + "version": 0, + "ssidDetails": [ + { + "name": "string", + "wlanType": "string", + "enableFastLane": true, + "securityLevel": "string", + "authServer": "string", + "passphrase": "string", + "trafficType": "string", + "enableMACFiltering": true, + "isEnabled": true, + "isFabric": true, + "fastTransition": "string", + "radioPolicy": "string", + "enableBroadcastSSID": true, + "nasOptions": [ + "string" + ] + } + ], + "groupUuid": "string", + "inheritedGroupUuid": "string", + "inheritedGroupName": "string" + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_profile.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_profile.py new file mode 100644 index 00000000..33cb7ecb --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_profile.py @@ -0,0 +1,162 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_profile +short_description: Resource module for Wireless Profile +description: +- Manage operations create, update and delete of the resource Wireless Profile. +- Creates Wireless Network Profile on Cisco DNA Center and associates sites and SSIDs to it. +- Delete the Wireless Profile from Cisco DNA Center whose name is provided. +- > + Updates the wireless Network Profile with updated details provided. All sites to be present in the network profile + should be provided. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + profileDetails: + description: Wireless Profile's profileDetails. + suboptions: + name: + description: Profile Name. + type: str + sites: + description: Array of site name hierarchies(eg "Global/aaa/zzz", "Global/aaa/zzz"). + elements: str + type: list + ssidDetails: + description: Wireless Profile's ssidDetails. + elements: dict + suboptions: + enableFabric: + description: True is ssid is fabric else false. + type: bool + flexConnect: + description: Wireless Profile's flexConnect. + suboptions: + enableFlexConnect: + description: True if flex connect is enabled else false. + type: bool + localToVlan: + description: Local To Vlan. + type: int + type: dict + interfaceName: + description: Interface Name. + type: str + name: + description: Ssid Name. + type: str + type: + description: Ssid Type(enum Enterprise/Guest). + type: str + type: list + type: dict + wirelessProfileName: + description: WirelessProfileName path parameter. Wireless Profile Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless CreateWirelessProfile + description: Complete reference of the CreateWirelessProfile API. + link: https://developer.cisco.com/docs/dna-center/#!create-wireless-profile +- name: Cisco DNA Center documentation for Wireless DeleteWirelessProfile + description: Complete reference of the DeleteWirelessProfile API. + link: https://developer.cisco.com/docs/dna-center/#!delete-wireless-profile +- name: Cisco DNA Center documentation for Wireless UpdateWirelessProfile + description: Complete reference of the UpdateWirelessProfile API. + link: https://developer.cisco.com/docs/dna-center/#!update-wireless-profile +notes: + - SDK Method used are + wireless.Wireless.create_wireless_profile, + wireless.Wireless.delete_wireless_profile, + wireless.Wireless.update_wireless_profile, + + - Paths used are + post /dna/intent/api/v1/wireless/profile, + delete /dna/intent/api/v1/wireless-profile/{wirelessProfileName}, + put /dna/intent/api/v1/wireless/profile, + +""" + +EXAMPLES = r""" +- name: Delete by name + cisco.dnac.wireless_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + wirelessProfileName: string + +- name: Update all + cisco.dnac.wireless_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + profileDetails: + name: string + sites: + - string + ssidDetails: + - enableFabric: true + flexConnect: + enableFlexConnect: true + localToVlan: 0 + interfaceName: string + name: string + type: string + +- name: Create + cisco.dnac.wireless_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + profileDetails: + name: string + sites: + - string + ssidDetails: + - enableFabric: true + flexConnect: + enableFlexConnect: true + localToVlan: 0 + interfaceName: string + name: string + type: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_profile_info.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_profile_info.py new file mode 100644 index 00000000..f88760c1 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_profile_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_profile_info +short_description: Information module for Wireless Profile +description: +- Get all Wireless Profile. +- Gets either one or all the wireless network profiles if no name is provided for network-profile. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + profileName: + description: + - ProfileName query parameter. Wireless Network Profile Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless GetWirelessProfile + description: Complete reference of the GetWirelessProfile API. + link: https://developer.cisco.com/docs/dna-center/#!get-wireless-profile +notes: + - SDK Method used are + wireless.Wireless.get_wireless_profile, + + - Paths used are + get /dna/intent/api/v1/wireless/profile, + +""" + +EXAMPLES = r""" +- name: Get all Wireless Profile + cisco.dnac.wireless_profile_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + profileName: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "profileDetails": { + "name": "string", + "sites": [ + "string" + ], + "ssidDetails": [ + { + "name": "string", + "type": "string", + "enableFabric": true, + "flexConnect": { + "enableFlexConnect": true, + "localToVlan": 0 + }, + "interfaceName": "string" + } + ] + } + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_access_point.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_access_point.py new file mode 100644 index 00000000..c7913ce8 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_access_point.py @@ -0,0 +1,99 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_provision_access_point +short_description: Resource module for Wireless Provision Access Point +description: +- Manage operation create of the resource Wireless Provision Access Point. +- Access Point Provision and ReProvision. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + payload: + description: Wireless Provision Access Point's payload. + elements: dict + suboptions: + customApGroupName: + description: Custom AP group name. + type: str + customFlexGroupName: + description: '"Custom flex group name".' + elements: str + type: list + deviceName: + description: Device name. + type: str + rfProfile: + description: Radio frequency profile name. + type: str + siteId: + description: Site name hierarchy(ex Global/...). + type: str + siteNameHierarchy: + description: Site name hierarchy(ex Global/...). + type: str + type: + description: ApWirelessConfiguration. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless APProvision + description: Complete reference of the APProvision API. + link: https://developer.cisco.com/docs/dna-center/#!a-p-provision +notes: + - SDK Method used are + wireless.Wireless.ap_provision, + + - Paths used are + post /dna/intent/api/v1/wireless/ap-provision, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_provision_access_point: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + payload: + - customApGroupName: string + customFlexGroupName: + - string + deviceName: string + rfProfile: string + siteId: string + siteNameHierarchy: string + type: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_create.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_create.py new file mode 100644 index 00000000..d626052a --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_create.py @@ -0,0 +1,116 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_provision_device_create +short_description: Resource module for Wireless Provision Device Create +description: +- Manage operation create of the resource Wireless Provision Device Create. +- Provision wireless devices. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Wireless Provision Device Create's payload. + elements: dict + suboptions: + deviceName: + description: Controller Name. + type: str + dynamicInterfaces: + description: Wireless Provision Device Create's dynamicInterfaces. + elements: dict + suboptions: + interfaceGateway: + description: Interface Gateway. + type: str + interfaceIPAddress: + description: Interface IP Address. + type: str + interfaceName: + description: Interface Name. + type: str + interfaceNetmaskInCIDR: + description: Interface Netmask In CIDR. + type: int + lagOrPortNumber: + description: Lag Or Port Number. + type: int + vlanId: + description: VLAN ID. + type: int + type: list + managedAPLocations: + description: List of managed AP locations (Site Hierarchies). + elements: str + type: list + site: + description: Full Site Hierarchy where device has to be assigned. + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless Provision + description: Complete reference of the Provision API. + link: https://developer.cisco.com/docs/dna-center/#!provision +notes: + - SDK Method used are + wireless.Wireless.provision, + + - Paths used are + post /dna/intent/api/v1/wireless/provision, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_provision_device_create: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - deviceName: string + dynamicInterfaces: + - interfaceGateway: string + interfaceIPAddress: string + interfaceName: string + interfaceNetmaskInCIDR: 0 + lagOrPortNumber: 0 + vlanId: 0 + managedAPLocations: + - string + site: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionUrl": "string", + "provisioningTasks": { + "success": [ + "string" + ], + "failed": [ + "string" + ] + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_update.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_update.py new file mode 100644 index 00000000..07e983f3 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_device_update.py @@ -0,0 +1,116 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_provision_device_update +short_description: Resource module for Wireless Provision Device Update +description: +- Manage operation update of the resource Wireless Provision Device Update. +- Updates wireless provisioning. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + payload: + description: Wireless Provision Device Update's payload. + elements: dict + suboptions: + deviceName: + description: Device Name. + type: str + dynamicInterfaces: + description: Wireless Provision Device Update's dynamicInterfaces. + elements: dict + suboptions: + interfaceGateway: + description: Interface Gateway. + type: str + interfaceIPAddress: + description: Interface IPAddress. + type: str + interfaceName: + description: Interface Name. + type: str + interfaceNetmaskInCIDR: + description: Interface Netmask In CIDR. + type: int + lagOrPortNumber: + description: Lag Or Port Number. + type: int + vlanId: + description: Vlan Id. + type: int + type: list + managedAPLocations: + description: Managed APLocations. + elements: str + type: list + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless ProvisionUpdate + description: Complete reference of the ProvisionUpdate API. + link: https://developer.cisco.com/docs/dna-center/#!provision-update +notes: + - SDK Method used are + wireless.Wireless.provision_update, + + - Paths used are + put /dna/intent/api/v1/wireless/provision, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.wireless_provision_device_update: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + payload: + - deviceName: string + dynamicInterfaces: + - interfaceGateway: string + interfaceIPAddress: string + interfaceName: string + interfaceNetmaskInCIDR: 0 + lagOrPortNumber: 0 + vlanId: 0 + managedAPLocations: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionUrl": "string", + "provisioningTasks": { + "success": [ + "string" + ], + "failed": [ + "string" + ] + } + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_create_provision.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_create_provision.py new file mode 100644 index 00000000..075f6578 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_create_provision.py @@ -0,0 +1,140 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_provision_ssid_create_provision +short_description: Resource module for Wireless Provision Ssid Create Provision +description: +- Manage operation create of the resource Wireless Provision Ssid Create Provision. +- > + Creates SSID, updates the SSID to the corresponding site profiles and provision it to the devices matching the + given sites. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + enableFabric: + description: Enable SSID for Fabric. + type: bool + flexConnect: + description: Wireless Provision Ssid Create Provision's flexConnect. + suboptions: + enableFlexConnect: + description: Enable Flex Connect. + type: bool + localToVlan: + description: Local To Vlan (range is 1 to 4094). + type: int + type: dict + headers: + description: Additional headers. + type: dict + managedAPLocations: + description: Managed AP Locations (Enter entire Site(s) hierarchy). + elements: str + type: list + ssidDetails: + description: Wireless Provision Ssid Create Provision's ssidDetails. + suboptions: + enableBroadcastSSID: + description: Enable Broadcast SSID. + type: bool + enableFastLane: + description: Enable Fast Lane. + type: bool + enableMACFiltering: + description: Enable MAC Filtering. + type: bool + fastTransition: + description: Fast Transition. + type: str + name: + description: SSID Name. + type: str + passphrase: + description: Pass Phrase ( Only applicable for SSID with PERSONAL auth type + ). + type: str + radioPolicy: + description: Radio Policy. Allowed values are 'Dual band operation (2.4GHz and + 5GHz)', 'Dual band operation with band select', '5GHz only', '2.4GHz only'. + type: str + securityLevel: + description: Security Level(For guest SSID OPEN/WEB_AUTH, For Enterprise SSID + ENTERPRISE/PERSONAL/OPEN). + type: str + trafficType: + description: Traffic Type. + type: str + webAuthURL: + description: Web Auth URL. + type: str + type: dict + ssidType: + description: SSID Type. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless CreateAndProvisionSSID + description: Complete reference of the CreateAndProvisionSSID API. + link: https://developer.cisco.com/docs/dna-center/#!create-and-provision-ssid +notes: + - SDK Method used are + wireless.Wireless.create_and_provision_ssid, + + - Paths used are + post /dna/intent/api/v1/business/ssid, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_provision_ssid_create_provision: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + enableFabric: true + flexConnect: + enableFlexConnect: true + localToVlan: 0 + headers: '{{my_headers | from_json}}' + managedAPLocations: + - string + ssidDetails: + enableBroadcastSSID: true + enableFastLane: true + enableMACFiltering: true + fastTransition: string + name: string + passphrase: string + radioPolicy: string + securityLevel: string + trafficType: string + webAuthURL: string + ssidType: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_delete_reprovision.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_delete_reprovision.py new file mode 100644 index 00000000..fed3cb2c --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_provision_ssid_delete_reprovision.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_provision_ssid_delete_reprovision +short_description: Resource module for Wireless Provision Ssid Delete Reprovision +description: +- Manage operation delete of the resource Wireless Provision Ssid Delete Reprovision. +- Removes SSID or WLAN from the network profile, reprovision the devices and deletes the SSID or WLAN from DNA Center. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + managedAPLocations: + description: ManagedAPLocations path parameter. + type: str + ssidName: + description: SsidName path parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless DeleteSSIDAndProvisionItToDevices + description: Complete reference of the DeleteSSIDAndProvisionItToDevices API. + link: https://developer.cisco.com/docs/dna-center/#!delete-ssid-and-provision-it-to-devices +notes: + - SDK Method used are + wireless.Wireless.delete_ssid_and_provision_it_to_devices, + + - Paths used are + delete /dna/intent/api/v1/business/ssid/{ssidName}/{managedAPLocations}, + +""" + +EXAMPLES = r""" +- name: Delete by id + cisco.dnac.wireless_provision_ssid_delete_reprovision: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: '{{my_headers | from_json}}' + managedAPLocations: string + ssidName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_psk_override.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_psk_override.py new file mode 100644 index 00000000..55fc0d21 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_psk_override.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_psk_override +short_description: Resource module for Wireless Psk Override +description: +- Manage operation create of the resource Wireless Psk Override. +- Update/override pass phrase of enterprise SSID. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + payload: + description: Wireless Psk Override's payload. + elements: dict + suboptions: + passPhrase: + description: Pass phrase (create/update). + type: str + site: + description: Site name hierarchy (ex Global/aaa/zzz/...). + type: str + ssid: + description: Enterprise ssid name(already created/present). + type: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless PSKOverride + description: Complete reference of the PSKOverride API. + link: https://developer.cisco.com/docs/dna-center/#!p-sk-override +notes: + - SDK Method used are + wireless.Wireless.psk_override, + + - Paths used are + post /dna/intent/api/v1/wireless/psk-override, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_psk_override: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + payload: + - passPhrase: string + site: string + ssid: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionStatusUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile.py new file mode 100644 index 00000000..4aa97f65 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile.py @@ -0,0 +1,225 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_rf_profile +short_description: Resource module for Wireless Rf Profile +description: +- Manage operations create and delete of the resource Wireless Rf Profile. +- Create or Update RF profile. +- Delete RF profiles. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + channelWidth: + description: Channel Width. + type: str + defaultRfProfile: + description: Is Default Rf Profile. + type: bool + enableBrownField: + description: Enable Brown Field. + type: bool + enableCustom: + description: Enable Custom. + type: bool + enableRadioTypeA: + description: Enable Radio Type A. + type: bool + enableRadioTypeB: + description: Enable Radio Type B. + type: bool + enableRadioTypeC: + description: Enable Radio Type C (6GHz). + type: bool + name: + description: RF Profile Name. + type: str + radioTypeAProperties: + description: Wireless Rf Profile's radioTypeAProperties. + suboptions: + dataRates: + description: Data Rates. + type: str + mandatoryDataRates: + description: Mandatory Data Rates. + type: str + maxPowerLevel: + description: Max Power Level. + type: int + minPowerLevel: + description: Rx Sop Threshold. + type: int + parentProfile: + description: Parent Profile. + type: str + powerThresholdV1: + description: Power Threshold V1. + type: int + radioChannels: + description: Radio Channels. + type: str + rxSopThreshold: + description: Rx Sop Threshold. + type: str + type: dict + radioTypeBProperties: + description: Wireless Rf Profile's radioTypeBProperties. + suboptions: + dataRates: + description: Data Rates. + type: str + mandatoryDataRates: + description: Mandatory Data Rates. + type: str + maxPowerLevel: + description: Max Power Level. + type: int + minPowerLevel: + description: Min Power Level. + type: int + parentProfile: + description: Parent Profile. + type: str + powerThresholdV1: + description: Power Threshold V1. + type: int + radioChannels: + description: Radio Channels. + type: str + rxSopThreshold: + description: Rx Sop Threshold. + type: str + type: dict + radioTypeCProperties: + description: Wireless Rf Profile's radioTypeCProperties. + suboptions: + dataRates: + description: Data Rates. + type: str + mandatoryDataRates: + description: Mandatory Data Rates. + type: str + maxPowerLevel: + description: Max Power Level. + type: int + minPowerLevel: + description: Min Power Level. + type: int + parentProfile: + description: Parent Profile. + type: str + powerThresholdV1: + description: Power Threshold V1. + type: int + radioChannels: + description: Radio Channels. + type: str + rxSopThreshold: + description: Rx Sop Threshold. + type: str + type: dict + rfProfileName: + description: RfProfileName path parameter. RF profile name to be deleted(required) + *non-custom RF profile cannot be deleted. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless CreateOrUpdateRFProfile + description: Complete reference of the CreateOrUpdateRFProfile API. + link: https://developer.cisco.com/docs/dna-center/#!create-or-update-rf-profile +- name: Cisco DNA Center documentation for Wireless DeleteRFProfiles + description: Complete reference of the DeleteRFProfiles API. + link: https://developer.cisco.com/docs/dna-center/#!delete-rf-profiles +notes: + - SDK Method used are + wireless.Wireless.create_or_update_rf_profile, + wireless.Wireless.delete_rf_profiles, + + - Paths used are + post /dna/intent/api/v1/wireless/rf-profile, + delete /dna/intent/api/v1/wireless/rf-profile/{rfProfileName}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_rf_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: present + channelWidth: string + defaultRfProfile: true + enableBrownField: true + enableCustom: true + enableRadioTypeA: true + enableRadioTypeB: true + enableRadioTypeC: true + name: string + radioTypeAProperties: + dataRates: string + mandatoryDataRates: string + maxPowerLevel: 0 + minPowerLevel: 0 + parentProfile: string + powerThresholdV1: 0 + radioChannels: string + rxSopThreshold: string + radioTypeBProperties: + dataRates: string + mandatoryDataRates: string + maxPowerLevel: 0 + minPowerLevel: 0 + parentProfile: string + powerThresholdV1: 0 + radioChannels: string + rxSopThreshold: string + radioTypeCProperties: + dataRates: string + mandatoryDataRates: string + maxPowerLevel: 0 + minPowerLevel: 0 + parentProfile: string + powerThresholdV1: 0 + radioChannels: string + rxSopThreshold: string + +- name: Delete by name + cisco.dnac.wireless_rf_profile: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + state: absent + rfProfileName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "executionId": "string", + "executionUrl": "string", + "message": "string" + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile_info.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile_info.py new file mode 100644 index 00000000..722ddfc4 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_rf_profile_info.py @@ -0,0 +1,99 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_rf_profile_info +short_description: Information module for Wireless Rf Profile +description: +- Get all Wireless Rf Profile. +- Retrieve all RF profiles. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + rf_profile_name: + description: + - Rf-profile-name query parameter. RF Profile Name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless RetrieveRFProfiles + description: Complete reference of the RetrieveRFProfiles API. + link: https://developer.cisco.com/docs/dna-center/#!retrieve-rf-profiles +notes: + - SDK Method used are + wireless.Wireless.retrieve_rf_profiles, + + - Paths used are + get /dna/intent/api/v1/wireless/rf-profile, + +""" + +EXAMPLES = r""" +- name: Get all Wireless Rf Profile + cisco.dnac.wireless_rf_profile_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + rf_profile_name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "name": "string", + "parentProfileA": "string", + "parentProfileB": "string", + "enableARadioType": true, + "enableBRadioType": true, + "enableCRadioType": true, + "channelWidth": "string", + "aRadioChannels": "string", + "bRadioChannels": "string", + "cRadioChannels": "string", + "dataRatesA": "string", + "dataRatesB": "string", + "dataRatesC": "string", + "mandatoryDataRatesA": "string", + "mandatoryDataRatesB": "string", + "mandatoryDataRatesC": "string", + "enableCustom": true, + "minPowerLevelA": "string", + "minPowerLevelB": "string", + "minPowerLevelC": "string", + "maxPowerLevelA": "string", + "maxPowerLevelB": "string", + "powerThresholdV1A": 0, + "powerThresholdV1B": 0, + "powerThresholdV1C": 0, + "rxSopThresholdA": "string", + "rxSopThresholdB": "string", + "rxSopThresholdC": "string", + "defaultRfProfile": true, + "enableBrownField": true + } + ] +""" diff --git a/ansible_collections/cisco/dnac/plugins/modules/wireless_sensor_test_results_info.py b/ansible_collections/cisco/dnac/plugins/modules/wireless_sensor_test_results_info.py new file mode 100644 index 00000000..41d727dd --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/modules/wireless_sensor_test_results_info.py @@ -0,0 +1,148 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_sensor_test_results_info +short_description: Information module for Wireless Sensor Test Results +description: +- Get all Wireless Sensor Test Results. +- Intent API to get SENSOR test result summary. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. Assurance site UUID. + type: str + startTime: + description: + - StartTime query parameter. The epoch time in milliseconds. + type: int + endTime: + description: + - EndTime query parameter. The epoch time in milliseconds. + type: int + testFailureBy: + description: + - TestFailureBy query parameter. Obtain failure statistics group by "area", "building", or "floor". + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless SensorTestResults + description: Complete reference of the SensorTestResults API. + link: https://developer.cisco.com/docs/dna-center/#!sensor-test-results +notes: + - SDK Method used are + wireless.Wireless.sensor_test_results, + + - Paths used are + get /dna/intent/api/v1/AssuranceGetSensorTestResults, + +""" + +EXAMPLES = r""" +- name: Get all Wireless Sensor Test Results + cisco.dnac.wireless_sensor_test_results_info: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + headers: "{{my_headers | from_json}}" + siteId: string + startTime: 0 + endTime: 0 + testFailureBy: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "summary": { + "totalTestCount": 0, + "ONBOARDING": { + "AUTH": { + "passCount": 0, + "failCount": 0 + }, + "DHCP": { + "passCount": 0, + "failCount": 0 + }, + "ASSOC": { + "passCount": 0, + "failCount": 0 + } + }, + "PERFORMANCE": { + "IPSLASENDER": { + "passCount": 0, + "failCount": 0 + } + }, + "NETWORK_SERVICES": { + "DNS": { + "passCount": 0, + "failCount": 0 + } + }, + "APP_CONNECTIVITY": { + "HOST_REACHABILITY": { + "passCount": 0, + "failCount": 0 + }, + "WEBSERVER": { + "passCount": 0, + "failCount": 0 + }, + "FILETRANSFER": { + "passCount": 0, + "failCount": 0 + } + }, + "RF_ASSESSMENT": { + "DATA_RATE": { + "passCount": 0, + "failCount": 0 + }, + "SNR": { + "passCount": 0, + "failCount": 0 + } + }, + "EMAIL": { + "MAILSERVER": { + "passCount": 0, + "failCount": 0 + } + } + }, + "failureStats": [ + { + "errorCode": 0, + "errorTitle": "string", + "testType": "string", + "testCategory": "string" + } + ] + } +""" diff --git a/ansible_collections/cisco/dnac/plugins/plugin_utils/__init__.py b/ansible_collections/cisco/dnac/plugins/plugin_utils/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ansible_collections/cisco/dnac/plugins/plugin_utils/dnac.py b/ansible_collections/cisco/dnac/plugins/plugin_utils/dnac.py new file mode 100644 index 00000000..9df54705 --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/plugin_utils/dnac.py @@ -0,0 +1,245 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) + +__metaclass__ = type +try: + from dnacentersdk import api, exceptions +except ImportError: + DNAC_SDK_IS_INSTALLED = False +else: + DNAC_SDK_IS_INSTALLED = True +from ansible.module_utils.basic import AnsibleModule, env_fallback +from ansible.module_utils._text import to_native +try: + from ansible.errors import AnsibleActionFail +except ImportError: + ANSIBLE_ERRORS_INSTALLED = False +else: + ANSIBLE_ERRORS_INSTALLED = True +try: + import logging +except ImportError: + LOGGING_IN_STANDARD = False +else: + LOGGING_IN_STANDARD = True +import os.path + + +def is_list_complex(x): + return isinstance(x[0], dict) or isinstance(x[0], list) + + +def has_diff_elem(ls1, ls2): + return any((elem not in ls1 for elem in ls2)) + + +def compare_list(list1, list2): + len_list1 = len(list1) + len_list2 = len(list2) + if len_list1 != len_list2: + return False + + if len_list1 == 0: + return True + + attempt_std_cmp = list1 == list2 + if attempt_std_cmp: + return True + + if not is_list_complex(list1) and not is_list_complex(list2): + return set(list1) == set(list2) + + # Compare normally if it exceeds expected size * 2 (len_list1==len_list2) + MAX_SIZE_CMP = 100 + # Fail fast if elem not in list, thanks to any and generators + if len_list1 > MAX_SIZE_CMP: + return attempt_std_cmp + else: + # not changes 'has diff elem' to list1 != list2 ':lists are not equal' + has_diff_1 = has_diff_elem(list1, list2) + has_diff_2 = has_diff_elem(list2, list1) + return not has_diff_1 or not has_diff_2 + + +def fn_comp_key(k, dict1, dict2): + return dnac_compare_equality(dict1.get(k), dict2.get(k)) + + +def dnac_compare_equality(current_value, requested_value): + # print("dnac_compare_equality", current_value, requested_value) + if requested_value is None: + return True + if current_value is None: + return True + if isinstance(current_value, dict) and isinstance(requested_value, dict): + all_dict_params = list(current_value.keys()) + list(requested_value.keys()) + return not any((not fn_comp_key(param, current_value, requested_value) for param in all_dict_params)) + elif isinstance(current_value, list) and isinstance(requested_value, list): + return compare_list(current_value, requested_value) + else: + return current_value == requested_value + + +def simple_cmp(obj1, obj2): + return obj1 == obj2 + + +def get_dict_result(result, key, value, cmp_fn=simple_cmp): + if isinstance(result, list): + if len(result) == 1: + if isinstance(result[0], dict): + result = result[0] + if result.get(key) is not None and result.get(key) != value: + result = None + else: + result = None + else: + for item in result: + if isinstance(item, dict) and (item.get(key) is None or item.get(key) == value): + result = item + return result + result = None + elif not isinstance(result, dict): + result = None + elif result.get(key) is not None and result.get(key) != value: + result = None + return result + + +def dnac_argument_spec(): + argument_spec = dict( + dnac_host=dict(type="str", fallback=(env_fallback, ['DNAC_HOST']), required=True), + dnac_port=dict(type="int", fallback=(env_fallback, ['DNAC_PORT']), required=False, default=443), + dnac_username=dict(type="str", fallback=(env_fallback, ['DNAC_USERNAME']), default="admin", aliases=["user"]), + dnac_password=dict(type="str", fallback=(env_fallback, ['DNAC_PASSWORD']), no_log=True), + dnac_verify=dict(type="bool", fallback=(env_fallback, ['DNAC_VERIFY']), default=True), + dnac_version=dict(type="str", fallback=(env_fallback, ['DNAC_VERSION']), default="2.3.3.0"), + dnac_debug=dict(type="bool", fallback=(env_fallback, ['DNAC_DEBUG']), default=False), + validate_response_schema=dict(type="bool", fallback=(env_fallback, ['VALIDATE_RESPONSE_SCHEMA']), default=True), + ) + return argument_spec + + +class DNACSDK(object): + def __init__(self, params): + self.result = dict(changed=False, result="") + self.validate_response_schema = params.get("validate_response_schema") + if DNAC_SDK_IS_INSTALLED: + self.api = api.DNACenterAPI( + username=params.get("dnac_username"), + password=params.get("dnac_password"), + base_url="https://{dnac_host}:{dnac_port}".format( + dnac_host=params.get("dnac_host"), dnac_port=params.get("dnac_port") + ), + version=params.get("dnac_version"), + verify=params.get("dnac_verify"), + debug=params.get("dnac_debug"), + ) + if params.get("dnac_debug") and LOGGING_IN_STANDARD: + logging.getLogger('dnacentersdk').addHandler(logging.StreamHandler()) + else: + self.fail_json(msg="DNA Center Python SDK is not installed. Execute 'pip install dnacentersdk'") + + def changed(self): + self.result["changed"] = True + + def object_created(self): + self.changed() + self.result["result"] = "Object created" + + def object_updated(self): + self.changed() + self.result["result"] = "Object updated" + + def object_deleted(self): + self.changed() + self.result["result"] = "Object deleted" + + def object_already_absent(self): + self.result["result"] = "Object already absent" + + def object_already_present(self): + self.result["result"] = "Object already present" + + def object_present_and_different(self): + self.result["result"] = "Object already present, but it has different values to the requested" + + def object_modify_result(self, changed=None, result=None): + if result is not None: + self.result["result"] = result + if changed: + self.changed() + + def is_file(self, file_path): + return os.path.isfile(file_path) + + def extract_file_name(self, file_path): + return os.path.basename(file_path) + + def exec(self, family, function, params=None, op_modifies=False, **kwargs): + try: + family = getattr(self.api, family) + func = getattr(family, function) + except Exception as e: + self.fail_json(msg=e) + + try: + if params: + file_paths_params = kwargs.get('file_paths', []) + # This substitution is for the import file operation + if file_paths_params and isinstance(file_paths_params, list): + multipart_fields = {} + for (key, value) in file_paths_params: + if isinstance(params.get(key), str) and self.is_file(params[key]): + file_name = self.extract_file_name(params[key]) + file_path = params[key] + multipart_fields[value] = (file_name, open(file_path, 'rb')) + + params.setdefault("multipart_fields", multipart_fields) + params.setdefault("multipart_monitor_callback", None) + + if not self.validate_response_schema and op_modifies: + params["active_validation"] = False + + response = func(**params) + else: + response = func() + except exceptions.dnacentersdkException as e: + self.fail_json( + msg=( + "An error occured when executing operation." + " The error was: {error}" + ).format(error=to_native(e)) + ) + return response + + def fail_json(self, msg, **kwargs): + self.result.update(**kwargs) + raise AnsibleActionFail(msg, kwargs) + + def exit_json(self): + return self.result + + def verify_array(self, verify_interface, **kwargs): + if type(verify_interface) is None: + return list() + + if isinstance(verify_interface, list): + if len(verify_interface) == 0: + return list() + if verify_interface[0] is None: + return list() + return verify_interface + + +def main(): + pass + + +if __name__ == "__main__": + main() diff --git a/ansible_collections/cisco/dnac/plugins/plugin_utils/exceptions.py b/ansible_collections/cisco/dnac/plugins/plugin_utils/exceptions.py new file mode 100644 index 00000000..0ed417be --- /dev/null +++ b/ansible_collections/cisco/dnac/plugins/plugin_utils/exceptions.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +class AnsibleDNACException(Exception): + """Base class for all Ansible DNAC package exceptions.""" + pass + + +class InconsistentParameters(AnsibleDNACException): + """Provided parameters are not consistent.""" + pass + + +class AnsibleSDAException(Exception): + def __init__(self, response): + self._response = response diff --git a/ansible_collections/cisco/dnac/requirements.txt b/ansible_collections/cisco/dnac/requirements.txt new file mode 100644 index 00000000..ddd00358 --- /dev/null +++ b/ansible_collections/cisco/dnac/requirements.txt @@ -0,0 +1 @@ +dnacentersdk >= 2.5.5 \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/tests/sanity/ignore-2.10.txt b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.10.txt new file mode 100644 index 00000000..4cd6816a --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.10.txt @@ -0,0 +1,722 @@ +plugins/plugin_utils/dnac.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/plugin_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate_p12.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/cli_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_proximity_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/command_runner_run_command.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_check_run.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_status_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_clone.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_v2.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_project_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_configurations_export.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_by_ip_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_isis_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_ospf_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_deploy.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_job_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_range_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/dna_command_runner_keywords_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_api_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_artifact_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_artifact_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_parent_records_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_email_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_rest_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_syslog_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_email.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_email_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_namespace_files_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_namespaces_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_pool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_pool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/http_read_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/http_write_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/issues_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/issues_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_cmdb_sync_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_failed_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_retry.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_deregistration.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_license_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_license_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_registration.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_smart_account_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_term_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_usage_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_change.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/netconf_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_by_ip_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_by_serial_number_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_chassis_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_config_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_config_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_equipment_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_export.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_functional_capability_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_global_polling_interval_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_interface_poe_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_inventory_insight_link_mismatch_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_lexicographically_sorted_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_linecard_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_meraki_organization_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_module_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_module_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_poe_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_polling_interval_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_register_for_wsa_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_stack_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_supervisor_card_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_sync.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_update_role.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_vlan_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_wireless_lan_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_with_snmp_v3_des_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision_details.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/path_trace.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/path_trace_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/platform_nodes_configuration_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/platform_release_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim_to_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_config_preview.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_history_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_import.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_reset.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_unclaim.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_server_profile_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_smart_account_domains_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_add.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_deregister.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_devices_sync.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_sync_result_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_accounts_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_executions_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_view_group_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_view_group_view_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_device_role_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_multicast.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_multicast_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_provision_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_provision_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_devices_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_ids_per_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_per_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_run.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_duplicate.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_edit.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_profile_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_assign_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_assign_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_design_floormap.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_design_floormap_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_membership_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmp_properties.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmp_properties_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv2_read_community_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv2_write_community_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv3_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_image_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_import_local.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_import_via_url.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_trigger_activation.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_trigger_distribution.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_health_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_performance_historical_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_performance_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_type_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_membership.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_operation_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_tree_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/template_preview.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_detail.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_detail_count.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_summary.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_layer_2_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_layer_3_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_network_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_physical_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_vlan_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/user_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_access_point.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_create_provision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_delete_reprovision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_psk_override.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_sensor_test_results_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_by_id_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_default_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_intent_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/associate_site_to_network_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_family_identifiers_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disassociate_site_to_network_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_operationstatus_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/dnacaap_management_execution_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_image_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/profiling_rules_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/profiling_rules_in_bulk_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/projects_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/templates_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/assign_device_to_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/buildings_planned_access_points_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_virtual_network_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_config_connector_types_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_email_config_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_email_config_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_webhook_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_webhook_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_import.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_operation_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_log_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_interface_neighbor_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/planned_access_points_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_authorize.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/syslog_config_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/syslog_config_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/transit_peer_network.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/transit_peer_network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate_p12.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/cli_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_proximity_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/command_runner_run_command.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_check_run.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_status_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_clone.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_v2.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_configurations_export.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_by_ip_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_isis_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_ospf_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_deploy.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_job_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dna_command_runner_keywords_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_api_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_parent_records_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_email_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_rest_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_syslog_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespace_files_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespaces_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_read_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_write_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_cmdb_sync_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_failed_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_retry.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_deregistration.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_registration.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_smart_account_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_term_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_usage_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_change.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/netconf_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_ip_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_serial_number_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_chassis_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_equipment_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_export.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_functional_capability_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_global_polling_interval_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_poe_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_inventory_insight_link_mismatch_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_lexicographically_sorted_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_linecard_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_meraki_organization_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_poe_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_polling_interval_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_register_for_wsa_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_stack_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_supervisor_card_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_sync.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_update_role.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_vlan_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_wireless_lan_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_with_snmp_v3_des_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_details.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_nodes_configuration_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_release_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim_to_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_config_preview.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_history_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_import.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_reset.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_unclaim.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_server_profile_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_smart_account_domains_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_add.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_deregister.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_devices_sync.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_sync_result_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_accounts_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_executions_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_view_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_role_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_devices_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_ids_per_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_per_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_run.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_duplicate.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_edit.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_profile_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_membership_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_read_community_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_write_community_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv3_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_image_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_local.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_via_url.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_activation.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_distribution.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_historical_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_type_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_membership.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_operation_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_tree_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/template_preview.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail_count.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_summary.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_2_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_3_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_network_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_physical_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_vlan_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/user_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_access_point.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_create_provision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_delete_reprovision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_psk_override.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_sensor_test_results_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_by_id_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_default_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_intent_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/associate_site_to_network_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_family_identifiers_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disassociate_site_to_network_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_operationstatus_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dnacaap_management_execution_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_image_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_in_bulk_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/projects_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/templates_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/assign_device_to_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/buildings_planned_access_points_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_virtual_network_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_config_connector_types_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_import.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_operation_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_log_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_neighbor_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/planned_access_points_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_authorize.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK diff --git a/ansible_collections/cisco/dnac/tests/sanity/ignore-2.11.txt b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.11.txt new file mode 100644 index 00000000..c18cef23 --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.11.txt @@ -0,0 +1,1073 @@ +plugins/plugin_utils/dnac.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/plugin_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/plugin_utils/dnac.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate_p12.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/cli_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_proximity_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/command_runner_run_command.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_check_run.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_status_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_clone.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_v2.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_project_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_configurations_export.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_by_ip_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_isis_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_ospf_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_deploy.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_job_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_range_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/dna_command_runner_keywords_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_api_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_artifact_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_artifact_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_parent_records_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_email_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_rest_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_syslog_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_email.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_email_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_namespace_files_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_namespaces_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_pool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_pool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/http_read_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/http_write_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/issues_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/issues_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_cmdb_sync_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_failed_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_retry.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_deregistration.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_license_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_license_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_registration.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_smart_account_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_term_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_usage_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_change.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/netconf_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_by_ip_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_by_serial_number_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_chassis_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_config_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_config_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_equipment_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_export.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_functional_capability_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_global_polling_interval_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_interface_poe_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_inventory_insight_link_mismatch_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_lexicographically_sorted_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_linecard_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_meraki_organization_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_module_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_module_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_poe_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_polling_interval_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_register_for_wsa_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_stack_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_supervisor_card_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_sync.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_update_role.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_vlan_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_wireless_lan_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_with_snmp_v3_des_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision_details.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/path_trace.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/path_trace_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/platform_nodes_configuration_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/platform_release_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim_to_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_config_preview.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_history_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_import.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_reset.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_unclaim.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_server_profile_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_smart_account_domains_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_add.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_deregister.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_devices_sync.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_sync_result_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_accounts_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_executions_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_view_group_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_view_group_view_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_device_role_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_multicast.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_multicast_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_provision_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_provision_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_devices_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_ids_per_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_per_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_run.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_duplicate.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_edit.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_profile_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_assign_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_assign_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_design_floormap.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_design_floormap_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_membership_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmp_properties.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmp_properties_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv2_read_community_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv2_write_community_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv3_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_image_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_import_local.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_import_via_url.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_trigger_activation.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_trigger_distribution.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_health_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_performance_historical_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_performance_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_type_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_membership.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_operation_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_tree_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/template_preview.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_detail.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_detail_count.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_summary.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_layer_2_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_layer_3_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_network_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_physical_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_vlan_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/user_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_access_point.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_create_provision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_delete_reprovision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_psk_override.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_sensor_test_results_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_by_id_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_default_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_intent_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/associate_site_to_network_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_family_identifiers_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disassociate_site_to_network_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_operationstatus_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/dnacaap_management_execution_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_image_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/profiling_rules_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/profiling_rules_in_bulk_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/projects_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/templates_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/assign_device_to_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/buildings_planned_access_points_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_virtual_network_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_config_connector_types_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_email_config_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_email_config_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_webhook_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_webhook_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_import.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_operation_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_log_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_interface_neighbor_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/planned_access_points_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_authorize.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/syslog_config_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/syslog_config_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/transit_peer_network.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/transit_peer_network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate_p12.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/cli_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_proximity_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/command_runner_run_command.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_check_run.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_status_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_clone.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_v2.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_configurations_export.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_by_ip_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_isis_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_ospf_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_deploy.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_job_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dna_command_runner_keywords_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_api_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_parent_records_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_email_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_rest_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_syslog_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespace_files_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespaces_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_read_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_write_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_cmdb_sync_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_failed_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_retry.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_deregistration.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_registration.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_smart_account_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_term_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_usage_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_change.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/netconf_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_ip_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_serial_number_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_chassis_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_equipment_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_export.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_functional_capability_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_global_polling_interval_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_poe_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_inventory_insight_link_mismatch_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_lexicographically_sorted_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_linecard_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_meraki_organization_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_poe_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_polling_interval_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_register_for_wsa_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_stack_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_supervisor_card_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_sync.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_update_role.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_vlan_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_wireless_lan_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_with_snmp_v3_des_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_details.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_nodes_configuration_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_release_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim_to_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_config_preview.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_history_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_import.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_reset.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_unclaim.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_server_profile_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_smart_account_domains_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_add.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_deregister.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_devices_sync.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_sync_result_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_accounts_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_executions_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_view_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_role_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_devices_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_ids_per_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_per_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_run.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_duplicate.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_edit.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_profile_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_membership_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_read_community_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_write_community_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv3_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_image_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_local.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_via_url.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_activation.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_distribution.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_historical_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_type_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_membership.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_operation_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_tree_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/template_preview.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail_count.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_summary.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_2_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_3_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_network_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_physical_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_vlan_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/user_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_access_point.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_create_provision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_delete_reprovision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_psk_override.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_sensor_test_results_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_by_id_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_default_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_intent_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/associate_site_to_network_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_family_identifiers_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disassociate_site_to_network_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_operationstatus_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dnacaap_management_execution_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_image_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_in_bulk_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/projects_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/templates_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/assign_device_to_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/buildings_planned_access_points_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_virtual_network_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_config_connector_types_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_import.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_operation_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_log_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_neighbor_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/planned_access_points_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_authorize.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_health_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate_p12.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/cli_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_detail_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_enrichment_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_health_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_proximity_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/command_runner_run_command.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_check_run.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_status_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_clone.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_status_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_v2.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_project.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_template.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_project.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_template.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_configurations_export.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_enrichment_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_health_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_by_ip_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_isis_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_ospf_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_deploy.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_range_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_job_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dna_command_runner_keywords_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_api_status_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_parent_records_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_email_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_rest_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_syslog_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespace_files_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespaces_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_read_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_write_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_detail_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_range_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_enrichment_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_cmdb_sync_status_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_failed_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_retry.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_deregistration.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_registration.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_smart_account_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_term_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_usage_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_change.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/netconf_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_ip_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_serial_number_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_chassis_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_equipment_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_export.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_functional_capability_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_global_polling_interval_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_poe_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_inventory_insight_link_mismatch_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_lexicographically_sorted_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_linecard_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_meraki_organization_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_poe_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_polling_interval_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_range_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_register_for_wsa_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_stack_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_supervisor_card_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_sync.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_update_role.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_vlan_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_wireless_lan_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_with_snmp_v3_des_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_detail_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_details.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_nodes_configuration_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_release_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim_to_site.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_config_preview.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_history_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_import.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_reset.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_unclaim.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_server_profile_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_smart_account_domains_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_add.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_deregister.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_devices_sync.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_sync_result_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_accounts_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_executions_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_view_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_role_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_devices_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_ids_per_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_per_device_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_run.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_duplicate.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_edit.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_profile_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_device.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_health_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_membership_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_read_community_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_write_community_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv3_credential.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_image_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_local.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_via_url.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_activation.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_distribution.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_historical_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_type_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_membership.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_operation_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_tree_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/template_preview.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail_count.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_summary.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_2_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_3_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_network_health_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_physical_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_site_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_vlan_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/user_enrichment_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_access_point.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_create_provision.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_delete_reprovision.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_psk_override.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_sensor_test_results_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_by_id_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_default_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_intent_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/associate_site_to_network_profile.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_family_identifiers_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disassociate_site_to_network_profile.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_operationstatus_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_status_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dnacaap_management_execution_status_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_image_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_in_bulk_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/projects_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/templates_details_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/assign_device_to_site.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/buildings_planned_access_points_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_virtual_network_summary_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_config_connector_types_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_import.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_operation_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_count_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_delete.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_log_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_status_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_neighbor_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/planned_access_points_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_authorize.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_create.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_update.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network_info.py import-2.7 # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK diff --git a/ansible_collections/cisco/dnac/tests/sanity/ignore-2.12.txt b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.12.txt new file mode 100644 index 00000000..4c6b7ecd --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.12.txt @@ -0,0 +1,20 @@ +plugins/module_utils/dnac.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/tests/sanity/ignore-2.13.txt b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.13.txt new file mode 100644 index 00000000..1ef6913d --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.13.txt @@ -0,0 +1,10 @@ +plugins/module_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/tests/sanity/ignore-2.14.txt b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.14.txt new file mode 100644 index 00000000..1ef6913d --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.14.txt @@ -0,0 +1,10 @@ +plugins/module_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/tests/sanity/ignore-2.15.txt b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.15.txt new file mode 100644 index 00000000..1ef6913d --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.15.txt @@ -0,0 +1,10 @@ +plugins/module_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK \ No newline at end of file diff --git a/ansible_collections/cisco/dnac/tests/sanity/ignore-2.9.txt b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.9.txt new file mode 100644 index 00000000..4cd6816a --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/sanity/ignore-2.9.txt @@ -0,0 +1,722 @@ +plugins/plugin_utils/dnac.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/plugin_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/applications_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate_p12.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/cli_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/client_proximity_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/command_runner_run_command.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_check_run.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_status_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_clone.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_v2.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_template.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_project.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_project_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_configurations_export.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_credential_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_by_ip_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_isis_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_interface_ospf_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_deploy.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_replacement_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_job_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_range_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/discovery_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/dna_command_runner_keywords_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_api_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_artifact_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_artifact_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_parent_records_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_series_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_email_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_rest_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_syslog_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_email.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_email_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_namespace_files_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_namespaces_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_credential_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_pool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/global_pool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/http_read_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/http_write_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_network_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/issues_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/issues_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_cmdb_sync_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_failed_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_retry.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_deregistration.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_license_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_license_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_device_registration.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_smart_account_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_term_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_usage_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_change.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/netconf_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_by_ip_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_by_serial_number_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_chassis_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_config_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_config_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_equipment_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_export.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_functional_capability_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_global_polling_interval_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_interface_poe_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_inventory_insight_link_mismatch_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_lexicographically_sorted_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_linecard_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_meraki_organization_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_module_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_module_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_poe_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_polling_interval_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_range_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_register_for_wsa_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_stack_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_supervisor_card_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_sync.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_update_role.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_vlan_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_wireless_lan_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_with_snmp_v3_des_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision_detail_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/nfv_provision_details.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/path_trace.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/path_trace_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/platform_nodes_configuration_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/platform_release_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim_to_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_config_preview.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_history_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_import.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_reset.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_unclaim.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_server_profile_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_smart_account_domains_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_add.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_deregister.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_devices_sync.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_sync_result_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_accounts_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_executions_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_view_group_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reports_view_group_view_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_device_role_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_multicast.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_multicast_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_provision_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_provision_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_devices_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_ids_per_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_per_device_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/security_advisories_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_run.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_duplicate.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_edit.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_profile_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/service_provider_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_assign_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_assign_device.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_design_floormap.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_design_floormap_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_membership_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/site_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmp_properties.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmp_properties_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv2_read_community_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv2_write_community_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/snmpv3_credential.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_image_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_import_local.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_import_via_url.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_trigger_activation.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/swim_trigger_distribution.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_health_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_performance_historical_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/system_performance_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_member_type_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/tag_membership.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_operation_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/task_tree_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/template_preview.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_detail.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_detail_count.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/threat_summary.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_layer_2_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_layer_3_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_network_health_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_physical_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_site_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/topology_vlan_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/user_enrichment_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_access_point.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_create_provision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_delete_reprovision.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_psk_override.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/wireless_sensor_test_results_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/compliance_device_by_id_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_default_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_intent_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/associate_site_to_network_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/device_family_identifiers_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disassociate_site_to_network_profile.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_operationstatus_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/dnacaap_management_execution_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_image_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/profiling_rules_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/profiling_rules_in_bulk_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/projects_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/qos_device_interface.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/templates_details_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/assign_device_to_site.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/buildings_planned_access_points_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/business_sda_virtual_network_summary_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_config_connector_types_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_email_config_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_email_config_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_webhook_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/event_webhook_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/file_import.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_operation_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/interface_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_count_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_delete.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_log_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/lan_automation_status_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/network_device_interface_neighbor_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/planned_access_points_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/pnp_device_authorize.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/syslog_config_create.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/syslog_config_update.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/transit_peer_network.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/transit_peer_network_info.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/action/application_sets.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/application_sets_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/applications_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/authentication_import_certificate_p12.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/cli_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/client_proximity_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/command_runner_run_command.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_check_run.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_status_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_clone.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_deploy_v2.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_export_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_import_template.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_project_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/configuration_template_version_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_configurations_export.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_credential_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_by_ip_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_isis_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_interface_ospf_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_deploy.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_replacement_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_job_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/discovery_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dna_command_runner_keywords_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_api_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_artifact_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_parent_records_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_audit_logs_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_series_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_email_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_rest_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_details_syslog_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_email_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_rest_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_subscription_syslog_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespace_files_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_namespaces_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_credential_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/global_pool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_read_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/http_write_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_network_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/issues_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_cmdb_sync_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_failed_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/itsm_integration_events_retry.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_deregistration.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_license_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_device_registration.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_smart_account_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_term_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_usage_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_change.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/license_virtual_account_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/netconf_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_ip_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_by_serial_number_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_chassis_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_config_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_equipment_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_export.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_functional_capability_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_global_polling_interval_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_poe_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_inventory_insight_link_mismatch_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_lexicographically_sorted_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_linecard_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_meraki_organization_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_module_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_poe_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_polling_interval_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_range_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_register_for_wsa_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_stack_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_supervisor_card_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_sync.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_update_role.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_vlan_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_wireless_lan_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_with_snmp_v3_des_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_detail_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/nfv_provision_details.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/path_trace_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_nodes_configuration_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/platform_release_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_claim_to_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_config_preview.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_history_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_import.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_reset.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_unclaim.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_global_settings_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_server_profile_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_smart_account_domains_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_add.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_deregister.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_devices_sync.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_account_sync_result_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_virtual_accounts_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_workflow_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_executions_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reports_view_group_view_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_device_role_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_authentication_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_border_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_control_plane_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_edge_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_fabric_site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_multicast_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_access_point_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_port_assignment_for_user_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_provision_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_ip_pool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sda_virtual_network_v2_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_devices_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_ids_per_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_per_device_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/security_advisories_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_run.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_duplicate.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/sensor_test_template_edit.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_profile_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/service_provider_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_assign_device.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_design_floormap_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_membership_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/site_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmp_properties_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_read_community_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv2_write_community_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/snmpv3_credential.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_image_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_local.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_import_via_url.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_activation.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/swim_trigger_distribution.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_historical_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/system_performance_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_member_type_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/tag_membership.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_operation_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/task_tree_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/template_preview.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_detail_count.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/threat_summary.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_2_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_layer_3_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_network_health_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_physical_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_site_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/topology_vlan_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/user_enrichment_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_dynamic_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_enterprise_ssid_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_access_point.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_device_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_create_provision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_provision_ssid_delete_reprovision.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_psk_override.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_rf_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/wireless_sensor_test_results_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/compliance_device_by_id_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_default_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_intent_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/app_policy_queuing_profile_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/associate_site_to_network_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_hostonboarding_ssid_ippool_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_wireless_controller_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/device_family_identifiers_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disassociate_site_to_network_profile.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_operationstatus_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/disasterrecovery_system_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/dnacaap_management_execution_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/endpoint_analytics_profiling_rules_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_image_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/golden_tag_image_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/profiling_rules_in_bulk_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/projects_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/qos_device_interface.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/reserve_ip_subpool_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/templates_details_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/assign_device_to_site.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/buildings_planned_access_points_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/business_sda_virtual_network_summary_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_config_connector_types_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_email_config_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/event_webhook_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/file_import.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_operation_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/interface_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_count_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_delete.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_log_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/lan_automation_status_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_custom_prompt_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/network_device_interface_neighbor_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/planned_access_points_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/pnp_device_authorize.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_create.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/syslog_config_update.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/action/transit_peer_network_info.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py compile-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.6!skip # Python 2.6 is not supported by the DNA Center SDK +plugins/module_utils/dnac.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/pnp_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/template_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/site_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK +plugins/modules/swim_intent.py import-2.7!skip # Python 2.7 is not supported by the DNA Center SDK diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/__init__.py b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/dnac_module.py b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/dnac_module.py new file mode 100644 index 00000000..c05b5a6e --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/dnac_module.py @@ -0,0 +1,140 @@ +# Copyright (c) 2022 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Make coding more python3-ish +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + +import os +import json + +from ansible_collections.ansible.netcommon.tests.unit.modules.utils import ( + AnsibleExitJson, + AnsibleFailJson, + ModuleTestCase, +) +from ansible_collections.ansible.netcommon.tests.unit.modules.utils import ( + set_module_args as _set_module_args, +) + + +def set_module_args(args): + return _set_module_args(args) + + +fixture_path = os.path.join(os.path.dirname(__file__), "fixtures") +fixture_data = {} + + +def loadPlaybookData(module_name): + path = os.path.join(fixture_path, "{0}.json".format(module_name)) + print(path) + + with open(path) as f: + data = f.read() + + try: + j_data = json.loads(data) + except Exception as e: + print(e) + pass + + return j_data + + +def load_fixture(module_name, name, device=""): + path = os.path.join(fixture_path, module_name, device, name) + if not os.path.exists(path): + path = os.path.join(fixture_path, module_name, name) + + if path in fixture_data: + return fixture_data[path] + + with open(path) as f: + data = f.read() + + try: + data = json.loads(data) + except Exception: + pass + + fixture_data[path] = data + return data + + +class TestDnacModule(ModuleTestCase): + def execute_module_devices( + self, failed=False, changed=False, response=None, sort=True, defaults=False + ): + module_name = self.module.__name__.rsplit(".", 1)[1] + local_fixture_path = os.path.join(fixture_path, module_name) + + models = [] + for path in os.listdir(local_fixture_path): + path = os.path.join(local_fixture_path, path) + if os.path.isdir(path): + models.append(os.path.basename(path)) + if not models: + models = [""] + + retvals = {} + for model in models: + retvals[model] = self.execute_module( + failed, changed, response, sort, device=model + ) + + return retvals + + def execute_module( + self, failed=False, changed=False, response=None, sort=True, device="" + ): + + self.load_fixtures(response, device=device) + + if failed: + result = self.failed() + self.assertTrue(result["failed"], result) + else: + result = self.changed(changed) + self.assertEqual(result["changed"], changed, result) + + if response is not None: + if sort: + self.assertEqual( + sorted(response), sorted(result["response"]), result["response"] + ) + else: + self.assertEqual(response, result["response"], result["response"]) + + return result + + def failed(self): + with self.assertRaises(AnsibleFailJson) as exc: + self.module.main() + + result = exc.exception.args[0] + self.assertTrue(result["failed"], result) + return result + + def changed(self, changed=False): + with self.assertRaises(AnsibleExitJson) as exc: + self.module.main() + + result = exc.exception.args[0] + self.assertEqual(result["changed"], changed, result) + return result + + def load_fixtures(self, response=None, device=""): + pass diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/pnp_intent.json b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/pnp_intent.json new file mode 100644 index 00000000..449ed54e --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/pnp_intent.json @@ -0,0 +1,166 @@ +{ + "playbook_config": [ + { + "image_name": "cat9k_iosxe.17.04.01.SPA.bin", + "site_name": "Global/Chennai/MS_Test_1", + "device_version": 2, + "template_name": "ANSIBLE-TEST", + "deviceInfo": { + "serialNumber": "PRATEST4", + "hostname": "PRATEST4", + "state": "Unclaimed", + "pid": "C9300-25UX" + } + } + ], + + "playbook_config_missing_parameter": [ + { + "site_name": "Global/Chennai/MS_Test_1", + "device_version": 2, + "template_name": "ANSIBLE-TEST", + "deviceInfo": { + "serialNumber": "PRATEST4", + "hostname": "PRATEST4", + "state": "Unclaimed", + "pid": "C9300-25UX" + } + } + ], + + "image_exists_response": { + "response": + [{ + "imageUuid": "2f566ca4-cca8-4b4f-8bc9-917ef813bfb3", + "name": "cat9k_iosxe.17.04.01.SPA.bin", + "family": "CAT9K", + "version": "17.04.01.0.173" + }], + "version": "1.0" + }, + + "image_doesnot_exist_response": { + "response": [], + "version": "1.0" + }, + + "template_exists_response": + [{ + "name": "ANSIBLE-TEST", + "projectName": "Onboarding Configuration", + "projectId": "1d0e4377-a0f7-4146-9ee7-60b2e23f1343", + "templateId": "77bf8489-b14b-47c0-9d87-12a26e89796a", + "softwareType": "IOS-XE", + "deviceTypes": + [{ + "productFamily": "Switches and Hubs" + }] + }], + + "template_doesnot_exist_response": + [{ + "name": "DMVPN Hub for Cloud Router", + "projectName": "Onboarding Configuration", + "projectId": "1d0e4377-a0f7-4146-9ee7-60b2e23f1343", + "templateId": "94b4b0ff-25dd-4c05-9cee-1229a86f8a2b", + "softwareType": "IOS-XE", + "deviceTypes": + [{ + "productFamily": "Routers" + }] + }], + + "create_site_response":{ + "executionId": "e40e3f70-9b09-4a32-90b6-8d1c72d81cf5", + "executionStatusUrl": "/dna/platform/management/business-api/v1/execution-status/e40e3f70-9b09-4a32-90b6-8d1c72d81cf5", + "message": "The request has been accepted for execution" + }, + + "execution_details_create_success":{ + "bapiKey": "50b5-89fd-4c7a-930a", + "bapiName": "Create Site", + "bapiExecutionId": "e40e3f70-9b09-4a32-90b6-8d1c72d81cf5", + "status": "SUCCESS" + }, + + "site_exists_response": { + "response": + [{ + "parentId": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "additionalInfo": + [{ + "nameSpace": "Location", + "attributes": + { + "country": "India", + "latitude": "12.93570674358", + "type": "building", + "longitude": "80.24982195822832" + } + }], + "name": "MS_Test_1", + "id": "63b99771-bae4-43da-bf75-bce03cdaf7ee", + "siteNameHierarchy": "Global/Chennai/MS_Test_1" + }] + }, + + "site_needs_update_response": { + "response": + [{ + "parentId": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "additionalInfo": + [{ + "nameSpace": "Location", + "attributes": + { + "country": "India", + "latitude": "13.02372563782", + "type": "building", + "longitude": "80.2541235068557" + } + }], + "name": "MS_Test_1", + "id": "63b99771-bae4-43da-bf75-bce03cdaf7ee", + "siteNameHierarchy": "Global/Chennai/MS_Test_1" + }] + }, + + "device_exists_response":[{ + "version": 2, + "deviceInfo": { + "serialNumber": "PRATEST4", + "name": "PRATEST4", + "pid": "C9300-25UX", + "state": "Planned", + "siteId": "a5aaf1be-5257-4445-b84f-d0d6d65b645d", + "siteName": "Global/Chennai/MS_Test_1", + "hostname": "PRATEST4" + } + }], + + "add_device_response":{ + "version": 2, + "deviceInfo": + { + "serialNumber": "PRATEST4", + "name": "PRATEST4", + "pid": "C9300-25UX", + "state": "Unclaimed", + "hostname": "PRATEST4" + }, + "id": "627daabc938cba2eb64042d2" + + }, + + "claim_response": { + "response": "Device Claimed", + "version": "1.0" + }, + + "delete_device_response":{ + "deviceInfo": + { + "state": "Deleted" + } + } +} diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/site_intent.json b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/site_intent.json new file mode 100644 index 00000000..703de3cb --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/site_intent.json @@ -0,0 +1,186 @@ +{ + "playbook_config": [{ + "type": "floor", + "site": { + "floor": { + "name": "Floor 1", + "parentName": "Global/Chennai/Trill", + "rfModel": "Free Space", + "width": "100.0", + "length": "100.0", + "height": "100.0" + } + } + }], + "playbook_config_invalid_param": [{ + "type": "floor" + }], + "create_site_response":{ + "executionId": "0ac985a4-b1bb-442d-9fa3-2032cb9e9ba6", + "executionStatusUrl": "/dna/platform/management/business-api/v1/execution-status/0ac985a4-b1bb-442d-9fa3-2032cb9e9ba6", + "message": "The request has been accepted for execution" + }, + "get_business_api_execution_details_response":{ + "status": "SUCCESS" + }, + "get_site_response":{ + "response": [{ + "parentId": "1e3868a6-666d-47a3-813c-6a2aa9bce46c", + "additionalInfo": [ + { + "nameSpace": "mapsSummary", + "attributes": { + "rfModel": "14144130", + "imageURL": "", + "isCadFile": "false", + "floorIndex": "1" + } + }, + { + "nameSpace": "Location", + "attributes": { + "addressInheritedFrom": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "type": "floor" + } + }, + { + "nameSpace": "mapGeometry", + "attributes": { + "offsetX": "0.0", + "offsetY": "0.0", + "width": "90.0", + "length": "100.0", + "height": "100.0" + } + } + ], + "name": "Floor 2", + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "ea3848d7-5337-4e48-aec3-605beaee55b4", + "siteHierarchy": "c6622c8a-ae49-47db-bc7c-5984fa61ca28/597dba2d-c09f-4bae-ae61-8b0d9c8cd268/1e3868a6-666d-47a3-813c-6a2aa9bce46c/ea3848d7-5337-4e48-aec3-605beaee55b4", + "siteNameHierarchy": "Global/Chennai/Trill/Floor 2" + } + ] + }, + "update_not_needed_get_site_response":{ + "response": [ + { + "parentId": "1e3868a6-666d-47a3-813c-6a2aa9bce46c", + "additionalInfo": [ + { + "nameSpace": "mapsSummary", + "attributes": { + "rfModel": "14144130", + "imageURL": "", + "isCadFile": "false", + "floorIndex": "1" + } + }, + { + "nameSpace": "mapGeometry", + "attributes": { + "offsetX": "0.0", + "offsetY": "0.0", + "length": "100.0", + "width": "100.0", + "height": "100.0" + } + }, + { + "nameSpace": "Location", + "attributes": { + "latitude": "0.0", + "addressInheritedFrom": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "type": "floor", "longitude": "0.0" + } + } + ], + "name": "Floor 1", + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "16d77f9d-e1ae-4556-8e80-615651ee52ca", + "siteHierarchy": "c6622c8a-ae49-47db-bc7c-5984fa61ca28/597dba2d-c09f-4bae-ae61-8b0d9c8cd268/1e3868a6-666d-47a3-813c-6a2aa9bce46c/16d77f9d-e1ae-4556-8e80-615651ee52ca", + "siteNameHierarchy": "Global/Chennai/Trill/Floor 1" + } + ] + }, + "update_needed_get_site_response": { + "response": [ + { + "parentId": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "additionalInfo": [ + { + "nameSpace": "Location", + "attributes": { + "country": "India", + "latitude": "12.933971097851867", + "addressInheritedFrom": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "type": "building", + "longitude": "80.2467681804189" + } + } + ], + "name": "Triill", + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "87169daa-7de2-4f9d-814a-d8746de41be6", + "siteHierarchy": "c6622c8a-ae49-47db-bc7c-5984fa61ca28/597dba2d-c09f-4bae-ae61-8b0d9c8cd268/87169daa-7de2-4f9d-814a-d8746de41be6", + "siteNameHierarchy": "Global/Chennai/Triill" + } + ] + }, + "update_needed_update_site_response":{ + "executionId": "67f206ab-5377-46d4-99bf-dadf1543f84e", + "executionStatusUrl": "/dna/platform/management/business-api/v1/execution-status/67f206ab-5377-46d4-99bf-dadf1543f84e", + "message": "The request has been accepted for execution" + }, + "delete_get_site_response":{ + "response": [ + { + "parentId": "4ee5983e-4e4b-4a91-96fa-3d526d593cb0", + "additionalInfo": [ + { + "nameSpace": "Location", + "attributes": { + "addressInheritedFrom": "4ee5983e-4e4b-4a91-96fa-3d526d593cb0", + "type": "area" + } + } + ], + "name": "Hebbal", + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "e9b94916-e5b0-422c-9dac-16618ebb5f73", + "siteHierarchy": "c6622c8a-ae49-47db-bc7c-5984fa61ca28/4ee5983e-4e4b-4a91-96fa-3d526d593cb0/e9b94916-e5b0-422c-9dac-16618ebb5f73", + "siteNameHierarchy": "Global/Bangalore/Hebbal" + } + ] + }, + "delete_delete_site_response":{ + "executionId": "820b2ad9-4c31-48c1-b729-e029ad00ce95" + }, + "delete_execution_details_error":{ + "bapiError":"True" + }, + "delete_error_get_site_response":{ + "response": [ + { + "parentId": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "additionalInfo": [ + { + "nameSpace": "Location", + "attributes": { + "country": "India", + "latitude": "12.933971097851867", + "addressInheritedFrom": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "type": "building", + "longitude": "80.2467681804189" + } + } + ], + "name": "Triill", + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "87169daa-7de2-4f9d-814a-d8746de41be6", + "siteHierarchy": "c6622c8a-ae49-47db-bc7c-5984fa61ca28/597dba2d-c09f-4bae-ae61-8b0d9c8cd268/87169daa-7de2-4f9d-814a-d8746de41be6", + "siteNameHierarchy": "Global/Chennai/Triill" + } + ] + } +} diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/swim_intent.json b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/swim_intent.json new file mode 100644 index 00000000..d10d077b --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/swim_intent.json @@ -0,0 +1,211 @@ +{ + "playbook_config": [{ + "importImageDetails": { + "type": "url", + "urlDetails": { + "payload": [{ + "sourceURL":"http://10.104.118.10/swim/17.9/cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin", + "isThirdParty": 0 + }] + } + }, + "taggingDetails": { + "deviceRole": "ALL", + "deviceFamilyName": "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1", + "tagging": true + }, + "imageDistributionDetails": { + "deviceSerialNumber": "FXS2325Q01C" + }, + "imageActivationDetails": { + "scehduleValidate": false, + "activateLowerImageVersion": true, + "deviceSerialNumber": "FXS2325Q01C" + } + }], + "playbook_config_image_import": [{ + "importImageDetails": { + "type": "url", + "urlDetails": { + "payload": [{ + "sourceURL":"http://10.104.118.10/swim/17.9/cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin", + "isThirdParty": 0 + }] + } + } + }], + "playbook_config_untag_golden_image":[{ + "taggingDetails": { + "imageName": "cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin", + "deviceRole": "ALL", + "deviceFamilyName": "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1", + "tagging": false, + "siteName": "Global/Bangalore/Trill" + } + }], + "playbook_config_tag_golden_image_missing_param":[{ + "taggingDetails": { + "deviceRole": "ALL", + "deviceFamilyName": "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1", + "tagging": true, + "siteName": "Global/Bangalore/Trill" + } + }], + "playbook_config_tag_golden_image_incorrect_family_name":[{ + "taggingDetails": { + "imageName": "cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin", + "deviceRole": "ALL", + "deviceFamilyName": "Cisco Catalyst 9600 Series Supervisor Engine 1", + "tagging": true, + "siteName": "Global/Bangalore/Trill" + } + }], + "playbook_config_activation_missing_param":[{ + "imageActivationDetails": { + "scehduleValidate": false, + "activateLowerImageVersion": true, + "deviceSerialNumber": "FXS2325Q01C" + } + }], + "playbook_config_distribution":[{ + "imageDistributionDetails": { + "deviceSerialNumber": "FXS2325Q01C", + "imageName": "cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin" + } + }], + "playbook_config_activation":[{ + "imageActivationDetails": { + "scehduleValidate": false, + "activateLowerImageVersion": true, + "deviceSerialNumber": "FXS2325Q01C", + "imageName": "cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin" + } + }], + "playbook_config_distribution_missing_param":[{ + "imageDistributionDetails": { + "deviceSerialNumber": "FXS2325Q01C" + } + }], + "task_info_response": { + "response": { + "taskId": "0df54111-93ed-41e9-9c6d-2590e395dd45" + } + }, + "image_imported_successfully_response": { + "response": { + "data": "import", + "progress": "completed successfully. Success = 1, Failure = 0, Running = 0, Pending = 0, Total = 1", + "version": 1663130446725, + "endTime": 1663130659133, + "startTime": 1663130446717, + "serviceType": "Swim Service", + "isError": false, + "rootId": "0df54111-93ed-41e9-9c6d-2590e395dd45", + "additionalStatusURL": "/api/v1/image/task?taskUuid=0df54111-93ed-41e9-9c6d-2590e395dd45", + "lastUpdate": 1663130446725, + "instanceTenantId": "626aafc1ceaf922ba8951626", + "id": "0df54111-93ed-41e9-9c6d-2590e395dd45" + }, + "version": "1.0" + }, + "image_id_fetched_successfully_response": { + "response": [{ + "imageUuid": "b03146ee-f93d-457c-a1c1-87f31219f902", + "name": "cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin", + "family": "CAT9K", + "version": "17.09.01.0.29", + "displayVersion": "17.09.01", + "imageName": "cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin", + "isTaggedGolden": false + }] + }, + "image_already_exists_response":{ + "response": { + "data": "import", + "progress": "Workflow Image Import failed. Success = 0, Failure = 1, Running = 0, Pending = 0, Total = 1", + "errorCode": "400", + "serviceType": "Swim Service", + "isError": true, + "failureReason": "NCSW10042: Image already exists" + }, + "version": "1.0" + }, + "image_doesnot_exist_response": { + "response": [], + "version": "1.0" + }, + "device_family_fetched_successfully": { + "response": [{ + "deviceFamily": "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1", + "deviceFamilyIdentifier": "286322137-286323141" + }] + }, + "device_id_fetched_successfully_response": { + "response": [{ + "type": "Cisco Catalyst 9606R Switch", + "macAddress": "2c:4f:52:05:a9:40", + "serialNumber": "FXS2325Q01C", + "family": "Switches and Hubs", + "platformId": "C9606R", + "series": "Cisco Catalyst 9600 Series Switches", + "instanceUuid": "108d726f-be89-4d7a-8234-44e4808cca4f", + "id": "108d726f-be89-4d7a-8234-44e4808cca4f" + }] + }, + "device_doesnot_exist_response":{ + "response": [], + "version": "1.0" + }, + "tagging_image_successful_response": { + "response": { + "data": "Golden-Tagging", + "progress": "Tagging image as Golden.", + "serviceType": "Swim Service", + "isError": false, + "id": "a98068db-1867-49a5-a470-5c3d2b3c514f" + } + }, + "untagging_image_successful_response": { + "response": { + "data": "Golden-Tagging", + "progress": "Un-tagging image as Golden.", + "serviceType": "Swim Service", + "isError": false, + "id": "a98068db-1867-49a5-a470-5c3d2b3c514f" + } + }, + "image_distribution_successful_response": { + "response": { + "data": "distribute", + "progress": "completed successfully. Success = 1, Failure = 0, Running = 0, Pending = 0, Total = 1", "serviceType": "Swim Service", + "isError": false, + "id": "ba152b35-afde-490f-8575-82c1fce0fab4" + } + }, + "image_activation_successful_response": { + "response": { + "data": "activate", + "progress": "completed successfully. Success = 1, Failure = 0, Running = 0, Pending = 0, Total = 1", "serviceType": "Swim Service", + "isError": false, + "id": "b6f3b7dd-f2b1-46ee-9111-32137226adc0" + } + }, + "fetch_site_id_response": { + "response": [{ + "parentId": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "additionalInfo": [{ + "nameSpace": "Location", + "attributes": { + "country": "India", + "latitude": "12.933971097851867", + "addressInheritedFrom": "597dba2d-c09f-4bae-ae61-8b0d9c8cd268", + "type": "building", + "longitude": "80.2467681804189" + } + }], + "name": "Trill", + "id": "87169daa-7de2-4f9d-814a-d8746de41be6", + "siteNameHierarchy": "Global/Chennai/Trill" + }] + } +} diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/template_intent.json b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/template_intent.json new file mode 100644 index 00000000..68c16646 --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/fixtures/template_intent.json @@ -0,0 +1,244 @@ +{ + "playbook_config": [ + { + "projectName": "Onboarding Configuration", + "templateContent": "hostname Test-2", + "language": "velocity", + "deviceTypes": [{ + "productFamily": "Switches and Hubs" + }], + "softwareType": "IOS-XE", + "sofwtareVariant": "XE", + "templateName": "ANSIBLE-TEST", + "versionDescription": "MS Test Template" + }], + + "playbook_config_missing_param": [ + { + "projectName": "Onboarding Configuration", + "templateContent": "hostname Test-2", + "deviceTypes": [{ + "productFamily": "Switches and Hubs" + }], + "softwareType": "IOS-XE", + "sofwtareVariant": "XE", + "templateName": "ANSIBLE-TEST", + "versionDescription": "MS Test Template" + }], + + "playbook_config_invalid_param": [ + { + "projectName": "Onboarding Configuration", + "templateContent": "hostname Test-2", + "language": "velocty", + "deviceTypes": [{ + "productFamily": "Switches and Hubs" + }], + "softwareType": "IOS-XE", + "sofwtareVariant": "XE", + "templateName": "ANSIBLE-TEST", + "versionDescription": "MS Test Template" + }], + + "create_template_list_response":[ + { + "name": "DMVPN Hub for Cloud Router- System Default", + "projectName": "Onboarding Configuration", + "projectId": "1d0e4377-a0f7-4146-9ee7-60b2e23f1343", + "templateId": "94b4b0ff-25dd-4c05-9cee-1229a86f8a2b" + } + ], + + "create_template_get_project_response": [ + { + "name": "Onboarding Configuration", + "id": "1d0e4377-a0f7-4146-9ee7-60b2e23f1343", + "isDeletable": false + } + ], + + "create_template_response":{ + "response": { + "taskId": "f79b5b3e-09b0-4ddf-9039-7172313f4ac0", + "url": "/api/v1/task/f79b5b3e-09b0-4ddf-9039-7172313f4ac0" + }, + "version": "1.0" + }, + + "create_template_task_details_for_create": { + "response": { + "data": "b750cf21-54a0-4ce7-93d1-8d14de24b86f", + "progress": "Successfully created template with name ANSIBLE-TEST", + "isError": false, + "id": "f79b5b3e-09b0-4ddf-9039-7172313f4ac0" + }, + "version": "1.0"}, + + "create_template_version_template_response": { + "response": { + "taskId": "91baaf05-c9cd-46ed-b180-4a2ff8aabb18", + "url": "/api/v1/task/91baaf05-c9cd-46ed-b180-4a2ff8aabb18" + }, + "version": "1.0" + }, + + "create_template_task_details_for_versioning": { + "response": { + "endTime": 1652055868465, + "version": 1652055868449, + "data": "1, 1652055868457", + "startTime": 1652055868449, + "username": "admin", + "progress": "Successfully committed template ANSIBLE-TEST to version 1", + "serviceType": "NCTP", "rootId": "91baaf05-c9cd-46ed-b180-4a2ff8aabb18", + "isError": false, + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "91baaf05-c9cd-46ed-b180-4a2ff8aabb18" + }, + "version": "1.0" + }, + + "update_template_list": [ + { + "name": "ANSIBLE-TEST", + "projectName": "Onboarding Configuration", + "projectId": "1d0e4377-a0f7-4146-9ee7-60b2e23f1343", + "templateId": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15" + } + ], + + "update_template_existing_template": { + "name": "ANSIBLE-TEST", + "tags": [], + "deviceTypes": + [ + { + "productFamily": "Switches and Hubs" + } + ], + "softwareType": "IOS-XE", + "softwareVariant": "XE", + "templateContent": "hostname Test-2", + "templateParams": [], + "rollbackTemplateParams": [], + "composite": false, + "containingTemplates": [], + "language": "VELOCITY", + "id": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "customParamsOrder": false, + "createTime": 1652056127518, + "lastUpdateTime": 1652056127518, + "latestVersionTime": 1652056127638, + "projectName": "Onboarding Configuration", + "projectId": "1d0e4377-a0f7-4146-9ee7-60b2e23f1343", + "parentTemplateId": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "validationErrors": + { + "templateErrors": [], + "rollbackTemplateErrors": [], + "templateId": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "templateVersion": null + }, + "projectAssociated": true, + "documentDatabase": false + }, + + "update_template_existing_template_needs_update": { + "name": "ANSIBLE-TEST", + "tags": [], + "deviceTypes": + [ + { + "productFamily": "Switches and Hubs" + } + ], + "softwareType": "IOS-XE", + "softwareVariant": "XE", + "templateContent": "hostname TEST-RC\n", + "templateParams": [], + "rollbackTemplateParams": [], + "composite": false, + "containingTemplates": [], + "language": "VELOCITY", + "id": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "customParamsOrder": false, + "createTime": 1652056127518, + "lastUpdateTime": 1652056127518, + "latestVersionTime": 1652056127638, + "projectName": "Onboarding Configuration", + "projectId": "1d0e4377-a0f7-4146-9ee7-60b2e23f1343", + "parentTemplateId": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "validationErrors": + { + "templateErrors": [], + "rollbackTemplateErrors": [], + "templateId": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "templateVersion": null + }, + "projectAssociated": true, + "documentDatabase": false + }, + + "update_template_response":{ + "response": + { + "taskId": "31f072a0-7d85-4102-8d24-3ddb40034dff", + "url": "/api/v1/task/31f072a0-7d85-4102-8d24-3ddb40034dff" + }, + "version": "1.0" + }, + + "update_template_version_template_response":{ + "response": + { + "taskId": "addf4d04-7a9b-439c-915c-12618d5e5411", + "url": "/api/v1/task/addf4d04-7a9b-439c-915c-12618d5e5411" + }, + "version": "1.0" + }, + + "update_template_task_details_for_versioning":{ + "response": + { + "endTime": 1652085898143, + "version": 1652085898124, + "data": "2, 1652085898134", + "startTime": 1652085898124, + "username": "admin", + "progress": "Successfully committed template ANSIBLE-TEST to version 2", + "serviceType": "NCTP", + "rootId": "addf4d04-7a9b-439c-915c-12618d5e5411", + "isError": false, + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "addf4d04-7a9b-439c-915c-12618d5e5411" + }, + "version": "1.0" + }, + + "delete_template_response":{ + "response": + { + "taskId": "d13f4df1-39b0-452f-bbc1-5e170e6c302f", + "url": "/api/v1/task/d13f4df1-39b0-452f-bbc1-5e170e6c302f" + }, + "version": "1.0" + }, + + "delete_template_task_details":{ + "response": + { + "endTime": 1652086415305, + "version": 1652086415256, + "data": "fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "startTime": 1652086415256, + "username": "admin", + "progress": "Successfully deleted template with name fd74ab6c-fdda-465e-9f59-fb7eac7d6b15", + "serviceType": "NCTP", + "rootId": "d13f4df1-39b0-452f-bbc1-5e170e6c302f", + "isError": false, + "instanceTenantId": "5fa5559c4238fb00c6cc6801", + "id": "d13f4df1-39b0-452f-bbc1-5e170e6c302f" + }, + "version": "1.0" + } +} diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_pnp_intent.py b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_pnp_intent.py new file mode 100644 index 00000000..a2805e49 --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_pnp_intent.py @@ -0,0 +1,303 @@ +# Copyright (c) 2020-2022 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Make coding more python3-ish +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +import pdb + +from dnacentersdk import exceptions +from unittest.mock import patch +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.modules import pnp_intent +from .dnac_module import TestDnacModule, set_module_args, loadPlaybookData + +import json +import copy + + +class TestDnacPnPIntent(TestDnacModule): + + module = pnp_intent + + test_data = loadPlaybookData("pnp_intent") + + playbook_config = test_data.get("playbook_config") + playbook_config_missing_param = test_data.get("playbook_config_missing_param") + + def setUp(self): + super(TestDnacPnPIntent, self).setUp() + + self.mock_dnac_init = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.__init__") + self.run_dnac_init = self.mock_dnac_init.start() + self.run_dnac_init.side_effect = [None] + self.mock_dnac_exec = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.exec" + ) + self.run_dnac_exec = self.mock_dnac_exec.start() + + def tearDown(self): + super(TestDnacPnPIntent, self).tearDown() + self.mock_dnac_exec.stop() + self.mock_dnac_init.stop() + + def load_fixtures(self, response=None, device=""): + if "site_not_found" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_exists_response"), + self.test_data.get("template_exists_response"), + Exception(), + ] + + elif "add_new_device" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_exists_response"), + self.test_data.get("template_exists_response"), + self.test_data.get("site_exists_response"), + [], + self.test_data.get("add_device_response"), + self.test_data.get("claim_response") + ] + + elif "device_exists" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_exists_response"), + self.test_data.get("template_exists_response"), + self.test_data.get("site_exists_response"), + self.test_data.get("device_exists_response"), + self.test_data.get("claim_response") + ] + + elif "delete_device" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("device_exists_response"), + self.test_data.get("delete_device_response") + ] + + elif "deletion_error" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("device_exists_response"), + AnsibleActionFail("An error occured when executing operation." + + "The error was: [400] Bad Request - NCOB01313: Delete device(FJC2416U047) from Inventory"), + ] + + elif "image_doesnot_exist" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_doesnot_exist_response") + ] + + elif "template_doesnot_exist" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_exists_response"), + self.test_data.get("template_doesnot_exist_response") + ] + + elif "project_not_found" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_exists_response"), + [] + ] + elif "delete_nonexisting_device" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + [] + ] + + def test_pnp_intent_site_not_found(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Site not found" + ) + + def test_pnp_intent_add_new_device(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('response').get('response'), + "Device Claimed" + ) + + def test_pnp_intent_device_exists(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('response').get('response'), + "Device Claimed" + ) + + def test_pnp_intent_image_doesnot_exist(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Image not found" + ) + + def test_pnp_intent_template_doesnot_exist(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Template not found" + ) + + def test_pnp_intent_project_not_found(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Project Not Found" + ) + + def test_pnp_intent_missing_param(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.test_data.get("playbook_config_missing_parameter") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Invalid parameters in playbook: image_name : Required parameter not found" + ) + + def test_pnp_intent_delete_device(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('msg'), + "Device Deleted Successfully" + ) + + def test_pnp_intent_deletion_error(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Device Deletion Failed" + ) + + def test_pnp_intent_delete_nonexisting_device(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Device Not Found" + ) + + def test_pnp_intent_invalid_state(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merge", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "value of state must be one of: merged, deleted, got: merge" + ) diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_site_intent.py b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_site_intent.py new file mode 100644 index 00000000..e92dc773 --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_site_intent.py @@ -0,0 +1,251 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Make coding more python3-ish +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +import pdb + +from dnacentersdk import exceptions +from unittest.mock import patch + +from ansible_collections.cisco.dnac.plugins.modules import site_intent +from .dnac_module import TestDnacModule, set_module_args, loadPlaybookData + +import json +import copy + + +class TestDnacSiteIntent(TestDnacModule): + + module = site_intent + + test_data = loadPlaybookData("site_intent") + + playbook_config = test_data.get("playbook_config") + playbook_config_missing_param = test_data.get("playbook_config_missing_param") + + def setUp(self): + super(TestDnacSiteIntent, self).setUp() + + self.mock_dnac_init = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.__init__") + self.run_dnac_init = self.mock_dnac_init.start() + self.run_dnac_init.side_effect = [None] + self.mock_dnac_exec = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.exec" + ) + self.run_dnac_exec = self.mock_dnac_exec.start() + + def tearDown(self): + super(TestDnacSiteIntent, self).tearDown() + self.mock_dnac_exec.stop() + self.mock_dnac_init.stop() + + def load_fixtures(self, response=None, device=""): + if "create_site" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + Exception(), + self.test_data.get("create_site_response"), + self.test_data.get("get_business_api_execution_details_response"), + self.test_data.get("get_site_response") + ] + + elif "update_not_needed" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("update_not_needed_get_site_response"), + ] + + elif "update_needed" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("update_needed_get_site_response"), + self.test_data.get("update_needed_update_site_response"), + self.test_data.get("get_business_api_execution_details_response") + ] + elif "delete_existing_site" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("delete_get_site_response"), + self.test_data.get("delete_delete_site_response"), + self.test_data.get("get_business_api_execution_details_response") + ] + elif "delete_non_existing_site" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + Exception() + ] + elif "error_delete" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("delete_error_get_site_response"), + self.test_data.get("delete_delete_site_response"), + self.test_data.get("delete_execution_details_error") + ] + elif "error_create" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + Exception(), + self.test_data.get("create_site_response"), + self.test_data.get("delete_execution_details_error") + ] + + def test_site_intent_create_site(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('msg'), + "Site Created Successfully" + ) + + def test_site_intent_update_not_needed(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=False) + self.assertEqual( + result.get('msg'), + "Site does not need update" + ) + + def test_site_intent_update_needed(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('msg'), + "Site Updated Successfully" + ) + + def test_site_intent_delete_existing_site(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('response').get('status'), + "SUCCESS" + ) + + def test_site_intent_delete_non_existing_site(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Site Not Found" + ) + + def test_site_intent_invalid_param(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.test_data.get("playbook_config_invalid_param") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertTrue( + "Invalid parameters in playbook:" in result.get('msg') + ) + + def test_site_intent_error_delete(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "True" + ) + + def test_site_intent_error_create(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "True" + ) + + def test_site_intent_invalid_state(self): + + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merge", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "value of state must be one of: merged, deleted, got: merge" + ) diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_swim_intent.py b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_swim_intent.py new file mode 100644 index 00000000..39a98aa8 --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_swim_intent.py @@ -0,0 +1,309 @@ +# Copyright (c) 2020 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Make coding more python3-ish +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +import pdb + +from dnacentersdk import exceptions +from unittest.mock import patch + +from ansible_collections.cisco.dnac.plugins.modules import swim_intent +from .dnac_module import TestDnacModule, set_module_args, loadPlaybookData + +import json +import copy + + +class TestDnacSwimIntent(TestDnacModule): + + module = swim_intent + test_data = loadPlaybookData("swim_intent") + playbook_config = test_data.get("playbook_config") + playbook_config_untag_image = test_data.get("playbook_config_untag_golden_image") + + def setUp(self): + super(TestDnacSwimIntent, self).setUp() + + self.mock_dnac_init = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.__init__") + self.run_dnac_init = self.mock_dnac_init.start() + self.run_dnac_init.side_effect = [None] + self.mock_dnac_exec = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.exec" + ) + self.run_dnac_exec = self.mock_dnac_exec.start() + + def tearDown(self): + super(TestDnacSwimIntent, self).tearDown() + self.mock_dnac_exec.stop() + self.mock_dnac_init.stop() + + def load_fixtures(self, response=None, device=""): + if "full_flow" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("task_info_response"), + self.test_data.get("image_imported_successfully_response"), + self.test_data.get("image_id_fetched_successfully_response"), + self.test_data.get("device_family_fetched_successfully"), + self.test_data.get("device_id_fetched_successfully_response"), + self.test_data.get("device_id_fetched_successfully_response"), + self.test_data.get("task_info_response"), + self.test_data.get("tagging_image_successful_response"), + self.test_data.get("task_info_response"), + self.test_data.get("image_distribution_successful_response"), + self.test_data.get("task_info_response"), + self.test_data.get("image_activation_successful_response") + ] + elif "swim_image_import" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("task_info_response"), + self.test_data.get("image_already_exists_response"), + ] + elif "untag_image" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_id_fetched_successfully_response"), + self.test_data.get("fetch_site_id_response"), + self.test_data.get("device_family_fetched_successfully"), + self.test_data.get("task_info_response"), + self.test_data.get("untagging_image_successful_response"), + ] + elif "incorrect_site_untag_golden_image" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_id_fetched_successfully_response"), + Exception() + ] + elif "image_doesnot_exist_response" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_doesnot_exist_response"), + ] + elif "tag_golden_incorrect_family_name" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_id_fetched_successfully_response"), + self.test_data.get("fetch_site_id_response"), + self.test_data.get("device_family_fetched_successfully"), + ] + elif "only_image_distribution" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_id_fetched_successfully_response"), + self.test_data.get("device_id_fetched_successfully_response"), + self.test_data.get("task_info_response"), + self.test_data.get("image_distribution_successful_response"), + ] + elif "only_image_activation" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_id_fetched_successfully_response"), + self.test_data.get("device_id_fetched_successfully_response"), + self.test_data.get("task_info_response"), + self.test_data.get("image_activation_successful_response"), + ] + elif "device_doesnot_exist" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("image_id_fetched_successfully_response"), + self.test_data.get("device_doesnot_exist_response"), + ] + + def test_swim_full_flow(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('msg'), + "Image activated successfully" + ) + + def test_swim_image_import(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_image_import") + ) + ) + result = self.execute_module(changed=False, failed=False) + self.assertEqual( + result.get('msg'), + "Image already exists." + ) + + def test_swim_untag_image(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.playbook_config_untag_image + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('msg'), + "Un-tagging image as Golden." + ) + + def test_swim_missing_param_tag_golden_image(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_tag_golden_image_missing_param") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Image details for tagging not provided" + ) + + def test_swim_incorrect_site_untag_golden_image(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.playbook_config_untag_image + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Site not found" + ) + + def test_swim_image_doesnot_exist_response(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.playbook_config_untag_image + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Image not found" + ) + + def test_swim_only_image_distribution(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_distribution") + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('msg'), + "Image Distributed Successfully" + ) + + def test_swim_image_distribution_missing_param(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_distribution_missing_param") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Image details for distribution not provided" + ) + + def test_swim_only_image_activation(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_activation") + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('msg'), + "Image activated successfully" + ) + + def test_swim_image_activation_missing_param(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_activation_missing_param") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Image details for activation not provided" + ) + + def test_swim_tag_golden_incorrect_family_name(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_tag_golden_image_incorrect_family_name") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Family Device Name not found" + ) + + def test_swim_device_doesnot_exist(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + config=self.test_data.get("playbook_config_activation") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Device not found" + ) diff --git a/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_template_intent.py b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_template_intent.py new file mode 100644 index 00000000..1cde7f7d --- /dev/null +++ b/ansible_collections/cisco/dnac/tests/unit/modules/dnac/test_template_intent.py @@ -0,0 +1,244 @@ +# Copyright (c) 2020-2022 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Make coding more python3-ish +from __future__ import absolute_import, division, print_function + +__metaclass__ = type +import pdb + +from unittest.mock import patch +from ansible_collections.cisco.dnac.plugins.modules import template_intent +from .dnac_module import TestDnacModule, set_module_args, loadPlaybookData + +import json +import copy + + +class TestDnacTemplateIntent(TestDnacModule): + + module = template_intent + + test_data = loadPlaybookData("template_intent") + + playbook_config = test_data.get("playbook_config") + playbook_config_missing_param = test_data.get("playbook_config_missing_param") + + def setUp(self): + super(TestDnacTemplateIntent, self).setUp() + self.mock_dnac_init = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.__init__") + self.run_dnac_init = self.mock_dnac_init.start() + self.run_dnac_init.side_effect = [None] + self.mock_dnac_exec = patch( + "ansible_collections.cisco.dnac.plugins.module_utils.dnac.DNACSDK.exec" + ) + self.run_dnac_exec = self.mock_dnac_exec.start() + + def tearDown(self): + super(TestDnacTemplateIntent, self).tearDown() + self.mock_dnac_exec.stop() + self.mock_dnac_init.stop() + + def load_fixtures(self, response=None, device=""): + if "create_template" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("create_template_list_response"), + self.test_data.get("create_template_get_project_response"), + self.test_data.get("create_template_response"), + self.test_data.get("create_template_task_details_for_create"), + self.test_data.get("create_template_version_template_response"), + self.test_data.get("create_template_task_details_for_versioning") + ] + elif "update_not_needed" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("update_template_list"), + self.test_data.get("update_template_existing_template"), + ] + elif "update_needed" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("update_template_list"), + self.test_data.get("update_template_existing_template_needs_update"), + self.test_data.get("update_template_response"), + self.test_data.get("update_template_version_template_response"), + self.test_data.get("update_template_task_details_for_versioning") + ] + elif "project_not_found" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + [], + ] + elif "delete_non_existing_template" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("create_template_list_response") + ] + elif "delete_template" in self._testMethodName: + self.run_dnac_exec.side_effect = [ + self.test_data.get("update_template_list"), + self.test_data.get("update_template_existing_template_needs_update"), + self.test_data.get("delete_template_response"), + self.test_data.get("delete_template_task_details"), + ] + + def test_template_intent_create_template(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('response').get('progress'), + "Successfully committed template ANSIBLE-TEST to version 1" + ) + + def test_template_intent_update_not_needed(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=False) + self.assertEqual( + result.get('msg'), + "Template does not need update" + ) + + def test_template_intent_update_needed(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('response').get('progress'), + "Successfully committed template ANSIBLE-TEST to version 2" + ) + + def test_template_intent_project_not_found(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Project Not Found" + ) + + def test_template_intent_delete_non_existing_template(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Template not found" + ) + + def test_template_intent_delete_template(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="deleted", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=True, failed=False) + self.assertEqual( + result.get('response').get('progress'), + "Successfully deleted template with name fd74ab6c-fdda-465e-9f59-fb7eac7d6b15" + ) + + def test_template_intent_missing_param(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.playbook_config_missing_param + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "missing required arguments: language or deviceTypes or softwareType" + ) + + def test_template_intent_invalid_state(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merge", + config=self.playbook_config + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "value of state must be one of: merged, deleted, got: merge" + ) + + def test_template_intent_invalid_param(self): + set_module_args( + dict( + dnac_host="1.1.1.1", + dnac_username="dummy", + dnac_password="dummy", + dnac_log=True, + state="merged", + config=self.test_data.get("playbook_config_invalid_param") + ) + ) + result = self.execute_module(changed=False, failed=True) + self.assertEqual( + result.get('msg'), + "Invalid parameters in playbook: velocty : Invalid choice provided" + ) -- cgit v1.2.3