Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func Int(v int) *int
- func Int64(v int64) *int64
- func String(v string) *string
- type AccessType
- type AdminRuns
- type AdminRunsList
- type AdminRunsListOptions
- type AdminTwoFactor
- type AdminUser
- type AdminUsers
- type AdminUsersList
- type AdminUsersListOptions
- type AdminWorkspaces
- type AdminWorkspacesList
- type AdminWorkspacesListOptions
- type Applies
- type Apply
- type ApplyStatus
- type ApplyStatusTimestamps
- type AuthPolicyType
- type CVStatusTimestamps
- type Capacity
- type CategoryType
- type Client
- type Config
- type ConfigurationSource
- type ConfigurationStatus
- type ConfigurationVersion
- type ConfigurationVersionCreateOptions
- type ConfigurationVersionList
- type ConfigurationVersionListOptions
- type ConfigurationVersions
- type CostEstimate
- type CostEstimateStatus
- type CostEstimateStatusTimestamps
- type CostEstimates
- type DeliveryResponse
- type Enforcement
- type EnforcementLevel
- type EnforcementOptions
- type EnterprisePlanType
- type Entitlements
- type ListOptions
- type LogReader
- type Meta
- type NotificationConfiguration
- type NotificationConfigurationCreateOptions
- type NotificationConfigurationList
- type NotificationConfigurationListOptions
- type NotificationConfigurationUpdateOptions
- type NotificationConfigurations
- type NotificationDestinationType
- type OAuthClient
- type OAuthClientCreateOptions
- type OAuthClientList
- type OAuthClientListOptions
- type OAuthClients
- type OAuthToken
- type OAuthTokenList
- type OAuthTokenListOptions
- type OAuthTokenUpdateOptions
- type OAuthTokens
- type Organization
- type OrganizationAccess
- type OrganizationAccessOptions
- type OrganizationCreateOptions
- type OrganizationList
- type OrganizationListOptions
- type OrganizationMembership
- type OrganizationMembershipCreateOptions
- type OrganizationMembershipList
- type OrganizationMembershipListOptions
- type OrganizationMembershipReadOptions
- type OrganizationMembershipStatus
- type OrganizationMemberships
- type OrganizationPermissions
- type OrganizationToken
- type OrganizationTokens
- type OrganizationUpdateOptions
- type Organizations
- type Pagination
- type Plan
- type PlanExport
- type PlanExportCreateOptions
- type PlanExportDataType
- type PlanExportStatus
- type PlanExportStatusTimestamps
- type PlanExports
- type PlanStatus
- type PlanStatusTimestamps
- type Plans
- type Policies
- type Policy
- type PolicyActions
- type PolicyCheck
- type PolicyCheckList
- type PolicyCheckListOptions
- type PolicyChecks
- type PolicyCreateOptions
- type PolicyList
- type PolicyListOptions
- type PolicyPermissions
- type PolicyResult
- type PolicyScope
- type PolicySet
- type PolicySetAddPoliciesOptions
- type PolicySetAddWorkspacesOptions
- type PolicySetCreateOptions
- type PolicySetList
- type PolicySetListOptions
- type PolicySetParameter
- type PolicySetParameterCreateOptions
- type PolicySetParameterList
- type PolicySetParameterListOptions
- type PolicySetParameterUpdateOptions
- type PolicySetParameters
- type PolicySetRemovePoliciesOptions
- type PolicySetRemoveWorkspacesOptions
- type PolicySetUpdateOptions
- type PolicySets
- type PolicyStatus
- type PolicyStatusTimestamps
- type PolicyUpdateOptions
- type RegistryModule
- type RegistryModuleCreateOptions
- type RegistryModuleCreateVersionOptions
- type RegistryModuleCreateWithVCSConnectionOptions
- type RegistryModulePermissions
- type RegistryModuleStatus
- type RegistryModuleVCSRepoOptions
- type RegistryModuleVersion
- type RegistryModuleVersionStatus
- type RegistryModuleVersionStatuses
- type RegistryModules
- type RetryLogHook
- type Run
- type RunActions
- type RunApplyOptions
- type RunCancelOptions
- type RunCreateOptions
- type RunDiscardOptions
- type RunForceCancelOptions
- type RunList
- type RunListOptions
- type RunPermissions
- type RunQueue
- type RunQueueOptions
- type RunSource
- type RunStatus
- type RunStatusTimestamps
- type RunTrigger
- type RunTriggerCreateOptions
- type RunTriggerList
- type RunTriggerListOptions
- type RunTriggers
- type Runs
- type RunsPermissionType
- type SSHKey
- type SSHKeyCreateOptions
- type SSHKeyList
- type SSHKeyListOptions
- type SSHKeyUpdateOptions
- type SSHKeys
- type SentinelMocksPermissionType
- type ServiceProviderType
- type StateVersion
- type StateVersionCreateOptions
- type StateVersionList
- type StateVersionListOptions
- type StateVersions
- type StateVersionsPermissionType
- type StatusCounts
- type Team
- type TeamAccess
- type TeamAccessAddOptions
- type TeamAccessList
- type TeamAccessListOptions
- type TeamAccessUpdateOptions
- type TeamAccesses
- type TeamCreateOptions
- type TeamList
- type TeamListOptions
- type TeamMemberAddOptions
- type TeamMemberRemoveOptions
- type TeamMembers
- type TeamPermissions
- type TeamToken
- type TeamTokens
- type TeamUpdateOptions
- type Teams
- type TestAccountDetails
- type TwoFactor
- type User
- type UserUpdateOptions
- type Users
- type VCSRepo
- type VCSRepoOptions
- type Variable
- type VariableCreateOptions
- type VariableList
- type VariableListOptions
- type VariableUpdateOptions
- type Variables
- type VariablesPermissionType
- type Workspace
- type WorkspaceActions
- type WorkspaceAssignSSHKeyOptions
- type WorkspaceCreateOptions
- type WorkspaceList
- type WorkspaceListOptions
- type WorkspaceLockOptions
- type WorkspaceLockingPermissionType
- type WorkspacePermissions
- type WorkspaceUpdateOptions
- type Workspaces
Constants ¶
const ( NotificationTriggerCreated string = "run:created" NotificationTriggerPlanning string = "run:planning" NotificationTriggerNeedsAttention string = "run:needs_attention" NotificationTriggerApplying string = "run:applying" NotificationTriggerCompleted string = "run:completed" NotificationTriggerErrored string = "run:errored" )
List of available notification triggers.
const ( OrganizationMembershipActive = "active" OrganizationMembershipInvited = "invited" )
List all available organization membership statuses.
const ( AccessAdmin AccessType = "admin" AccessPlan AccessType = "plan" AccessRead AccessType = "read" AccessWrite AccessType = "write" AccessCustom AccessType = "custom" RunsPermissionRead RunsPermissionType = "read" RunsPermissionPlan RunsPermissionType = "plan" RunsPermissionApply RunsPermissionType = "apply" VariablesPermissionNone VariablesPermissionType = "none" VariablesPermissionRead VariablesPermissionType = "read" VariablesPermissionWrite VariablesPermissionType = "write" StateVersionsPermissionNone StateVersionsPermissionType = "none" StateVersionsPermissionReadOutputs StateVersionsPermissionType = "read-outputs" StateVersionsPermissionRead StateVersionsPermissionType = "read" StateVersionsPermissionWrite StateVersionsPermissionType = "write" SentinelMocksPermissionNone SentinelMocksPermissionType = "none" SentinelMocksPermissionRead SentinelMocksPermissionType = "read" )
List all available team access types and permissions.
const ( // DefaultAddress of Terraform Enterprise. DefaultAddress = "https://app.terraform.io" // DefaultBasePath on which the API is served. DefaultBasePath = "/api/v2/" // PingEndpoint is a no-op API endpoint used to configure the rate limiter PingEndpoint = "ping" )
Variables ¶
var ( // ErrWorkspaceLocked is returned when trying to lock a // locked workspace. ErrWorkspaceLocked = errors.New("workspace already locked") // ErrWorkspaceNotLocked is returned when trying to unlock // a unlocked workspace. ErrWorkspaceNotLocked = errors.New("workspace already unlocked") ErrUnauthorized = errors.New("unauthorized") // ErrResourceNotFound is returned when a receiving a 404. ErrResourceNotFound = errors.New("resource not found") )
Functions ¶
Types ¶
type AccessType ¶ added in v0.1.2
type AccessType string
AccessType represents a team access type.
func Access ¶
func Access(v AccessType) *AccessType
Access returns a pointer to the given team access type.
type AdminRuns ¶ added in v0.5.1
type AdminRuns interface { // List all the runs of the given installation. List(ctx context.Context, options AdminRunsListOptions) (*AdminRunsList, error) // Force-cancel a run by its ID. ForceCancel(ctx context.Context, runID string, options RunForceCancelOptions) error }
AdminRuns Users Admin API contains endpoints to help site administrators manage user accounts.
TFE API docs: https://www.terraform.io/docs/cloud/api/admin runs.html
type AdminRunsList ¶ added in v0.5.1
type AdminRunsList struct { *Pagination *StatusCounts Items []*Run }
AdminRunsList represents a list of runs.
type AdminRunsListOptions ¶ added in v0.5.1
type AdminRunsListOptions struct { ListOptions RunStatus *string `url:"filter[status],omitempty"` // sending an empty param returns zero results Query *string `url:"q"` Include string `url:"include"` }
AdminRunsListOptions represents the options for listing runs.
type AdminTwoFactor ¶ added in v0.5.1
AdminTwoFactor represents the organization permissions.
type AdminUser ¶ added in v0.5.1
type AdminUser struct { ID string `jsonapi:"primary,users"` AvatarURL string `jsonapi:"attr,avatar-url"` Email string `jsonapi:"attr,email"` IsServiceAccount bool `jsonapi:"attr,is-service-account"` TwoFactor *AdminTwoFactor `jsonapi:"attr,two-factor"` UnconfirmedEmail string `jsonapi:"attr,unconfirmed-email"` Username string `jsonapi:"attr,username"` V2Only bool `jsonapi:"attr,v2-only"` // Relations // AuthenticationTokens *AuthenticationTokens `jsonapi:"relation,authentication-tokens"` Organizations []*Organization `jsonapi:"relation,organizations"` }
AdminUser represents a Terraform Enterprise user.
type AdminUsers ¶ added in v0.5.1
type AdminUsers interface { // List all the users of the given installation. List(ctx context.Context, options AdminUsersListOptions) (*AdminUsersList, error) }
AdminUsers Users Admin API contains endpoints to help site administrators manage user accounts.
TFE API docs: https://www.terraform.io/docs/cloud/api/admin/users.html
type AdminUsersList ¶ added in v0.5.1
type AdminUsersList struct { *Pagination *StatusCounts Items []*AdminUser }
AdminUsersList represents a list of users.
type AdminUsersListOptions ¶ added in v0.5.1
type AdminUsersListOptions struct { ListOptions Include string `url:"include"` }
AdminUsersListOptions represents the options for listing users.
type AdminWorkspaces ¶ added in v0.6.6
type AdminWorkspaces interface { // List all the workspaces of the given installation. List(ctx context.Context, options AdminWorkspacesListOptions) (*AdminWorkspacesList, error) // Read a workspace by its id. Read(ctx context.Context, workspaceID string) (*Workspace, error) // Delete a workspace by id. Delete(ctx context.Context, workspaceID string) error }
AdminWorkspaces Admin API contains endpoints to help site administrators manage workspaces.
TFE API docs: https://www.terraform.io/docs/cloud/api/admin/workspaces.html
type AdminWorkspacesList ¶ added in v0.6.6
type AdminWorkspacesList struct { *Pagination Items []*Workspace }
AdminWorkspacesList represents a list of workspaces.
type AdminWorkspacesListOptions ¶ added in v0.6.6
type AdminWorkspacesListOptions struct { ListOptions RunStatus *string `url:"filter[current_run][status],omitempty"` Query *string `url:"q"` }
AdminWorkspacesListOptions represents the options for listing workspaces.
type Applies ¶ added in v0.2.3
type Applies interface { // Read an apply by its ID. Read(ctx context.Context, applyID string) (*Apply, error) // Logs retrieves the logs of an apply. Logs(ctx context.Context, applyID string) (io.Reader, error) }
Applies describes all the apply related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/apply.html
type Apply ¶ added in v0.2.3
type Apply struct { ID string `jsonapi:"primary,applies"` LogReadURL string `jsonapi:"attr,log-read-url"` ResourceAdditions int `jsonapi:"attr,resource-additions"` ResourceChanges int `jsonapi:"attr,resource-changes"` ResourceDestructions int `jsonapi:"attr,resource-destructions"` Status ApplyStatus `jsonapi:"attr,status"` StatusTimestamps *ApplyStatusTimestamps `jsonapi:"attr,status-timestamps"` }
Apply represents a Terraform Enterprise apply.
type ApplyStatus ¶ added in v0.2.3
type ApplyStatus string
ApplyStatus represents an apply state.
const ( ApplyCanceled ApplyStatus = "canceled" ApplyCreated ApplyStatus = "created" ApplyErrored ApplyStatus = "errored" ApplyFinished ApplyStatus = "finished" ApplyMFAWaiting ApplyStatus = "mfa_waiting" ApplyPending ApplyStatus = "pending" ApplyQueued ApplyStatus = "queued" ApplyRunning ApplyStatus = "running" ApplyUnreachable ApplyStatus = "unreachable" )
List all available apply statuses.
type ApplyStatusTimestamps ¶ added in v0.2.3
type ApplyStatusTimestamps struct { CanceledAt time.Time `json:"canceled-at"` ErroredAt time.Time `json:"errored-at"` FinishedAt time.Time `json:"finished-at"` ForceCanceledAt time.Time `json:"force-canceled-at"` QueuedAt time.Time `json:"queued-at"` StartedAt time.Time `json:"started-at"` }
ApplyStatusTimestamps holds the timestamps for individual apply statuses.
type AuthPolicyType ¶
type AuthPolicyType string
AuthPolicyType represents an authentication policy type.
const ( AuthPolicyPassword AuthPolicyType = "password" AuthPolicyTwoFactor AuthPolicyType = "two_factor_mandatory" )
List of available authentication policies.
func AuthPolicy ¶
func AuthPolicy(v AuthPolicyType) *AuthPolicyType
AuthPolicy returns a pointer to the given authentication poliy.
type CVStatusTimestamps ¶
type CVStatusTimestamps struct { FinishedAt time.Time `json:"finished-at"` QueuedAt time.Time `json:"queued-at"` StartedAt time.Time `json:"started-at"` }
CVStatusTimestamps holds the timestamps for individual configuration version statuses.
type Capacity ¶ added in v0.2.4
type Capacity struct { Organization string `jsonapi:"primary,organization-capacity"` Pending int `jsonapi:"attr,pending"` Running int `jsonapi:"attr,running"` }
Capacity represents the current run capacity of an organization.
type CategoryType ¶
type CategoryType string
CategoryType represents a category type.
const ( CategoryEnv CategoryType = "env" CategoryPolicySet CategoryType = "policy-set" CategoryTerraform CategoryType = "terraform" )
List all available categories.
func Category ¶
func Category(v CategoryType) *CategoryType
Category returns a pointer to the given category type.
type Client ¶
type Client struct { AdminWorkspaces AdminWorkspaces Applies Applies ConfigurationVersions ConfigurationVersions CostEstimates CostEstimates NotificationConfigurations NotificationConfigurations OAuthClients OAuthClients OAuthTokens OAuthTokens Organizations Organizations OrganizationMemberships OrganizationMemberships OrganizationTokens OrganizationTokens Plans Plans PlanExports PlanExports Policies Policies PolicyChecks PolicyChecks PolicySetParameters PolicySetParameters PolicySets PolicySets RegistryModules RegistryModules Runs Runs RunTriggers RunTriggers SSHKeys SSHKeys StateVersions StateVersions Teams Teams TeamAccess TeamAccesses TeamMembers TeamMembers TeamTokens TeamTokens Users Users Variables Variables Workspaces Workspaces AdminUsers AdminUsers AdminRuns AdminRuns // contains filtered or unexported fields }
Client is the Terraform Enterprise API client. It provides the basic connectivity and configuration for accessing the TFE API.
func (*Client) RemoteAPIVersion ¶ added in v0.5.1
RemoteAPIVersion returns the server's declared API version string.
A Terraform Cloud or Enterprise API server returns its API version in an HTTP header field in all responses. The NewClient function saves the version number returned in its initial setup request and RemoteAPIVersion returns that cached value.
The API protocol calls for this string to be a dotted-decimal version number like 2.3.0, where the first number indicates the API major version while the second indicates a minor version which may have introduced some backward-compatible additional features compared to its predecessor.
Explicit API versioning was added to the Terraform Cloud and Enterprise APIs as a later addition, so older servers will not return version information. In that case, this function returns an empty string as the version.
func (*Client) RetryServerErrors ¶ added in v0.5.1
RetryServerErrors configures the retry HTTP check to also retry unexpected errors or requests that failed with a server error.
func (*Client) SetFakeRemoteAPIVersion ¶ added in v0.5.1
SetFakeRemoteAPIVersion allows setting a given string as the client's remoteAPIVersion, overriding the value pulled from the API header during client initialization.
This is intended for use in tests, when you may want to configure your TFE client to return something different than the actual API version in order to test error handling.
type Config ¶
type Config struct { // The address of the Terraform Enterprise API. Address string // The base path on which the API is served. BasePath string // API token used to access the Terraform Enterprise API. Token string // Headers that will be added to every request. Headers http.Header // A custom HTTP client to use. HTTPClient *http.Client // RetryLogHook is invoked each time a request is retried. RetryLogHook RetryLogHook }
Config provides configuration details to the API client.
type ConfigurationSource ¶
type ConfigurationSource string
ConfigurationSource represents a source of a configuration version.
const ( ConfigurationSourceAPI ConfigurationSource = "tfe-api" ConfigurationSourceBitbucket ConfigurationSource = "bitbucket" ConfigurationSourceGithub ConfigurationSource = "github" ConfigurationSourceGitlab ConfigurationSource = "gitlab" ConfigurationSourceTerraform ConfigurationSource = "terraform" )
List all available configuration version sources.
type ConfigurationStatus ¶
type ConfigurationStatus string
ConfigurationStatus represents a configuration version status.
const ( ConfigurationErrored ConfigurationStatus = "errored" ConfigurationPending ConfigurationStatus = "pending" ConfigurationUploaded ConfigurationStatus = "uploaded" )
List all available configuration version statuses.
type ConfigurationVersion ¶
type ConfigurationVersion struct { ID string `jsonapi:"primary,configuration-versions"` AutoQueueRuns bool `jsonapi:"attr,auto-queue-runs"` Error string `jsonapi:"attr,error"` ErrorMessage string `jsonapi:"attr,error-message"` Source ConfigurationSource `jsonapi:"attr,source"` Speculative bool `jsonapi:"attr,speculative "` Status ConfigurationStatus `jsonapi:"attr,status"` StatusTimestamps *CVStatusTimestamps `jsonapi:"attr,status-timestamps"` UploadURL string `jsonapi:"attr,upload-url"` }
ConfigurationVersion is a representation of an uploaded or ingressed Terraform configuration in TFE. A workspace must have at least one configuration version before any runs may be queued on it.
type ConfigurationVersionCreateOptions ¶
type ConfigurationVersionCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,configuration-versions"` // When true, runs are queued automatically when the configuration version // is uploaded. AutoQueueRuns *bool `jsonapi:"attr,auto-queue-runs,omitempty"` // When true, this configuration version can only be used for planning. Speculative *bool `jsonapi:"attr,speculative,omitempty"` }
ConfigurationVersionCreateOptions represents the options for creating a configuration version.
type ConfigurationVersionList ¶ added in v0.2.0
type ConfigurationVersionList struct { *Pagination Items []*ConfigurationVersion }
ConfigurationVersionList represents a list of configuration versions.
type ConfigurationVersionListOptions ¶
type ConfigurationVersionListOptions struct {
ListOptions
}
ConfigurationVersionListOptions represents the options for listing configuration versions.
type ConfigurationVersions ¶
type ConfigurationVersions interface { // List returns all configuration versions of a workspace. List(ctx context.Context, workspaceID string, options ConfigurationVersionListOptions) (*ConfigurationVersionList, error) // Create is used to create a new configuration version. The created // configuration version will be usable once data is uploaded to it. Create(ctx context.Context, workspaceID string, options ConfigurationVersionCreateOptions) (*ConfigurationVersion, error) // Read a configuration version by its ID. Read(ctx context.Context, cvID string) (*ConfigurationVersion, error) // Upload packages and uploads Terraform configuration files. It requires // the upload URL from a configuration version and the full path to the // configuration files on disk. Upload(ctx context.Context, url string, path string) error }
ConfigurationVersions describes all the configuration version related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/configuration-versions.html
type CostEstimate ¶ added in v0.5.1
type CostEstimate struct { ID string `jsonapi:"primary,cost-estimates"` DeltaMonthlyCost string `jsonapi:"attr,delta-monthly-cost"` ErrorMessage string `jsonapi:"attr,error-message"` MatchedResourcesCount int `jsonapi:"attr,matched-resources-count"` PriorMonthlyCost string `jsonapi:"attr,prior-monthly-cost"` ProposedMonthlyCost string `jsonapi:"attr,proposed-monthly-cost"` ResourcesCount int `jsonapi:"attr,resources-count"` Status CostEstimateStatus `jsonapi:"attr,status"` StatusTimestamps *CostEstimateStatusTimestamps `jsonapi:"attr,status-timestamps"` UnmatchedResourcesCount int `jsonapi:"attr,unmatched-resources-count"` }
CostEstimate represents a Terraform Enterprise costEstimate.
type CostEstimateStatus ¶ added in v0.5.1
type CostEstimateStatus string
CostEstimateStatus represents a costEstimate state.
const ( CostEstimateCanceled CostEstimateStatus = "canceled" CostEstimateErrored CostEstimateStatus = "errored" CostEstimateFinished CostEstimateStatus = "finished" CostEstimatePending CostEstimateStatus = "pending" CostEstimateQueued CostEstimateStatus = "queued" CostEstimateSkippedDueToTargeting CostEstimateStatus = "skipped_due_to_targeting" )
List all available costEstimate statuses.
type CostEstimateStatusTimestamps ¶ added in v0.5.1
type CostEstimateStatusTimestamps struct { CanceledAt time.Time `json:"canceled-at"` ErroredAt time.Time `json:"errored-at"` FinishedAt time.Time `json:"finished-at"` PendingAt time.Time `json:"pending-at"` QueuedAt time.Time `json:"queued-at"` SkippedDueToTargetingAt time.Time `json:"skipped-due-to-targeting-at"` }
CostEstimateStatusTimestamps holds the timestamps for individual costEstimate statuses.
type CostEstimates ¶ added in v0.5.1
type CostEstimates interface { // Read a costEstimate by its ID. Read(ctx context.Context, costEstimateID string) (*CostEstimate, error) // Logs retrieves the logs of a costEstimate. Logs(ctx context.Context, costEstimateID string) (io.Reader, error) }
CostEstimates describes all the costEstimate related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/ (TBD)
type DeliveryResponse ¶ added in v0.5.1
type DeliveryResponse struct { Body string `json:"body"` Code int `json:"code"` Headers http.Header `json:"headers"` SentAt time.Time `json:"sent-at,iso8601"` Successful bool `json:"successful"` URL string `json:"url"` }
DeliveryResponse represents a notification configuration delivery response.
type Enforcement ¶
type Enforcement struct { Path string `json:"path"` Mode EnforcementLevel `json:"mode"` }
Enforcement describes a enforcement.
type EnforcementLevel ¶
type EnforcementLevel string
EnforcementLevel represents an enforcement level.
const ( EnforcementAdvisory EnforcementLevel = "advisory" EnforcementHard EnforcementLevel = "hard-mandatory" EnforcementSoft EnforcementLevel = "soft-mandatory" )
List the available enforcement types.
func EnforcementMode ¶
func EnforcementMode(v EnforcementLevel) *EnforcementLevel
EnforcementMode returns a pointer to the given enforcement level.
type EnforcementOptions ¶
type EnforcementOptions struct { Path *string `json:"path,omitempty"` Mode *EnforcementLevel `json:"mode"` }
EnforcementOptions represents the enforcement options of a policy.
type EnterprisePlanType ¶
type EnterprisePlanType string
EnterprisePlanType represents an enterprise plan type.
const ( EnterprisePlanDisabled EnterprisePlanType = "disabled" EnterprisePlanPremium EnterprisePlanType = "premium" EnterprisePlanPro EnterprisePlanType = "pro" EnterprisePlanTrial EnterprisePlanType = "trial" )
List of available enterprise plan types.
type Entitlements ¶ added in v0.5.1
type Entitlements struct { ID string `jsonapi:"primary,entitlement-sets"` Operations bool `jsonapi:"attr,operations"` PrivateModuleRegistry bool `jsonapi:"attr,private-module-registry"` Sentinel bool `jsonapi:"attr,sentinel"` StateStorage bool `jsonapi:"attr,state-storage"` Teams bool `jsonapi:"attr,teams"` VCSIntegrations bool `jsonapi:"attr,vcs-integrations"` }
Entitlements represents the entitlements of an organization.
type ListOptions ¶
type ListOptions struct { // The page number to request. The results vary based on the PageSize. PageNumber int `url:"page[number],omitempty"` // The number of elements returned in a single page. PageSize int `url:"page[size],omitempty"` }
ListOptions is used to specify pagination options when making API requests. Pagination allows breaking up large result sets into chunks, or "pages".
type LogReader ¶ added in v0.1.1
type LogReader struct {
// contains filtered or unexported fields
}
LogReader implements io.Reader for streaming logs.
type Meta ¶ added in v0.6.3
type Meta struct { Pagination Pagination `json:"pagination"` StatusCounts StatusCounts `json:"status-counts,omitempty"` }
Meta is used to return the meta struct
type NotificationConfiguration ¶ added in v0.5.1
type NotificationConfiguration struct { ID string `jsonapi:"primary,notification-configurations"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` DeliveryResponses []*DeliveryResponse `jsonapi:"attr,delivery-responses"` DestinationType NotificationDestinationType `jsonapi:"attr,destination-type"` Enabled bool `jsonapi:"attr,enabled"` Name string `jsonapi:"attr,name"` Token string `jsonapi:"attr,token"` Triggers []string `jsonapi:"attr,triggers"` UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"` URL string `jsonapi:"attr,url"` // EmailAddresses is only available for TFE users. It is not available in TFC. EmailAddresses []string `jsonapi:"attr,email-addresses"` // Relations Subscribable *Workspace `jsonapi:"relation,subscribable"` EmailUsers []*User `jsonapi:"relation,users"` }
NotificationConfiguration represents a Notification Configuration.
type NotificationConfigurationCreateOptions ¶ added in v0.5.1
type NotificationConfigurationCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,notification-configurations"` // The destination type of the notification configuration DestinationType *NotificationDestinationType `jsonapi:"attr,destination-type"` // Whether the notification configuration should be enabled or not Enabled *bool `jsonapi:"attr,enabled"` // The name of the notification configuration Name *string `jsonapi:"attr,name"` // The token of the notification configuration Token *string `jsonapi:"attr,token,omitempty"` // The list of run events that will trigger notifications. Triggers []string `jsonapi:"attr,triggers,omitempty"` // The url of the notification configuration URL *string `jsonapi:"attr,url,omitempty"` // The list of email addresses that will receive notification emails. // EmailAddresses is only available for TFE users. It is not available in TFC. EmailAddresses []string `jsonapi:"attr,email-addresses,omitempty"` // The list of users belonging to the organization that will receive notification emails. EmailUsers []*User `jsonapi:"relation,users,omitempty"` }
NotificationConfigurationCreateOptions represents the options for creating a new notification configuration.
type NotificationConfigurationList ¶ added in v0.5.1
type NotificationConfigurationList struct { *Pagination Items []*NotificationConfiguration }
NotificationConfigurationList represents a list of Notification Configurations.
type NotificationConfigurationListOptions ¶ added in v0.5.1
type NotificationConfigurationListOptions struct {
ListOptions
}
NotificationConfigurationListOptions represents the options for listing notification configurations.
type NotificationConfigurationUpdateOptions ¶ added in v0.5.1
type NotificationConfigurationUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,notification-configurations"` // Whether the notification configuration should be enabled or not Enabled *bool `jsonapi:"attr,enabled,omitempty"` // The name of the notification configuration Name *string `jsonapi:"attr,name,omitempty"` // The token of the notification configuration Token *string `jsonapi:"attr,token,omitempty"` // The list of run events that will trigger notifications. Triggers []string `jsonapi:"attr,triggers,omitempty"` // The url of the notification configuration URL *string `jsonapi:"attr,url,omitempty"` // The list of email addresses that will receive notification emails. // EmailAddresses is only available for TFE users. It is not available in TFC. EmailAddresses []string `jsonapi:"attr,email-addresses,omitempty"` // The list of users belonging to the organization that will receive notification emails. EmailUsers []*User `jsonapi:"relation,users,omitempty"` }
NotificationConfigurationUpdateOptions represents the options for updating a existing notification configuration.
type NotificationConfigurations ¶ added in v0.5.1
type NotificationConfigurations interface { // List all the notification configurations within a workspace. List(ctx context.Context, workspaceID string, options NotificationConfigurationListOptions) (*NotificationConfigurationList, error) // Create a new notification configuration with the given options. Create(ctx context.Context, workspaceID string, options NotificationConfigurationCreateOptions) (*NotificationConfiguration, error) // Read a notification configuration by its ID. Read(ctx context.Context, notificationConfigurationID string) (*NotificationConfiguration, error) // Update an existing notification configuration. Update(ctx context.Context, notificationConfigurationID string, options NotificationConfigurationUpdateOptions) (*NotificationConfiguration, error) // Delete a notification configuration by its ID. Delete(ctx context.Context, notificationConfigurationID string) error // Verify a notification configuration by its ID. Verify(ctx context.Context, notificationConfigurationID string) (*NotificationConfiguration, error) }
NotificationConfigurations describes all the Notification Configuration related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/notification-configurations.html
type NotificationDestinationType ¶ added in v0.5.1
type NotificationDestinationType string
NotificationDestinationType represents the destination type of the notification configuration.
const ( NotificationDestinationTypeEmail NotificationDestinationType = "email" NotificationDestinationTypeGeneric NotificationDestinationType = "generic" NotificationDestinationTypeSlack NotificationDestinationType = "slack" )
List of available notification destination types.
func NotificationDestination ¶ added in v0.5.1
func NotificationDestination(v NotificationDestinationType) *NotificationDestinationType
NotificationDestination returns a pointer to the given notification configuration destination type
type OAuthClient ¶
type OAuthClient struct { ID string `jsonapi:"primary,oauth-clients"` APIURL string `jsonapi:"attr,api-url"` CallbackURL string `jsonapi:"attr,callback-url"` ConnectPath string `jsonapi:"attr,connect-path"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` HTTPURL string `jsonapi:"attr,http-url"` Key string `jsonapi:"attr,key"` RSAPublicKey string `jsonapi:"attr,rsa-public-key"` ServiceProvider ServiceProviderType `jsonapi:"attr,service-provider"` ServiceProviderName string `jsonapi:"attr,service-provider-display-name"` // Relations Organization *Organization `jsonapi:"relation,organization"` OAuthTokens []*OAuthToken `jsonapi:"relation,oauth-tokens"` }
OAuthClient represents a connection between an organization and a VCS provider.
type OAuthClientCreateOptions ¶
type OAuthClientCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,oauth-clients"` // The base URL of your VCS provider's API. APIURL *string `jsonapi:"attr,api-url"` // The homepage of your VCS provider. HTTPURL *string `jsonapi:"attr,http-url"` // The token string you were given by your VCS provider. OAuthToken *string `jsonapi:"attr,oauth-token-string"` // Private key associated with this vcs provider - only available for ado_server PrivateKey *string `jsonapi:"attr,private-key"` // The VCS provider being connected with. ServiceProvider *ServiceProviderType `jsonapi:"attr,service-provider"` }
OAuthClientCreateOptions represents the options for creating an OAuth client.
type OAuthClientList ¶ added in v0.2.2
type OAuthClientList struct { *Pagination Items []*OAuthClient }
OAuthClientList represents a list of OAuth clients.
type OAuthClientListOptions ¶ added in v0.2.2
type OAuthClientListOptions struct {
ListOptions
}
OAuthClientListOptions represents the options for listing OAuth clients.
type OAuthClients ¶
type OAuthClients interface { // List all the OAuth clients for a given organization. List(ctx context.Context, organization string, options OAuthClientListOptions) (*OAuthClientList, error) // Create an OAuth client to connect an organization and a VCS provider. Create(ctx context.Context, organization string, options OAuthClientCreateOptions) (*OAuthClient, error) // Read an OAuth client by its ID. Read(ctx context.Context, oAuthClientID string) (*OAuthClient, error) // Delete an OAuth client by its ID. Delete(ctx context.Context, oAuthClientID string) error }
OAuthClients describes all the OAuth client related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/oauth-clients.html
type OAuthToken ¶
type OAuthToken struct { ID string `jsonapi:"primary,oauth-tokens"` UID string `jsonapi:"attr,uid"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` HasSSHKey bool `jsonapi:"attr,has-ssh-key"` ServiceProviderUser string `jsonapi:"attr,service-provider-user"` // Relations OAuthClient *OAuthClient `jsonapi:"relation,oauth-client"` }
OAuthToken represents a VCS configuration including the associated OAuth token
type OAuthTokenList ¶ added in v0.2.0
type OAuthTokenList struct { *Pagination Items []*OAuthToken }
OAuthTokenList represents a list of OAuth tokens.
type OAuthTokenListOptions ¶ added in v0.2.0
type OAuthTokenListOptions struct {
ListOptions
}
OAuthTokenListOptions represents the options for listing OAuth tokens.
type OAuthTokenUpdateOptions ¶ added in v0.2.2
type OAuthTokenUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,oauth-tokens"` // A private SSH key to be used for git clone operations. PrivateSSHKey *string `jsonapi:"attr,ssh-key"` }
OAuthTokenUpdateOptions represents the options for updating an OAuth token.
type OAuthTokens ¶
type OAuthTokens interface { // List all the OAuth tokens for a given organization. List(ctx context.Context, organization string, options OAuthTokenListOptions) (*OAuthTokenList, error) // Read a OAuth token by its ID. Read(ctx context.Context, oAuthTokenID string) (*OAuthToken, error) // Update an existing OAuth token. Update(ctx context.Context, oAuthTokenID string, options OAuthTokenUpdateOptions) (*OAuthToken, error) // Delete a OAuth token by its ID. Delete(ctx context.Context, oAuthTokenID string) error }
OAuthTokens describes all the OAuth token related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/oauth-tokens.html
type Organization ¶
type Organization struct { Name string `jsonapi:"primary,organizations"` CollaboratorAuthPolicy AuthPolicyType `jsonapi:"attr,collaborator-auth-policy"` CostEstimationEnabled bool `jsonapi:"attr,cost-estimation-enabled"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` Email string `jsonapi:"attr,email"` EnterprisePlan EnterprisePlanType `jsonapi:"attr,enterprise-plan"` ExternalID string `jsonapi:"attr,external-id"` OwnersTeamSAMLRoleID string `jsonapi:"attr,owners-team-saml-role-id"` Permissions *OrganizationPermissions `jsonapi:"attr,permissions"` SAMLEnabled bool `jsonapi:"attr,saml-enabled"` SessionRemember int `jsonapi:"attr,session-remember"` SessionTimeout int `jsonapi:"attr,session-timeout"` TrialExpiresAt time.Time `jsonapi:"attr,trial-expires-at,iso8601"` TwoFactorConformant bool `jsonapi:"attr,two-factor-conformant"` }
Organization represents a Terraform Enterprise organization.
type OrganizationAccess ¶ added in v0.5.1
type OrganizationAccess struct { ManagePolicies bool `json:"manage-policies"` ManageWorkspaces bool `json:"manage-workspaces"` ManageVCSSettings bool `json:"manage-vcs-settings"` }
OrganizationAccess represents the team's permissions on its organization
type OrganizationAccessOptions ¶ added in v0.5.1
type OrganizationAccessOptions struct { ManagePolicies *bool `json:"manage-policies,omitempty"` ManageWorkspaces *bool `json:"manage-workspaces,omitempty"` ManageVCSSettings *bool `json:"manage-vcs-settings,omitempty"` }
OrganizationAccessOptions represents the organization access options of a team.
type OrganizationCreateOptions ¶
type OrganizationCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,organizations"` // Name of the organization. Name *string `jsonapi:"attr,name"` // Admin email address. Email *string `jsonapi:"attr,email"` // Session expiration (minutes). SessionRemember *int `jsonapi:"attr,session-remember,omitempty"` // Session timeout after inactivity (minutes). SessionTimeout *int `jsonapi:"attr,session-timeout,omitempty"` // Authentication policy. CollaboratorAuthPolicy *AuthPolicyType `jsonapi:"attr,collaborator-auth-policy,omitempty"` // Enable Cost Estimation CostEstimationEnabled *bool `jsonapi:"attr,cost-estimation-enabled,omitempty"` // The name of the "owners" team OwnersTeamSAMLRoleID *string `jsonapi:"attr,owners-team-saml-role-id,omitempty"` }
OrganizationCreateOptions represents the options for creating an organization.
type OrganizationList ¶ added in v0.2.0
type OrganizationList struct { *Pagination Items []*Organization }
OrganizationList represents a list of organizations.
type OrganizationListOptions ¶
type OrganizationListOptions struct {
ListOptions
}
OrganizationListOptions represents the options for listing organizations.
type OrganizationMembership ¶ added in v0.5.1
type OrganizationMembership struct { ID string `jsonapi:"primary,organization-memberships"` Status OrganizationMembershipStatus `jsonapi:"attr,status"` Email string `jsonapi:"attr,email"` // Relations Organization *Organization `jsonapi:"relation,organization"` User *User `jsonapi:"relation,user"` Teams []*Team `jsonapi:"relation,teams"` }
OrganizationMembership represents a Terraform Enterprise organization membership.
type OrganizationMembershipCreateOptions ¶ added in v0.5.1
type OrganizationMembershipCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,organization-memberships"` // User's email address. Email *string `jsonapi:"attr,email"` }
OrganizationMembershipCreateOptions represents the options for creating an organization membership.
type OrganizationMembershipList ¶ added in v0.5.1
type OrganizationMembershipList struct { *Pagination Items []*OrganizationMembership }
OrganizationMembershipList represents a list of organization memberships.
type OrganizationMembershipListOptions ¶ added in v0.5.1
type OrganizationMembershipListOptions struct { ListOptions Include string `url:"include"` }
OrganizationMembershipListOptions represents the options for listing organization memberships.
type OrganizationMembershipReadOptions ¶ added in v0.5.1
type OrganizationMembershipReadOptions struct {
Include string `url:"include"`
}
OrganizationMembershipReadOptions represents the options for reading organization memberships.
type OrganizationMembershipStatus ¶ added in v0.5.1
type OrganizationMembershipStatus string
OrganizationMembershipStatus represents an organization membership status.
type OrganizationMemberships ¶ added in v0.5.1
type OrganizationMemberships interface { // List all the organization memberships of the given organization. List(ctx context.Context, organization string, options OrganizationMembershipListOptions) (*OrganizationMembershipList, error) // Create a new organization membership with the given options. Create(ctx context.Context, organization string, options OrganizationMembershipCreateOptions) (*OrganizationMembership, error) // Read an organization membership by ID Read(ctx context.Context, organizationMembershipID string) (*OrganizationMembership, error) // Read an organization membership by ID with options ReadWithOptions(ctx context.Context, organizationMembershipID string, options OrganizationMembershipReadOptions) (*OrganizationMembership, error) // Delete an organization membership by its ID. Delete(ctx context.Context, organizationMembershipID string) error }
OrganizationMemberships describes all the organization membership related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/cloud/api/organization-memberships.html
type OrganizationPermissions ¶
type OrganizationPermissions struct { CanCreateTeam bool `json:"can-create-team"` CanCreateWorkspace bool `json:"can-create-workspace"` CanCreateWorkspaceMigration bool `json:"can-create-workspace-migration"` CanDestroy bool `json:"can-destroy"` CanTraverse bool `json:"can-traverse"` CanUpdate bool `json:"can-update"` CanUpdateAPIToken bool `json:"can-update-api-token"` CanUpdateOAuth bool `json:"can-update-oauth"` CanUpdateSentinel bool `json:"can-update-sentinel"` }
OrganizationPermissions represents the organization permissions.
type OrganizationToken ¶
type OrganizationToken struct { ID string `jsonapi:"primary,authentication-tokens"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` Description string `jsonapi:"attr,description"` LastUsedAt time.Time `jsonapi:"attr,last-used-at,iso8601"` Token string `jsonapi:"attr,token"` }
OrganizationToken represents a Terraform Enterprise organization token.
type OrganizationTokens ¶
type OrganizationTokens interface { // Generate a new organization token, replacing any existing token. Generate(ctx context.Context, organization string) (*OrganizationToken, error) // Read an organization token. Read(ctx context.Context, organization string) (*OrganizationToken, error) // Delete an organization token. Delete(ctx context.Context, organization string) error }
OrganizationTokens describes all the organization token related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/organization-tokens.html
type OrganizationUpdateOptions ¶
type OrganizationUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,organizations"` // New name for the organization. Name *string `jsonapi:"attr,name,omitempty"` // New admin email address. Email *string `jsonapi:"attr,email,omitempty"` // Session expiration (minutes). SessionRemember *int `jsonapi:"attr,session-remember,omitempty"` // Session timeout after inactivity (minutes). SessionTimeout *int `jsonapi:"attr,session-timeout,omitempty"` // Authentication policy. CollaboratorAuthPolicy *AuthPolicyType `jsonapi:"attr,collaborator-auth-policy,omitempty"` // Enable Cost Estimation CostEstimationEnabled *bool `jsonapi:"attr,cost-estimation-enabled,omitempty"` // The name of the "owners" team OwnersTeamSAMLRoleID *string `jsonapi:"attr,owners-team-saml-role-id,omitempty"` }
OrganizationUpdateOptions represents the options for updating an organization.
type Organizations ¶
type Organizations interface { // List all the organizations visible to the current user. List(ctx context.Context, options OrganizationListOptions) (*OrganizationList, error) // Create a new organization with the given options. Create(ctx context.Context, options OrganizationCreateOptions) (*Organization, error) // Read an organization by its name. Read(ctx context.Context, organization string) (*Organization, error) // Update attributes of an existing organization. Update(ctx context.Context, organization string, options OrganizationUpdateOptions) (*Organization, error) // Delete an organization by its name. Delete(ctx context.Context, organization string) error // Capacity shows the current run capacity of an organization. Capacity(ctx context.Context, organization string) (*Capacity, error) // Entitlements shows the entitlements of an organization. Entitlements(ctx context.Context, organization string) (*Entitlements, error) // RunQueue shows the current run queue of an organization. RunQueue(ctx context.Context, organization string, options RunQueueOptions) (*RunQueue, error) }
Organizations describes all the organization related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/organizations.html
type Pagination ¶ added in v0.2.0
type Pagination struct { CurrentPage int `json:"current-page"` PreviousPage int `json:"prev-page"` NextPage int `json:"next-page"` TotalPages int `json:"total-pages"` TotalCount int `json:"total-count"` }
Pagination is used to return the pagination details of an API request.
type Plan ¶ added in v0.1.1
type Plan struct { ID string `jsonapi:"primary,plans"` HasChanges bool `jsonapi:"attr,has-changes"` LogReadURL string `jsonapi:"attr,log-read-url"` ResourceAdditions int `jsonapi:"attr,resource-additions"` ResourceChanges int `jsonapi:"attr,resource-changes"` ResourceDestructions int `jsonapi:"attr,resource-destructions"` Status PlanStatus `jsonapi:"attr,status"` StatusTimestamps *PlanStatusTimestamps `jsonapi:"attr,status-timestamps"` // Relations Exports []*PlanExport `jsonapi:"relation,exports"` }
Plan represents a Terraform Enterprise plan.
type PlanExport ¶ added in v0.5.1
type PlanExport struct { ID string `jsonapi:"primary,plan-exports"` DataType PlanExportDataType `jsonapi:"attr,data-type"` Status PlanExportStatus `jsonapi:"attr,status"` StatusTimestamps *PlanExportStatusTimestamps `jsonapi:"attr,status-timestamps"` }
PlanExport represents an export of Terraform Enterprise plan data.
type PlanExportCreateOptions ¶ added in v0.5.1
type PlanExportCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,plan-exports"` // The plan to export. Plan *Plan `jsonapi:"relation,plan"` // The name of the policy set. DataType *PlanExportDataType `jsonapi:"attr,data-type"` }
PlanExportCreateOptions represents the options for exporting data from a plan.
type PlanExportDataType ¶ added in v0.5.1
type PlanExportDataType string
PlanExportDataType represents the type of data exported from a plan.
const (
PlanExportSentinelMockBundleV0 PlanExportDataType = "sentinel-mock-bundle-v0"
)
List all available plan export data types.
func PlanExportType ¶ added in v0.5.1
func PlanExportType(v PlanExportDataType) *PlanExportDataType
PlanExportType returns a pointer to the given plan export data type.
type PlanExportStatus ¶ added in v0.5.1
type PlanExportStatus string
PlanExportStatus represents a plan export state.
const ( PlanExportCanceled PlanExportStatus = "canceled" PlanExportErrored PlanExportStatus = "errored" PlanExportExpired PlanExportStatus = "expired" PlanExportFinished PlanExportStatus = "finished" PlanExportPending PlanExportStatus = "pending" PlanExportQueued PlanExportStatus = "queued" )
List all available plan export statuses.
type PlanExportStatusTimestamps ¶ added in v0.5.1
type PlanExportStatusTimestamps struct { CanceledAt time.Time `json:"canceled-at"` ErroredAt time.Time `json:"errored-at"` ExpiredAt time.Time `json:"expired-at"` FinishedAt time.Time `json:"finished-at"` QueuedAt time.Time `json:"queued-at"` }
PlanExportStatusTimestamps holds the timestamps for plan export statuses.
type PlanExports ¶ added in v0.5.1
type PlanExports interface { // Export a plan by its ID with the given options. Create(ctx context.Context, options PlanExportCreateOptions) (*PlanExport, error) // Read a plan export by its ID. Read(ctx context.Context, planExportID string) (*PlanExport, error) // Delete a plan export by its ID. Delete(ctx context.Context, planExportID string) error // Download the data of an plan export. Download(ctx context.Context, planExportID string) ([]byte, error) }
PlanExports describes all the plan export related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/plan-exports.html
type PlanStatus ¶ added in v0.1.1
type PlanStatus string
PlanStatus represents a plan state.
const ( PlanCanceled PlanStatus = "canceled" PlanCreated PlanStatus = "created" PlanErrored PlanStatus = "errored" PlanFinished PlanStatus = "finished" PlanMFAWaiting PlanStatus = "mfa_waiting" PlanPending PlanStatus = "pending" PlanQueued PlanStatus = "queued" PlanRunning PlanStatus = "running" PlanUnreachable PlanStatus = "unreachable" )
List all available plan statuses.
type PlanStatusTimestamps ¶ added in v0.1.1
type PlanStatusTimestamps struct { CanceledAt time.Time `json:"canceled-at"` ErroredAt time.Time `json:"errored-at"` FinishedAt time.Time `json:"finished-at"` ForceCanceledAt time.Time `json:"force-canceled-at"` QueuedAt time.Time `json:"queued-at"` StartedAt time.Time `json:"started-at"` }
PlanStatusTimestamps holds the timestamps for individual plan statuses.
type Plans ¶ added in v0.1.1
type Plans interface { // Read a plan by its ID. Read(ctx context.Context, planID string) (*Plan, error) // Logs retrieves the logs of a plan. Logs(ctx context.Context, planID string) (io.Reader, error) }
Plans describes all the plan related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/plan.html
type Policies ¶
type Policies interface { // List all the policies for a given organization List(ctx context.Context, organization string, options PolicyListOptions) (*PolicyList, error) // Create a policy and associate it with an organization. Create(ctx context.Context, organization string, options PolicyCreateOptions) (*Policy, error) // Read a policy by its ID. Read(ctx context.Context, policyID string) (*Policy, error) // Update an existing policy. Update(ctx context.Context, policyID string, options PolicyUpdateOptions) (*Policy, error) // Delete a policy by its ID. Delete(ctx context.Context, policyID string) error // Upload the policy content of the policy. Upload(ctx context.Context, policyID string, content []byte) error // Upload the policy content of the policy. Download(ctx context.Context, policyID string) ([]byte, error) }
Policies describes all the policy related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/policies.html
type Policy ¶
type Policy struct { ID string `jsonapi:"primary,policies"` Name string `jsonapi:"attr,name"` Description string `jsonapi:"attr,description"` Enforce []*Enforcement `jsonapi:"attr,enforce"` PolicySetCount int `jsonapi:"attr,policy-set-count"` UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"` // Relations Organization *Organization `jsonapi:"relation,organization"` }
Policy represents a Terraform Enterprise policy.
type PolicyActions ¶
type PolicyActions struct {
IsOverridable bool `json:"is-overridable"`
}
PolicyActions represents the policy check actions.
type PolicyCheck ¶
type PolicyCheck struct { ID string `jsonapi:"primary,policy-checks"` Actions *PolicyActions `jsonapi:"attr,actions"` Permissions *PolicyPermissions `jsonapi:"attr,permissions"` Result *PolicyResult `jsonapi:"attr,result"` Scope PolicyScope `jsonapi:"attr,scope"` Status PolicyStatus `jsonapi:"attr,status"` StatusTimestamps *PolicyStatusTimestamps `jsonapi:"attr,status-timestamps"` }
PolicyCheck represents a Terraform Enterprise policy check..
type PolicyCheckList ¶ added in v0.2.0
type PolicyCheckList struct { *Pagination Items []*PolicyCheck }
PolicyCheckList represents a list of policy checks.
type PolicyCheckListOptions ¶
type PolicyCheckListOptions struct {
ListOptions
}
PolicyCheckListOptions represents the options for listing policy checks.
type PolicyChecks ¶
type PolicyChecks interface { // List all policy checks of the given run. List(ctx context.Context, runID string, options PolicyCheckListOptions) (*PolicyCheckList, error) // Read a policy check by its ID. Read(ctx context.Context, policyCheckID string) (*PolicyCheck, error) // Override a soft-mandatory or warning policy. Override(ctx context.Context, policyCheckID string) (*PolicyCheck, error) // Logs retrieves the logs of a policy check. Logs(ctx context.Context, policyCheckID string) (io.Reader, error) }
PolicyChecks describes all the policy check related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/policy-checks.html
type PolicyCreateOptions ¶
type PolicyCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,policies"` // The name of the policy. Name *string `jsonapi:"attr,name"` // A description of the policy's purpose. Description *string `jsonapi:"attr,description,omitempty"` // The enforcements of the policy. Enforce []*EnforcementOptions `jsonapi:"attr,enforce"` }
PolicyCreateOptions represents the options for creating a new policy.
type PolicyList ¶ added in v0.2.0
type PolicyList struct { *Pagination Items []*Policy }
PolicyList represents a list of policies..
type PolicyListOptions ¶
type PolicyListOptions struct { ListOptions // A search string (partial policy name) used to filter the results. Search *string `url:"search[name],omitempty"` }
PolicyListOptions represents the options for listing policies.
type PolicyPermissions ¶
type PolicyPermissions struct {
CanOverride bool `json:"can-override"`
}
PolicyPermissions represents the policy check permissions.
type PolicyResult ¶
type PolicyResult struct { AdvisoryFailed int `json:"advisory-failed"` Duration int `json:"duration"` HardFailed int `json:"hard-failed"` Passed int `json:"passed"` Result bool `json:"result"` // Sentinel *sentinel.EvalResult `json:"sentinel"` SoftFailed int `json:"soft-failed"` TotalFailed int `json:"total-failed"` }
PolicyResult represents the complete policy check result,
type PolicyScope ¶
type PolicyScope string
PolicyScope represents a policy scope.
const ( PolicyScopeOrganization PolicyScope = "organization" PolicyScopeWorkspace PolicyScope = "workspace" )
List all available policy scopes.
type PolicySet ¶ added in v0.5.1
type PolicySet struct { ID string `jsonapi:"primary,policy-sets"` Name string `jsonapi:"attr,name"` Description string `jsonapi:"attr,description"` Global bool `jsonapi:"attr,global"` PoliciesPath string `jsonapi:"attr,policies-path"` PolicyCount int `jsonapi:"attr,policy-count"` VCSRepo *VCSRepo `jsonapi:"attr,vcs-repo"` WorkspaceCount int `jsonapi:"attr,workspace-count"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"` // Relations Organization *Organization `jsonapi:"relation,organization"` Policies []*Policy `jsonapi:"relation,policies"` Workspaces []*Workspace `jsonapi:"relation,workspaces"` }
PolicySet represents a Terraform Enterprise policy set.
type PolicySetAddPoliciesOptions ¶ added in v0.5.1
type PolicySetAddPoliciesOptions struct { /// The policies to add to the policy set. Policies []*Policy }
PolicySetAddPoliciesOptions represents the options for adding policies to a policy set.
type PolicySetAddWorkspacesOptions ¶ added in v0.5.1
type PolicySetAddWorkspacesOptions struct { /// The workspaces to add to the policy set. Workspaces []*Workspace }
PolicySetAddWorkspacesOptions represents the options for adding workspaces to a policy set.
type PolicySetCreateOptions ¶ added in v0.5.1
type PolicySetCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,policy-sets"` // The name of the policy set. Name *string `jsonapi:"attr,name"` // The description of the policy set. Description *string `jsonapi:"attr,description,omitempty"` // Whether or not the policy set is global. Global *bool `jsonapi:"attr,global,omitempty"` // The sub-path within the attached VCS repository to ingress. All // files and directories outside of this sub-path will be ignored. // This option may only be specified when a VCS repo is present. PoliciesPath *string `jsonapi:"attr,policies-path,omitempty"` // The initial members of the policy set. Policies []*Policy `jsonapi:"relation,policies,omitempty"` // VCS repository information. When present, the policies and // configuration will be sourced from the specified VCS repository // instead of being defined within the policy set itself. Note that // this option is mutually exclusive with the Policies option and // both cannot be used at the same time. VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"` // The initial list of workspaces for which the policy set should be enforced. Workspaces []*Workspace `jsonapi:"relation,workspaces,omitempty"` }
PolicySetCreateOptions represents the options for creating a new policy set.
type PolicySetList ¶ added in v0.5.1
type PolicySetList struct { *Pagination Items []*PolicySet }
PolicySetList represents a list of policy sets.
type PolicySetListOptions ¶ added in v0.5.1
type PolicySetListOptions struct { ListOptions // A search string (partial policy set name) used to filter the results. Search *string `url:"search[name],omitempty"` }
PolicySetListOptions represents the options for listing policy sets.
type PolicySetParameter ¶ added in v0.5.1
type PolicySetParameter struct { ID string `jsonapi:"primary,vars"` Key string `jsonapi:"attr,key"` Value string `jsonapi:"attr,value"` Category CategoryType `jsonapi:"attr,category"` Sensitive bool `jsonapi:"attr,sensitive"` // Relations PolicySet *PolicySet `jsonapi:"relation,configurable"` }
PolicySetParameter represents a Policy Set parameter
type PolicySetParameterCreateOptions ¶ added in v0.5.1
type PolicySetParameterCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,vars"` // The name of the parameter. Key *string `jsonapi:"attr,key"` // The value of the parameter. Value *string `jsonapi:"attr,value,omitempty"` // The Category of the parameter, should always be "policy-set" Category *CategoryType `jsonapi:"attr,category"` // Whether the value is sensitive. Sensitive *bool `jsonapi:"attr,sensitive,omitempty"` }
PolicySetParameterCreateOptions represents the options for creating a new parameter.
type PolicySetParameterList ¶ added in v0.5.1
type PolicySetParameterList struct { *Pagination Items []*PolicySetParameter }
PolicySetParameterList represents a list of parameters.
type PolicySetParameterListOptions ¶ added in v0.5.1
type PolicySetParameterListOptions struct {
ListOptions
}
PolicySetParameterListOptions represents the options for listing parameters.
type PolicySetParameterUpdateOptions ¶ added in v0.5.1
type PolicySetParameterUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,vars"` // The name of the parameter. Key *string `jsonapi:"attr,key,omitempty"` // The value of the parameter. Value *string `jsonapi:"attr,value,omitempty"` // Whether the value is sensitive. Sensitive *bool `jsonapi:"attr,sensitive,omitempty"` }
PolicySetParameterUpdateOptions represents the options for updating a parameter.
type PolicySetParameters ¶ added in v0.5.1
type PolicySetParameters interface { // List all the parameters associated with the given policy-set. List(ctx context.Context, policySetID string, options PolicySetParameterListOptions) (*PolicySetParameterList, error) // Create is used to create a new parameter. Create(ctx context.Context, policySetID string, options PolicySetParameterCreateOptions) (*PolicySetParameter, error) // Read a parameter by its ID. Read(ctx context.Context, policySetID string, parameterID string) (*PolicySetParameter, error) // Update values of an existing parameter. Update(ctx context.Context, policySetID string, parameterID string, options PolicySetParameterUpdateOptions) (*PolicySetParameter, error) // Delete a parameter by its ID. Delete(ctx context.Context, policySetID string, parameterID string) error }
PolicySetParameters describes all the parameter related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/policy-set-params.html
type PolicySetRemovePoliciesOptions ¶ added in v0.5.1
type PolicySetRemovePoliciesOptions struct { /// The policies to remove from the policy set. Policies []*Policy }
PolicySetRemovePoliciesOptions represents the options for removing policies from a policy set.
type PolicySetRemoveWorkspacesOptions ¶ added in v0.5.1
type PolicySetRemoveWorkspacesOptions struct { /// The workspaces to remove from the policy set. Workspaces []*Workspace }
PolicySetRemoveWorkspacesOptions represents the options for removing workspaces from a policy set.
type PolicySetUpdateOptions ¶ added in v0.5.1
type PolicySetUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,policy-sets"` /// The name of the policy set. Name *string `jsonapi:"attr,name,omitempty"` // The description of the policy set. Description *string `jsonapi:"attr,description,omitempty"` // Whether or not the policy set is global. Global *bool `jsonapi:"attr,global,omitempty"` // The sub-path within the attached VCS repository to ingress. All // files and directories outside of this sub-path will be ignored. // This option may only be specified when a VCS repo is present. PoliciesPath *string `jsonapi:"attr,policies-path,omitempty"` // VCS repository information. When present, the policies and // configuration will be sourced from the specified VCS repository // instead of being defined within the policy set itself. Note that // specifying this option may only be used on policy sets with no // directly-attached policies (*PolicySet.Policies). Specifying this // option when policies are already present will result in an error. VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"` }
PolicySetUpdateOptions represents the options for updating a policy set.
type PolicySets ¶ added in v0.5.1
type PolicySets interface { // List all the policy sets for a given organization. List(ctx context.Context, organization string, options PolicySetListOptions) (*PolicySetList, error) // Create a policy set and associate it with an organization. Create(ctx context.Context, organization string, options PolicySetCreateOptions) (*PolicySet, error) // Read a policy set by its ID. Read(ctx context.Context, policySetID string) (*PolicySet, error) // Update an existing policy set. Update(ctx context.Context, policySetID string, options PolicySetUpdateOptions) (*PolicySet, error) // Add policies to a policy set. This function can only be used when // there is no VCS repository associated with the policy set. AddPolicies(ctx context.Context, policySetID string, options PolicySetAddPoliciesOptions) error // Remove policies from a policy set. This function can only be used // when there is no VCS repository associated with the policy set. RemovePolicies(ctx context.Context, policySetID string, options PolicySetRemovePoliciesOptions) error // Add workspaces to a policy set. AddWorkspaces(ctx context.Context, policySetID string, options PolicySetAddWorkspacesOptions) error // Remove workspaces from a policy set. RemoveWorkspaces(ctx context.Context, policySetID string, options PolicySetRemoveWorkspacesOptions) error // Delete a policy set by its ID. Delete(ctx context.Context, policyID string) error }
PolicySets describes all the policy set related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/policies.html
type PolicyStatus ¶
type PolicyStatus string
PolicyStatus represents a policy check state.
const ( PolicyCanceled PolicyStatus = "canceled" PolicyErrored PolicyStatus = "errored" PolicyHardFailed PolicyStatus = "hard_failed" PolicyOverridden PolicyStatus = "overridden" PolicyPasses PolicyStatus = "passed" PolicyPending PolicyStatus = "pending" PolicyQueued PolicyStatus = "queued" PolicySoftFailed PolicyStatus = "soft_failed" PolicyUnreachable PolicyStatus = "unreachable" )
List all available policy check statuses.
type PolicyStatusTimestamps ¶
type PolicyStatusTimestamps struct { ErroredAt time.Time `json:"errored-at"` HardFailedAt time.Time `json:"hard-failed-at"` PassedAt time.Time `json:"passed-at"` QueuedAt time.Time `json:"queued-at"` SoftFailedAt time.Time `json:"soft-failed-at"` }
PolicyStatusTimestamps holds the timestamps for individual policy check statuses.
type PolicyUpdateOptions ¶
type PolicyUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,policies"` // A description of the policy's purpose. Description *string `jsonapi:"attr,description,omitempty"` // The enforcements of the policy. Enforce []*EnforcementOptions `jsonapi:"attr,enforce,omitempty"` }
PolicyUpdateOptions represents the options for updating a policy.
type RegistryModule ¶ added in v0.6.5
type RegistryModule struct { ID string `jsonapi:"primary,registry-modules"` Name string `jsonapi:"attr,name"` Provider string `jsonapi:"attr,provider"` Permissions *RegistryModulePermissions `jsonapi:"attr,permissions"` Status RegistryModuleStatus `jsonapi:"attr,status"` VCSRepo *VCSRepo `jsonapi:"attr,vcs-repo"` VersionStatuses []RegistryModuleVersionStatuses `jsonapi:"attr,version-statuses"` CreatedAt string `jsonapi:"attr,created-at"` UpdatedAt string `jsonapi:"attr,updated-at"` // Relations Organization *Organization `jsonapi:"relation,organization"` }
RegistryModule represents a registry module
type RegistryModuleCreateOptions ¶ added in v0.6.5
type RegistryModuleCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,registry-modules"` Name *string `jsonapi:"attr,name"` Provider *string `jsonapi:"attr,provider"` }
RegistryModuleCreateOptions is used when creating a registry module without a VCS repo
type RegistryModuleCreateVersionOptions ¶ added in v0.6.5
type RegistryModuleCreateVersionOptions struct { // For internal use only! ID string `jsonapi:"primary,registry-module-versions"` Version *string `jsonapi:"attr,version"` }
RegistryModuleCreateVersionOptions is used when creating a registry module version
type RegistryModuleCreateWithVCSConnectionOptions ¶ added in v0.6.5
type RegistryModuleCreateWithVCSConnectionOptions struct { // VCS repository information VCSRepo *RegistryModuleVCSRepoOptions `jsonapi:"attr,vcs-repo"` }
RegistryModuleCreateWithVCSConnectionOptions is used when creating a registry module with a VCS repo
type RegistryModulePermissions ¶ added in v0.6.5
type RegistryModuleStatus ¶ added in v0.6.5
type RegistryModuleStatus string
RegistryModuleStatus represents the status of the registry module
const ( RegistryModuleStatusPending RegistryModuleStatus = "pending" RegistryModuleStatusNoVersionTags RegistryModuleStatus = "no_version_tags" RegistryModuleStatusSetupFailed RegistryModuleStatus = "setup_failed" RegistryModuleStatusSetupComplete RegistryModuleStatus = "setup_complete" )
List of available registry module statuses
type RegistryModuleVCSRepoOptions ¶ added in v0.6.5
type RegistryModuleVersion ¶ added in v0.6.5
type RegistryModuleVersion struct { ID string `jsonapi:"primary,registry-module-versions"` Source string `jsonapi:"attr,source"` Status RegistryModuleVersionStatus `jsonapi:"attr,status"` Version string `jsonapi:"attr,version"` CreatedAt string `jsonapi:"attr,created-at"` UpdatedAt string `jsonapi:"attr,updated-at"` // Relations RegistryModule *RegistryModule `jsonapi:"relation,registry-module"` }
RegistryModuleVersion represents a registry module version
type RegistryModuleVersionStatus ¶ added in v0.6.5
type RegistryModuleVersionStatus string
RegistryModuleVersionStatus represents the status of a specific version of a registry module
const ( RegistryModuleVersionStatusPending RegistryModuleVersionStatus = "pending" RegistryModuleVersionStatusCloning RegistryModuleVersionStatus = "cloning" RegistryModuleVersionStatusCloneFailed RegistryModuleVersionStatus = "clone_failed" RegistryModuleVersionStatusRegIngressReqFailed RegistryModuleVersionStatus = "reg_ingress_req_failed" RegistryModuleVersionStatusRegIngressing RegistryModuleVersionStatus = "reg_ingressing" RegistryModuleVersionStatusRegIngressFailed RegistryModuleVersionStatus = "reg_ingress_failed" RegistryModuleVersionStatusOk RegistryModuleVersionStatus = "ok" )
List of available registry module version statuses
type RegistryModuleVersionStatuses ¶ added in v0.6.5
type RegistryModuleVersionStatuses struct { Version string `json:"version"` Status RegistryModuleVersionStatus `json:"status"` Error string `json:"error"` }
type RegistryModules ¶ added in v0.6.5
type RegistryModules interface { // Create a registry module without a VCS repo Create(ctx context.Context, organization string, options RegistryModuleCreateOptions) (*RegistryModule, error) // Create a registry module version CreateVersion(ctx context.Context, organization string, name string, provider string, options RegistryModuleCreateVersionOptions) (*RegistryModuleVersion, error) // Create and publish a registry module with a VCS repo CreateWithVCSConnection(ctx context.Context, options RegistryModuleCreateWithVCSConnectionOptions) (*RegistryModule, error) // Read a registry module Read(ctx context.Context, organization string, name string, provider string) (*RegistryModule, error) // Delete a registry module Delete(ctx context.Context, organization string, name string) error // Delete a specific registry module provider DeleteProvider(ctx context.Context, organization string, name string, provider string) error // Delete a specific registry module version DeleteVersion(ctx context.Context, organization string, name string, provider string, version string) error }
RegistryModules describes all the registry module related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/cloud/api/modules.html
type RetryLogHook ¶ added in v0.5.1
RetryLogHook allows a function to run before each retry.
type Run ¶
type Run struct { ID string `jsonapi:"primary,runs"` Actions *RunActions `jsonapi:"attr,actions"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` ForceCancelAvailableAt time.Time `jsonapi:"attr,force-cancel-available-at,iso8601"` HasChanges bool `jsonapi:"attr,has-changes"` IsDestroy bool `jsonapi:"attr,is-destroy"` Message string `jsonapi:"attr,message"` Permissions *RunPermissions `jsonapi:"attr,permissions"` PositionInQueue int `jsonapi:"attr,position-in-queue"` Source RunSource `jsonapi:"attr,source"` Status RunStatus `jsonapi:"attr,status"` StatusTimestamps *RunStatusTimestamps `jsonapi:"attr,status-timestamps"` TargetAddrs []string `jsonapi:"attr,target-addrs,omitempty"` // Relations Apply *Apply `jsonapi:"relation,apply"` ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"` CostEstimate *CostEstimate `jsonapi:"relation,cost-estimate"` Plan *Plan `jsonapi:"relation,plan"` PolicyChecks []*PolicyCheck `jsonapi:"relation,policy-checks"` Workspace *Workspace `jsonapi:"relation,workspace"` }
Run represents a Terraform Enterprise run.
type RunActions ¶
type RunActions struct { IsCancelable bool `json:"is-cancelable"` IsConfirmable bool `json:"is-confirmable"` IsDiscardable bool `json:"is-discardable"` IsForceCancelable bool `json:"is-force-cancelable"` }
RunActions represents the run actions.
type RunApplyOptions ¶
type RunApplyOptions struct { // An optional comment about the run. Comment *string `json:"comment,omitempty"` }
RunApplyOptions represents the options for applying a run.
type RunCancelOptions ¶
type RunCancelOptions struct { // An optional explanation for why the run was canceled. Comment *string `json:"comment,omitempty"` }
RunCancelOptions represents the options for canceling a run.
type RunCreateOptions ¶
type RunCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,runs"` // Specifies if this plan is a destroy plan, which will destroy all // provisioned resources. IsDestroy *bool `jsonapi:"attr,is-destroy,omitempty"` // Specifies the message to be associated with this run. Message *string `jsonapi:"attr,message,omitempty"` // Specifies the configuration version to use for this run. If the // configuration version object is omitted, the run will be created using the // workspace's latest configuration version. ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"` // Specifies the workspace where the run will be executed. Workspace *Workspace `jsonapi:"relation,workspace"` // If non-empty, requests that Terraform should create a plan including // actions only for the given objects (specified using resource address // syntax) and the objects they depend on. // // This capability is provided for exceptional circumstances only, such as // recovering from mistakes or working around existing Terraform // limitations. Terraform will generally mention the -target command line // option in its error messages describing situations where setting this // argument may be appropriate. This argument should not be used as part // of routine workflow and Terraform will emit warnings reminding about // this whenever this property is set. TargetAddrs []string `jsonapi:"attr,target-addrs,omitempty"` }
RunCreateOptions represents the options for creating a new run.
type RunDiscardOptions ¶
type RunDiscardOptions struct { // An optional explanation for why the run was discarded. Comment *string `json:"comment,omitempty"` }
RunDiscardOptions represents the options for discarding a run.
type RunForceCancelOptions ¶ added in v0.2.4
type RunForceCancelOptions struct { // An optional comment explaining the reason for the force-cancel. Comment *string `json:"comment,omitempty"` }
RunForceCancelOptions represents the options for force-canceling a run.
type RunList ¶ added in v0.2.0
type RunList struct { *Pagination Items []*Run }
RunList represents a list of runs.
type RunListOptions ¶
type RunListOptions struct {
ListOptions
}
RunListOptions represents the options for listing runs.
type RunPermissions ¶
type RunPermissions struct { CanApply bool `json:"can-apply"` CanCancel bool `json:"can-cancel"` CanDiscard bool `json:"can-discard"` CanForceCancel bool `json:"can-force-cancel"` CanForceExecute bool `json:"can-force-execute"` }
RunPermissions represents the run permissions.
type RunQueue ¶ added in v0.2.4
type RunQueue struct { *Pagination Items []*Run }
RunQueue represents the current run queue of an organization.
type RunQueueOptions ¶ added in v0.2.4
type RunQueueOptions struct {
ListOptions
}
RunQueueOptions represents the options for showing the queue.
type RunStatus ¶
type RunStatus string
RunStatus represents a run state.
const ( RunApplied RunStatus = "applied" RunApplyQueued RunStatus = "apply_queued" RunApplying RunStatus = "applying" RunCanceled RunStatus = "canceled" RunConfirmed RunStatus = "confirmed" RunCostEstimated RunStatus = "cost_estimated" RunCostEstimating RunStatus = "cost_estimating" RunDiscarded RunStatus = "discarded" RunErrored RunStatus = "errored" RunPending RunStatus = "pending" RunPlanQueued RunStatus = "plan_queued" RunPlanned RunStatus = "planned" RunPlannedAndFinished RunStatus = "planned_and_finished" RunPlanning RunStatus = "planning" RunPolicyChecked RunStatus = "policy_checked" RunPolicyChecking RunStatus = "policy_checking" RunPolicyOverride RunStatus = "policy_override" RunPolicySoftFailed RunStatus = "policy_soft_failed" )
List all available run statuses.
type RunStatusTimestamps ¶
type RunStatusTimestamps struct { ErroredAt time.Time `json:"errored-at"` FinishedAt time.Time `json:"finished-at"` QueuedAt time.Time `json:"queued-at"` StartedAt time.Time `json:"started-at"` ApplyingAt time.Time `json:"applying-at"` AppliedAt time.Time `json:"applied-at"` PlanningAt time.Time `json:"planning-at"` PlannedAt time.Time `json:"planned-at"` PlannedAndFinishedAt time.Time `json:"planned-and-finished-at"` PlanQueuabledAt time.Time `json:"plan-queueable-at"` }
RunStatusTimestamps holds the timestamps for individual run statuses.
type RunTrigger ¶ added in v0.5.1
type RunTrigger struct { ID string `jsonapi:"primary,run-triggers"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` SourceableName string `jsonapi:"attr,sourceable-name"` WorkspaceName string `jsonapi:"attr,workspace-name"` // Relations // TODO: this will eventually need to be polymorphic Sourceable *Workspace `jsonapi:"relation,sourceable"` Workspace *Workspace `jsonapi:"relation,workspace"` }
RunTrigger represents a run trigger.
type RunTriggerCreateOptions ¶ added in v0.5.1
type RunTriggerCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,run-triggers"` // The source workspace Sourceable *Workspace `jsonapi:"relation,sourceable"` }
RunTriggerCreateOptions represents the options for creating a new run trigger.
type RunTriggerList ¶ added in v0.5.1
type RunTriggerList struct { *Pagination Items []*RunTrigger }
RunTriggerList represents a list of Run Triggers
type RunTriggerListOptions ¶ added in v0.5.1
type RunTriggerListOptions struct { ListOptions RunTriggerType *string `url:"filter[run-trigger][type]"` }
RunTriggerListOptions represents the options for listing run triggers.
type RunTriggers ¶ added in v0.5.1
type RunTriggers interface { // List all the run triggers within a workspace. List(ctx context.Context, workspaceID string, options RunTriggerListOptions) (*RunTriggerList, error) // Create a new run trigger with the given options. Create(ctx context.Context, workspaceID string, options RunTriggerCreateOptions) (*RunTrigger, error) // Read a run trigger by its ID. Read(ctx context.Context, RunTriggerID string) (*RunTrigger, error) // Delete a run trigger by its ID. Delete(ctx context.Context, RunTriggerID string) error }
RunTriggers describes all the Run Trigger related methods that the Terraform Cloud API supports.
TFE API docs: https://www.terraform.io/docs/cloud/api/run-triggers.html
type Runs ¶
type Runs interface { // List all the runs of the given workspace. List(ctx context.Context, workspaceID string, options RunListOptions) (*RunList, error) // Create a new run with the given options. Create(ctx context.Context, options RunCreateOptions) (*Run, error) // Read a run by its ID. Read(ctx context.Context, runID string) (*Run, error) // Apply a run by its ID. Apply(ctx context.Context, runID string, options RunApplyOptions) error // Cancel a run by its ID. 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(ctx context.Context, runID string, options RunDiscardOptions) error }
Runs describes all the run related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/run.html
type RunsPermissionType ¶ added in v0.5.1
type RunsPermissionType string
RunsPermissionType represents the permissiontype to a workspace's runs.
func RunsPermission ¶ added in v0.5.1
func RunsPermission(v RunsPermissionType) *RunsPermissionType
RunsPermission returns a pointer to the given team runs permission type.
type SSHKeyCreateOptions ¶
type SSHKeyCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,ssh-keys"` // A name to identify the SSH key. Name *string `jsonapi:"attr,name"` // The content of the SSH private key. Value *string `jsonapi:"attr,value"` }
SSHKeyCreateOptions represents the options for creating an SSH key.
type SSHKeyList ¶ added in v0.2.0
type SSHKeyList struct { *Pagination Items []*SSHKey }
SSHKeyList represents a list of SSH keys.
type SSHKeyListOptions ¶
type SSHKeyListOptions struct {
ListOptions
}
SSHKeyListOptions represents the options for listing SSH keys.
type SSHKeyUpdateOptions ¶
type SSHKeyUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,ssh-keys"` // A new name to identify the SSH key. Name *string `jsonapi:"attr,name,omitempty"` // Updated content of the SSH private key. Value *string `jsonapi:"attr,value,omitempty"` }
SSHKeyUpdateOptions represents the options for updating an SSH key.
type SSHKeys ¶
type SSHKeys interface { // List all the SSH keys for a given organization List(ctx context.Context, organization string, options SSHKeyListOptions) (*SSHKeyList, error) // Create an SSH key and associate it with an organization. Create(ctx context.Context, organization string, options SSHKeyCreateOptions) (*SSHKey, error) // Read an SSH key by its ID. Read(ctx context.Context, sshKeyID string) (*SSHKey, error) // Update an SSH key by its ID. Update(ctx context.Context, sshKeyID string, options SSHKeyUpdateOptions) (*SSHKey, error) // Delete an SSH key by its ID. Delete(ctx context.Context, sshKeyID string) error }
SSHKeys describes all the SSH key related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/ssh-keys.html
type SentinelMocksPermissionType ¶ added in v0.5.1
type SentinelMocksPermissionType string
SentinelMocksPermissionType represents the permissiontype to a workspace's Sentinel mocks.
func SentinelMocksPermission ¶ added in v0.5.1
func SentinelMocksPermission(v SentinelMocksPermissionType) *SentinelMocksPermissionType
SentinelMocksPermission returns a pointer to the given team Sentinel mocks permission type.
type ServiceProviderType ¶
type ServiceProviderType string
ServiceProviderType represents a VCS type.
const ( ServiceProviderAzureDevOpsServer ServiceProviderType = "ado_server" ServiceProviderAzureDevOpsServices ServiceProviderType = "ado_services" ServiceProviderBitbucket ServiceProviderType = "bitbucket_hosted" // Bitbucket Server v5.4.0 and above ServiceProviderBitbucketServer ServiceProviderType = "bitbucket_server" // Bitbucket Server v5.3.0 and below ServiceProviderBitbucketServerLegacy ServiceProviderType = "bitbucket_server_legacy" ServiceProviderGithub ServiceProviderType = "github" ServiceProviderGithubEE ServiceProviderType = "github_enterprise" ServiceProviderGitlab ServiceProviderType = "gitlab_hosted" ServiceProviderGitlabCE ServiceProviderType = "gitlab_community_edition" ServiceProviderGitlabEE ServiceProviderType = "gitlab_enterprise_edition" )
List of available VCS types.
func ServiceProvider ¶
func ServiceProvider(v ServiceProviderType) *ServiceProviderType
ServiceProvider returns a pointer to the given service provider type.
type StateVersion ¶
type StateVersion struct { ID string `jsonapi:"primary,state-versions"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` DownloadURL string `jsonapi:"attr,hosted-state-download-url"` Serial int64 `jsonapi:"attr,serial"` VCSCommitSHA string `jsonapi:"attr,vcs-commit-sha"` VCSCommitURL string `jsonapi:"attr,vcs-commit-url"` // Relations Run *Run `jsonapi:"relation,run"` }
StateVersion represents a Terraform Enterprise state version.
type StateVersionCreateOptions ¶
type StateVersionCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,state-versions"` // The lineage of the state. Lineage *string `jsonapi:"attr,lineage,omitempty"` // The MD5 hash of the state version. MD5 *string `jsonapi:"attr,md5"` // The serial of the state. Serial *int64 `jsonapi:"attr,serial"` // The base64 encoded state. State *string `jsonapi:"attr,state"` // Force can be set to skip certain validations. Wrong use // of this flag can cause data loss, so USE WITH CAUTION! Force *bool `jsonapi:"attr,force"` // Specifies the run to associate the state with. Run *Run `jsonapi:"relation,run,omitempty"` }
StateVersionCreateOptions represents the options for creating a state version.
type StateVersionList ¶ added in v0.2.0
type StateVersionList struct { *Pagination Items []*StateVersion }
StateVersionList represents a list of state versions.
type StateVersionListOptions ¶
type StateVersionListOptions struct { ListOptions Organization *string `url:"filter[organization][name]"` Workspace *string `url:"filter[workspace][name]"` }
StateVersionListOptions represents the options for listing state versions.
type StateVersions ¶
type StateVersions interface { // List all the state versions for a given workspace. List(ctx context.Context, options StateVersionListOptions) (*StateVersionList, error) // Create a new state version for the given workspace. Create(ctx context.Context, workspaceID string, options StateVersionCreateOptions) (*StateVersion, error) // Read a state version by its ID. Read(ctx context.Context, svID string) (*StateVersion, error) // Current reads the latest available state from the given workspace. Current(ctx context.Context, workspaceID string) (*StateVersion, error) // Download retrieves the actual stored state of a state version Download(ctx context.Context, url string) ([]byte, error) }
StateVersions describes all the state version related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/state-versions.html
type StateVersionsPermissionType ¶ added in v0.5.1
type StateVersionsPermissionType string
StateVersionsPermissionType represents the permissiontype to a workspace's state versions.
func StateVersionsPermission ¶ added in v0.5.1
func StateVersionsPermission(v StateVersionsPermissionType) *StateVersionsPermissionType
StateVersionsPermission returns a pointer to the given team state versions permission type.
type StatusCounts ¶ added in v0.6.1
type StatusCounts struct { Total int `json:"total,omitempty"` // organization ActiveTrial int `json:"active-trial,omitempty"` ExpiredTrial int `json:"expired-trial,omitempty"` Pro int `json:"pro,omitempty"` Premium int `json:"premium,omitempty"` Disabled int `json:"disabled,omitempty"` // runs + workspaces Pending int `json:"pending,omitempty"` Planning int `json:"planning,omitempty"` Planned int `json:"planned,omitempty"` Confirmed int `json:"confirmed,omitempty"` Applying int `json:"applying,omitempty"` Applied int `json:"applied,omitempty"` Discarded int `json:"discarded,omitempty"` Errored int `json:"errored,omitempty"` Canceled int `json:"canceled,omitempty"` PolicyChecking int `json:"policy-checking,omitempty"` PolicyOverride int `json:"policy-override,omitempty"` PolicyChecked int `json:"policy-checked,omitempty"` // workspaces None int `json:"none,omitempty"` }
StatusCounts is used to return statistics for your list requests.
type Team ¶
type Team struct { ID string `jsonapi:"primary,teams"` Name string `jsonapi:"attr,name"` OrganizationAccess *OrganizationAccess `jsonapi:"attr,organization-access"` Visibility string `jsonapi:"attr,visibility"` Permissions *TeamPermissions `jsonapi:"attr,permissions"` UserCount int `jsonapi:"attr,users-count"` // Relations Users []*User `jsonapi:"relation,users"` OrganizationMemberships []*OrganizationMembership `jsonapi:"relation,organization-memberships"` }
Team represents a Terraform Enterprise team.
type TeamAccess ¶
type TeamAccess struct { ID string `jsonapi:"primary,team-workspaces"` Access AccessType `jsonapi:"attr,access"` Runs RunsPermissionType `jsonapi:"attr,runs"` Variables VariablesPermissionType `jsonapi:"attr,variables"` StateVersions StateVersionsPermissionType `jsonapi:"attr,state-versions"` SentinelMocks SentinelMocksPermissionType `jsonapi:"attr,sentinel-mocks"` WorkspaceLocking bool `jsonapi:"attr,workspace-locking"` // Relations Team *Team `jsonapi:"relation,team"` Workspace *Workspace `jsonapi:"relation,workspace"` }
TeamAccess represents the workspace access for a team.
type TeamAccessAddOptions ¶
type TeamAccessAddOptions struct { // For internal use only! ID string `jsonapi:"primary,team-workspaces"` // The type of access to grant. Access *AccessType `jsonapi:"attr,access"` // Custom workspace access permissions. These can only be edited when Access is 'custom'; otherwise, they are // read-only and reflect the Access level's implicit permissions. Runs *RunsPermissionType `jsonapi:"attr,runs,omitempty"` Variables *VariablesPermissionType `jsonapi:"attr,variables,omitempty"` StateVersions *StateVersionsPermissionType `jsonapi:"attr,state-versions,omitempty"` SentinelMocks *SentinelMocksPermissionType `jsonapi:"attr,sentinel-mocks,omitempty"` WorkspaceLocking *bool `jsonapi:"attr,workspace-locking,omitempty"` // The team to add to the workspace Team *Team `jsonapi:"relation,team"` // The workspace to which the team is to be added. Workspace *Workspace `jsonapi:"relation,workspace"` }
TeamAccessAddOptions represents the options for adding team access.
type TeamAccessList ¶ added in v0.2.0
type TeamAccessList struct { *Pagination Items []*TeamAccess }
TeamAccessList represents a list of team accesses.
type TeamAccessListOptions ¶
type TeamAccessListOptions struct { ListOptions WorkspaceID *string `url:"filter[workspace][id],omitempty"` }
TeamAccessListOptions represents the options for listing team accesses.
type TeamAccessUpdateOptions ¶ added in v0.5.1
type TeamAccessUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,team-workspaces"` // The type of access to grant. Access *AccessType `jsonapi:"attr,access,omitempty"` // Custom workspace access permissions. These can only be edited when Access is 'custom'; otherwise, they are // read-only and reflect the Access level's implicit permissions. Runs *RunsPermissionType `jsonapi:"attr,runs,omitempty"` Variables *VariablesPermissionType `jsonapi:"attr,variables,omitempty"` StateVersions *StateVersionsPermissionType `jsonapi:"attr,state-versions,omitempty"` SentinelMocks *SentinelMocksPermissionType `jsonapi:"attr,sentinel-mocks,omitempty"` WorkspaceLocking *bool `jsonapi:"attr,workspace-locking,omitempty"` }
TeamAccessUpdateOptions represents the options for updating team access.
type TeamAccesses ¶
type TeamAccesses interface { // List all the team accesses for a given workspace. List(ctx context.Context, options TeamAccessListOptions) (*TeamAccessList, error) // Add team access for a workspace. Add(ctx context.Context, options TeamAccessAddOptions) (*TeamAccess, error) // Read a team access by its ID. Read(ctx context.Context, teamAccessID string) (*TeamAccess, error) // Update a team access by its ID. Update(ctx context.Context, teamAccessID string, options TeamAccessUpdateOptions) (*TeamAccess, error) // Remove team access from a workspace. Remove(ctx context.Context, teamAccessID string) error }
TeamAccesses describes all the team access related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/team-access.html
type TeamCreateOptions ¶
type TeamCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,teams"` // Name of the team. Name *string `jsonapi:"attr,name"` // The team's organization access OrganizationAccess *OrganizationAccessOptions `jsonapi:"attr,organization-access,omitempty"` // The team's visibility ("secret", "organization") Visibility *string `jsonapi:"attr,visibility,omitempty"` }
TeamCreateOptions represents the options for creating a team.
type TeamList ¶ added in v0.2.0
type TeamList struct { *Pagination Items []*Team }
TeamList represents a list of teams.
type TeamListOptions ¶
type TeamListOptions struct { ListOptions Include string `url:"include"` }
TeamListOptions represents the options for listing teams.
type TeamMemberAddOptions ¶
TeamMemberAddOptions represents the options for adding or removing team members.
type TeamMemberRemoveOptions ¶
TeamMemberRemoveOptions represents the options for adding or removing team members.
type TeamMembers ¶
type TeamMembers interface { // List returns all Users of a team calling ListUsers // See ListOrganizationMemberships for fetching memberships List(ctx context.Context, teamID string) ([]*User, error) // ListUsers returns the Users of this team. ListUsers(ctx context.Context, teamID string) ([]*User, error) // ListOrganizationMemberships returns the OrganizationMemberships of this team. ListOrganizationMemberships(ctx context.Context, teamID string) ([]*OrganizationMembership, error) // Add multiple users to a team. Add(ctx context.Context, teamID string, options TeamMemberAddOptions) error // Remove multiple users from a team. Remove(ctx context.Context, teamID string, options TeamMemberRemoveOptions) error }
TeamMembers describes all the team member related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/team-members.html
type TeamPermissions ¶
type TeamPermissions struct { CanDestroy bool `json:"can-destroy"` CanUpdateMembership bool `json:"can-update-membership"` }
TeamPermissions represents the current user's permissions on the team.
type TeamToken ¶
type TeamToken struct { ID string `jsonapi:"primary,authentication-tokens"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` Description string `jsonapi:"attr,description"` LastUsedAt time.Time `jsonapi:"attr,last-used-at,iso8601"` Token string `jsonapi:"attr,token"` }
TeamToken represents a Terraform Enterprise team token.
type TeamTokens ¶
type TeamTokens interface { // Generate a new team token, replacing any existing token. Generate(ctx context.Context, teamID string) (*TeamToken, error) // Read a team token by its ID. Read(ctx context.Context, teamID string) (*TeamToken, error) // Delete a team token by its ID. Delete(ctx context.Context, teamID string) error }
TeamTokens describes all the team token related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/team-tokens.html
type TeamUpdateOptions ¶ added in v0.5.1
type TeamUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,teams"` // New name for the team Name *string `jsonapi:"attr,name,omitempty"` // The team's organization access OrganizationAccess *OrganizationAccessOptions `jsonapi:"attr,organization-access,omitempty"` // The team's visibility ("secret", "organization") Visibility *string `jsonapi:"attr,visibility,omitempty"` }
TeamUpdateOptions represents the options for updating a team.
type Teams ¶
type Teams interface { // List all the teams of the given organization. List(ctx context.Context, organization string, options TeamListOptions) (*TeamList, error) // Create a new team with the given options. Create(ctx context.Context, organization string, options TeamCreateOptions) (*Team, error) // Read a team by its ID. Read(ctx context.Context, teamID string) (*Team, error) // Update a team by its ID. Update(ctx context.Context, teamID string, options TeamUpdateOptions) (*Team, error) // Delete a team by its ID. Delete(ctx context.Context, teamID string) error }
Teams describes all the team related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/teams.html
type TestAccountDetails ¶ added in v0.5.1
type TestAccountDetails struct { ID string `json:"id" jsonapi:"primary,users"` Username string `jsonapi:"attr,username"` Email string `jsonapi:"attr,email"` }
TestAccountDetails represents the basic account information of a TFE/TFC user.
See FetchTestAccountDetails for more information.
func FetchTestAccountDetails ¶ added in v0.5.1
func FetchTestAccountDetails(t *testing.T, client *Client) *TestAccountDetails
FetchTestAccountDetails returns TestAccountDetails of the user running the tests.
Use this helper to fetch the username and email address associated with the token used to run the tests.
type User ¶
type User struct { ID string `jsonapi:"primary,users"` AvatarURL string `jsonapi:"attr,avatar-url"` Email string `jsonapi:"attr,email"` IsServiceAccount bool `jsonapi:"attr,is-service-account"` TwoFactor *TwoFactor `jsonapi:"attr,two-factor"` UnconfirmedEmail string `jsonapi:"attr,unconfirmed-email"` Username string `jsonapi:"attr,username"` V2Only bool `jsonapi:"attr,v2-only"` }
User represents a Terraform Enterprise user.
type UserUpdateOptions ¶
type UserUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,users"` // New username. Username *string `jsonapi:"attr,username,omitempty"` // New email address (must be consumed afterwards to take effect). Email *string `jsonapi:"attr,email,omitempty"` }
UserUpdateOptions represents the options for updating a user.
type Users ¶
type Users interface { // ReadCurrent reads the details of the currently authenticated user. ReadCurrent(ctx context.Context) (*User, error) // Update attributes of the currently authenticated user. Update(ctx context.Context, options UserUpdateOptions) (*User, error) }
Users describes all the user related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/user.html
type VCSRepo ¶
type VCSRepo struct { Branch string `json:"branch"` DisplayIdentifier string `json:"display-identifier"` Identifier string `json:"identifier"` IngressSubmodules bool `json:"ingress-submodules"` OAuthTokenID string `json:"oauth-token-id"` }
VCSRepo contains the configuration of a VCS integration.
type VCSRepoOptions ¶
type VCSRepoOptions struct { Branch *string `json:"branch,omitempty"` Identifier *string `json:"identifier,omitempty"` IngressSubmodules *bool `json:"ingress-submodules,omitempty"` OAuthTokenID *string `json:"oauth-token-id,omitempty"` }
TODO: move this struct out. VCSRepoOptions is used by workspaces, policy sets, and registry modules VCSRepoOptions represents the configuration options of a VCS integration.
type Variable ¶
type Variable struct { ID string `jsonapi:"primary,vars"` Key string `jsonapi:"attr,key"` Value string `jsonapi:"attr,value"` Description string `jsonapi:"attr,description"` Category CategoryType `jsonapi:"attr,category"` HCL bool `jsonapi:"attr,hcl"` Sensitive bool `jsonapi:"attr,sensitive"` // Relations Workspace *Workspace `jsonapi:"relation,configurable"` }
Variable represents a Terraform Enterprise variable.
type VariableCreateOptions ¶
type VariableCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,vars"` // The name of the variable. Key *string `jsonapi:"attr,key"` // The value of the variable. Value *string `jsonapi:"attr,value,omitempty"` // The description of the variable. Description *string `jsonapi:"attr,description,omitempty"` // Whether this is a Terraform or environment variable. Category *CategoryType `jsonapi:"attr,category"` // Whether to evaluate the value of the variable as a string of HCL code. HCL *bool `jsonapi:"attr,hcl,omitempty"` // Whether the value is sensitive. Sensitive *bool `jsonapi:"attr,sensitive,omitempty"` }
VariableCreateOptions represents the options for creating a new variable.
type VariableList ¶ added in v0.2.0
type VariableList struct { *Pagination Items []*Variable }
VariableList represents a list of variables.
type VariableListOptions ¶
type VariableListOptions struct {
ListOptions
}
VariableListOptions represents the options for listing variables.
type VariableUpdateOptions ¶
type VariableUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,vars"` // The name of the variable. Key *string `jsonapi:"attr,key,omitempty"` // The value of the variable. Value *string `jsonapi:"attr,value,omitempty"` // The description of the variable. Description *string `jsonapi:"attr,description,omitempty"` // Whether to evaluate the value of the variable as a string of HCL code. HCL *bool `jsonapi:"attr,hcl,omitempty"` // Whether the value is sensitive. Sensitive *bool `jsonapi:"attr,sensitive,omitempty"` }
VariableUpdateOptions represents the options for updating a variable.
type Variables ¶
type Variables interface { // List all the variables associated with the given workspace. List(ctx context.Context, workspaceID string, options VariableListOptions) (*VariableList, error) // Create is used to create a new variable. Create(ctx context.Context, workspaceID string, options VariableCreateOptions) (*Variable, error) // Read a variable by its ID. Read(ctx context.Context, workspaceID string, variableID string) (*Variable, error) // Update values of an existing variable. Update(ctx context.Context, workspaceID string, variableID string, options VariableUpdateOptions) (*Variable, error) // Delete a variable by its ID. Delete(ctx context.Context, workspaceID string, variableID string) error }
Variables describes all the variable related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/variables.html
type VariablesPermissionType ¶ added in v0.5.1
type VariablesPermissionType string
VariablesPermissionType represents the permissiontype to a workspace's variables.
func VariablesPermission ¶ added in v0.5.1
func VariablesPermission(v VariablesPermissionType) *VariablesPermissionType
VariablesPermission returns a pointer to the given team variables permission type.
type Workspace ¶
type Workspace struct { ID string `jsonapi:"primary,workspaces"` Actions *WorkspaceActions `jsonapi:"attr,actions"` AutoApply bool `jsonapi:"attr,auto-apply"` CanQueueDestroyPlan bool `jsonapi:"attr,can-queue-destroy-plan"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` Environment string `jsonapi:"attr,environment"` FileTriggersEnabled bool `jsonapi:"attr,file-triggers-enabled"` Locked bool `jsonapi:"attr,locked"` MigrationEnvironment string `jsonapi:"attr,migration-environment"` Name string `jsonapi:"attr,name"` Operations bool `jsonapi:"attr,operations"` Permissions *WorkspacePermissions `jsonapi:"attr,permissions"` QueueAllRuns bool `jsonapi:"attr,queue-all-runs"` SpeculativeEnabled bool `jsonapi:"attr,speculative-enabled"` TerraformVersion string `jsonapi:"attr,terraform-version"` TriggerPrefixes []string `jsonapi:"attr,trigger-prefixes"` VCSRepo *VCSRepo `jsonapi:"attr,vcs-repo"` WorkingDirectory string `jsonapi:"attr,working-directory"` // Relations CurrentRun *Run `jsonapi:"relation,current-run"` Organization *Organization `jsonapi:"relation,organization"` SSHKey *SSHKey `jsonapi:"relation,ssh-key"` }
Workspace represents a Terraform Enterprise workspace.
type WorkspaceActions ¶
type WorkspaceActions struct {
IsDestroyable bool `json:"is-destroyable"`
}
WorkspaceActions represents the workspace actions.
type WorkspaceAssignSSHKeyOptions ¶
type WorkspaceAssignSSHKeyOptions struct { // For internal use only! ID string `jsonapi:"primary,workspaces"` // The SSH key ID to assign. SSHKeyID *string `jsonapi:"attr,id"` }
WorkspaceAssignSSHKeyOptions represents the options to assign an SSH key to a workspace.
type WorkspaceCreateOptions ¶
type WorkspaceCreateOptions struct { // For internal use only! ID string `jsonapi:"primary,workspaces"` // Whether to automatically apply changes when a Terraform plan is successful. AutoApply *bool `jsonapi:"attr,auto-apply,omitempty"` // Whether to filter runs based on the changed files in a VCS push. If // enabled, the working directory and trigger prefixes describe a set of // paths which must contain changes for a VCS push to trigger a run. If // disabled, any push will trigger a run. FileTriggersEnabled *bool `jsonapi:"attr,file-triggers-enabled,omitempty"` // The legacy TFE environment to use as the source of the migration, in the // form organization/environment. Omit this unless you are migrating a legacy // environment. MigrationEnvironment *string `jsonapi:"attr,migration-environment,omitempty"` // The name of the workspace, which can only include letters, numbers, -, // and _. This will be used as an identifier and must be unique in the // organization. Name *string `jsonapi:"attr,name"` // Whether the workspace will use remote or local execution mode. Operations *bool `jsonapi:"attr,operations,omitempty"` // Whether to queue all runs. Unless this is set to true, runs triggered by // a webhook will not be queued until at least one run is manually queued. QueueAllRuns *bool `jsonapi:"attr,queue-all-runs,omitempty"` // Whether this workspace allows speculative plans. Setting this to false // prevents Terraform Cloud or the Terraform Enterprise instance from // running plans on pull requests, which can improve security if the VCS // repository is public or includes untrusted contributors. SpeculativeEnabled *bool `jsonapi:"attr,speculative-enabled,omitempty"` // The version of Terraform to use for this workspace. Upon creating a // workspace, the latest version is selected unless otherwise specified. TerraformVersion *string `jsonapi:"attr,terraform-version,omitempty"` // List of repository-root-relative paths which list all locations to be // tracked for changes. See FileTriggersEnabled above for more details. TriggerPrefixes []string `jsonapi:"attr,trigger-prefixes,omitempty"` // Settings for the workspace's VCS repository. If omitted, the workspace is // created without a VCS repo. If included, you must specify at least the // oauth-token-id and identifier keys below. VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"` // A relative path that Terraform will execute within. This defaults to the // root of your repository and is typically set to a subdirectory matching the // environment when multiple environments exist within the same repository. WorkingDirectory *string `jsonapi:"attr,working-directory,omitempty"` }
WorkspaceCreateOptions represents the options for creating a new workspace.
type WorkspaceList ¶ added in v0.2.0
type WorkspaceList struct { *Pagination Items []*Workspace }
WorkspaceList represents a list of workspaces.
type WorkspaceListOptions ¶
type WorkspaceListOptions struct { ListOptions // A search string (partial workspace name) used to filter the results. Search *string `url:"search[name],omitempty"` }
WorkspaceListOptions represents the options for listing workspaces.
type WorkspaceLockOptions ¶
type WorkspaceLockOptions struct { // Specifies the reason for locking the workspace. Reason *string `json:"reason,omitempty"` }
WorkspaceLockOptions represents the options for locking a workspace.
type WorkspaceLockingPermissionType ¶ added in v0.5.1
type WorkspaceLockingPermissionType bool
WorkspaceLockingPermissionType represents the permissiontype to lock or unlock a workspace.
type WorkspacePermissions ¶
type WorkspacePermissions struct { CanDestroy bool `json:"can-destroy"` CanForceUnlock bool `json:"can-force-unlock"` CanLock bool `json:"can-lock"` CanQueueApply bool `json:"can-queue-apply"` CanQueueDestroy bool `json:"can-queue-destroy"` CanQueueRun bool `json:"can-queue-run"` CanReadSettings bool `json:"can-read-settings"` CanUnlock bool `json:"can-unlock"` CanUpdate bool `json:"can-update"` CanUpdateVariable bool `json:"can-update-variable"` }
WorkspacePermissions represents the workspace permissions.
type WorkspaceUpdateOptions ¶
type WorkspaceUpdateOptions struct { // For internal use only! ID string `jsonapi:"primary,workspaces"` // Whether to automatically apply changes when a Terraform plan is successful. AutoApply *bool `jsonapi:"attr,auto-apply,omitempty"` // A new name for the workspace, which can only include letters, numbers, -, // and _. This will be used as an identifier and must be unique in the // organization. Warning: Changing a workspace's name changes its URL in the // API and UI. Name *string `jsonapi:"attr,name,omitempty"` // Whether to filter runs based on the changed files in a VCS push. If // enabled, the working directory and trigger prefixes describe a set of // paths which must contain changes for a VCS push to trigger a run. If // disabled, any push will trigger a run. FileTriggersEnabled *bool `jsonapi:"attr,file-triggers-enabled,omitempty"` // Whether the workspace will use remote or local execution mode. Operations *bool `jsonapi:"attr,operations,omitempty"` // Whether to queue all runs. Unless this is set to true, runs triggered by // a webhook will not be queued until at least one run is manually queued. QueueAllRuns *bool `jsonapi:"attr,queue-all-runs,omitempty"` // Whether this workspace allows speculative plans. Setting this to false // prevents Terraform Cloud or the Terraform Enterprise instance from // running plans on pull requests, which can improve security if the VCS // repository is public or includes untrusted contributors. SpeculativeEnabled *bool `jsonapi:"attr,speculative-enabled,omitempty"` // The version of Terraform to use for this workspace. TerraformVersion *string `jsonapi:"attr,terraform-version,omitempty"` // List of repository-root-relative paths which list all locations to be // tracked for changes. See FileTriggersEnabled above for more details. TriggerPrefixes []string `jsonapi:"attr,trigger-prefixes,omitempty"` // To delete a workspace's existing VCS repo, specify null instead of an // object. To modify a workspace's existing VCS repo, include whichever of // the keys below you wish to modify. To add a new VCS repo to a workspace // that didn't previously have one, include at least the oauth-token-id and // identifier keys. VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"` // A relative path that Terraform will execute within. This defaults to the // root of your repository and is typically set to a subdirectory matching // the environment when multiple environments exist within the same // repository. WorkingDirectory *string `jsonapi:"attr,working-directory,omitempty"` }
WorkspaceUpdateOptions represents the options for updating a workspace.
type Workspaces ¶
type Workspaces interface { // List all the workspaces within an organization. List(ctx context.Context, organization string, options WorkspaceListOptions) (*WorkspaceList, error) // Create is used to create a new workspace. Create(ctx context.Context, organization string, options WorkspaceCreateOptions) (*Workspace, error) // Read a workspace by its name. Read(ctx context.Context, organization string, workspace string) (*Workspace, error) // ReadByID reads a workspace by its ID. ReadByID(ctx context.Context, workspaceID string) (*Workspace, error) // Update settings of an existing workspace. Update(ctx context.Context, organization string, workspace string, options WorkspaceUpdateOptions) (*Workspace, error) // UpdateByID updates the settings of an existing workspace. UpdateByID(ctx context.Context, workspaceID string, options WorkspaceUpdateOptions) (*Workspace, error) // Delete a workspace by its name. Delete(ctx context.Context, organization string, workspace string) error // DeleteByID deletes a workspace by its ID. DeleteByID(ctx context.Context, workspaceID string) error // RemoveVCSConnection from a workspace. RemoveVCSConnection(ctx context.Context, organization, workspace string) (*Workspace, error) // RemoveVCSConnectionByID removes a VCS connection from a workspace. RemoveVCSConnectionByID(ctx context.Context, workspaceID string) (*Workspace, error) // Lock a workspace by its ID. Lock(ctx context.Context, workspaceID string, options WorkspaceLockOptions) (*Workspace, error) // Unlock a workspace by its ID. Unlock(ctx context.Context, workspaceID string) (*Workspace, error) // ForceUnlock a workspace by its ID. ForceUnlock(ctx context.Context, workspaceID string) (*Workspace, error) // AssignSSHKey to a workspace. AssignSSHKey(ctx context.Context, workspaceID string, options WorkspaceAssignSSHKeyOptions) (*Workspace, error) // UnassignSSHKey from a workspace. UnassignSSHKey(ctx context.Context, workspaceID string) (*Workspace, error) }
Workspaces describes all the workspace related methods that the Terraform Enterprise API supports.
TFE API docs: https://www.terraform.io/docs/enterprise/api/workspaces.html
Source Files ¶
- admin_runs.go
- admin_users.go
- admin_workspace.go
- apply.go
- configuration_version.go
- cost_estimate.go
- logreader.go
- notification_configuration.go
- oauth_client.go
- oauth_token.go
- organization.go
- organization_membership.go
- organization_token.go
- plan.go
- plan_export.go
- policy.go
- policy_check.go
- policy_set.go
- policy_set_parameter.go
- registry_module.go
- run.go
- run_trigger.go
- ssh_key.go
- state_version.go
- team.go
- team_access.go
- team_member.go
- team_token.go
- testing.go
- tfe.go
- type_helpers.go
- user.go
- validations.go
- variable.go
- workspace.go