apply.go 496 B

123456789101112131415161718192021222324252627282930
  1. package client
  2. import (
  3. "context"
  4. "fmt"
  5. "github.com/porter-dev/porter/api/types"
  6. ptypes "github.com/porter-dev/porter/provisioner/types"
  7. )
  8. // Apply initiates a new apply operation for infra
  9. func (c *Client) Apply(
  10. ctx context.Context,
  11. projID, infraID uint,
  12. req *ptypes.ApplyBaseRequest,
  13. ) (*types.Operation, error) {
  14. resp := &types.Operation{}
  15. err := c.postRequest(
  16. fmt.Sprintf(
  17. "/projects/%d/infras/%d/apply",
  18. projID,
  19. infraID,
  20. ),
  21. req,
  22. resp,
  23. )
  24. return resp, err
  25. }