Skip to content

Commit 8a2f928

Browse files
authored
Merge pull request #2490 from hpe-dev-incubator/cms/blog/why-is-redfish®-different-from-other-rest-apis-part-1
Update Blog “why-is-redfish®-different-from-other-rest-apis-part-1”
2 parents 705cea0 + 26d6c02 commit 8a2f928

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

content/blog/why-is-redfish®-different-from-other-rest-apis-part-1.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The Redfish service is included in the server management controller firmware and
3333

3434
![Figure1: Client/service model](/img/fig-1-modelserviceclient.png "Figure1: Service-Client model")
3535

36-
_<figcaption>Figure 1: Service-Client model</figcaption>_
36+
*<figcaption>Figure 1: Service-Client model</figcaption>*
3737

3838
Redfish clients are numerous and varied. For development and troubleshooting, the <a href="https://www.postman.com/" target="_blank">Postman API platform</a> is very popular. For one-off actions or “quick and dirty” scripts, <a href="https://curl.se/" target="_blank">cURL</a>, PowerShell, Python or even <a href="https://github.com/HewlettPackard/python-redfish-utility/releases/latest" target="blank">HPE iLOrest</a> do the trick. For more sophisticated client programs, you can use an <a href="https://galaxy.ansible.com/ui/repo/published/hpe/ilo/" target="_blank">Ansible playbook library</a>, Chef or Go and its <a href="https://pkg.go.dev/github.com/stmcginnis/gofish/redfish" target="_blank">Go-Redfish library</a>.
3939

@@ -56,27 +56,27 @@ The Redfish protocol specification is published in DMTF document <a href="https:
5656

5757
![Figure 2: The error contains a success message !](/img/fig2-successerror.png "Figure 2: The error contains a success message !")
5858

59-
_<figcaption>Figure2: The error contains a success message !</figcaption>_
59+
*<figcaption>Figure2: The error contains a success message !</figcaption>*
6060

6161
#### Data model
6262

6363
Responses to Redfish requests consist of JSON packets containing key/value properties defined by the DMTF in a schema file. The name of the schema file describing responses is contained in the `@odata.type` property that must be present in each response.
6464

