@@ -18,7 +18,7 @@ type Stacks interface {
18
18
List (ctx context.Context , organization string , options * StackListOptions ) (* StackList , error )
19
19
20
20
// Read returns a stack by its ID.
21
- Read (ctx context.Context , stackID string , options * StackReadOptions ) (* Stack , error )
21
+ Read (ctx context.Context , stackID string ) (* Stack , error )
22
22
23
23
// Create creates a new stack.
24
24
Create (ctx context.Context , options StackCreateOptions ) (* Stack , error )
@@ -32,8 +32,8 @@ type Stacks interface {
32
32
// ForceDelete deletes a stack.
33
33
ForceDelete (ctx context.Context , stackID string ) error
34
34
35
- // UpdateConfiguration updates the configuration of a stack, triggering stack preparation.
36
- UpdateConfiguration (ctx context.Context , stackID string ) (* Stack , error )
35
+ // FetchLatestFromVcs updates the configuration of a stack, triggering stack preparation.
36
+ FetchLatestFromVcs (ctx context.Context , stackID string ) (* Stack , error )
37
37
}
38
38
39
39
// stacks implements Stacks.
@@ -88,17 +88,18 @@ type Stack struct {
88
88
ID string `jsonapi:"primary,stacks"`
89
89
Name string `jsonapi:"attr,name"`
90
90
Description string `jsonapi:"attr,description"`
91
- DeploymentNames []string `jsonapi:"attr,deployment-names"`
92
91
VCSRepo * StackVCSRepo `jsonapi:"attr,vcs-repo"`
93
- ErrorsCount int `jsonapi:"attr,errors-count"`
94
- WarningsCount int `jsonapi:"attr,warnings-count"`
95
92
SpeculativeEnabled bool `jsonapi:"attr,speculative-enabled"`
96
93
CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
97
94
UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
95
+ UpstreamCount int `jsonapi:"attr,upstream-count"`
96
+ DownstreamCount int `jsonapi:"attr,downstream-count"`
97
+ InputsCount int `jsonapi:"attr,inputs-count"`
98
+ OutputsCount int `jsonapi:"attr,outputs-count"`
98
99
99
100
// Relationships
100
- AgentPool * AgentPool `jsonapi:"relation,agent-pool"`
101
101
Project * Project `jsonapi:"relation,project"`
102
+ AgentPool * AgentPool `jsonapi:"relation,agent-pool"`
102
103
LatestStackConfiguration * StackConfiguration `jsonapi:"relation,latest-stack-configuration"`
103
104
}
104
105
@@ -117,54 +118,49 @@ type StackComponent struct {
117
118
Name string `json:"name"`
118
119
Correlator string `json:"correlator"`
119
120
Expanded bool `json:"expanded"`
121
+ Removed bool `json:"removed"`
120
122
}
121
123
122
124
// StackConfiguration represents a stack configuration snapshot
123
125
type StackConfiguration struct {
124
126
// 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"`
127
+ ID string `jsonapi:"primary,stack-configurations"`
128
+ Status string `jsonapi:"attr,status"`
129
+ SequenceNumber int `jsonapi:"attr,sequence-number"`
130
+ Components []* StackComponent `jsonapi:"attr,components"`
131
+ PreparingEventStreamURL string `jsonapi:"attr,preparing-event-stream-url"`
132
+ CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
133
+ UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
134
+ Speculative bool `jsonapi:"attr,speculative"`
135
+
136
+ // Relationships
137
+ Stack * Stack `jsonapi:"relation,stack"`
138
+ IngressAttributes * IngressAttributes `jsonapi:"relation,ingress-attributes"`
139
139
}
140
140
141
141
// StackState represents a stack state
142
142
type StackState struct {
143
143
// Attributes
144
- ID string `jsonapi:"primary,stack-states"`
145
- }
146
-
147
- // StackIncludeOpt represents the include options for a stack.
148
- type StackIncludeOpt string
144
+ ID string `jsonapi:"primary,stack-states"`
145
+ Description string `jsonapi:"attr,description"`
146
+ Generation int `jsonapi:"attr,generation"`
147
+ Status string `jsonapi:"attr,status"`
148
+ Deployment string `jsonapi:"attr,deployment"`
149
+ Components string `jsonapi:"attr,components"`
150
+ IsCurrent bool `jsonapi:"attr,is-current"`
151
+ ResourceInstanceCount int `jsonapi:"attr,resource-instance-count"`
149
152
150
- const (
151
- StackIncludeOrganization StackIncludeOpt = "organization"
152
- StackIncludeProject StackIncludeOpt = "project"
153
- StackIncludeLatestStackConfiguration StackIncludeOpt = "latest_stack_configuration"
154
- StackIncludeStackDiagnostics StackIncludeOpt = "stack_diagnostics"
155
- )
153
+ // Relationships
154
+ Stack * Stack `jsonapi:"relation,stack"`
155
+ StackDeploymentRun * StackDeploymentRun `jsonapi:"relation,stack-deployment-run"`
156
+ }
156
157
157
158
// StackListOptions represents the options for listing stacks.
158
159
type StackListOptions struct {
159
160
ListOptions
160
- ProjectID string `url:"filter[project[id]],omitempty"`
161
- Sort StackSortColumn `url:"sort,omitempty"`
162
- SearchByName string `url:"search[name],omitempty"`
163
- Include []StackIncludeOpt `url:"include,omitempty"`
164
- }
165
-
166
- type StackReadOptions struct {
167
- Include []StackIncludeOpt `url:"include,omitempty"`
161
+ ProjectID string `url:"filter[project[id]],omitempty"`
162
+ Sort StackSortColumn `url:"sort,omitempty"`
163
+ SearchByName string `url:"search[name],omitempty"`
168
164
}
169
165
170
166
// StackCreateOptions represents the options for creating a stack. The project
@@ -202,8 +198,8 @@ type WaitForStatusResult struct {
202
198
const minimumPollingIntervalMs = 3000
203
199
const maximumPollingIntervalMs = 5000
204
200
205
- // UpdateConfiguration fetches the latest configuration of a stack from VCS, triggering stack operations
206
- func (s * stacks ) UpdateConfiguration (ctx context.Context , stackID string ) (* Stack , error ) {
201
+ // FetchLatestFromVcs fetches the latest configuration of a stack from VCS, triggering stack operations
202
+ func (s * stacks ) FetchLatestFromVcs (ctx context.Context , stackID string ) (* Stack , error ) {
207
203
req , err := s .client .NewRequest ("POST" , fmt .Sprintf ("stacks/%s/fetch-latest-from-vcs" , url .PathEscape (stackID )), nil )
208
204
if err != nil {
209
205
return nil , err
@@ -239,8 +235,8 @@ func (s stacks) List(ctx context.Context, organization string, options *StackLis
239
235
}
240
236
241
237
// Read returns a stack by its ID.
242
- func (s stacks ) Read (ctx context.Context , stackID string , options * StackReadOptions ) (* Stack , error ) {
243
- req , err := s .client .NewRequest ("GET" , fmt .Sprintf ("stacks/%s" , url .PathEscape (stackID )), options )
238
+ func (s stacks ) Read (ctx context.Context , stackID string ) (* Stack , error ) {
239
+ req , err := s .client .NewRequest ("GET" , fmt .Sprintf ("stacks/%s" , url .PathEscape (stackID )), nil )
244
240
if err != nil {
245
241
return nil , err
246
242
}
0 commit comments