����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# -*- coding: utf-8 -*-

# Copyright: (c) 2020, Anvitha Jain (@anvitha-jain) <anvjain@cisco.com>
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function

__metaclass__ = type

ANSIBLE_METADATA = {"metadata_version": "1.1", "status": ["preview"], "supported_by": "community"}

DOCUMENTATION = r"""
---
module: mso_rest
short_description: Direct access to the Cisco MSO REST API
description:
- Enables the management of the Cisco MSO fabric through direct access to the Cisco MSO REST API.
- This module is not idempotent and does not report changes.
options:
  method:
    description:
    - The HTTP method of the request.
    - Using C(delete) is typically used for deleting objects.
    - Using C(get) is typically used for querying objects.
    - Using C(post) is typically used for modifying objects.
    - Using C(put) is typically used for modifying existing objects.
    - Using C(patch) is typically also used for modifying existing objects.
    type: str
    choices: [ delete, get, post, put, patch ]
    default: get
    aliases: [ action ]
  path:
    description:
    - URI being used to execute API calls.
    type: str
    required: true
    aliases: [ uri ]
  content:
    description:
    - Sets the payload of the API request directly.
    - This may be convenient to template simple requests.
    - For anything complex use the C(template) lookup plugin (see examples).
    type: raw
    aliases: [ payload ]
extends_documentation_fragment:
- cisco.mso.modules

notes:
- Most payloads are known not to be idempotent, so be careful when constructing payloads.
seealso:
- module: cisco.mso.mso_tenant
author:
- Anvitha Jain (@anvitha-jain)
"""

EXAMPLES = r"""
- name: Add schema (JSON)
  cisco.mso.mso_rest:
    host: mso
    username: admin
    password: SomeSecretPassword
    path: /mso/api/v1/schemas
    method: post
    content:
      {
          "displayName": "{{ mso_schema | default('ansible_test') }}",
          "templates": [{
              "name": "Template_1",
              "tenantId": "{{ add_tenant.jsondata.id }}",
              "displayName": "Template_1",
              "templateSubType": [],
              "templateType": "stretched-template",
              "anps": [],
              "contracts": [],
              "vrfs": [],
              "bds": [],
              "filters": [],
              "externalEpgs": [],
              "serviceGraphs": [],
              "intersiteL3outs": []
          }],
          "sites": [],
          "_updateVersion": 0
      }
  delegate_to: localhost

- name: Query schema
  cisco.mso.mso_rest:
    host: mso
    username: admin
    password: SomeSecretPassword
    path: /mso/api/v1/schemas
    method: get
  delegate_to: localhost

- name: Patch schema (YAML)
  cisco.mso.mso_rest:
    host: mso
    username: admin
    password: SomeSecretPassword
    path: "/mso/api/v1/schemas/{{ add_schema.jsondata.id }}"
    method: patch
    content:
      - op: add
        path: /templates/Template_1/anps/-
        value:
          name: AP2
          displayName: AP2
          epgs: []
        _updateVersion: 0
  delegate_to: localhost

- name: Add a tenant from a templated payload file from templates
  cisco.mso.mso_rest:
    host: mso
    username: admin
    password: SomeSecretPassword
    method: post
    path: /api/v1/tenants
    content: "{{ lookup('template', 'mso/tenant.json.j2') }}"
  delegate_to: localhost
"""

RETURN = r"""
"""

# Optional, only used for YAML validation
try:
    import yaml

    HAS_YAML = True
except Exception:
    HAS_YAML = False

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.mso.plugins.module_utils.mso import MSOModule, mso_argument_spec
from ansible.module_utils._text import to_text


def main():
    argument_spec = mso_argument_spec()
    argument_spec.update(
        path=dict(type="str", required=True, aliases=["uri"]),
        method=dict(type="str", default="get", choices=["delete", "get", "post", "put", "patch"], aliases=["action"]),
        content=dict(type="raw", aliases=["payload"]),
    )

    module = AnsibleModule(
        argument_spec=argument_spec,
    )

    content = module.params.get("content")
    path = module.params.get("path")

    mso = MSOModule(module)

    # Validate content/payload
    if content and isinstance(content, str) and HAS_YAML:
        try:
            # Validate YAML/JSON string
            content = yaml.safe_load(content)
        except Exception as e:
            module.fail_json(msg="Failed to parse provided JSON/YAML payload: %s" % to_text(e), exception=to_text(e), payload=content)

    mso.method = mso.params.get("method").upper()

    # Perform request
    if module.check_mode:
        mso.result["jsondata"] = content
    else:
        mso.result["jsondata"] = mso.request(path, method=mso.method, data=content, api_version=None)

    mso.result["status"] = mso.status

    if mso.method != "GET":
        mso.result["changed"] = True
        if mso.method == "DELETE":
            mso.result["jsondata"] = None

    # Report success
    mso.exit_json(**mso.result)