65-
For example, the schema defining the root of the Redfish tree is `#ServiceRoot`. Its full name returned by `curl -sk https://bmc-ip/redfish/v1 | jq '."@odata.type"'` is: `#ServiceRoot.v1_13_0.ServiceRoot`. Appended to the `#ServiceRoot` fragment, a version number (`1_13_0`) and then a subtype that, in this specific case, is identical to the main schema. All schemas are publicly available on the <a href="at https://redfish.dmtf.org/schemas" target="_blank">DMTF website</a> and, are sometimes included in the service itself (see the [Self Describing Model](#self-describing-model) paragraph below). Note that schema versions can evolve independently of each other.
65+
For example, the schema defining the root of the Redfish tree is `#ServiceRoot`. Its full name returned by `curl -sk https://bmc-ip/redfish/v1 | jq '."@odata.type"'` is: `#ServiceRoot.v1_13_0.ServiceRoot`. Appended to the `#ServiceRoot` fragment, a version number (`1_13_0`) and then a subtype that, in this specific case, is identical to the main schema. All schemas are publicly available on the <a href="at https://redfish.dmtf.org/schemas" target="_blank">DMTF website</a> and, are sometimes included in the service itself (refer to the [Self Describing Model](#self-describing-model) paragraph below). Note that schema versions can evolve independently of each other.
6666

6767
With a close look to the Redfish root diagram in (Figure 3), you will notice the presence of endpoints allowing access to the modeling of the server subsystems. For example, the `Chassis{}` object points to `/redfish/v1/Chassis`, which contains the exhaustive collection of URIs (`./{ChassisId}`) modeling the different chassis constituting the server (racks, blades, enclosures, storage enclosures, etc.).
6868

6969
![Figure 3: source dmtf.org/education](/img/fig3-resourcemap.png "Figure 3: source dmtf.org/education")
7070

71-
_<figcaption>Figure 3: Source dmtf.org/education</figcaption>_
71+
*<figcaption>Figure 3: Source dmtf.org/education</figcaption>*
7272

7373
### OEM extensions
7474

7575
Computer makers are able to model proprietary properties (not standardized), which constitutes added value compared to the competition. For example, HPE iLO can store firmware updates before deploying them to their respective components. This specificity is described in the proprietary schema `#HpeiLOUpdateServiceExt` present in the `Oem.Hpe{}` object under the URI `/redfish/v1/UpdateService` (Figure 4).
7676

7777
![Figure 4: OEM extension](/img/fig4-oemextensions.png "Figure 4: OEM extension")
7878

79-
_<figcaption>Figure 4: OEM extension</figcaption>_
79+
*<figcaption>Figure 4: OEM extension</figcaption>*
8080

8181
OEM extensions can also be used by a manufacturer while awaiting the standardization of a functionality unanimously recognized by DMTF members.
8282

@@ -86,15 +86,15 @@ As shown in figure 3 above, links contained in the Redfish root tree, do not pro
8686

8787
![Figure 5: HPE Superdome chassis collection](/img/fig5-sdfchassis.png "Figure 5: HPE Superdome chassis collection")
8888

89-
_<figcaption>Figure 5: HPE Superdome chassis collection</figcaption>_
89+
*<figcaption>Figure 5: HPE Superdome chassis collection</figcaption>*
9090

9191
Another example: An HPE ProLiant server containing a storage enclosure connected to a (“modern”) storage controller is represented by two members in the chassis collection; a member pointing to the chassis containing the motherboard of the server (`/redfish/v1/Chassis/1`) and a member pointing to the backplane of the storage enclosure (`/redfish/v1/Chassis/DE040000`).
9292

9393
Each member of the collection is an endpoint for accessing the member properties. Links to related resources constitute transversal access to other subsystems. For example, the storage chassis in Figure 6 contains a cross-link to the storage device under the "Systems" tree (`/redfish/v1/Systems/1/Storage/DE040000`).
9494

9595
![Figure 6: Universal backplane model](/img/fig6-storagechassis.png "Figure 6: Universal backplane model")
9696

97-
_<figcaption>Figure 6: Universal backplane model</figcaption>_
97+
*<figcaption>Figure 6: Universal backplane model</figcaption>*
9898

9999
### Naming convention of collection members
100100

@@ -110,13 +110,13 @@ Figure 7 is extracted from a BIOS registry that has the effect of prohibiting th
110110

111111
![Figure 7: Example of inter-dependency in BIOS registry](/img/fig7-registrebios.png "Figure 7: Example of inter-dependency in BIOS registry")
112112

113-
_<figcaption>Figure 7: Example of inter-dependency in BIOS registry</figcaption>_
113+
*<figcaption>Figure 7: Example of inter-dependency in BIOS registry</figcaption>*
114114

115115
Figure 8 is taken from the base message registry. It shows the modeling of the “Access prohibited” message with the name of the prohibited resource as an argument (%1).
116116

117117
![Figure 8: Modeling an error message with an argument](/img/fig8-registredesmessagesdebase.png "Figure 8: Modeling an error message with an argument")
118118

119-
_<figcaption>Figure 8: Modeling an error message with an argument</figcaption>_
119+
*<figcaption>Figure 8: Modeling an error message with an argument</figcaption>*
120120

121121
## Self-describing model
122122

@@ -137,19 +137,23 @@ These URIs contain links to all schemas and registries used by the service. They
137137

138138
The Redfish protocol requires GET request responses to contain the `Allow` header indicating the possible operations on the URI. Figure 9 shows that the URI `/redfish/v1/Chassis/{ChassisId}` allows GET, HEAD, and PATCH operations against this URI.
139139

140-
![Figure 9: Possible operations on the URI](/img/fig9-allowheader.png "Figure 9: Possible operations on the URI")
140+
After verification, the client code can change (PATCH) the properties marked as `ReadOnly=False` in the schema. The main server chassis in Figure 9 shows the PATCH method and the `IndicatorLED` property can be modified (Figure 10), so one should be able to turn on the small blue LED on this chassis to better identify it in the data center. A good programmer will perform all of these checks before sending their changes. The bad programmer will not perform any checks and will leave the end user to deal with the error(s) returned by the service!
141141

142-
_<figcaption>Figure 9: Possible operations on the URI</figcaption>_
142+
### Link to schema
143143

144-
After verification, the client code can change (PATCH) the properties marked as `ReadOnly=False` in the schema. The main server chassis in Figure 9 shows the PATCH method and the `IndicatorLED` property can be modified (Figure 10), so one should be able to turn on the small blue LED on this chassis to better identify it in the data center. A good programmer will perform all of these checks before sending their changes. The bad programmer will not perform any checks and will leave the end user to deal with the error(s) returned by the service!
144+
To help client programmers to verify programmatically property descriptions, the protocol imposes a header `Link` in responses, pointing to the concerned schema file, as shown in Figure 9. With such a link, clients don't have to browse the schema and the registry stores mentioned above; they just have to follow the provided link.
145+
146+
![Figure 9: Possible operations on the URI and link to schema](/img/fig9-allowheader.png "Figure 9: Possible operations on the URI and link to schema")
147+
148+
*<figcaption>Figure 9: Possible operations on the URI and link to schema</figcaption>*
145149

146150
### Deprecated resources
147151

148152
Over time, certain properties are deprecated. This information is mentioned in the schemas. Thus, clients receiving a “property not found” response will be able to consult the schema and check if by chance this property has not been deprecated. This type of verification will avoid comments from the programmer like "I don’t understand, it worked before!". But before what? Figure 10 shows an excerpt from the `#Chassis` schema, version 1.22.0, stating that the `IndicatorLED` property has been deprecated in version 1.14.0.
149153

150154
![Figure 10: Deprecated property](/img/fig10-propertydeprecated.png "Figure 10: Deprecated property")
151155

152-
_<figcaption>Figure 10: Deprecated property</figcaption>_
156+
*<figcaption>Figure 10: Deprecated property</figcaption>*
153157

154158
## What else?
155159

0 commit comments

Comments
 (0)