env_groups.go 631 B

12345678910111213141516171819202122232425
  1. package client
  2. import (
  3. "context"
  4. "fmt"
  5. "github.com/porter-dev/porter/api/server/handlers/environment_groups"
  6. )
  7. // GetLatestEnvGroupVariables gets the latest environment group variables for a given environment group
  8. func (c *Client) GetLatestEnvGroupVariables(
  9. ctx context.Context,
  10. projID, clusterID uint,
  11. envGroupName string,
  12. ) (*environment_groups.LatestEnvGroupVariablesResponse, error) {
  13. resp := &environment_groups.LatestEnvGroupVariablesResponse{}
  14. err := c.getRequest(
  15. fmt.Sprintf("/projects/%d/clusters/%d/environment-groups/%s/latest", projID, clusterID, envGroupName),
  16. nil,
  17. resp,
  18. )
  19. return resp, err
  20. }