Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
34 lines
927 B
Go
34 lines
927 B
Go
package slurm
|
|
|
|
import "context"
|
|
|
|
// GetConfig returns slurmdbd configuration.
|
|
func (s *SlurmdbConfigService) GetConfig(ctx context.Context) (*OpenapiSlurmdbdConfigResp, *Response, error) {
|
|
path := "slurmdb/v0.0.40/config"
|
|
req, err := s.client.NewRequest("GET", path, nil)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
var result OpenapiSlurmdbdConfigResp
|
|
resp, err := s.client.Do(ctx, req, &result)
|
|
if err != nil {
|
|
return nil, resp, err
|
|
}
|
|
return &result, resp, nil
|
|
}
|
|
|
|
// PostConfig updates slurmdbd configuration.
|
|
func (s *SlurmdbConfigService) PostConfig(ctx context.Context, config *OpenapiSlurmdbdConfigResp) (*OpenapiResp, *Response, error) {
|
|
path := "slurmdb/v0.0.40/config"
|
|
req, err := s.client.NewRequest("POST", path, config)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
var result OpenapiResp
|
|
resp, err := s.client.Do(ctx, req, &result)
|
|
if err != nil {
|
|
return nil, resp, err
|
|
}
|
|
return &result, resp, nil
|
|
}
|