mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
govendor: update go-tfe
This commit is contained in:
parent
617aaa6839
commit
5eb49f9df5
66
vendor/github.com/hashicorp/go-tfe/organization.go
generated
vendored
66
vendor/github.com/hashicorp/go-tfe/organization.go
generated
vendored
@ -31,6 +31,12 @@ type Organizations interface {
|
|||||||
|
|
||||||
// Delete an organization by its name.
|
// Delete an organization by its name.
|
||||||
Delete(ctx context.Context, organization string) error
|
Delete(ctx context.Context, organization string) error
|
||||||
|
|
||||||
|
// Capacity shows the current run capacity of an organization.
|
||||||
|
Capacity(ctx context.Context, organization string) (*Capacity, error)
|
||||||
|
|
||||||
|
// RunQueue shows the current run queue of an organization.
|
||||||
|
RunQueue(ctx context.Context, organization string, options RunQueueOptions) (*RunQueue, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// organizations implements Organizations.
|
// organizations implements Organizations.
|
||||||
@ -80,6 +86,19 @@ type Organization struct {
|
|||||||
TwoFactorConformant bool `jsonapi:"attr,two-factor-conformant"`
|
TwoFactorConformant bool `jsonapi:"attr,two-factor-conformant"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Capacity represents the current run capacity of an organization.
|
||||||
|
type Capacity struct {
|
||||||
|
Organization string `jsonapi:"primary,organization-capacity"`
|
||||||
|
Pending int `jsonapi:"attr,pending"`
|
||||||
|
Running int `jsonapi:"attr,running"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RunQueue represents the current run queue of an organization.
|
||||||
|
type RunQueue struct {
|
||||||
|
*Pagination
|
||||||
|
Items []*Run
|
||||||
|
}
|
||||||
|
|
||||||
// OrganizationPermissions represents the organization permissions.
|
// OrganizationPermissions represents the organization permissions.
|
||||||
type OrganizationPermissions struct {
|
type OrganizationPermissions struct {
|
||||||
CanCreateTeam bool `json:"can-create-team"`
|
CanCreateTeam bool `json:"can-create-team"`
|
||||||
@ -242,3 +261,50 @@ func (s *organizations) Delete(ctx context.Context, organization string) error {
|
|||||||
|
|
||||||
return s.client.do(ctx, req, nil)
|
return s.client.do(ctx, req, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Capacity shows the currently used capacity of an organization.
|
||||||
|
func (s *organizations) Capacity(ctx context.Context, organization string) (*Capacity, error) {
|
||||||
|
if !validStringID(&organization) {
|
||||||
|
return nil, errors.New("Invalid value for organization")
|
||||||
|
}
|
||||||
|
|
||||||
|
u := fmt.Sprintf("organizations/%s/capacity", url.QueryEscape(organization))
|
||||||
|
req, err := s.client.newRequest("GET", u, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
c := &Capacity{}
|
||||||
|
err = s.client.do(ctx, req, c)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return c, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RunQueueOptions represents the options for showing the queue.
|
||||||
|
type RunQueueOptions struct {
|
||||||
|
ListOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
// RunQueue shows the current run queue of an organization.
|
||||||
|
func (s *organizations) RunQueue(ctx context.Context, organization string, options RunQueueOptions) (*RunQueue, error) {
|
||||||
|
if !validStringID(&organization) {
|
||||||
|
return nil, errors.New("Invalid value for organization")
|
||||||
|
}
|
||||||
|
|
||||||
|
u := fmt.Sprintf("organizations/%s/runs/queue", url.QueryEscape(organization))
|
||||||
|
req, err := s.client.newRequest("GET", u, &options)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
rq := &RunQueue{}
|
||||||
|
err = s.client.do(ctx, req, rq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return rq, nil
|
||||||
|
}
|
||||||
|
54
vendor/github.com/hashicorp/go-tfe/run.go
generated
vendored
54
vendor/github.com/hashicorp/go-tfe/run.go
generated
vendored
@ -31,6 +31,9 @@ type Runs interface {
|
|||||||
// Cancel a run by its ID.
|
// Cancel a run by its ID.
|
||||||
Cancel(ctx context.Context, runID string, options RunCancelOptions) error
|
Cancel(ctx context.Context, runID string, options RunCancelOptions) error
|
||||||
|
|
||||||
|
// Force-cancel a run by its ID.
|
||||||
|
ForceCancel(ctx context.Context, runID string, options RunForceCancelOptions) error
|
||||||
|
|
||||||
// Discard a run by its ID.
|
// Discard a run by its ID.
|
||||||
Discard(ctx context.Context, runID string, options RunDiscardOptions) error
|
Discard(ctx context.Context, runID string, options RunDiscardOptions) error
|
||||||
}
|
}
|
||||||
@ -77,16 +80,18 @@ type RunList struct {
|
|||||||
|
|
||||||
// Run represents a Terraform Enterprise run.
|
// Run represents a Terraform Enterprise run.
|
||||||
type Run struct {
|
type Run struct {
|
||||||
ID string `jsonapi:"primary,runs"`
|
ID string `jsonapi:"primary,runs"`
|
||||||
Actions *RunActions `jsonapi:"attr,actions"`
|
Actions *RunActions `jsonapi:"attr,actions"`
|
||||||
CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
|
CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
|
||||||
HasChanges bool `jsonapi:"attr,has-changes"`
|
ForceCancelAvailableAt time.Time `jsonapi:"attr,force-cancel-available-at,iso8601"`
|
||||||
IsDestroy bool `jsonapi:"attr,is-destroy"`
|
HasChanges bool `jsonapi:"attr,has-changes"`
|
||||||
Message string `jsonapi:"attr,message"`
|
IsDestroy bool `jsonapi:"attr,is-destroy"`
|
||||||
Permissions *RunPermissions `jsonapi:"attr,permissions"`
|
Message string `jsonapi:"attr,message"`
|
||||||
Source RunSource `jsonapi:"attr,source"`
|
Permissions *RunPermissions `jsonapi:"attr,permissions"`
|
||||||
Status RunStatus `jsonapi:"attr,status"`
|
PositionInQueue int `jsonapi:"attr,position-in-queue"`
|
||||||
StatusTimestamps *RunStatusTimestamps `jsonapi:"attr,status-timestamps"`
|
Source RunSource `jsonapi:"attr,source"`
|
||||||
|
Status RunStatus `jsonapi:"attr,status"`
|
||||||
|
StatusTimestamps *RunStatusTimestamps `jsonapi:"attr,status-timestamps"`
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
Apply *Apply `jsonapi:"relation,apply"`
|
Apply *Apply `jsonapi:"relation,apply"`
|
||||||
@ -98,9 +103,10 @@ type Run struct {
|
|||||||
|
|
||||||
// RunActions represents the run actions.
|
// RunActions represents the run actions.
|
||||||
type RunActions struct {
|
type RunActions struct {
|
||||||
IsCancelable bool `json:"is-cancelable"`
|
IsCancelable bool `json:"is-cancelable"`
|
||||||
IsConfirmable bool `json:"is-confirmable"`
|
IsConfirmable bool `json:"is-confirmable"`
|
||||||
IsDiscardable bool `json:"is-discardable"`
|
IsDiscardable bool `json:"is-discardable"`
|
||||||
|
IsForceCancelable bool `json:"is-force-cancelable"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunPermissions represents the run permissions.
|
// RunPermissions represents the run permissions.
|
||||||
@ -108,6 +114,7 @@ type RunPermissions struct {
|
|||||||
CanApply bool `json:"can-apply"`
|
CanApply bool `json:"can-apply"`
|
||||||
CanCancel bool `json:"can-cancel"`
|
CanCancel bool `json:"can-cancel"`
|
||||||
CanDiscard bool `json:"can-discard"`
|
CanDiscard bool `json:"can-discard"`
|
||||||
|
CanForceCancel bool `json:"can-force-cancel"`
|
||||||
CanForceExecute bool `json:"can-force-execute"`
|
CanForceExecute bool `json:"can-force-execute"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,6 +266,27 @@ func (s *runs) Cancel(ctx context.Context, runID string, options RunCancelOption
|
|||||||
return s.client.do(ctx, req, nil)
|
return s.client.do(ctx, req, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RunCancelOptions represents the options for force-canceling a run.
|
||||||
|
type RunForceCancelOptions struct {
|
||||||
|
// An optional comment explaining the reason for the force-cancel.
|
||||||
|
Comment *string `json:"comment,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ForceCancel is used to forcefully cancel a run by its ID.
|
||||||
|
func (s *runs) ForceCancel(ctx context.Context, runID string, options RunForceCancelOptions) error {
|
||||||
|
if !validStringID(&runID) {
|
||||||
|
return errors.New("Invalid value for run ID")
|
||||||
|
}
|
||||||
|
|
||||||
|
u := fmt.Sprintf("runs/%s/actions/force-cancel", url.QueryEscape(runID))
|
||||||
|
req, err := s.client.newRequest("POST", u, &options)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.client.do(ctx, req, nil)
|
||||||
|
}
|
||||||
|
|
||||||
// RunDiscardOptions represents the options for discarding a run.
|
// RunDiscardOptions represents the options for discarding a run.
|
||||||
type RunDiscardOptions struct {
|
type RunDiscardOptions struct {
|
||||||
// An optional explanation for why the run was discarded.
|
// An optional explanation for why the run was discarded.
|
||||||
|
1
vendor/github.com/hashicorp/go-tfe/workspace.go
generated
vendored
1
vendor/github.com/hashicorp/go-tfe/workspace.go
generated
vendored
@ -72,6 +72,7 @@ type Workspace struct {
|
|||||||
WorkingDirectory string `jsonapi:"attr,working-directory"`
|
WorkingDirectory string `jsonapi:"attr,working-directory"`
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
|
CurrentRun *Run `jsonapi:"relation,current-run"`
|
||||||
Organization *Organization `jsonapi:"relation,organization"`
|
Organization *Organization `jsonapi:"relation,organization"`
|
||||||
SSHKey *SSHKey `jsonapi:"relation,ssh-key"`
|
SSHKey *SSHKey `jsonapi:"relation,ssh-key"`
|
||||||
}
|
}
|
||||||
|
6
vendor/vendor.json
vendored
6
vendor/vendor.json
vendored
@ -1804,10 +1804,10 @@
|
|||||||
"revisionTime": "2018-07-12T07:51:27Z"
|
"revisionTime": "2018-07-12T07:51:27Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "V2A92CHPEiPIsU4Wepl0ukznka8=",
|
"checksumSHA1": "9EZuhp7LWTAVsTDpP9DzajjmJxg=",
|
||||||
"path": "github.com/hashicorp/go-tfe",
|
"path": "github.com/hashicorp/go-tfe",
|
||||||
"revision": "cca0c15746d89219f9732f6c07d267827fef25cd",
|
"revision": "ed986a3b38aba4630ca6ae7dbc876eb0d0c95c57",
|
||||||
"revisionTime": "2018-09-20T19:42:22Z"
|
"revisionTime": "2018-10-10T13:21:10Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "85XUnluYJL7F55ptcwdmN8eSOsk=",
|
"checksumSHA1": "85XUnluYJL7F55ptcwdmN8eSOsk=",
|
||||||
|
Loading…
Reference in New Issue
Block a user