����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: ~ $
""" this is ndmp module

 (c) 2019, NetApp, Inc
 # GNU General Public License v3.0+ (see COPYING 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 = '''
---
module: na_ontap_ndmp
short_description: NetApp ONTAP NDMP services configuration
extends_documentation_fragment:
    - netapp.ontap.netapp.na_ontap
version_added: 2.9.0
author: NetApp Ansible Team (@carchi8py) <ng-ansibleteam@netapp.com>

description:
    - Modify NDMP Services.

options:

  vserver:
    description:
    - Name of the vserver.
    required: true
    type: str

  abort_on_disk_error:
    description:
    - Enable abort on disk error.
    type: bool

  authtype:
    description:
    - Authentication type.
    type: list
    elements: str

  backup_log_enable:
    description:
    - Enable backup log.
    type: bool

  data_port_range:
    description:
    - Data port range. Modification not supported for data Vservers.
    type: str

  debug_enable:
    description:
    - Enable debug.
    type: bool

  debug_filter:
    description:
    - Debug filter.
    type: str

  dump_detailed_stats:
    description:
    - Enable logging of VM stats for dump.
    type: bool

  dump_logical_find:
    description:
    - Enable logical find for dump.
    type: str

  enable:
    description:
    - Enable NDMP on vserver.
    type: bool

  fh_dir_retry_interval:
    description:
    - FH throttle value for dir.
    type: int

  fh_node_retry_interval:
    description:
    - FH throttle value for node.
    type: int

  ignore_ctime_enabled:
    description:
    - Ignore ctime.
    type: bool

  is_secure_control_connection_enabled:
    description:
    - Is secure control connection enabled.
    type: bool

  offset_map_enable:
    description:
    - Enable offset map.
    type: bool

  per_qtree_exclude_enable:
    description:
    - Enable per qtree exclusion.
    type: bool

  preferred_interface_role:
    description:
    - Preferred interface role.
    type: list
    elements: str

  restore_vm_cache_size:
    description:
    - Restore VM file cache size. Value range [4-1024]
    type: int

  secondary_debug_filter:
    description:
    - Secondary debug filter.
    type: str

  tcpnodelay:
    description:
    - Enable TCP nodelay.
    type: bool

  tcpwinsize:
    description:
    - TCP window size.
    type: int
'''

EXAMPLES = '''
    - name: modify ndmp
      na_ontap_ndmp:
        vserver: ansible
        hostname: "{{ hostname }}"
        abort_on_disk_error: true
        authtype: plaintext,challenge
        backup_log_enable: true
        data_port_range: 8000-9000
        debug_enable: true
        debug_filter: filter
        dump_detailed_stats: true
        dump_logical_find: default
        enable: true
        fh_dir_retry_interval: 100
        fh_node_retry_interval: 100
        ignore_ctime_enabled: true
        is_secure_control_connection_enabled: true
        offset_map_enable: true
        per_qtree_exclude_enable: true
        preferred_interface_role: node_mgmt,intercluster
        restore_vm_cache_size: 1000
        secondary_debug_filter: filter
        tcpnodelay: true
        tcpwinsize: 10000
        username: user
        password: pass
        https: False
'''

RETURN = '''
'''

import traceback
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_native
import ansible_collections.netapp.ontap.plugins.module_utils.netapp as netapp_utils
from ansible_collections.netapp.ontap.plugins.module_utils.netapp_module import NetAppModule
from ansible_collections.netapp.ontap.plugins.module_utils.netapp import OntapRestAPI

HAS_NETAPP_LIB = netapp_utils.has_netapp_lib()


class NetAppONTAPNdmp(object):
    '''
    modify vserver cifs security
    '''
    def __init__(self):
        self.use_rest = False

        self.argument_spec = netapp_utils.na_ontap_host_argument_spec()
        self.modifiable_options = dict(
            abort_on_disk_error=dict(required=False, type='bool'),
            authtype=dict(required=False, type='list', elements='str'),
            backup_log_enable=dict(required=False, type='bool'),
            data_port_range=dict(required=False, type='str'),
            debug_enable=dict(required=False, type='bool'),
            debug_filter=dict(required=False, type='str'),
            dump_detailed_stats=dict(required=False, type='bool'),
            dump_logical_find=dict(required=False, type='str'),
            enable=dict(required=False, type='bool'),
            fh_dir_retry_interval=dict(required=False, type='int'),
            fh_node_retry_interval=dict(required=False, type='int'),
            ignore_ctime_enabled=dict(required=False, type='bool'),
            is_secure_control_connection_enabled=dict(required=False, type='bool'),
            offset_map_enable=dict(required=False, type='bool'),
            per_qtree_exclude_enable=dict(required=False, type='bool'),
            preferred_interface_role=dict(required=False, type='list', elements='str'),
            restore_vm_cache_size=dict(required=False, type='int'),
            secondary_debug_filter=dict(required=False, type='str'),
            tcpnodelay=dict(required=False, type='bool'),
            tcpwinsize=dict(required=False, type='int')
        )
        self.argument_spec.update(dict(
            vserver=dict(required=True, type='str')
        ))

        self.argument_spec.update(self.modifiable_options)

        self.module = AnsibleModule(
            argument_spec=self.argument_spec,
            supports_check_mode=True
        )

        self.na_helper = NetAppModule()
        self.parameters = self.na_helper.set_parameters(self.module.params)
        # API should be used for ONTAP 9.6 or higher, ZAPI for lower version
        self.rest_api = OntapRestAPI(self.module)
        unsupported_rest_properties = ['abort_on_disk_error', 'backup_log_enable', 'data_port_range',
                                       'debug_enable', 'debug_filter', 'dump_detailed_stats',
                                       'dump_logical_find', 'fh_dir_retry_interval', 'fh_node_retry_interval',
                                       'ignore_ctime_enabled', 'is_secure_control_connection_enabled',
                                       'offset_map_enable', 'per_qtree_exclude_enable', 'preferred_interface_role',
                                       'restore_vm_cache_size', 'secondary_debug_filter', 'tcpnodelay', 'tcpwinsize']
        self.use_rest = self.rest_api.is_rest_supported_properties(self.parameters, unsupported_rest_properties)
        if not self.use_rest:
            if HAS_NETAPP_LIB is False:
                self.module.fail_json(msg="the python NetApp-Lib module is required")
            else:
                self.server = netapp_utils.setup_na_ontap_zapi(module=self.module, vserver=self.parameters['vserver'])

    def get_ndmp_svm_uuid(self):

        """
            Get a svm's UUID
            :return: uuid of the node
            """
        params = {'svm.name': self.parameters['vserver']}
        api = "protocols/ndmp/svms"
        message, error = self.rest_api.get(api, params)
        if error is not None:
            self.module.fail_json(msg=error)
        if 'records' in message and len(message['records']) == 0:
            self.module.fail_json(msg='Error fetching uuid for vserver %s: ' % (self.parameters['vserver']))
        if len(message.keys()) == 0:
            error = "No information collected from %s: %s" % (api, repr(message))
            self.module.fail_json(msg=error)
        elif 'records' not in message:
            error = "Unexpected response from %s: %s" % (api, repr(message))
            self.module.fail_json(msg=error)
        return message['records'][0]['svm']['uuid']

    def ndmp_get_iter(self, uuid=None):
        """
        get current vserver ndmp attributes.
        :return: a dict of ndmp attributes.
        """
        if self.use_rest:
            data = dict()
            params = {'fields': 'authentication_types,enabled'}
            api = '/protocols/ndmp/svms/' + uuid
            message, error = self.rest_api.get(api, params)
            data['enable'] = message['enabled']
            data['authtype'] = message['authentication_types']

            if error:
                self.module.fail_json(msg=error)
            return data
        else:
            ndmp_get = netapp_utils.zapi.NaElement('ndmp-vserver-attributes-get-iter')
            query = netapp_utils.zapi.NaElement('query')
            ndmp_info = netapp_utils.zapi.NaElement('ndmp-vserver-attributes-info')
            ndmp_info.add_new_child('vserver', self.parameters['vserver'])
            query.add_child_elem(ndmp_info)
            ndmp_get.add_child_elem(query)
            ndmp_details = dict()
            try:
                result = self.server.invoke_successfully(ndmp_get, enable_tunneling=True)
            except netapp_utils.zapi.NaApiError as error:
                self.module.fail_json(msg='Error fetching ndmp from %s: %s'
                                      % (self.parameters['vserver'], to_native(error)),
                                      exception=traceback.format_exc())

            if result.get_child_by_name('num-records') and int(result.get_child_content('num-records')) > 0:
                ndmp_attributes = result.get_child_by_name('attributes-list').get_child_by_name('ndmp-vserver-attributes-info')
                self.get_ndmp_details(ndmp_details, ndmp_attributes)
            return ndmp_details

    def get_ndmp_details(self, ndmp_details, ndmp_attributes):
        """
        :param ndmp_details: a dict of current ndmp.
        :param ndmp_attributes: ndmp returned from api call in xml format.
        :return: None
        """
        for option in self.modifiable_options:
            option_type = self.modifiable_options[option]['type']
            if option_type == 'bool':
                ndmp_details[option] = self.str_to_bool(ndmp_attributes.get_child_content(self.attribute_to_name(option)))
            elif option_type == 'int':
                ndmp_details[option] = int(ndmp_attributes.get_child_content(self.attribute_to_name(option)))
            elif option_type == 'list':
                child_list = ndmp_attributes.get_child_by_name(self.attribute_to_name(option))
                values = [child.get_content() for child in child_list.get_children()]
                ndmp_details[option] = values
            else:
                ndmp_details[option] = ndmp_attributes.get_child_content(self.attribute_to_name(option))

    def modify_ndmp(self, modify):
        """
        :param modify: A list of attributes to modify
        :return: None
        """
        if self.use_rest:
            ndmp = dict()
            uuid = self.get_ndmp_svm_uuid()
            if self.parameters.get('enable'):
                ndmp['enabled'] = self.parameters['enable']
            if self.parameters.get('authtype'):
                ndmp['authentication_types'] = self.parameters['authtype']
            api = "protocols/ndmp/svms/" + uuid
            dummy, error = self.rest_api.patch(api, ndmp)
            if error:
                self.module.fail_json(msg=error)
        else:

            ndmp_modify = netapp_utils.zapi.NaElement('ndmp-vserver-attributes-modify')
            for attribute in modify:
                if attribute == 'authtype':
                    authtypes = netapp_utils.zapi.NaElement('authtype')
                    types = self.parameters['authtype']
                    for authtype in types:
                        authtypes.add_new_child('ndmpd-authtypes', authtype)
                    ndmp_modify.add_child_elem(authtypes)
                elif attribute == 'preferred_interface_role':
                    preferred_interface_roles = netapp_utils.zapi.NaElement('preferred-interface-role')
                    roles = self.parameters['preferred_interface_role']
                    for role in roles:
                        preferred_interface_roles.add_new_child('netport-role', role)
                    ndmp_modify.add_child_elem(preferred_interface_roles)
                else:
                    ndmp_modify.add_new_child(self.attribute_to_name(attribute), str(self.parameters[attribute]))
            try:
                self.server.invoke_successfully(ndmp_modify, enable_tunneling=True)
            except netapp_utils.zapi.NaApiError as exc:
                self.module.fail_json(msg='Error modifying ndmp on %s: %s'
                                      % (self.parameters['vserver'], to_native(exc)),
                                      exception=traceback.format_exc())

    @staticmethod
    def attribute_to_name(attribute):
        return str.replace(attribute, '_', '-')

    @staticmethod
    def str_to_bool(value):
        return value == 'true'

    def apply(self):
        """Call modify operations."""
        uuid = None
        if self.use_rest:
            # we only have the svm name, we need to the the uuid for the svm
            uuid = self.get_ndmp_svm_uuid()
        current = self.ndmp_get_iter(uuid=uuid)
        modify = self.na_helper.get_modified_attributes(current, self.parameters)

        if self.na_helper.changed:
            if self.module.check_mode:
                pass
            else:
                if modify:
                    self.modify_ndmp(modify)
        result = netapp_utils.generate_result(self.na_helper.changed, modify=modify)
        self.module.exit_json(**result)


def main():
    obj = NetAppONTAPNdmp()
    obj.apply()


if __name__ == '__main__':
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
na_ontap_active_directory.py File 14.01 KB 0644
na_ontap_active_directory_domain_controllers.py File 8.48 KB 0644
na_ontap_aggregate.py File 49.5 KB 0644
na_ontap_autosupport.py File 19.35 KB 0644
na_ontap_autosupport_invoke.py File 6.52 KB 0644
na_ontap_bgp_peer_group.py File 12.33 KB 0644
na_ontap_broadcast_domain.py File 29.74 KB 0644
na_ontap_broadcast_domain_ports.py File 8.37 KB 0644
na_ontap_cg_snapshot.py File 8.23 KB 0644
na_ontap_cifs.py File 23.23 KB 0644
na_ontap_cifs_acl.py File 14.53 KB 0644
na_ontap_cifs_local_group.py File 7.85 KB 0644
na_ontap_cifs_local_group_member.py File 11.25 KB 0644
na_ontap_cifs_local_user.py File 8.44 KB 0644
na_ontap_cifs_local_user_modify.py File 8.63 KB 0644
na_ontap_cifs_local_user_set_password.py File 5.94 KB 0644
na_ontap_cifs_server.py File 25.92 KB 0644
na_ontap_cluster.py File 33.16 KB 0644
na_ontap_cluster_ha.py File 5.3 KB 0644
na_ontap_cluster_peer.py File 19.14 KB 0644
na_ontap_command.py File 11.33 KB 0644
na_ontap_debug.py File 11.05 KB 0644
na_ontap_disk_options.py File 5.23 KB 0644
na_ontap_disks.py File 15.02 KB 0644
na_ontap_dns.py File 14.22 KB 0644
na_ontap_domain_tunnel.py File 4.88 KB 0644
na_ontap_efficiency_policy.py File 18.31 KB 0644
na_ontap_ems_destination.py File 6.97 KB 0644
na_ontap_ems_filter.py File 9.25 KB 0644
na_ontap_export_policy.py File 10.24 KB 0644
na_ontap_export_policy_rule.py File 32.27 KB 0644
na_ontap_fcp.py File 9.84 KB 0644
na_ontap_fdsd.py File 4.87 KB 0644
na_ontap_fdsp.py File 4.88 KB 0644
na_ontap_fdspt.py File 8.11 KB 0644
na_ontap_fdss.py File 3.51 KB 0644
na_ontap_file_directory_policy.py File 15.37 KB 0644
na_ontap_file_security_permissions.py File 36.06 KB 0644
na_ontap_file_security_permissions_acl.py File 21.03 KB 0644
na_ontap_firewall_policy.py File 13.85 KB 0644
na_ontap_firmware_upgrade.py File 41.58 KB 0644
na_ontap_flexcache.py File 28.38 KB 0644
na_ontap_fpolicy_event.py File 18.51 KB 0644
na_ontap_fpolicy_ext_engine.py File 20.8 KB 0644
na_ontap_fpolicy_policy.py File 15.76 KB 0644
na_ontap_fpolicy_scope.py File 23.33 KB 0644
na_ontap_fpolicy_status.py File 9.96 KB 0644
na_ontap_igroup.py File 29.17 KB 0644
na_ontap_igroup_initiator.py File 8.28 KB 0644
na_ontap_info.py File 72.19 KB 0644
na_ontap_interface.py File 71.15 KB 0644
na_ontap_ipspace.py File 10.23 KB 0644
na_ontap_iscsi.py File 12.24 KB 0644
na_ontap_iscsi_security.py File 13.12 KB 0644
na_ontap_job_schedule.py File 20 KB 0644
na_ontap_kerberos_interface.py File 8.3 KB 0644
na_ontap_kerberos_realm.py File 17.46 KB 0644
na_ontap_ldap.py File 7.33 KB 0644
na_ontap_ldap_client.py File 22.46 KB 0644
na_ontap_license.py File 29.15 KB 0644
na_ontap_local_hosts.py File 7.3 KB 0644
na_ontap_log_forward.py File 11.83 KB 0644
na_ontap_login_messages.py File 12.76 KB 0644
na_ontap_lun.py File 56.54 KB 0644
na_ontap_lun_copy.py File 8 KB 0644
na_ontap_lun_map.py File 13.03 KB 0644
na_ontap_lun_map_reporting_nodes.py File 10.87 KB 0644
na_ontap_mcc_mediator.py File 5.42 KB 0644
na_ontap_metrocluster.py File 5.28 KB 0644
na_ontap_metrocluster_dr_group.py File 7.89 KB 0644
na_ontap_motd.py File 7.76 KB 0644
na_ontap_name_mappings.py File 11.6 KB 0644
na_ontap_name_service_switch.py File 10.45 KB 0644
na_ontap_ndmp.py File 13.49 KB 0644
na_ontap_net_ifgrp.py File 22.62 KB 0644
na_ontap_net_port.py File 11.03 KB 0644
na_ontap_net_routes.py File 13.84 KB 0644
na_ontap_net_subnet.py File 16.43 KB 0644
na_ontap_net_vlan.py File 13.32 KB 0644
na_ontap_nfs.py File 34.3 KB 0644
na_ontap_node.py File 9.74 KB 0644
na_ontap_ntfs_dacl.py File 13.41 KB 0644
na_ontap_ntfs_sd.py File 10.14 KB 0644
na_ontap_ntp.py File 10.27 KB 0644
na_ontap_ntp_key.py File 5.7 KB 0644
na_ontap_nvme.py File 9.42 KB 0644
na_ontap_nvme_namespace.py File 9.3 KB 0644
na_ontap_nvme_subsystem.py File 19.7 KB 0644
na_ontap_object_store.py File 13.8 KB 0644
na_ontap_partitions.py File 17.81 KB 0644
na_ontap_ports.py File 23.49 KB 0644
na_ontap_portset.py File 18.02 KB 0644
na_ontap_publickey.py File 10.76 KB 0644
na_ontap_qos_adaptive_policy_group.py File 12.75 KB 0644
na_ontap_qos_policy_group.py File 24.56 KB 0644
na_ontap_qtree.py File 17.83 KB 0644
na_ontap_quota_policy.py File 9.62 KB 0644
na_ontap_quotas.py File 40.3 KB 0644
na_ontap_rest_cli.py File 4.84 KB 0644
na_ontap_rest_info.py File 54.29 KB 0644
na_ontap_restit.py File 13.1 KB 0644
na_ontap_s3_buckets.py File 25.13 KB 0644
na_ontap_s3_groups.py File 8.38 KB 0644
na_ontap_s3_policies.py File 8.51 KB 0644
na_ontap_s3_services.py File 7.89 KB 0644
na_ontap_s3_users.py File 6.86 KB 0644
na_ontap_security_certificates.py File 17.9 KB 0644
na_ontap_security_config.py File 12.77 KB 0644
na_ontap_security_ipsec_ca_certificate.py File 6.92 KB 0644
na_ontap_security_ipsec_config.py File 4.39 KB 0644
na_ontap_security_ipsec_policy.py File 17.64 KB 0644
na_ontap_security_key_manager.py File 27.86 KB 0644
na_ontap_security_ssh.py File 7.2 KB 0644
na_ontap_service_policy.py File 12.93 KB 0644
na_ontap_service_processor_network.py File 17.83 KB 0644
na_ontap_snaplock_clock.py File 6.08 KB 0644
na_ontap_snapmirror.py File 86.94 KB 0644
na_ontap_snapmirror_policy.py File 52.81 KB 0644
na_ontap_snapshot.py File 18.52 KB 0644
na_ontap_snapshot_policy.py File 31.57 KB 0644
na_ontap_snmp.py File 8.45 KB 0644
na_ontap_snmp_traphosts.py File 4.26 KB 0644
na_ontap_software_update.py File 34.05 KB 0644
na_ontap_ssh_command.py File 9.34 KB 0644
na_ontap_storage_auto_giveback.py File 9.69 KB 0644
na_ontap_storage_failover.py File 6.92 KB 0644
na_ontap_svm.py File 42.08 KB 0644
na_ontap_svm_options.py File 5.33 KB 0644
na_ontap_ucadapter.py File 11.6 KB 0644
na_ontap_unix_group.py File 18.27 KB 0644
na_ontap_unix_user.py File 12.12 KB 0644
na_ontap_user.py File 40.32 KB 0644
na_ontap_user_role.py File 22.64 KB 0644
na_ontap_volume.py File 142.63 KB 0644
na_ontap_volume_autosize.py File 15.57 KB 0644
na_ontap_volume_clone.py File 14.79 KB 0644
na_ontap_volume_efficiency.py File 32.69 KB 0644
na_ontap_volume_snaplock.py File 8.67 KB 0644
na_ontap_vscan.py File 5.85 KB 0644
na_ontap_vscan_on_access_policy.py File 24.2 KB 0644
na_ontap_vscan_on_demand_task.py File 17.45 KB 0644
na_ontap_vscan_scanner_pool.py File 12 KB 0644
na_ontap_vserver_audit.py File 13.73 KB 0644
na_ontap_vserver_cifs_security.py File 12.08 KB 0644
na_ontap_vserver_peer.py File 19.63 KB 0644
na_ontap_vserver_peer_permissions.py File 7.29 KB 0644
na_ontap_wait_for_condition.py File 16.11 KB 0644
na_ontap_wwpn_alias.py File 6.03 KB 0644
na_ontap_zapit.py File 10.09 KB 0644