Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support set if-Machine header when update BiosAttributes #175

Merged
merged 1 commit into from
Jun 1, 2022
Merged

feature: support set if-Machine header when update BiosAttributes #175

merged 1 commit into from
Jun 1, 2022

Conversation

Sn0rt
Copy link
Contributor

@Sn0rt Sn0rt commented May 23, 2022

Closes: #174

and self-test

will take a query /redfish/v1/Systems/1/Bios/Setting for the Etag

GET /redfish/v1/Systems/1/Bios/Settings HTTP/1.1
Host: 192.168.142.53
User-Agent: gofish/1.0
Connection: close
Accept: application/json
Content-Type: application/json
Cookie: sessionKey=xx
X-Auth-Token: xx
Accept-Encoding: gzip


HTTP/1.1 200 OK
Connection: close
Content-Length: 536
Allow: GET,PATCH,POST
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self' wss://*:*; img-src 'self' data:; frame-src 'self'; font-src 'self' data:; object-src 'self'; style-src 'self' 'unsafe-inline'
Content-Type: application/json;charset=utf-8
Date: Mon, 23 May 2022 07:20:01 GMT
Etag: W/"93227b24"
Expires: 0
Link: </redfish/v1/SchemaStore/en/Bios.json>;rel=describedby
Odata-Version: 4.0
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

{"@odata.context":"/redfish/v1/$metadata#Systems/Members/1/Bios/Settings/$entity","@odata.id":"/redfish/v1/Systems/1/Bios/Settings","@odata.type":"#Bios.v1_0_0.Bios","Id":"Settings","Name":"BIOS Configuration Pending Settings","AttributeRegistry":"BiosAttributeRegistry.8.0.2","Attributes":{"PXE3Setting":"Disabled"},"Actions":{"Oem":{"Huawei":{"#Settings.Revoke":{"target":"/redfish/v1/Systems/1/Bios/Settings/Actions/Oem/Huawei/Settings.Revoke","@Redfish.ActionInfo":"/redfish/v1/Systems/1/Bios/Settings/SettingsRevokeActionInfo"}}}}}
PATCH /redfish/v1/Systems/1/Bios/Settings HTTP/1.1
Host: 192.168.142.53
User-Agent: gofish/1.0
Connection: close
Content-Length: 41
Accept: application/json
Content-Type: application/json
Cookie: sessionKey=xxx
If-Match: W/"93227b24"
X-Auth-Token: xxx
Accept-Encoding: gzip

{"Attributes":{"PXE3Setting":"Disabled"}}
HTTP/1.1 200 OK
Connection: close
Content-Length: 536
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self' wss://*:*; img-src 'self' data:; frame-src 'self'; font-src 'self' data:; object-src 'self'; style-src 'self' 'unsafe-inline'
Content-Type: application/json;charset=utf-8
Date: Mon, 23 May 2022 07:20:01 GMT
Etag: W/"93227b24"
Expires: 0
Odata-Version: 4.0
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

{"@odata.context":"/redfish/v1/$metadata#Systems/Members/1/Bios/Settings/$entity","@odata.id":"/redfish/v1/Systems/1/Bios/Settings","@odata.type":"#Bios.v1_0_0.Bios","Id":"Settings","Name":"BIOS Configuration Pending Settings","AttributeRegistry":"BiosAttributeRegistry.8.0.2","Attributes":{"PXE3Setting":"Disabled"},"Actions":{"Oem":{"Huawei":{"#Settings.Revoke":{"target":"/redfish/v1/Systems/1/Bios/Settings/Actions/Oem/Huawei/Settings.Revoke","@Redfish.ActionInfo":"/redfish/v1/Systems/1/Bios/Settings/SettingsRevokeActionInfo"}}}}}

Signed-off-by: Guohao Wang [email protected]

@stmcginnis
Copy link
Owner

Thanks! I am traveling for a little over a week yet, but I will take a closer look at this when I get back. Thanks for working on this!!

Copy link
Owner

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for full support we need to be able to get the etag from the normal Get call, then later be able to pass that in to Update calls. But this at least adds some protection and is a great start.

Thanks for working on this!

@stmcginnis stmcginnis merged commit e12f17e into stmcginnis:main Jun 1, 2022
@stmcginnis stmcginnis mentioned this pull request Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Huawei Machine support Etag when PATCH bios Attributes
2 participants