Skip to content

Commit 5d8038d

Browse files
committed
Add BMC user account management methods and update mock data
1 parent 5752291 commit 5d8038d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

bmc/bmc.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ type BMC interface {
113113

114114
// GetBMCUpgradeTask retrieves the task for the BMC upgrade.
115115
GetBMCUpgradeTask(ctx context.Context, manufacturer string, taskURI string) (*redfish.Task, error)
116+
117+
// CreateOrUpdateAccount creates or updates a BMC user account.
118+
CreateOrUpdateAccount(ctx context.Context, userName, role, password string, enabled bool) error
119+
120+
// DeleteAccount deletes a BMC user account.
121+
DeleteAccount(ctx context.Context, userName, id string) error
122+
123+
// GetAccounts retrieves all BMC user accounts.
124+
GetAccounts(ctx context.Context) ([]*redfish.ManagerAccount, error)
125+
126+
// GetAccountService retrieves the account service.
127+
GetAccountService(ctx context.Context) (*redfish.AccountService, error)
116128
}
117129

118130
type Entity struct {

bmc/mock/server/data/AccountService/Accounts/1/index.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"Enabled": true,
77
"Password": null,
88
"PasswordChangeRequired": false,
9+
"PasswordExpiration": "2026-12-31T23:59:59Z",
910
"AccountTypes": [
1011
"Redfish"
1112
],
@@ -30,4 +31,4 @@
3031
},
3132
"@odata.id": "/redfish/v1/AccountService/Accounts/1",
3233
"@Redfish.Copyright": "Copyright 2014-2023 DMTF. For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright."
33-
}
34+
}

0 commit comments

Comments
 (0)