netapp.ontap.na_ontap_rest_info – NetApp ONTAP information gatherer using REST APIs

Note

This plugin is part of the netapp.ontap collection (version 21.10.0).

To install it use: ansible-galaxy collection install netapp.ontap.

To use it in a playbook, specify: netapp.ontap.na_ontap_rest_info.

New in version 20.5.0: of netapp.ontap

Synopsis

  • This module allows you to gather various information about ONTAP configuration using REST APIs

Requirements

The below requirements are needed on the host that executes this module.

  • Ansible 2.9

  • Python3 netapp-lib (2018.11.13) or later. Install using ‘pip install netapp-lib’

  • netapp-lib 2020.3.12 is strongly recommended as it provides better error reporting for connection issues.

  • A physical or virtual clustered Data ONTAP system. The modules support Data ONTAP 9.1 and onward.

  • REST support requires ONTAP 9.6 or later.

  • To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’

Parameters

Parameter Choices/Defaults Comments
cert_filepath
string
added in 20.6.0 of netapp.ontap
path to SSL client cert file (.pem).
not supported with python 2.6.
feature_flags
dictionary
added in 20.5.0 of netapp.ontap
Enable or disable a new feature.
This can be used to enable an experimental feature or disable a new feature that breaks backward compatibility.
Supported keys and values are subject to change without notice. Unknown keys are ignored.
fields
list / elements=string
added in 20.6.0 of netapp.ontap
Request specific fields from subset. '*' to return all the fields, one or more subsets are allowed. '<list of fields>' to return specified fields, only one subset will be allowed.
If the option is not present, return all the fields.
gather_subset
list / elements=string
Default:
"demo"
When supplied, this argument will restrict the information collected to a given subset. Either the info name or the REST API can be given. Possible values for this argument include "aggregate_info" or "storage/aggregates", "aggr_efficiency_info" "application_info" or "application/applications", "application_template_info" or "application/templates", "autosupport_check_info" or "support/autosupport/check", "autosupport_config_info" or "support/autosupport", "autosupport_messages_history" or "support/autosupport/messages", "broadcast_domains_info" or "net_port_broadcast_domain_info" or "network/ethernet/broadcast-domains", "cifs_home_directory_info" or "protocols/cifs/home-directory/search-paths", "cifs_services_info" or "cifs_options_info" or "protocols/cifs/services", "cifs_vserver_security_info", "cifs_share_info" or "protocols/cifs/shares", "clock_info" "cloud_targets_info" or "cloud/targets", "cluster_chassis_info" or "cluster/chassis", "cluster_log_forwarding_info" or "security/audit/destinations" "cluster_identity_info", "cluster_jobs_info" or "cluster/jobs", "cluster_metrics_info" or "cluster/metrics", "cluster_metrocluster_diagnostics" or "metrocluster_check_info" or "cluster/metrocluster/diagnostics" "cluster_node_info" or "sysconfig_info" or "cluster/nodes", "cluster_peer_info" or "cluster/peers", "cluster_schedules" or "job_schedule_cron_info" or "cluster/schedules", "cluster_software_download" or "cluster/software/download", "cluster_software_history" or "cluster/software/history", "cluster_software_packages" or "cluster/software/packages", "cluster_switch_info" or "network/ethernet/switches" "disk_info" or "storage/disks", "event_notification_info" or "support/ems/destinations", "event_notification_destination_info" or "support/ems/destinations", "export_policy_info" or "protocols/nfs/export-policies" "file_directory_security" or "private/cli/vserver/security/file-directory", "initiator_groups_info" or "igroup_info" or "protocols/san/igroups", "ip_interfaces_info" or "net_interface_info" or "network/ip/interfaces", "ip_routes_info" or "net_routes_info" or "network/ip/routes", "ip_service_policies" or "net_interface_service_policy_info" or "network/ip/service-policies", "kerberos_realm_info" or "protocols/nfs/kerberos/realms" "license_info" or "cluster/licensing/licenses" "network_ipspaces_info" or "net_ipspaces_info" or "network/ipspaces", "network_ports_info" or " net_port_info" or "network/ethernet/ports", "net_vlan_info", "ntp_server_info" or "cluster/ntp/servers" "nvme_info" or "protocols/nvme/services", "nvme_interface_info" or "protocols/nvme/interfaces" "nvme_subsystem_info" or "protocols/nvme/subsystems" "metrocluster_info" or "cluster/metrocluster" "metrocluster-node-get-iter" or "cluster/metrocluster/nodes "ontap_system_version" or " cluster_image_info" or "cluster/software", "san_fc_logins_info" or "network/fc/logins", "san_fc_wppn-aliases" or "fcp_alias_info" or "network/fc/wwpn-aliases", "san_fcp_services" or "fcp_service_info" or "protocols/san/fcp/services", "san_iscsi_credentials" or "protocols/san/iscsi/credentials", "san_iscsi_services" or "iscsi_service_info" or "protocols/san/iscsi/services", "san_lun_maps" or "lun_map_info" or "protocols/san/lun-maps", "security_login_info" or "security_login_account_info" or "security/accounts", "security_login_rest_role_info" or "security/roles", "sis_info", "sis_policy_info" or "storage/volume-efficiency-policies", "snapmirror_destination_info" "snapmirror_info" or "snapmirror/relationships", "snapmirror_policy_info" or "snapmirror/policies" "storage_bridge_info" or "storage/bridges", "storage_flexcaches_info" or "storage/flexcache/flexcaches", "storage_flexcaches_origin_info" or "storage/flexcache/origins", "storage_luns_info" or "lun_info" or "storage/luns", "storage_NVMe_namespaces" or "nvme_namespace_info" or "storage/namespaces", "storage_ports_info" or "storage/ports", "storage_qos_policies" or "qos_policy_info" or "qos_adaptive_policy_info" or "storage/qos/policies", "storage_qtrees_config" or "qtree_info" or "storage/qtrees", "storage_quota_reports" or "quota_report_info" or "storage/quota/reports", "storage_quota_policy_rules" or "storage/quota/rules", "storage_shelves_config" or "shelf_info" or "storage/shelves", "storage_snapshot_policies" or "snapshot_policy_info" or "storage/snapshot-policies", "support_ems_config" or "support/ems", "support_ems_events" or "support/ems/events", "support_ems_filters" or "support/ems/filters", "svm_dns_config_info" or "net_dns_info" or "name-services/dns", "svm_ldap_config_info" or "ldap_client" or "ldap_config" or "name-services/ldap", "svm_name_mapping_config_info" or "name-services/name-mappings", "svm_nis_config_info" or "name-services/nis", "svm_peers_info" or "vserver_peer_info" or "svm/peers", "svm_peer-permissions_info" or "svm/peer-permissions", "sys_cluster_alerts" or "private/support/alerts" "system_node_info" "vserver_info" or "svm/svms", "vserver_nfs_info" or "nfs_info" or "protocols/nfs/services" "volume_info" or "storage/volumes", "volume_space_info", "vscan_connection_status_all_info" or "protocols/vscan/server-status" "vscan_status_info" or "vscan_info" or "protocols/vscan", Can specify a list of values to include a larger subset.
REST APIs are supported with ONTAP 9.6 onwards.
hostname
string / required
The hostname or IP address of the ONTAP instance.
http_port
integer
Override the default port (80 or 443) with this port
https
boolean
    Choices:
  • no ←
  • yes
