DeploymentConfig returns the deployment config for the coder server.
(ctx context.Context)
| 4970 | |
| 4971 | // DeploymentConfig returns the deployment config for the coder server. |
| 4972 | func (c *Client) DeploymentConfig(ctx context.Context) (*DeploymentConfig, error) { |
| 4973 | res, err := c.Request(ctx, http.MethodGet, "/api/v2/deployment/config", nil) |
| 4974 | if err != nil { |
| 4975 | return nil, xerrors.Errorf("execute request: %w", err) |
| 4976 | } |
| 4977 | defer res.Body.Close() |
| 4978 | |
| 4979 | if res.StatusCode != http.StatusOK { |
| 4980 | return nil, ReadBodyAsError(res) |
| 4981 | } |
| 4982 | |
| 4983 | conf := &DeploymentValues{} |
| 4984 | resp := &DeploymentConfig{ |
| 4985 | Values: conf, |
| 4986 | Options: conf.Options(), |
| 4987 | } |
| 4988 | return resp, json.NewDecoder(res.Body).Decode(resp) |
| 4989 | } |
| 4990 | |
| 4991 | func (c *Client) DeploymentStats(ctx context.Context) (DeploymentStats, error) { |
| 4992 | res, err := c.Request(ctx, http.MethodGet, "/api/v2/deployment/stats", nil) |