#adding 'fields' to REST api call

1 messages · Page 1 of 1 (latest)

hearty hill
#

We are looking for additional fields to be supported in REST. Specifically 'position' in the following Ansible task.

- name: Check for Disk settings
  netapp.ontap.na_ontap_restit:
    hostname: "{{ hostname }}"
    username: "{{ username }}"
    password: "{{ password }}"
    https: true
    validate_certs: false
    api: storage/disks?privilege_level=diagnostic
    method: GET
    query:
      fields: position
  register: result
- debug: var=result

TASK [Check for Disk settings] ******************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "error_code": "262197", "error_message": "The value "position" is invalid for field "fields" (<field,...>)", "msg": "Error when calling 'storage/disks?privilege_level=diagnostic': {u'target': u'fields'}", "response": null, "status_code": 400}

https://docs.netapp.com/us-en/ontap-restmap-9121/storage-disk.html#storage-disk-get-iter

As of ONTAP 9.12.1 this is not supported ^^

swift granite
#

You can get it using private cli
https://CLUSTER_IP/api/private/cli/disk?fields=position