@@ -83,22 +83,27 @@ type StackVCSRepoOptions struct {
83
83
OAuthTokenID string `json:"oauth-token-id,omitempty"`
84
84
}
85
85
86
+ type LinkedStackConnections struct {
87
+ UpstreamCount int `jsonapi:"attr,upstream-count"`
88
+ DownstreamCount int `jsonapi:"attr,downstream-count"`
89
+ InputsCount int `jsonapi:"attr,inputs-count"`
90
+ OutputsCount int `jsonapi:"attr,outputs-count"`
91
+ }
92
+
86
93
// Stack represents a stack.
87
94
type Stack struct {
88
- ID string `jsonapi:"primary,stacks"`
89
- Name string `jsonapi:"attr,name"`
90
- Description string `jsonapi:"attr,description"`
91
- DeploymentNames []string `jsonapi:"attr,deployment-names"`
92
- VCSRepo * StackVCSRepo `jsonapi:"attr,vcs-repo"`
93
- ErrorsCount int `jsonapi:"attr,errors-count"`
94
- WarningsCount int `jsonapi:"attr,warnings-count"`
95
- SpeculativeEnabled bool `jsonapi:"attr,speculative-enabled"`
96
- CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
97
- UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
95
+ ID string `jsonapi:"primary,stacks"`
96
+ Name string `jsonapi:"attr,name"`
97
+ Description string `jsonapi:"attr,description"`
98
+ VCSRepo * StackVCSRepo `jsonapi:"attr,vcs-repo"`
99
+ SpeculativeEnabled bool `jsonapi:"attr,speculative-enabled"`
100
+ CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
101
+ UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
102
+ LinkedStackConnections * LinkedStackConnections `jsonapi:"attr,linked-stack-connections"`
98
103
99
104
// Relationships
100
- AgentPool * AgentPool `jsonapi:"relation,agent-pool"`
101
105
Project * Project `jsonapi:"relation,project"`
106
+ AgentPool * AgentPool `jsonapi:"relation,agent-pool"`
102
107
LatestStackConfiguration * StackConfiguration `jsonapi:"relation,latest-stack-configuration"`
103
108
}
104
109
@@ -117,69 +122,49 @@ type StackComponent struct {
117
122
Name string `json:"name"`
118
123
Correlator string `json:"correlator"`
119
124
Expanded bool `json:"expanded"`
125
+ Removed bool `json:"removed"`
120
126
}
121
127
122
128
// StackConfiguration represents a stack configuration snapshot
123
129
type StackConfiguration struct {
124
130
// Attributes
125
- ID string `jsonapi:"primary,stack-configurations"`
126
- Status string `jsonapi:"attr,status"`
127
- StatusTimestamps * StackConfigurationStatusTimestamps `jsonapi:"attr,status-timestamps"`
128
- SequenceNumber int `jsonapi:"attr,sequence-number"`
129
- DeploymentNames []string `jsonapi:"attr,deployment-names"`
130
- ConvergedDeployments []string `jsonapi:"attr,converged-deployments"`
131
- Components []* StackComponent `jsonapi:"attr,components"`
132
- ErrorMessage * string `jsonapi:"attr,error-message"`
133
- EventStreamURL string `jsonapi:"attr,event-stream-url"`
134
- Diagnostics []* StackDiagnostic `jsonapi:"attr,diags"`
135
- CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
136
- UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
137
-
138
- Stack * Stack `jsonapi:"relation,stack"`
139
- }
140
-
141
- // StackDeployment represents a stack deployment, specified by configuration
142
- type StackDeployment struct {
143
- // Attributes
144
- ID string `jsonapi:"primary,stack-deployments"`
145
- Name string `jsonapi:"attr,name"`
146
- Status string `jsonapi:"attr,status"`
147
- DeployedAt time.Time `jsonapi:"attr,deployed-at,iso8601"`
148
- ErrorsCount int `jsonapi:"attr,errors-count"`
149
- WarningsCount int `jsonapi:"attr,warnings-count"`
150
- PausedCount int `jsonapi:"attr,paused-count"`
131
+ ID string `jsonapi:"primary,stack-configurations"`
132
+ Status string `jsonapi:"attr,status"`
133
+ SequenceNumber int `jsonapi:"attr,sequence-number"`
134
+ Components []* StackComponent `jsonapi:"attr,components"`
135
+ PreparingEventStreamURL string `jsonapi:"attr,preparing-event-stream-url"`
136
+ CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
137
+ UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
138
+ Speculative bool `jsonapi:"attr,speculative"`
151
139
152
140
// Relationships
153
- CurrentStackState * StackState `jsonapi:"relation,current-stack-state"`
141
+ Stack * Stack `jsonapi:"relation,stack"`
142
+ IngressAttributes * IngressAttributes `jsonapi:"relation,ingress-attributes"`
154
143
}
155
144
156
145
// StackState represents a stack state
157
146
type StackState struct {
158
147
// Attributes
159
- ID string `jsonapi:"primary,stack-states"`
160
- }
148
+ ID string `jsonapi:"primary,stack-states"`
149
+ Description string `jsonapi:"attr,description"`
150
+ Generation int `jsonapi:"attr,generation"`
151
+ Status string `jsonapi:"attr,status"`
152
+ Deployment string `jsonapi:"attr,deployment"`
153
+ Components string `jsonapi:"attr,components"`
154
+ IsCurrent bool `jsonapi:"attr,is-current"`
155
+ ResourceInstanceCount int `jsonapi:"attr,resource-instance-count"`
161
156
162
- // StackIncludeOpt represents the include options for a stack.
163
- type StackIncludeOpt string
164
-
165
- const (
166
- StackIncludeOrganization StackIncludeOpt = "organization"
167
- StackIncludeProject StackIncludeOpt = "project"
168
- StackIncludeLatestStackConfiguration StackIncludeOpt = "latest_stack_configuration"
169
- StackIncludeStackDiagnostics StackIncludeOpt = "stack_diagnostics"
170
- )
157
+ // Relationships
158
+ Stack * Stack `jsonapi:"relation,stack"`
159
+ StackDeploymentRun * StackDeploymentRun `jsonapi:"relation,stack-deployment-run"`
160
+ }
171
161
172
162
// StackListOptions represents the options for listing stacks.
173
163
type StackListOptions struct {
174
164
ListOptions
175
- ProjectID string `url:"filter[project[id]],omitempty"`
176
- Sort StackSortColumn `url:"sort,omitempty"`
177
- SearchByName string `url:"search[name],omitempty"`
178
- Include []StackIncludeOpt `url:"include,omitempty"`
179
- }
180
-
181
- type StackReadOptions struct {
182
- Include []StackIncludeOpt `url:"include,omitempty"`
165
+ ProjectID string `url:"filter[project[id]],omitempty"`
166
+ Sort StackSortColumn `url:"sort,omitempty"`
167
+ SearchByName string `url:"search[name],omitempty"`
183
168
}
184
169
185
170
// StackCreateOptions represents the options for creating a stack. The project
@@ -307,7 +292,7 @@ func (s stacks) Update(ctx context.Context, stackID string, options StackUpdateO
307
292
308
293
// Delete deletes a stack.
309
294
func (s stacks ) Delete (ctx context.Context , stackID string ) error {
310
- req , err := s .client .NewRequest ("POST " , fmt .Sprintf ("stacks/%s/delete " , url .PathEscape (stackID )), nil )
295
+ req , err := s .client .NewRequest ("DELETE " , fmt .Sprintf ("stacks/%s" , url .PathEscape (stackID )), nil )
311
296
if err != nil {
312
297
return err
313
298
}
@@ -317,7 +302,7 @@ func (s stacks) Delete(ctx context.Context, stackID string) error {
317
302
318
303
// ForceDelete deletes a stack that still has deployments.
319
304
func (s stacks ) ForceDelete (ctx context.Context , stackID string ) error {
320
- req , err := s .client .NewRequest ("POST " , fmt .Sprintf ("stacks/%s/ force-delete " , url .PathEscape (stackID )), nil )
305
+ req , err := s .client .NewRequest ("DELETE " , fmt .Sprintf ("stacks/%s? force=true " , url .PathEscape (stackID )), nil )
321
306
if err != nil {
322
307
return err
323
308
}
0 commit comments