Skip to content

Redfish data types and collections

The Redfish RESTful API introduces, among other things two important concept discussed in this section: Data types and Collections.

Data types

Each Resource resource and property of the Redfish API belong to a data type also called resource type, type or schema, that is mentioned in the mandatory @odata.type property returned in HTTP responses. Refer to the Redfish specification for @odata.type detail.

Each data type is associated to a set of URIs sometimes referred as instances. As an example the exhaustive list of the possible URIs of the EthernetInterface standard data type is listed in paragraph 6.31 of the DSP0268_2021.3 document. See first tabulation of the example below.

The use of the standard URI listings by Redfish clients, is explained in paragraph 2.1 of the DSP268_2021.3 document.

The first tabulation of the following example shows the exhaustive list of the EthernetInterface URIs as they appear in the DSP0268_2021.3 document. The second tabulation lists the same URIs, implemented in an HPE iLO 6 as documented in the Resource Definitions section.

/redfish/v1/Chassis/{ChassisId}/NetworkAdapters/{NetworkAdaptersId}/NetworkDeviceFunctions/{NetworkDeviceFunctionId}/EthernetInterfaces/{EthernetInterfaceId}
/redfish/v1/CompositionService/ResourceBlocks/{ResourceBlockId}/EthernetInterfaces/{EthernetInterfaceId}
/redfish/v1/CompositionService/ResourceBlocks/{ResourceBlockId}/Systems/{ComputerSystemId}/EthernetInterfaces/{EthernetInterfaceId}
/redfish/v1/Managers/{ManagerId}/EthernetInterfaces/{EthernetInterfaceId}
/redfish/v1/ResourceBlocks/{ResourceBlockId}/EthernetInterfaces/{EthernetInterfaceId}
/redfish/v1/ResourceBlocks/{ResourceBlockId}/Systems/{ComputerSystemId}/EthernetInterfaces/{EthernetInterfaceId}
/redfish/v1/Systems/{ComputerSystemId}/EthernetInterfaces/{EthernetInterfaceId}

The following example uses the HPE iLOrest tool to selects all the EthernetInterface data types implemented in a remote iLO 6 Redfish service and prints out the URIs (@odata.id) and associated type (@odata.type) in the second tabulation.

NOTE

You should note in the following example that both the Managers and Systems Redfish subtrees hold Ethernet interfaces.

ilorest login <ilo-ip> -u <ilo-user> -p password
ilorest select EthernetInterface.v
ilorest select
ilorest  get "@odata.type" "@odata.id"
ilorest logout 

The Redfish specification allows Redfish service providers to implement their specific and added values OEM data types. The list of HPE OEM data types implemented in iLO are described in the HPE Oem extensions .

NOTE

HPE iLO based servers prepend the "Hpe" string to the HPE OEM resource types. See next example.

ilorest login <ilo-ip> -u <ilo-user> -p password
ilorest  types | awk '/Hpe/ && !/Collection/ {print $NF}'
ilorest logout

Resource Collections

The Redfish Data Model specification provides the following definition for resource collections. The term instances is a synonym of URIs

A resource collection is a core concept in Redfish. A resource collection is a group of like resources where the number of instances in the group can shrink or grow depending on the scope of the Redfish service or the configuration of the devices being managed. Every resource collection contains the same set of supported properties, and all contain Collection in the name of their schema. Every resource linked in the Members array within a resource collection will have the same resource type with the same major version, but can vary in minor or errata schema versions.

As per the Redfish Specification:

The value of the type property (@data.type) for resource collections shall be in the format:

#<ResourceType>.<ResourceType> where ResourceType is the resource type in the Redfish schema that defines the resource collection.

An example of a resource collection type value is #ComputerSystemCollection.ComputerSystemCollection for the ComputerSystemCollection resource collection.

Collections may be GET-only and may not accept members to be added to or removed. An examples of a GET-only collection is the Systems collection at /redfish/v1/Systems/. In a typical ComputerSystemCollection describing physical hardware, it wouldn't make sense to be able to create or remove members using POST or DELETE.

Other collections may be editable. Examples of these might be the ManagerAccountCollection at /redfish/v1/accountservice/accounts. The API supports the addition or removal of manager user accounts. To add a new member to an editable collection, perform an HTTP POST to the collection resource with a body consisting of the required JSON properties needed to create a new member (this does not necessarily require you to POST every property because many may take a unique service-assigned value or take a default value.)

The following example retrieves the ComputerSystem collection of an iLO based server. It shows the body of the response and the allowed operations on that collection. Note the Members@odata.count key containing the number of elements of the Members array.

The the elements of the Members array consists of URI links (@odata.id) to the members of the collection.

GET https://{iLO}/redfish/v1/Systems/

The exhaustive list of standard resource collections is present in the Redfish data Model specification.

The Redfish specification allows Redfish services to complement the data model with Oem specific extensions. HPE prefixes its OEM collection extensions with the "Hpe" string.

The following example retrieves HPE Oem extensions of an iLO 6 based server using the iLOrest tool.

ilorest login $ilo_ip -u $ilo-user -p $password
ilorest types | grep 'Hpe.*Collection'
ilorest logout