-
Notifications
You must be signed in to change notification settings - Fork 39
Redfish useraccounts #242
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
Merged
Merged
Redfish useraccounts #242
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
401d0e4
redfish: DEBUG_BMCLIB dumps gofish requests
joelrebel 3500206
providers/redfish: add user create/update/delete methods
joelrebel fda3dba
Update gofish dep to v0.12.0; update README
joelrebel db8e610
errors: declare user account management errors
joelrebel baed09c
internal/utils: add StringInSlice() helper method
joelrebel e7818b1
providers/asrockrack: add helper methods to list and create/update us…
joelrebel 4e21025
providers/asrockrack: implement UserCreate/UserList/UserUpdate bmc in…
joelrebel 8cec5d6
providers/asrockrack: purge debug spew, fix test
joelrebel 1e73ef3
go: switch test asset package; go mod tidy
joelrebel c9201f7
redfish: update user example; check DEBUG_BMCLIB env var for 'true' val
joelrebel 13cdcf7
providers/asrockrack: purge invalid/unused comments, use http.StatusO…
joelrebel 585ea25
Merge pull request #243 from bmc-toolbox/asrr-useraccounts
joelrebel 6a51f16
providers/redfish: purge dup StringInSlice() method
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 hidden or 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 hidden or 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 hidden or 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,48 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
"time" | ||
|
||
"github.com/bmc-toolbox/bmclib" | ||
"github.com/bombsimon/logrusr" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
func main() { | ||
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) | ||
defer cancel() | ||
|
||
// set BMC parameters here | ||
host := "" | ||
port := "" | ||
user := "" | ||
pass := "" | ||
|
||
l := logrus.New() | ||
l.Level = logrus.DebugLevel | ||
logger := logrusr.NewLogger(l) | ||
|
||
if host == "" || user == "" || pass == "" { | ||
log.Fatal("required host/user/pass parameters not defined") | ||
} | ||
|
||
cl := bmclib.NewClient(host, port, user, pass, bmclib.WithLogger(logger)) | ||
|
||
cl.Registry.Drivers = cl.Registry.Using("redfish") | ||
// cl.Registry.Drivers = cl.Registry.Using("vendorapi") | ||
|
||
err := cl.Open(ctx) | ||
if err != nil { | ||
log.Fatal(err, "bmc login failed") | ||
} | ||
|
||
defer cl.Close(ctx) | ||
|
||
_, err = cl.CreateUser(ctx, "foobar", "sekurity101", "Administrator") | ||
if err != nil { | ||
l.Error(err) | ||
} | ||
|
||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.