-
Notifications
You must be signed in to change notification settings - Fork 38
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
[2/4] Supermicro redfish methods #370
Merged
Merged
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3e6a6f1
providers/redfish: purge un-used methods
joelrebel b7f3de9
supermicro: implement Inventory, PowerSet, PowerStateGet methods
joelrebel bbc734d
providers/supermicro: fix up redfish session init and purge unused me…
joelrebel d22930a
providers/supermicro: fix TestOpen()
joelrebel 5622adc
redfish/GetBiosconfiguration: tests and fixtures moved under redfishw…
joelrebel 63f4d53
redfishwrapper/firmware: lets not strip the JID_ prefix, since the me…
joelrebel 9f0b439
bmc/firmware: initialize metadata object properly
joelrebel 37d8981
bmc/firmware: defines interface to upload and install firmware in the…
joelrebel e14321b
providers/dell: adds a helper method and implements Inventory(), Powe…
joelrebel ba60fa0
providers/dell: Implements FirmwareInstallSteps(), FirmwareInstallUpl…
joelrebel 6ee715b
go: update gofish to include Task Oem data fix
joelrebel 41cb5fa
providers/redfish: task methods moved under redfishwrapper package
joelrebel 04eb8ca
squash
joelrebel cdc6f14
providers/redfish: dell tests moved under dell provider
joelrebel 8c3aefb
redfishwrapper: minor fix for test
joelrebel 95d52c0
Merge pull request #372 from bmc-toolbox/redfish-dell
joelrebel ef9c38c
Merge pull request #371 from bmc-toolbox/redfishwrapper-bios
joelrebel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#### x11 XML API power commands | ||
|
||
power-off - immediate - `op=POWER_INFO.XML&r=(1,0)&_=` | ||
power-on - `op=POWER_INFO.XML&r=(1,1)&_=` | ||
power-off - `acpi/orderly - op=POWER_INFO.XML&r=(1,5)&_=` | ||
reset server - cold powercycle - `op=POWER_INFO.XML&r=(1,3)&_=` | ||
power cycle - `op=POWER_INFO.XML&r=(1,2)&_=` | ||
|
||
|
||
ref invocation | ||
```go | ||
// powerCycle using SMC XML API | ||
func (c *x11) powerCycle(ctx context.Context) (bool, error) { | ||
payload := []byte(`op=POWER_INFO.XML&r=(1,3)&_=`) | ||
|
||
headers := map[string]string{ | ||
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8", | ||
} | ||
|
||
body, status, err := c.serviceClient.query(ctx, "cgi/ipmi.cgi", http.MethodPost, bytes.NewBuffer(payload), headers, 0) | ||
if err != nil { | ||
return false, err | ||
} | ||
|
||
if status != http.StatusOK { | ||
return false, unexpectedResponseErr(payload, body, status) | ||
} | ||
|
||
return true, nil | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"@odata.type": "#ServiceRoot.v1_5_2.ServiceRoot", | ||
"@odata.id": "/redfish/v1", | ||
"Id": "ServiceRoot", | ||
"Name": "Root Service", | ||
"RedfishVersion": "1.9.0", | ||
"UUID": "00000000-0000-0000-0000-3CECEFCEFEDA", | ||
"Systems": { | ||
"@odata.id": "/redfish/v1/Systems" | ||
}, | ||
"Chassis": { | ||
"@odata.id": "/redfish/v1/Chassis" | ||
}, | ||
"Managers": { | ||
"@odata.id": "/redfish/v1/Managers" | ||
}, | ||
"Tasks": { | ||
"@odata.id": "/redfish/v1/TaskService" | ||
}, | ||
"SessionService": { | ||
"@odata.id": "/redfish/v1/SessionService" | ||
}, | ||
"AccountService": { | ||
"@odata.id": "/redfish/v1/AccountService" | ||
}, | ||
"EventService": { | ||
"@odata.id": "/redfish/v1/EventService" | ||
}, | ||
"UpdateService": { | ||
"@odata.id": "/redfish/v1/UpdateService" | ||
}, | ||
"CertificateService": { | ||
"@odata.id": "/redfish/v1/CertificateService" | ||
}, | ||
"Registries": { | ||
"@odata.id": "/redfish/v1/Registries" | ||
}, | ||
"JsonSchemas": { | ||
"@odata.id": "/redfish/v1/JsonSchemas" | ||
}, | ||
"TelemetryService": { | ||
"@odata.id": "/redfish/v1/TelemetryService" | ||
}, | ||
"Links": { | ||
"Sessions": { | ||
"@odata.id": "/redfish/v1/SessionService/Sessions" | ||
} | ||
}, | ||
"ProtocolFeaturesSupported": { | ||
"FilterQuery": true, | ||
"SelectQuery": true, | ||
"ExcerptQuery": false, | ||
"OnlyMemberQuery": false, | ||
"ExpandQuery": { | ||
"Links": true, | ||
"NoLinks": true, | ||
"ExpandAll": true, | ||
"Levels": true, | ||
"MaxLevels": 2 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the
state
for these methods be a constant with a specific type, something likePowerState
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep thats the plan, although since this will affect all providers and it changes the interface, it needs to be done separately