block:
- name: Retrieve Source Volumes List
uri:
url: "https://{{ dms_ip }}/api/source/volumes"
url_username: "{{ credential_dms.username }}"
url_password: "{{ credential_dms.password }}"
method: GET
force_basic_auth: true
validate_certs: false
register: source_volume_data
- name: register for hostnames full details
set_fact:
hostnamea: "{{ source_volume_data.json.volumes | json_query('[].{hostName: hostName, uuid: uuid, deviceName: deviceName, capacity: capacity}') }}"
I need to replace - in uuid, tried different ways nothing worked. Below is the API output.
{
"capacity": "34361180160",
"destinationInUse": false,
"destinationPurpose": "PURPOSE_UNKNOWN",
"deviceDisplayName": "Dev-S-02210",
"deviceName": "Dev-S-02210",
"firstPathLun": 41,
"hostId": 7,
"hostName": "Host005",
"inquiry": "EMC_____SYMMETRIX_______5977",
"pathCount": 2,
"paths": [],
"product": "SYMMETRIX ",
"rev": "5977",
"sectorSize": 512,
"sharedDevice": false,
"status": "ONLINE",
"storageArrayId": 11,
"storageArrayName": "EMC-11",
"type": "NEXUS",
"uuid": "60000970-0002-9670-0118-533032343211",
"vendor": "EMC "
},
{
"capacity": "34361180160",
"destinationInUse": false,
"destinationPurpose": "PURPOSE_UNKNOWN",
"deviceDisplayName": "Dev-S-02211",
"deviceName": "Dev-S-02211",
"firstPathLun": 42,
"hostId": 7,
"hostName": "Host005",
"inquiry": "EMC_____SYMMETRIX_______5977",
"pathCount": 2,
"paths": [],
"product": "SYMMETRIX ",
"rev": "5977",
"sectorSize": 512,
"sharedDevice": false,
"status": "ONLINE",
"storageArrayId": 11,
"storageArrayName": "EMC-11",
"type": "NEXUS",
"uuid": "60000970-0002-9670-0118-533032343711",
"vendor": "EMC "
}
A minimal example playbook
will result into an output of
Further Documentation