|
|
|
@@ -84,14 +84,15 @@ func GetAcctInfo() AcctInfoMsg { |
|
|
|
|
|
|
|
func (slurmStruct SlurmStruct) ListAccounts(ctx context.Context, req *pbslurm.ListAccountsReq) (*pbslurm.ListAccountsResp, error) { |
|
|
|
|
|
|
|
AcctList := GetAcctInfo() |
|
|
|
acctList := GetAcctInfo() |
|
|
|
|
|
|
|
resp := pbslurm.ListAccountsResp{} |
|
|
|
for _, Acct := range AcctList.AcctInfoList { |
|
|
|
AcctInfoResult := pbslurm.AccountInfo{} |
|
|
|
AcctInfoResult.Name = Acct.Name |
|
|
|
for _, acct := range acctList.AcctInfoList { |
|
|
|
//AcctInfoResult := pbslurm.AccountInfo{} |
|
|
|
//AcctInfoResult.Name = Acct.Name |
|
|
|
acctInfoResult := acct |
|
|
|
|
|
|
|
resp.AccountInfos = append(resp.AccountInfos, &AcctInfoResult) |
|
|
|
resp.AccountInfos = append(resp.AccountInfos, &acctInfoResult) |
|
|
|
} |
|
|
|
|
|
|
|
return &resp, nil |
|
|
|
@@ -99,14 +100,13 @@ func (slurmStruct SlurmStruct) ListAccounts(ctx context.Context, req *pbslurm.Li |
|
|
|
|
|
|
|
func (slurmStruct SlurmStruct) GetAccount(ctx context.Context, req *pbslurm.GetAccountReq) (*pbslurm.GetAccountResp, error) { |
|
|
|
|
|
|
|
AcctList := GetAcctInfo() |
|
|
|
acctList := GetAcctInfo() |
|
|
|
|
|
|
|
resp := pbslurm.GetAccountResp{} |
|
|
|
for _, Acct := range AcctList.AcctInfoList { |
|
|
|
AcctInfoResult := pbslurm.AccountInfo{} |
|
|
|
AcctInfoResult.Name = Acct.Name |
|
|
|
|
|
|
|
resp.AccountInfos = append(resp.AccountInfos, &AcctInfoResult) |
|
|
|
for _, acct := range acctList.AcctInfoList { |
|
|
|
acctInfoResult := acct |
|
|
|
//todo add filter logic |
|
|
|
resp.AccountInfos = append(resp.AccountInfos, &acctInfoResult) |
|
|
|
} |
|
|
|
|
|
|
|
return &resp, nil |
|
|
|
|