Skip to contentSkip to conversation

Redfish metadata implementation

DISCUSSION Ratan Gupta 3 participants 3 messages Jan 20, 2020

lore
Share & tools
lore
#0 lore raw

Hi James,

I was looking at the current master metadata redfish url implementation and seems that is not correct.

Currently redfish/v1 and redfish/v1/$metadata is giving the same service root data(service root).

curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1
curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/$metadata

I am hoping the redfish/v1/$metadata should return the following data

https://github.com/openbmc/bmcweb/blob/master/static/redfish/v1/%24metadata/index.xml

Ratan

#1 lore raw
Quoted 9 lines · Ratan Gupta

Hi James,

I was looking at the current master metadata redfish url implementation and seems that is not correct.

Currently redfish/v1 and redfish/v1/$metadata is giving the same service root data(service root).

curl -k -H "X-Auth-Token: $bmc_token" -X GEThttps://${bmc}/redfish/v1 curl -k -H "X-Auth-Token: $bmc_token" -X GEThttps://${bmc}/redfish/v1/$metadata

I wonder if  $metadata  is being expanded as a shell variable.  The shell expands un-set variables to the empty string and you get the result you are seeing.  If this is happening to you, you could quote your command in one of these ways (but be careful not to quote the ${bmc} variable):

curl -k -H "X-Auth-Token: $bmc_token" -X GEThttps://${bmc}/redfish/v1/\$metadata

-or-

curl -k -H "X-Auth-Token: $bmc_token" -X GEThttps://${bmc}'/redfish/v1/$metadata'

Also, note that URI /redfish/v1/$metadata does not require authentication, so the X-Auth-Token header is not needed.

- Joseph

Quoted 8 lines

I am hoping the redfish/v1/$metadata should return the following data

https://github.com/openbmc/bmcweb/blob/master/static/redfish/v1/%24metadata/index.xml

Ratan

#2 lore raw

I just ran this using my restclient utility, and the metadata is being reported correctly.

     <?xml version="1.0" encoding="UTF-8"?>
     <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
       <edmx:Reference Uri="/redfish/v1/schema/AccelerationFunction_v1.xml"> <edmx:Include Namespace="AccelerationFunction"/> <edmx:Include Namespace="AccelerationFunction.v1_0_0"/> <edmx:Include Namespace="AccelerationFunction.v1_0_1"/> <edmx:Include Namespace="AccelerationFunction.v1_0_2"/> </edmx:Reference>

I think Joseph is correct, the problem is a shell expansion issue.

Quoted 44 lines · Joseph Reynolds
Quoted 6 lines · Ratan Gupta

Hi James,

I was looking at the current master metadata redfish url implementation and seems that is not correct.

Quoted 6 lines

Currently redfish/v1 and redfish/v1/$metadata is giving the same service root data(service root).

curl -k -H "X-Auth-Token: $bmc_token" -X GEThttps://${bmc}/redfish/v1 curl -k -H "X-Auth-Token: $bmc_token" -X GEThttps://${bmc}/redfish/v1/$metadata

I wonder if  $metadata  is being expanded as a shell variable.  The shell expands un-set variables to the empty string and you get the result you are seeing.  If this is happening to you, you could quote your command in one of these ways (but be careful not to quote the ${bmc} variable):

curl -k -H "X-Auth-Token: $bmc_token" -X
GEThttps://${bmc}/redfish/v1/\$metadata

-or-

curl -k -H "X-Auth-Token: $bmc_token" -X
GEThttps://${bmc}'/redfish/v1/$metadata'

Also, note that URI /redfish/v1/$metadata does not require authentication, so the X-Auth-Token header is not needed.

- Joseph

Quoted 9 lines

I am hoping the redfish/v1/$metadata should return the following data

https://github.com/openbmc/bmcweb/blob/master/static/redfish/v1/%24metadata/index.xml

Ratan

Signature · 6 lines
Johnathan Mantey
Senior Software Engineer
*azad te**chnology partners*
Contributing to Technology Innovation since 1992
Phone: (503) 712-6764
Email: [email protected] <mailto:[email protected]>