if __name__ == "__main__":
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
mso_backup.py File 10.65 KB 0644
mso_backup_schedule.py File 6.39 KB 0644
mso_dhcp_option_policy.py File 4.65 KB 0644
mso_dhcp_option_policy_option.py File 5.39 KB 0644
mso_dhcp_relay_policy.py File 4.52 KB 0644
mso_dhcp_relay_policy_provider.py File 7.98 KB 0644
mso_label.py File 3.96 KB 0644
mso_remote_location.py File 7.81 KB 0644
mso_rest.py File 5.11 KB 0644
mso_role.py File 7.11 KB 0644
mso_schema.py File 3.26 KB 0644
mso_schema_clone.py File 3.72 KB 0644
mso_schema_site.py File 4.94 KB 0644
mso_schema_site_anp.py File 6.44 KB 0644
mso_schema_site_anp_epg.py File 9.57 KB 0644
mso_schema_site_anp_epg_bulk_staticport.py File 14.7 KB 0644
mso_schema_site_anp_epg_domain.py File 18.1 KB 0644
mso_schema_site_anp_epg_selector.py File 13.02 KB 0644
mso_schema_site_anp_epg_staticleaf.py File 7.78 KB 0644
mso_schema_site_anp_epg_staticport.py File 13.95 KB 0644
mso_schema_site_anp_epg_subnet.py File 8.32 KB 0644
mso_schema_site_bd.py File 6.65 KB 0644
mso_schema_site_bd_l3out.py File 8.04 KB 0644
mso_schema_site_bd_subnet.py File 8.34 KB 0644
mso_schema_site_external_epg.py File 7.21 KB 0644
mso_schema_site_external_epg_selector.py File 8.88 KB 0644
mso_schema_site_l3out.py File 7.19 KB 0644
mso_schema_site_service_graph.py File 9.1 KB 0644
mso_schema_site_vrf.py File 5.66 KB 0644
mso_schema_site_vrf_region.py File 8.47 KB 0644
mso_schema_site_vrf_region_cidr.py File 9.57 KB 0644
mso_schema_site_vrf_region_cidr_subnet.py File 10.54 KB 0644
mso_schema_site_vrf_region_hub_network.py File 7.59 KB 0644
mso_schema_template.py File 7.52 KB 0644
mso_schema_template_anp.py File 5.69 KB 0644
mso_schema_template_anp_epg.py File 15.14 KB 0644
mso_schema_template_anp_epg_contract.py File 8.03 KB 0644
mso_schema_template_anp_epg_selector.py File 8.49 KB 0644
mso_schema_template_anp_epg_subnet.py File 7.38 KB 0644
mso_schema_template_bd.py File 16.94 KB 0644
mso_schema_template_bd_dhcp_policy.py File 7.24 KB 0644
mso_schema_template_bd_subnet.py File 7.51 KB 0644
mso_schema_template_clone.py File 7.72 KB 0644
mso_schema_template_contract_filter.py File 16.95 KB 0644
mso_schema_template_contract_service_graph.py File 12.3 KB 0644
mso_schema_template_deploy.py File 3.95 KB 0644
mso_schema_template_deploy_status.py File 4.51 KB 0644
mso_schema_template_external_epg.py File 10.77 KB 0644
mso_schema_template_external_epg_contract.py File 7.59 KB 0644
mso_schema_template_external_epg_selector.py File 7.6 KB 0644
mso_schema_template_external_epg_subnet.py File 7.21 KB 0644
mso_schema_template_externalepg.py File 10.77 KB 0644
mso_schema_template_filter_entry.py File 12.28 KB 0644
mso_schema_template_l3out.py File 6.59 KB 0644
mso_schema_template_migrate.py File 6.3 KB 0644
mso_schema_template_service_graph.py File 8.69 KB 0644
mso_schema_template_vrf.py File 6.63 KB 0644
mso_schema_template_vrf_contract.py File 8.68 KB 0644
mso_schema_validate.py File 1.97 KB 0644
mso_service_node_type.py File 4.5 KB 0644
mso_site.py File 8.5 KB 0644
mso_tenant.py File 6.09 KB 0644
mso_tenant_site.py File 13.21 KB 0644
mso_user.py File 7.88 KB 0644
mso_version.py File 1.53 KB 0644
ndo_schema_template_deploy.py File 4.2 KB 0644