MCPcopy Index your code
hub / github.com/coder/coder / DeploymentConfig

Method DeploymentConfig

codersdk/deployment.go:4972–4989  ·  view source on GitHub ↗

DeploymentConfig returns the deployment config for the coder server.

(ctx context.Context)

Source from the content-addressed store, hash-verified

4970
4971// DeploymentConfig returns the deployment config for the coder server.
4972func (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
4991func (c *Client) DeploymentStats(ctx context.Context) (DeploymentStats, error) {
4992 res, err := c.Request(ctx, http.MethodGet, "/api/v2/deployment/stats", nil)

Callers 5

TestServerFunction · 0.95
TestDeploymentValuesFunction · 0.80
RunFunction · 0.80
getScaletestWorkspacesFunction · 0.80
DeploymentInfoFunction · 0.80

Calls 5

RequestMethod · 0.95
OptionsMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
ErrorfMethod · 0.45

Tested by 2

TestServerFunction · 0.76
TestDeploymentValuesFunction · 0.64