@@ -70,6 +70,7 @@ const (
70
70
RunPending RunStatus = "pending"
71
71
RunPlanned RunStatus = "planned"
72
72
RunPlannedAndFinished RunStatus = "planned_and_finished"
73
+ RunPlannedAndSaved RunStatus = "planned_and_saved" // Note: This status is in BETA.
73
74
RunPlanning RunStatus = "planning"
74
75
RunPlanQueued RunStatus = "plan_queued"
75
76
RunPolicyChecked RunStatus = "policy_checked"
@@ -107,6 +108,8 @@ const (
107
108
RunOperationRefreshOnly RunOperation = "refresh_only"
108
109
RunOperationDestroy RunOperation = "destroy"
109
110
RunOperationEmptyApply RunOperation = "empty_apply"
111
+ // **Note: This operation type is still in BETA and subject to change.**
112
+ RunOperationSavePlan RunOperation = "save_plan"
110
113
)
111
114
112
115
// RunList represents a list of runs.
@@ -117,28 +120,30 @@ type RunList struct {
117
120
118
121
// Run represents a Terraform Enterprise run.
119
122
type Run struct {
120
- ID string `jsonapi:"primary,runs"`
121
- Actions * RunActions `jsonapi:"attr,actions"`
122
- AutoApply bool `jsonapi:"attr,auto-apply,omitempty"`
123
- AllowConfigGeneration * bool `jsonapi:"attr,allow-config-generation,omitempty"`
124
- AllowEmptyApply bool `jsonapi:"attr,allow-empty-apply"`
125
- CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
126
- ForceCancelAvailableAt time.Time `jsonapi:"attr,force-cancel-available-at,iso8601"`
127
- HasChanges bool `jsonapi:"attr,has-changes"`
128
- IsDestroy bool `jsonapi:"attr,is-destroy"`
129
- Message string `jsonapi:"attr,message"`
130
- Permissions * RunPermissions `jsonapi:"attr,permissions"`
131
- PositionInQueue int `jsonapi:"attr,position-in-queue"`
132
- PlanOnly bool `jsonapi:"attr,plan-only"`
133
- Refresh bool `jsonapi:"attr,refresh"`
134
- RefreshOnly bool `jsonapi:"attr,refresh-only"`
135
- ReplaceAddrs []string `jsonapi:"attr,replace-addrs,omitempty"`
136
- Source RunSource `jsonapi:"attr,source"`
137
- Status RunStatus `jsonapi:"attr,status"`
138
- StatusTimestamps * RunStatusTimestamps `jsonapi:"attr,status-timestamps"`
139
- TargetAddrs []string `jsonapi:"attr,target-addrs,omitempty"`
140
- TerraformVersion string `jsonapi:"attr,terraform-version"`
141
- Variables []* RunVariableAttr `jsonapi:"attr,variables"`
123
+ ID string `jsonapi:"primary,runs"`
124
+ Actions * RunActions `jsonapi:"attr,actions"`
125
+ AutoApply bool `jsonapi:"attr,auto-apply,omitempty"`
126
+ AllowConfigGeneration * bool `jsonapi:"attr,allow-config-generation,omitempty"`
127
+ AllowEmptyApply bool `jsonapi:"attr,allow-empty-apply"`
128
+ CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
129
+ ForceCancelAvailableAt time.Time `jsonapi:"attr,force-cancel-available-at,iso8601"`
130
+ HasChanges bool `jsonapi:"attr,has-changes"`
131
+ IsDestroy bool `jsonapi:"attr,is-destroy"`
132
+ Message string `jsonapi:"attr,message"`
133
+ Permissions * RunPermissions `jsonapi:"attr,permissions"`
134
+ PositionInQueue int `jsonapi:"attr,position-in-queue"`
135
+ PlanOnly bool `jsonapi:"attr,plan-only"`
136
+ Refresh bool `jsonapi:"attr,refresh"`
137
+ RefreshOnly bool `jsonapi:"attr,refresh-only"`
138
+ ReplaceAddrs []string `jsonapi:"attr,replace-addrs,omitempty"`
139
+ // **Note: This field is still in BETA and subject to change.**
140
+ SavePlan bool `jsonapi:"attr,save-plan,omitempty"`
141
+ Source RunSource `jsonapi:"attr,source"`
142
+ Status RunStatus `jsonapi:"attr,status"`
143
+ StatusTimestamps * RunStatusTimestamps `jsonapi:"attr,status-timestamps"`
144
+ TargetAddrs []string `jsonapi:"attr,target-addrs,omitempty"`
145
+ TerraformVersion string `jsonapi:"attr,terraform-version"`
146
+ Variables []* RunVariableAttr `jsonapi:"attr,variables"`
142
147
143
148
// Relations
144
149
Apply * Apply `jsonapi:"relation,apply"`
@@ -184,17 +189,19 @@ type RunStatusTimestamps struct {
184
189
FetchingAt time.Time `jsonapi:"attr,fetching-at,rfc3339"`
185
190
ForceCanceledAt time.Time `jsonapi:"attr,force-canceled-at,rfc3339"`
186
191
PlannedAndFinishedAt time.Time `jsonapi:"attr,planned-and-finished-at,rfc3339"`
187
- PlannedAt time.Time `jsonapi:"attr,planned-at,rfc3339"`
188
- PlanningAt time.Time `jsonapi:"attr,planning-at,rfc3339"`
189
- PlanQueueableAt time.Time `jsonapi:"attr,plan-queueable-at,rfc3339"`
190
- PlanQueuedAt time.Time `jsonapi:"attr,plan-queued-at,rfc3339"`
191
- PolicyCheckedAt time.Time `jsonapi:"attr,policy-checked-at,rfc3339"`
192
- PolicySoftFailedAt time.Time `jsonapi:"attr,policy-soft-failed-at,rfc3339"`
193
- PostPlanCompletedAt time.Time `jsonapi:"attr,post-plan-completed-at,rfc3339"`
194
- PostPlanRunningAt time.Time `jsonapi:"attr,post-plan-running-at,rfc3339"`
195
- PrePlanCompletedAt time.Time `jsonapi:"attr,pre-plan-completed-at,rfc3339"`
196
- PrePlanRunningAt time.Time `jsonapi:"attr,pre-plan-running-at,rfc3339"`
197
- QueuingAt time.Time `jsonapi:"attr,queuing-at,rfc3339"`
192
+ // **Note: This field is still in BETA and subject to change.**
193
+ PlannedAndSavedAt time.Time `jsonapi:"attr,planned-and-saved-at,rfc3339"`
194
+ PlannedAt time.Time `jsonapi:"attr,planned-at,rfc3339"`
195
+ PlanningAt time.Time `jsonapi:"attr,planning-at,rfc3339"`
196
+ PlanQueueableAt time.Time `jsonapi:"attr,plan-queueable-at,rfc3339"`
197
+ PlanQueuedAt time.Time `jsonapi:"attr,plan-queued-at,rfc3339"`
198
+ PolicyCheckedAt time.Time `jsonapi:"attr,policy-checked-at,rfc3339"`
199
+ PolicySoftFailedAt time.Time `jsonapi:"attr,policy-soft-failed-at,rfc3339"`
200
+ PostPlanCompletedAt time.Time `jsonapi:"attr,post-plan-completed-at,rfc3339"`
201
+ PostPlanRunningAt time.Time `jsonapi:"attr,post-plan-running-at,rfc3339"`
202
+ PrePlanCompletedAt time.Time `jsonapi:"attr,pre-plan-completed-at,rfc3339"`
203
+ PrePlanRunningAt time.Time `jsonapi:"attr,pre-plan-running-at,rfc3339"`
204
+ QueuingAt time.Time `jsonapi:"attr,queuing-at,rfc3339"`
198
205
}
199
206
200
207
// RunIncludeOpt represents the available options for include query params.
@@ -290,6 +297,12 @@ type RunCreateOptions struct {
290
297
// and refresh the state only
291
298
RefreshOnly * bool `jsonapi:"attr,refresh-only,omitempty"`
292
299
300
+ // SavePlan determines whether this should be a saved-plan run. Saved-plan
301
+ // runs perform their plan and checks immediately, but won't lock the
302
+ // workspace and become its current run until they are confirmed for apply.
303
+ // **Note: This field is still in BETA and subject to change.**
304
+ SavePlan * bool `jsonapi:"attr,save-plan,omitempty"`
305
+
293
306
// Specifies the message to be associated with this run.
294
307
Message * string `jsonapi:"attr,message,omitempty"`
295
308
0 commit comments