Enable and disable https.
Ignored when using REST as only https is supported.
Ignored when using SSL certificate authentication as it requires SSL.
key_filepath
string
added in 20.6.0 of netapp.ontap
path to SSL client key file.
max_records
integer
Default:
1024
Maximum number of records returned in a single call.
ontapi
integer
The ontap api version to use
parameters
dictionary
added in 20.7.0 of netapp.ontap
Allows for any rest option to be passed in
password
string
Password for the specified user.

aliases: pass
state
string
deprecated as of 21.1.0.
this option was ignored and continues to be ignored.
use_python_keys
boolean
added in 21.9.0 of netapp.ontap
    Choices:
  • no ←
  • yes
If true, / in the returned dictionary keys are translated to _.
It makes it possible to use a . notation when processing the output.
For instance ontap_info["svm/svms"] can be accessed as ontap_info.svm_svms.
use_rest
string
Default:
"auto"
REST API if supported by the target system for all the resources and attributes the module requires. Otherwise will revert to ZAPI.
always -- will always use the REST API
never -- will always use the ZAPI
auto -- will try to use the REST Api
username
string
This can be a Cluster-scoped or SVM-scoped account, depending on whether a Cluster-level or SVM-level API is required.
For more information, please read the documentation https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/.
Two authentication methods are supported
1. basic authentication, using username and password,
2. SSL certificate authentication, using a ssl client cert file, and optionally a private key file.
To use a certificate, the certificate must have been installed in the ONTAP cluster, and cert authentication must have been enabled.

