Documentation
¶
Overview ¶
Package types provides structs suitable for marshaling to/from json:api
Index ¶
- Variables
- type AgentToken
- type AgentTokenCreateOptions
- type Apply
- type CVStatusTimestamps
- type ConfigurationVersion
- type ConfigurationVersionCreateOptions
- type ConfigurationVersionList
- type CreateRunTokenOptions
- type CreateTeamOptions
- type CreateUserOptions
- type DeliveryResponse
- type Entitlements
- type IngressAttributes
- type NotificationConfiguration
- type NotificationConfigurationCreateOptions
- type NotificationConfigurationList
- type NotificationConfigurationUpdateOptions
- type NotificationDestinationType
- type NotificationTriggerType
- type Organization
- type OrganizationAccess
- type OrganizationAccessOptions
- type OrganizationCreateOptions
- type OrganizationList
- type OrganizationMembership
- type OrganizationMembershipCreateOptions
- type OrganizationMembershipStatus
- type OrganizationPermissions
- type OrganizationTag
- type OrganizationUpdateOptions
- type Pagination
- type PhaseStatusTimestamps
- type Plan
- type ResourceReport
- type RollbackStateVersionOptions
- type Run
- type RunActions
- type RunCreateOptions
- type RunList
- type RunPermissions
- type RunStatusTimestamps
- type StateVersion
- type StateVersionCreateVersionOptions
- type StateVersionList
- type StateVersionOutput
- type Tag
- type Team
- type TeamPermissions
- type TwoFactor
- type User
- type VCSRepo
- type VCSRepoOptions
- type Variable
- type VariableCreateOptions
- type VariableList
- type VariableUpdateOptions
- type Workspace
- type WorkspaceActions
- type WorkspaceCreateOptions
- type WorkspaceList
- type WorkspacePermissions
- type WorkspaceUpdateOptions
Constants ¶
This section is empty.
Variables ¶
var DefaultOrganizationPermissions = OrganizationPermissions{ CanCreateWorkspace: true, CanUpdate: true, CanDestroy: true, }
Functions ¶
This section is empty.
Types ¶
type AgentToken ¶
type AgentToken struct {
ID string `jsonapi:"primary,agent_tokens"`
Organization string `jsonapi:"attribute" json:"organization_name"`
}
AgentToken represents an otf agent token.
type AgentTokenCreateOptions ¶
type AgentTokenCreateOptions struct {
// Type is a public field utilized by JSON:API to set the resource type via
// the field tag. It is not a user-defined value and does not need to be
// set. https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,agent_tokens"`
// Description is a meaningful description of the purpose of the agent
// token.
Description string `jsonapi:"attribute" json:"description"`
// Organization is the name of the organization in which to create the
// token.
Organization string `jsonapi:"attribute" json:"organization_name"`
}
AgentTokenCreateOptions represents the options for creating a new otf agent token.
type Apply ¶
type Apply struct {
ID string `jsonapi:"primary,applies"`
LogReadURL string `jsonapi:"attribute" json:"log-read-url"`
Status string `jsonapi:"attribute" json:"status"`
StatusTimestamps *PhaseStatusTimestamps `jsonapi:"attribute" json:"status-timestamps"`
ResourceReport
}
Apply is a terraform apply
type CVStatusTimestamps ¶
type CVStatusTimestamps struct {
FinishedAt *time.Time `json:"finished-at,omitempty"`
QueuedAt *time.Time `json:"queued-at,omitempty"`
StartedAt *time.Time `json:"started-at,omitempty"`
}
CVStatusTimestamps holds the timestamps for individual configuration version statuses.
type ConfigurationVersion ¶
type ConfigurationVersion struct {
ID string `jsonapi:"primary,configuration-versions"`
AutoQueueRuns bool `jsonapi:"attribute" json:"auto-queue-runs"`
Error string `jsonapi:"attribute" json:"error"`
ErrorMessage string `jsonapi:"attribute" json:"error-message"`
Source string `jsonapi:"attribute" json:"source"`
Speculative bool `jsonapi:"attribute" json:"speculative"`
Status string `jsonapi:"attribute" json:"status"`
StatusTimestamps *CVStatusTimestamps `jsonapi:"attribute" json:"status-timestamps"`
UploadURL string `jsonapi:"attribute" json:"upload-url"`
}
ConfigurationVersion is an uploaded or ingressed Terraform configuration. A workspace must have at least one configuration version before any runs may be queued on it.
type ConfigurationVersionCreateOptions ¶
type ConfigurationVersionCreateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,configuration-versions"`
// When true, runs are queued automatically when the configuration version
// is uploaded.
AutoQueueRuns *bool `jsonapi:"attribute" json:"auto-queue-runs,omitempty"`
// When true, this configuration version can only be used for planning.
Speculative *bool `jsonapi:"attribute" json:"speculative,omitempty"`
}
ConfigurationVersionCreateOptions represents the options for creating a configuration version.
type ConfigurationVersionList ¶
type ConfigurationVersionList struct {
*Pagination
Items []*ConfigurationVersion
}
ConfigurationVersionList represents a list of configuration versions.
type CreateRunTokenOptions ¶
type CreateRunTokenOptions struct {
// Type is a public field utilized by JSON:API to set the resource type via
// the field tag. It is not a user-defined value and does not need to be
// set. https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,run_tokens"`
// Organization is the organization of the run
Organization *string `jsonapi:"attribute" json:"organization_name"`
// RunID is the ID of the run for which the token is being created.
RunID *string `jsonapi:"attribute" json:"run_id"`
}
type CreateTeamOptions ¶
type CreateTeamOptions struct {
Type string `jsonapi:"primary,teams"`
Name *string `jsonapi:"attribute" json:"name"`
Organization *string `schema:"organization_name,required"`
OrganizationAccess *OrganizationAccessOptions `jsonapi:"attribute" json:"organization-access,omitempty"`
}
CreateTeamOptions represents the options for creating a user.
type CreateUserOptions ¶
type CreateUserOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,users"`
Username *string `jsonapi:"attribute" json:"username"`
}
CreateUserOptions represents the options for creating a user.
type DeliveryResponse ¶
type DeliveryResponse struct {
Body string `jsonapi:"attribute" json:"body"`
Code string `jsonapi:"attribute" json:"code"`
Headers map[string][]string `jsonapi:"attribute" json:"headers"`
SentAt time.Time `jsonapi:"attribute" json:"sent-at"`
Successful string `jsonapi:"attribute" json:"successful"`
URL string `jsonapi:"attribute" json:"url"`
}
DeliveryResponse represents a notification configuration delivery response.
type Entitlements ¶
type Entitlements struct {
ID string `jsonapi:"primary,entitlement-sets"`
Agents bool `jsonapi:"attribute" json:"agents"`
AuditLogging bool `jsonapi:"attribute" json:"audit-logging"`
CostEstimation bool `jsonapi:"attribute" json:"cost-estimation"`
Operations bool `jsonapi:"attribute" json:"operations"`
PrivateModuleRegistry bool `jsonapi:"attribute" json:"private-module-registry"`
SSO bool `jsonapi:"attribute" json:"sso"`
Sentinel bool `jsonapi:"attribute" json:"sentinel"`
StateStorage bool `jsonapi:"attribute" json:"state-storage"`
Teams bool `jsonapi:"attribute" json:"teams"`
VCSIntegrations bool `jsonapi:"attribute" json:"vcs-integrations"`
}
Entitlements represents the entitlements of an organization. Unlike TFE/TFC, OTF is free and therefore the user is entitled to all currently supported services. Entitlements represents the entitlements of an organization.
type IngressAttributes ¶
type IngressAttributes struct {
ID string `jsonapi:"primary,ingress-attributes"`
Branch string `jsonapi:"attribute" json:"branch"`
CloneURL string `jsonapi:"attribute" json:"clone-url"`
CommitMessage string `jsonapi:"attribute" json:"commit-message"`
CommitSHA string `jsonapi:"attribute" json:"commit-sha"`
CommitURL string `jsonapi:"attribute" json:"commit-url"`
CompareURL string `jsonapi:"attribute" json:"compare-url"`
Identifier string `jsonapi:"attribute" json:"identifier"`
IsPullRequest bool `jsonapi:"attribute" json:"is-pull-request"`
OnDefaultBranch bool `jsonapi:"attribute" json:"on-default-branch"`
PullRequestNumber int `jsonapi:"attribute" json:"pull-request-number"`
PullRequestURL string `jsonapi:"attribute" json:"pull-request-url"`
PullRequestTitle string `jsonapi:"attribute" json:"pull-request-title"`
PullRequestBody string `jsonapi:"attribute" json:"pull-request-body"`
Tag string `jsonapi:"attribute" json:"tag"`
SenderUsername string `jsonapi:"attribute" json:"sender-username"`
SenderAvatarURL string `jsonapi:"attribute" json:"sender-avatar-url"`
SenderHTMLURL string `jsonapi:"attribute" json:"sender-html-url"`
// Links
Links map[string]interface{} `jsonapi:"links,omitempty"`
}
type NotificationConfiguration ¶
type NotificationConfiguration struct {
ID string `jsonapi:"primary,notification-configurations"`
CreatedAt time.Time `jsonapi:"attribute" json:"created-at"`
DeliveryResponses []*DeliveryResponse `jsonapi:"attribute" json:"delivery-responses"`
DestinationType NotificationDestinationType `jsonapi:"attribute" json:"destination-type"`
Enabled bool `jsonapi:"attribute" json:"enabled"`
Name string `jsonapi:"attribute" json:"name"`
Token string `jsonapi:"attribute" json:"token"`
Triggers []string `jsonapi:"attribute" json:"triggers"`
UpdatedAt time.Time `jsonapi:"attribute" json:"updated-at"`
URL string `jsonapi:"attribute" json:"url"`
// EmailAddresses is only available for TFE users. It is not available in TFC.
EmailAddresses []string `jsonapi:"attribute" json:"email-addresses"`
// relationships
Subscribable *Workspace `jsonapi:"relationship" json:"subscribable"`
EmailUsers []*User `jsonapi:"relationship" json:"users"`
}
NotificationConfiguration represents a Notification Configuration.
type NotificationConfigurationCreateOptions ¶
type NotificationConfigurationCreateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,notification-configurations"`
// Required: The destination type of the notification configuration
DestinationType *NotificationDestinationType `jsonapi:"attribute" json:"destination-type"`
// Required: Whether the notification configuration should be enabled or not
Enabled *bool `jsonapi:"attribute" json:"enabled"`
// Required: The name of the notification configuration
Name *string `jsonapi:"attribute" json:"name"`
// Optional: The token of the notification configuration
Token *string `jsonapi:"attribute" json:"token,omitempty"`
// Optional: The list of run events that will trigger notifications.
Triggers []NotificationTriggerType `jsonapi:"attribute" json:"triggers,omitempty"`
// Optional: The url of the notification configuration
URL *string `jsonapi:"attribute" json:"url,omitempty"`
// Optional: 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:"attribute" json:"email-addresses,omitempty"`
// Optional: The list of users belonging to the organization that will receive notification emails.
EmailUsers []*User `jsonapi:"relationship" json:"users,omitempty"`
}
NotificationConfigurationCreateOptions represents the options for creating a new notification configuration.
type NotificationConfigurationList ¶
type NotificationConfigurationList struct {
*Pagination
Items []*NotificationConfiguration
}
NotificationConfigurationList represents a list of Notification Configurations.
type NotificationConfigurationUpdateOptions ¶
type NotificationConfigurationUpdateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,notification-configurations"`
// Optional: Whether the notification configuration should be enabled or not
Enabled *bool `jsonapi:"attribute" json:"enabled,omitempty"`
// Optional: The name of the notification configuration
Name *string `jsonapi:"attribute" json:"name,omitempty"`
// Optional: The token of the notification configuration
Token *string `jsonapi:"attribute" json:"token,omitempty"`
// Optional: The list of run events that will trigger notifications.
Triggers []NotificationTriggerType `jsonapi:"attribute" json:"triggers,omitempty"`
// Optional: The url of the notification configuration
URL *string `jsonapi:"attribute" json:"url,omitempty"`
// Optional: 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:"attribute" json:"email-addresses,omitempty"`
// Optional: The list of users belonging to the organization that will receive notification emails.
EmailUsers []*User `jsonapi:"relationship" json:"users,omitempty"`
}
NotificationConfigurationUpdateOptions represents the options for updating a existing notification configuration.
type NotificationDestinationType ¶
type NotificationDestinationType string
NotificationDestinationType represents the destination type of the notification configuration.
const ( NotificationDestinationTypeEmail NotificationDestinationType = "email" NotificationDestinationTypeGeneric NotificationDestinationType = "generic" NotificationDestinationTypeSlack NotificationDestinationType = "slack" NotificationDestinationTypeMicrosoftTeams NotificationDestinationType = "microsoft-teams" )
List of available notification destination types.
func NotificationDestinationPtr ¶
func NotificationDestinationPtr(d NotificationDestinationType) *NotificationDestinationType
type NotificationTriggerType ¶
type NotificationTriggerType string
NotificationTriggerType represents the different TFE notifications that can be sent as a run's progress transitions between different states
const ( NotificationTriggerCreated NotificationTriggerType = "run:created" NotificationTriggerPlanning NotificationTriggerType = "run:planning" NotificationTriggerNeedsAttention NotificationTriggerType = "run:needs_attention" NotificationTriggerApplying NotificationTriggerType = "run:applying" NotificationTriggerCompleted NotificationTriggerType = "run:completed" NotificationTriggerErrored NotificationTriggerType = "run:errored" NotificationTriggerAssessmentDrifted NotificationTriggerType = "assessment:drifted" NotificationTriggerAssessmentFailed NotificationTriggerType = "assessment:failed" NotificationTriggerAssessmentCheckFailed NotificationTriggerType = "assessment:check_failure" )
type Organization ¶
type Organization struct {
Name string `jsonapi:"primary,organizations"`
CostEstimationEnabled bool `jsonapi:"attribute" json:"cost-estimation-enabled"`
CreatedAt time.Time `jsonapi:"attribute" json:"created-at"`
ExternalID string `jsonapi:"attribute" json:"external-id"`
OwnersTeamSAMLRoleID string `jsonapi:"attribute" json:"owners-team-saml-role-id"`
Permissions *OrganizationPermissions `jsonapi:"attribute" json:"permissions"`
SAMLEnabled bool `jsonapi:"attribute" json:"saml-enabled"`
SessionRemember int `jsonapi:"attribute" json:"session-remember"`
SessionTimeout int `jsonapi:"attribute" json:"session-timeout"`
TrialExpiresAt time.Time `jsonapi:"attribute" json:"trial-expires-at"`
TwoFactorConformant bool `jsonapi:"attribute" json:"two-factor-conformant"`
}
Organization JSON-API representation
type OrganizationAccess ¶
type OrganizationAccess struct {
ManagePolicies bool `jsonapi:"attribute" json:"manage-policies"`
ManagePolicyOverrides bool `jsonapi:"attribute" json:"manage-policy-overrides"`
ManageWorkspaces bool `jsonapi:"attribute" json:"manage-workspaces"`
ManageVCSSettings bool `jsonapi:"attribute" json:"manage-vcs-settings"`
ManageProviders bool `jsonapi:"attribute" json:"manage-providers"`
ManageModules bool `jsonapi:"attribute" json:"manage-modules"`
ManageRunTasks bool `jsonapi:"attribute" json:"manage-run-tasks"`
ManageProjects bool `jsonapi:"attribute" json:"manage-projects"`
ReadWorkspaces bool `jsonapi:"attribute" json:"read-workspaces"`
ReadProjects bool `jsonapi:"attribute" json:"read-projects"`
ManageMembership bool `jsonapi:"attribute" json:"manage-membership"`
}
OrganizationAccess represents the team's permissions on its organization
type OrganizationAccessOptions ¶
type OrganizationAccessOptions struct {
ManagePolicies *bool `json:"manage-policies,omitempty"`
ManagePolicyOverrides *bool `json:"manage-policy-overrides,omitempty"`
ManageWorkspaces *bool `json:"manage-workspaces,omitempty"`
ManageVCSSettings *bool `json:"manage-vcs-settings,omitempty"`
ManageProviders *bool `json:"manage-providers,omitempty"`
ManageModules *bool `json:"manage-modules,omitempty"`
ManageRunTasks *bool `json:"manage-run-tasks,omitempty"`
ManageProjects *bool `json:"manage-projects,omitempty"`
ReadWorkspaces *bool `json:"read-workspaces,omitempty"`
ReadProjects *bool `json:"read-projects,omitempty"`
ManageMembership *bool `json:"manage-membership,omitempty"`
}
OrganizationAccessOptions represents the organization access options of a team.
type OrganizationCreateOptions ¶
type OrganizationCreateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,organizations"`
// Name of the organization.
Name *string `jsonapi:"attribute" json:"name"`
SessionRemember *int `jsonapi:"attribute" json:"session-remember,omitempty"`
// Session timeout after inactivity (minutes).
SessionTimeout *int `jsonapi:"attribute" json:"session-timeout,omitempty"`
}
OrganizationCreateOptions represents the options for creating an organization.
type OrganizationList ¶
type OrganizationList struct {
*Pagination
Items []*Organization
}
OrganizationList JSON-API representation
type OrganizationMembership ¶
type OrganizationMembership struct {
ID string `jsonapi:"primary,organization-memberships"`
Status OrganizationMembershipStatus `jsonapi:"attribute" json:"status"`
Email string `jsonapi:"attribute" json:"email"`
// Relations
Organization *Organization `jsonapi:"relationship" json:"organization"`
User *User `jsonapi:"relationship" json:"user"`
Teams []*Team `jsonapi:"relationship" json:"teams"`
}
OrganizationMembership represents a Terraform Enterprise organization membership.
type OrganizationMembershipCreateOptions ¶
type OrganizationMembershipCreateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,organization-memberships"`
// Required: User's email address.
Email *string `jsonapi:"attribute" json:"email"`
}
OrganizationMembershipCreateOptions represents the options for creating an organization membership.
type OrganizationMembershipStatus ¶
type OrganizationMembershipStatus string
OrganizationMembershipStatus represents an organization membership status.
const ( OrganizationMembershipActive OrganizationMembershipStatus = "active" OrganizationMembershipInvited OrganizationMembershipStatus = "invited" )
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 OrganizationTag ¶
type OrganizationTag struct {
ID string `jsonapi:"primary,tags"`
// Optional:
Name string `jsonapi:"attribute" json:"name,omitempty"`
// Optional: Number of workspaces that have this tag
InstanceCount int `jsonapi:"attribute" json:"instance-count,omitempty"`
// The org this tag belongs to
Organization *Organization `jsonapi:"relationship" json:"organization"`
}
OrganizationTag represents a Terraform Enterprise Organization tag
type OrganizationUpdateOptions ¶
type OrganizationUpdateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,organizations"`
// New name for the organization.
Name *string `jsonapi:"attribute" json:"name,omitempty"`
// Session expiration (minutes).
SessionRemember *int `jsonapi:"attribute" json:"session-remember,omitempty"`
// Session timeout after inactivity (minutes).
SessionTimeout *int `jsonapi:"attribute" json:"session-timeout,omitempty"`
}
OrganizationUpdateOptions represents the options for updating an organization.
type Pagination ¶
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 PhaseStatusTimestamps ¶
type PhaseStatusTimestamps struct {
CanceledAt *time.Time `json:"canceled-at,omitempty"`
ErroredAt *time.Time `json:"errored-at,omitempty"`
FinishedAt *time.Time `json:"finished-at,omitempty"`
PendingAt *time.Time `json:"pending-at,omitempty"`
QueuedAt *time.Time `json:"queued-at,omitempty"`
StartedAt *time.Time `json:"started-at,omitempty"`
UnreachableAt *time.Time `json:"unreachable-at,omitempty"`
}
PhaseStatusTimestamps holds the timestamps for individual statuses for a phase.
type Plan ¶
type Plan struct {
ID string `jsonapi:"primary,plans"`
HasChanges bool `jsonapi:"attribute" json:"has-changes"`
LogReadURL string `jsonapi:"attribute" json:"log-read-url"`
Status string `jsonapi:"attribute" json:"status"`
StatusTimestamps *PhaseStatusTimestamps `jsonapi:"attribute" json:"status-timestamps"`
ResourceReport
}
Plan represents a Terraform Enterprise plan.
type ResourceReport ¶
type RollbackStateVersionOptions ¶
type RollbackStateVersionOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,state-versions"`
// Specifies state version to rollback to. Only its ID is specified.
RollbackStateVersion *StateVersion `jsonapi:"relationship" json:"state-version"`
}
RollbackStateVersionOptions are options for rolling back a state version
type Run ¶
type Run struct {
ID string `jsonapi:"primary,runs"`
Actions *RunActions `jsonapi:"attribute" json:"actions"`
CreatedAt time.Time `jsonapi:"attribute" json:"created-at"`
ForceCancelAvailableAt *time.Time `jsonapi:"attribute" json:"force-cancel-available-at"`
ExecutionMode string `jsonapi:"attribute" json:"execution-mode"`
HasChanges bool `jsonapi:"attribute" json:"has-changes"`
IsDestroy bool `jsonapi:"attribute" json:"is-destroy"`
Message string `jsonapi:"attribute" json:"message"`
Permissions *RunPermissions `jsonapi:"attribute" json:"permissions"`
PositionInQueue int `jsonapi:"attribute" json:"position-in-queue"`
Refresh bool `jsonapi:"attribute" json:"refresh"`
RefreshOnly bool `jsonapi:"attribute" json:"refresh-only"`
ReplaceAddrs []string `jsonapi:"attribute" json:"replace-addrs,omitempty"`
Source string `jsonapi:"attribute" json:"source"`
Status string `jsonapi:"attribute" json:"status"`
StatusTimestamps *RunStatusTimestamps `jsonapi:"attribute" json:"status-timestamps"`
TargetAddrs []string `jsonapi:"attribute" json:"target-addrs,omitempty"`
// Relations
Apply *Apply `jsonapi:"relationship" json:"apply"`
ConfigurationVersion *ConfigurationVersion `jsonapi:"relationship" json:"configuration-version"`
CreatedBy *User `jsonapi:"relationship" json:"created-by"`
Plan *Plan `jsonapi:"relationship" json:"plan"`
Workspace *Workspace `jsonapi:"relationship" json:"workspace"`
}
Run is a terraform 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 RunCreateOptions ¶
type RunCreateOptions struct {
// Type is a public field utilized by JSON:API to set the resource type via
// the field tag. It is not a user-defined value and does not need to be
// set. https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,runs"`
// PlanOnly specifies if this is a speculative, plan-only run that Terraform cannot apply.
PlanOnly *bool `jsonapi:"attr,plan-only,omitempty"`
// Specifies if this plan is a destroy plan, which will destroy all
// provisioned resources.
IsDestroy *bool `jsonapi:"attribute" json:"is-destroy,omitempty"`
// Refresh determines if the run should
// update the state prior to checking for differences
Refresh *bool `jsonapi:"attribute" json:"refresh,omitempty"`
// RefreshOnly determines whether the run should ignore config changes
// and refresh the state only
RefreshOnly *bool `jsonapi:"attribute" json:"refresh-only,omitempty"`
// Specifies the message to be associated with this run.
Message *string `jsonapi:"attribute" json:"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:"relationship" json:"configuration-version"`
// Specifies the workspace where the run will be executed.
Workspace *Workspace `jsonapi:"relationship" json:"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:"attribute" json:"target-addrs,omitempty"`
// If non-empty, requests that Terraform create a plan that replaces
// (destroys and then re-creates) the objects specified by the given
// resource addresses.
ReplaceAddrs []string `jsonapi:"attribute" json:"replace-addrs,omitempty"`
// AutoApply determines if the run should be applied automatically without
// user confirmation. It defaults to the Workspace.AutoApply setting.
AutoApply *bool `jsonapi:"attribute" json:"auto-apply,omitempty"`
}
RunCreateOptions represents the options for creating a new run.
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 RunStatusTimestamps ¶
type RunStatusTimestamps struct {
AppliedAt *time.Time `json:"applied-at,omitempty"`
ApplyQueuedAt *time.Time `json:"apply-queued-at,omitempty"`
ApplyingAt *time.Time `json:"applying-at,omitempty"`
CanceledAt *time.Time `json:"canceled-at,omitempty"`
ConfirmedAt *time.Time `json:"confirmed-at,omitempty"`
CostEstimatedAt *time.Time `json:"cost-estimated-at,omitempty"`
CostEstimatingAt *time.Time `json:"cost-estimating-at,omitempty"`
DiscardedAt *time.Time `json:"discarded-at,omitempty"`
ErroredAt *time.Time `json:"errored-at,omitempty"`
ForceCanceledAt *time.Time `json:"force-canceled-at,omitempty"`
PlanQueueableAt *time.Time `json:"plan-queueable-at,omitempty"`
PlanQueuedAt *time.Time `json:"plan-queued-at,omitempty"`
PlannedAndFinishedAt *time.Time `json:"planned-and-finished-at,omitempty"`
PlannedAt *time.Time `json:"planned-at,omitempty"`
PlanningAt *time.Time `json:"planning-at,omitempty"`
PolicyCheckedAt *time.Time `json:"policy-checked-at,omitempty"`
PolicySoftFailedAt *time.Time `json:"policy-soft-failed-at,omitempty"`
}
RunStatusTimestamps holds the timestamps for individual run statuses.
type StateVersion ¶
type StateVersion struct {
ID string `jsonapi:"primary,state-versions"`
CreatedAt time.Time `jsonapi:"attribute" json:"created-at"`
DownloadURL string `jsonapi:"attribute" json:"hosted-state-download-url"`
Serial int64 `jsonapi:"attribute" json:"serial"`
VCSCommitSHA string `jsonapi:"attribute" json:"vcs-commit-sha"`
VCSCommitURL string `jsonapi:"attribute" json:"vcs-commit-url"`
// Relations
Outputs []*StateVersionOutput `jsonapi:"relationship" json:"outputs"`
}
StateVersion is a state version suitable for marshaling into JSONAPI
type StateVersionCreateVersionOptions ¶
type StateVersionCreateVersionOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,state-versions"`
// The lineage of the state.
Lineage *string `jsonapi:"attribute" json:"lineage,omitempty"`
// The MD5 hash of the state version.
MD5 *string `jsonapi:"attribute" json:"md5"`
// The serial of the state.
Serial *int64 `jsonapi:"attribute" json:"serial"`
// The base64 encoded state.
State *string `jsonapi:"attribute" json:"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:"attribute" json:"force"`
}
StateVersionCreateVersionOptions are options for creating a state version via JSONAPI
type StateVersionList ¶
type StateVersionList struct {
*Pagination
Items []*StateVersion
}
StateVersionList is a list of state versions suitable for marshaling into JSONAPI
type StateVersionOutput ¶
type Team ¶
type Team struct {
ID string `jsonapi:"primary,teams"`
Name string `jsonapi:"attribute" json:"name"`
OrganizationAccess *OrganizationAccess `jsonapi:"attribute" json:"organization-access"`
Visibility string `jsonapi:"attribute" json:"visibility"`
Permissions *TeamPermissions `jsonapi:"attribute" json:"permissions"`
UserCount int `jsonapi:"attribute" json:"users-count"`
SSOTeamID string `jsonapi:"attribute" json:"sso-team-id"`
// Relations
Users []*User `jsonapi:"relationship" json:"users"`
}
Team represents an otf team.
type TeamPermissions ¶
type TeamPermissions struct {
CanDestroy bool `jsonapi:"attribute" json:"can-destroy"`
CanUpdateMembership bool `jsonapi:"attribute" json:"can-update-membership"`
}
TeamPermissions represents the current user's permissions on the team.
type TwoFactor ¶
type TwoFactor struct {
Enabled bool `jsonapi:"attribute" json:"enabled"`
Verified bool `jsonapi:"attribute" json:"verified"`
}
TwoFactor represents the organization permissions.
type User ¶
type User struct {
ID string `jsonapi:"primary,users"`
AvatarURL string `jsonapi:"attribute" json:"avatar-url"`
Email string `jsonapi:"attribute" json:"email"`
IsServiceAccount bool `jsonapi:"attribute" json:"is-service-account"`
TwoFactor *TwoFactor `jsonapi:"attribute" json:"two-factor"`
UnconfirmedEmail string `jsonapi:"attribute" json:"unconfirmed-email"`
Username string `jsonapi:"attribute" json:"username"`
V2Only bool `jsonapi:"attribute" json:"v2-only"`
}
User represents an OTF user.
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"`
RepositoryHTTPURL string `json:"repository-http-url"`
ServiceProvider string `json:"service-provider"`
}
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"`
}
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:"attribute" json:"key"`
Value string `jsonapi:"attribute" json:"value"`
Description string `jsonapi:"attribute" json:"description"`
Category string `jsonapi:"attribute" json:"category"`
HCL bool `jsonapi:"attribute" json:"hcl"`
Sensitive bool `jsonapi:"attribute" json:"sensitive"`
// Relations
Workspace *Workspace `jsonapi:"relationship" json:"configurable"`
}
Variable is a workspace variable.
type VariableCreateOptions ¶
type VariableCreateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,vars"`
// The name of the variable.
Key *string `jsonapi:"attribute" json:"key"`
// The value of the variable.
Value *string `jsonapi:"attribute" json:"value,omitempty"`
// The description of the variable.
Description *string `jsonapi:"attribute" json:"description,omitempty"`
// Whether this is a Terraform or environment variable.
Category *string `jsonapi:"attribute" json:"category"`
// Whether to evaluate the value of the variable as a string of HCL code.
HCL *bool `jsonapi:"attribute" json:"hcl,omitempty"`
// Whether the value is sensitive.
Sensitive *bool `jsonapi:"attribute" json:"sensitive,omitempty"`
}
VariableCreateOptions represents the options for creating a new variable.
type VariableList ¶
type VariableList struct {
*Pagination
Items []*Variable
}
VariableList is a list of workspace variables
type VariableUpdateOptions ¶
type VariableUpdateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,vars"`
// The name of the variable.
Key *string `jsonapi:"attribute" json:"key,omitempty"`
// The value of the variable.
Value *string `jsonapi:"attribute" json:"value,omitempty"`
// The description of the variable.
Description *string `jsonapi:"attribute" json:"description,omitempty"`
// Whether this is a Terraform or environment variable.
Category *string `jsonapi:"attribute" json:"category"`
// Whether to evaluate the value of the variable as a string of HCL code.
HCL *bool `jsonapi:"attribute" json:"hcl,omitempty"`
// Whether the value is sensitive.
Sensitive *bool `jsonapi:"attribute" json:"sensitive,omitempty"`
}
VariableUpdateOptions represents the options for updating a variable.
type Workspace ¶
type Workspace struct {
ID string `jsonapi:"primary,workspaces"`
Actions *WorkspaceActions `jsonapi:"attribute" json:"actions"`
AgentPoolID string `jsonapi:"attribute" json:"agent-pool-id"`
AllowDestroyPlan bool `jsonapi:"attribute" json:"allow-destroy-plan"`
AutoApply bool `jsonapi:"attribute" json:"auto-apply"`
CanQueueDestroyPlan bool `jsonapi:"attribute" json:"can-queue-destroy-plan"`
CreatedAt time.Time `jsonapi:"attribute" json:"created-at"`
Description string `jsonapi:"attribute" json:"description"`
Environment string `jsonapi:"attribute" json:"environment"`
ExecutionMode string `jsonapi:"attribute" json:"execution-mode"`
FileTriggersEnabled bool `jsonapi:"attribute" json:"file-triggers-enabled"`
GlobalRemoteState bool `jsonapi:"attribute" json:"global-remote-state"`
Locked bool `jsonapi:"attribute" json:"locked"`
MigrationEnvironment string `jsonapi:"attribute" json:"migration-environment"`
Name string `jsonapi:"attribute" json:"name"`
Operations bool `jsonapi:"attribute" json:"operations"`
Permissions *WorkspacePermissions `jsonapi:"attribute" json:"permissions"`
QueueAllRuns bool `jsonapi:"attribute" json:"queue-all-runs"`
SpeculativeEnabled bool `jsonapi:"attribute" json:"speculative-enabled"`
SourceName string `jsonapi:"attribute" json:"source-name"`
SourceURL string `jsonapi:"attribute" json:"source-url"`
StructuredRunOutputEnabled bool `jsonapi:"attribute" json:"structured-run-output-enabled"`
TerraformVersion string `jsonapi:"attribute" json:"terraform-version"`
TriggerPrefixes []string `jsonapi:"attribute" json:"trigger-prefixes"`
VCSRepo *VCSRepo `jsonapi:"attribute" json:"vcs-repo"`
WorkingDirectory string `jsonapi:"attribute" json:"working-directory"`
UpdatedAt time.Time `jsonapi:"attribute" json:"updated-at"`
ResourceCount int `jsonapi:"attribute" json:"resource-count"`
ApplyDurationAverage time.Duration `jsonapi:"attribute" json:"apply-duration-average"`
PlanDurationAverage time.Duration `jsonapi:"attribute" json:"plan-duration-average"`
PolicyCheckFailures int `jsonapi:"attribute" json:"policy-check-failures"`
RunFailures int `jsonapi:"attribute" json:"run-failures"`
RunsCount int `jsonapi:"attribute" json:"workspace-kpis-runs-count"`
TagNames []string `jsonapi:"attribute" json:"tag-names"`
// Relations
CurrentRun *Run `jsonapi:"relationship" json:"current-run"`
Organization *Organization `jsonapi:"relationship" json:"organization"`
Outputs []*StateVersionOutput `jsonapi:"relationship" json:"outputs"`
}
Workspace represents a Terraform Enterprise workspace.
type WorkspaceActions ¶
type WorkspaceActions struct {
IsDestroyable bool `json:"is-destroyable"`
}
WorkspaceActions represents the workspace actions.
type WorkspaceCreateOptions ¶
type WorkspaceCreateOptions struct {
// Type is a public field utilized by JSON:API to set the resource type via
// the field tag. It is not a user-defined value and does not need to be
// set. https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,workspaces"`
// Required when execution-mode is set to agent. The ID of the agent pool
// belonging to the workspace's organization. This value must not be
// specified if execution-mode is set to remote or local or if operations is
// set to true.
AgentPoolID *string `jsonapi:"attribute" json:"agent-pool-id,omitempty"`
// Whether destroy plans can be queued on the workspace.
AllowDestroyPlan *bool `jsonapi:"attribute" json:"allow-destroy-plan,omitempty"`
// Whether to automatically apply changes when a Terraform plan is successful.
AutoApply *bool `jsonapi:"attribute" json:"auto-apply,omitempty"`
// A description for the workspace.
Description *string `jsonapi:"attribute" json:"description,omitempty"`
// Which execution mode to use. Valid values are remote, local, and agent.
// When set to local, the workspace will be used for state storage only.
// This value must not be specified if operations is specified.
// 'agent' execution mode is not available in Terraform Enterprise.
ExecutionMode *string `jsonapi:"attribute" json:"execution-mode,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:"attribute" json:"file-triggers-enabled,omitempty"`
GlobalRemoteState *bool `jsonapi:"attribute" json:"global-remote-state,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:"attribute" json:"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:"attribute" json:"name"`
// DEPRECATED. Whether the workspace will use remote or local execution mode.
// Use ExecutionMode instead.
Operations *bool `jsonapi:"attribute" json:"operations,omitempty"`
// Organization the workspace belongs to. Required.
Organization *string `schema:"organization_name"`
// 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:"attribute" json:"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:"attribute" json:"speculative-enabled,omitempty"`
// BETA. A friendly name for the application or client creating this
// workspace. If set, this will be displayed on the workspace as
// "Created via <SOURCE NAME>".
SourceName *string `jsonapi:"attribute" json:"source-name,omitempty"`
// BETA. A URL for the application or client creating this workspace. This
// can be the URL of a related resource in another app, or a link to
// documentation or other info about the client.
SourceURL *string `jsonapi:"attribute" json:"source-url,omitempty"`
// BETA. Enable the experimental advanced run user interface.
// This only applies to runs using Terraform version 0.15.2 or newer,
// and runs executed using older versions will see the classic experience
// regardless of this setting.
StructuredRunOutputEnabled *bool `jsonapi:"attribute" json:"structured-run-output-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:"attribute" json:"terraform-version,omitempty" schema:"terraform_version"`
// List of repository-root-relative paths which list all locations to be
// tracked for changes. See FileTriggersEnabled above for more details.
TriggerPrefixes []string `jsonapi:"attribute" json:"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:"attribute" json:"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:"attribute" json:"working-directory,omitempty"`
// A list of tags to attach to the workspace. If the tag does not already
// exist, it is created and added to the workspace.
Tags []*Tag `jsonapi:"relationship" json:"tags,omitempty"`
}
WorkspaceCreateOptions represents the options for creating a new workspace.
type WorkspaceList ¶
type WorkspaceList struct {
*Pagination
Items []*Workspace
}
WorkspaceList represents a list of workspaces.
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 {
// Type is a public field utilized by JSON:API to set the resource type via
// the field tag. It is not a user-defined value and does not need to be
// set. https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,workspaces"`
// Required when execution-mode is set to agent. The ID of the agent pool
// belonging to the workspace's organization. This value must not be
// specified if execution-mode is set to remote or local or if operations is
// set to true.
AgentPoolID *string `jsonapi:"attribute" json:"agent-pool-id,omitempty"`
// Whether destroy plans can be queued on the workspace.
AllowDestroyPlan *bool `jsonapi:"attribute" json:"allow-destroy-plan,omitempty"`
// Whether to automatically apply changes when a Terraform plan is successful.
AutoApply *bool `jsonapi:"attribute" json:"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:"attribute" json:"name,omitempty"`
// A description for the workspace.
Description *string `jsonapi:"attribute" json:"description,omitempty"`
// Which execution mode to use. Valid values are remote, local, and agent.
// When set to local, the workspace will be used for state storage only.
// This value must not be specified if operations is specified.
// 'agent' execution mode is not available in Terraform Enterprise.
ExecutionMode *string `jsonapi:"attribute" json:"execution-mode,omitempty" schema:"execution_mode"`
// 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:"attribute" json:"file-triggers-enabled,omitempty"`
GlobalRemoteState *bool `jsonapi:"attribute" json:"global-remote-state,omitempty"`
// DEPRECATED. Whether the workspace will use remote or local execution mode.
// Use ExecutionMode instead.
Operations *bool `jsonapi:"attribute" json:"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:"attribute" json:"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:"attribute" json:"speculative-enabled,omitempty"`
// BETA. Enable the experimental advanced run user interface.
// This only applies to runs using Terraform version 0.15.2 or newer,
// and runs executed using older versions will see the classic experience
// regardless of this setting.
StructuredRunOutputEnabled *bool `jsonapi:"attribute" json:"structured-run-output-enabled,omitempty"`
// The version of Terraform to use for this workspace.
TerraformVersion *string `jsonapi:"attribute" json:"terraform-version,omitempty" schema:"terraform_version"`
// List of repository-root-relative paths which list all locations to be
// tracked for changes. See FileTriggersEnabled above for more details.
TriggerPrefixes []string `jsonapi:"attribute" json:"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:"attribute" json:"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:"attribute" json:"working-directory,omitempty"`
}
WorkspaceUpdateOptions represents the options for updating a workspace.
func (*WorkspaceUpdateOptions) Validate ¶
func (opts *WorkspaceUpdateOptions) Validate() error