get_raw_state.go 438 B

123456789101112131415161718192021222324252627
  1. package client
  2. import (
  3. "context"
  4. "fmt"
  5. ptypes "github.com/porter-dev/porter/provisioner/types"
  6. )
  7. // GetRawState gets the state stored for that infrastructure
  8. func (c *Client) GetRawState(
  9. ctx context.Context,
  10. workspaceID string,
  11. ) (*ptypes.ParseableRawTFState, error) {
  12. resp := &ptypes.ParseableRawTFState{}
  13. err := c.getRequest(
  14. fmt.Sprintf(
  15. "/%s/tfstate/raw",
  16. workspaceID,
  17. ),
  18. nil,
  19. resp,
  20. )
  21. return resp, err
  22. }