aliases: user
validate_certs
boolean
    Choices:
  • no
  • yes ←
If set to no, the SSL certificates will not be validated.
This should only set to False used on personally controlled sites using self-signed certificates.

Notes

Note

  • security_login_role_config_info there is no REST equivalent.

  • security_login_role_info there is no REST equivalent.

  • security_key_manager_key_info there is no REST equivalent.

  • vserver_motd_info there is no REST equivalent.

  • vserver_login_banner_info there is no REST equivalent.

  • vscan_connection_extended_stats_info there is no REST equivalent.

  • env_sensors_info there is no REST equivalent.

  • fcp_adapter_info there is no REST equivalent.

  • net_dev_discovery_info there is no REST equivalent.

  • net_failover_group_info there is no REST equivalent.

  • net_firewall_info there is no REST equivalent.

  • ntfs_dacl_info there is no REST equivalent.

  • ntfs_sd_info there is no REST equivalent.

  • role_info there is not REST equivalent.

  • subsys_health_info there is not REST equivalent.

  • volume_move_target_aggr_info there is not REST equivalent.

  • The modules prefixed with na_ontap are built to support the ONTAP storage platform.

Examples

- name: run ONTAP gather facts for vserver info
  netapp.ontap.na_ontap_rest_info:
      hostname: "1.2.3.4"
      username: "testuser"
      password: "test-password"
      https: true
      validate_certs: false
      use_rest: Always
      gather_subset:
      - vserver_info

- name: run ONTAP gather facts for aggregate info and volume info
  netapp.ontap.na_ontap_rest_info:
      hostname: "1.2.3.4"
      username: "testuser"
      password: "test-password"
      https: true
      validate_certs: false
      use_rest: Always
      gather_subset:
      - aggregate_info
      - volume_info

- name: run ONTAP gather facts for all subsets
  netapp.ontap.na_ontap_rest_info:
      hostname: "1.2.3.4"
      username: "testuser"
      password: "test-password"
      https: true
      validate_certs: false
      use_rest: Always
      gather_subset:
      - all

- name: run ONTAP gather facts for aggregate info and volume info with fields section
  netapp.ontap.na_ontap_rest_info:
      hostname: "1.2.3.4"
      username: "testuser"
      password: "test-password"
      https: true
      fields:
        - '*'
      validate_certs: false
      use_rest: Always
      gather_subset:
        - aggregate_info
        - volume_info

- name: run ONTAP gather facts for aggregate info with specified fields
  netapp.ontap.na_ontap_rest_info:
      hostname: "1.2.3.4"
      username: "testuser"
      password: "test-password"
      https: true
      fields:
        - 'uuid'
        - 'name'
        - 'node'
      validate_certs: false
      use_rest: Always
      gather_subset:
        - aggregate_info
      parameters:
        recommend:
          true

- name: run ONTAP gather facts for volume info with query on name and state
  netapp.ontap.na_ontap_rest_info:
      hostname: "1.2.3.4"
      username: "testuser"
      password: "test-password"
      https: true
      validate_certs: false
      gather_subset:
        - volume_info
      parameters:
        name: ansible*
        state: online
- name: run ONTAP gather fact to get DACLs
  netapp.ontap.na_ontap_rest_info:
    hostname: "1.2.3.4"
    username: "testuser"
    password: "test-password"
    https: true
    validate_certs: false
    gather_subset:
        - file_directory_security
    parameters:
      vserver: svm1
      path: /vol1/qtree1
      use_python_keys: true

Authors