White Papers
18 Standards-based storage management for Dell EMC PowerEdge servers
3.6 Setting external storage enclosure asset tag by using Redfish 2016
The Redfish 2016 storage APIs also enable the detailed inventory and management of external storage
enclosures. For example, the asset tag for an external storage enclosure can be set by using a PATCH
command on the URI “redfish/v1/Chassis/{external enclosure instance ID}/Settings”.
This example from the “SetEnclosureAssetTagRedfish.py” script in the Dell EMC Redfish Scripting GitHub
shows the URI, payload, and PATCH command to set an enclosure’s asset tag:
url = 'https://%s/redfish/v1/Chassis/%s/Settings' % (idrac_ip,
external_enclosure)
payload={"AssetTag":asset_tag}
headers = {'content-type': 'application/json'}
response = requests.patch(url, data=json.dumps(payload), headers=headers,
verify=False,auth=(idrac_username,idrac_password))
This example uses the “SetEnclosureAssetTagRedfish.py” script to set a storage enclosure asset tag:
1. View the storage controllers detected for the target server
C:\Python27>SetEnclosureAssetTagRedfish.py -ip 192.168.0.130 -u root -p calvin -
c y
- Server controller(s) detected -
RAID.Slot.2-1
PCIeExtender.Slot.1
AHCI.Embedded.1-1
AHCI.Embedded.2-1
PCIeExtender.Slot.7
PCIeExtender.Slot.
2. Get the external storage enclosures attached to the storage controller adapter RAID.Slot.2-1:
C:\Python27>SetEnclosureAssetTagRedfish.py -ip 192.168.0.130 -u root -p calvin -
e RAID.Slot.2-1
- Supported External Enclosures to Set Asset Tag for controller RAID.Slot.2-1 -
Enclosure.External.0-2:RAID.Slot.2-1
Enclosure.External.1-3:RAID.Slot.2-1
Enclosure.External.1-2:RAID.Slot.2-1
Enclosure.External.0-3:RAID.Slot.2-1
Enclosure.External.0-1:RAID.Slot.2-1
Enclosure.External.1-1:RAID.Slot.2-1
Enclosure.External.1-0:RAID.Slot.2-1
Enclosure.External.0-0:RAID.Slot.2-1
3. Before setting the storage enclosure’s asset tag for “Enclosure.External.1-2:RAID.Slot.2-1”, check the
current asset tag value.
C:\Python27>SetEnclosureAssetTagRedfish.py -ip 192.168.0.130 -u root -p calvin -
-asset Enclosure.External.0-2:RAID.Slot.2-1
- WARNING, current asset tag for Enclosure.External.0-2:RAID.Slot.2-1 is: 645GVT