diff --git a/components/fctl/cmd/stack/internal/print.go b/components/fctl/cmd/stack/internal/print.go index dbd631ff6e..278df7fd6d 100644 --- a/components/fctl/cmd/stack/internal/print.go +++ b/components/fctl/cmd/stack/internal/print.go @@ -21,10 +21,12 @@ func PrintStackInformation(out io.Writer, profile *fctl.Profile, stack *membersh return err } - err = printVersion(out, baseUrlStr, versions, stack) + if versions != nil { + err = printVersion(out, baseUrlStr, versions, stack) - if err != nil { - return err + if err != nil { + return err + } } err = printMetadata(out, stack) @@ -42,6 +44,8 @@ func printInformation(out io.Writer, stack *membershipclient.Stack) error { tableData = append(tableData, []string{pterm.LightCyan("ID"), stack.Id, ""}) tableData = append(tableData, []string{pterm.LightCyan("Name"), stack.Name, ""}) tableData = append(tableData, []string{pterm.LightCyan("Region"), stack.RegionID, ""}) + tableData = append(tableData, []string{pterm.LightCyan("Status"), stack.State, ""}) + tableData = append(tableData, []string{pterm.LightCyan("Effective status"), stack.Status, ""}) return pterm.DefaultTable. WithWriter(out). WithData(tableData). diff --git a/components/fctl/cmd/stack/list.go b/components/fctl/cmd/stack/list.go index e9204c66ab..3d88b12245 100644 --- a/components/fctl/cmd/stack/list.go +++ b/components/fctl/cmd/stack/list.go @@ -12,8 +12,8 @@ import ( ) const ( - deletedFlag = "deleted" - disabledFlag = "disabled" + allFlag = "all" + deletedFlag = "deleted" ) type Stack struct { @@ -23,6 +23,7 @@ type Stack struct { RegionID string `json:"region"` DisabledAt *string `json:"disabledAt"` DeletedAt *string `json:"deletedAt"` + Status string `json:"status"` } type StackListStore struct { Stacks []Stack `json:"stacks"` @@ -53,7 +54,8 @@ func NewListCommand() *cobra.Command { fctl.WithShortDescription("List stacks"), fctl.WithArgs(cobra.ExactArgs(0)), fctl.WithBoolFlag(deletedFlag, false, "Display deleted stacks"), - fctl.WithBoolFlag(disabledFlag, false, "Display disabled stacks"), + fctl.WithBoolFlag(allFlag, false, "Display deleted stacks"), + fctl.WithDeprecatedFlag(deletedFlag, "Use --all instead"), fctl.WithController[*StackListStore](NewStackListController()), ) } @@ -81,8 +83,8 @@ func (c *StackListController) Run(cmd *cobra.Command, args []string) (fctl.Rende } rsp, _, err := apiClient.DefaultApi.ListStacks(cmd.Context(), organization). + All(fctl.GetBool(cmd, allFlag)). Deleted(fctl.GetBool(cmd, deletedFlag)). - Disabled(fctl.GetBool(cmd, disabledFlag)). Execute() if err != nil { return nil, errors.Wrap(err, "listing stacks") @@ -99,6 +101,7 @@ func (c *StackListController) Run(cmd *cobra.Command, args []string) (fctl.Rende Name: stack.Name, Dashboard: c.profile.ServicesBaseUrl(&stack).String(), RegionID: stack.RegionID, + Status: stack.State, DisabledAt: func() *string { if stack.DisabledAt != nil { t := stack.DisabledAt.Format(time.RFC3339) @@ -131,32 +134,36 @@ func (c *StackListController) Render(cmd *cobra.Command, args []string) error { stack.Name, stack.Dashboard, stack.RegionID, + stack.Status, } - if fctl.GetBool(cmd, disabledFlag) { + if fctl.GetBool(cmd, allFlag) { + if stack.DisabledAt != nil { data = append(data, *stack.DisabledAt) } else { data = append(data, "") } - } - if fctl.GetBool(cmd, deletedFlag) { + if stack.DeletedAt != nil { data = append(data, *stack.DeletedAt) } else { - data = append(data, "") + if stack.Status != "DELETED" { + data = append(data, "") + + } else { + + data = append(data, "") + } } } + return data }) - headers := []string{"ID", "Name", "Dashboard", "Region"} - if fctl.GetBool(cmd, disabledFlag) { - headers = append(headers, "Disabled at") + headers := []string{"ID", "Name", "Dashboard", "Region", "Status"} + if fctl.GetBool(cmd, allFlag) { + headers = append(headers, "Disabled At", "Deleted At") } - if fctl.GetBool(cmd, deletedFlag) { - headers = append(headers, "Deleted at") - } - tableData = fctl.Prepend(tableData, headers) return pterm.DefaultTable. diff --git a/components/fctl/cmd/stack/show.go b/components/fctl/cmd/stack/show.go index 9921f30961..9b04039e3d 100644 --- a/components/fctl/cmd/stack/show.go +++ b/components/fctl/cmd/stack/show.go @@ -105,6 +105,16 @@ func (c *StackShowController) Run(cmd *cobra.Command, args []string) (fctl.Rende return nil, errStackNotFound } + c.store.Stack = stack + c.config = cfg + + // the stack is not active, we can't get the running versions + // Maybe add something in the process with sync status and store it in membership + + if stack.Status != "ACTIVE" { + return c, nil + } + stackClient, err := fctl.NewStackClient(cmd, cfg, stack) if err != nil { return nil, err @@ -112,6 +122,7 @@ func (c *StackShowController) Run(cmd *cobra.Command, args []string) (fctl.Rende versions, err := stackClient.GetVersions(cmd.Context()) if err != nil { + return nil, err } @@ -119,9 +130,7 @@ func (c *StackShowController) Run(cmd *cobra.Command, args []string) (fctl.Rende return nil, fmt.Errorf("unexpected status code %d when reading versions", versions.StatusCode) } - c.store.Stack = stack c.store.Versions = versions.GetVersionsResponse - c.config = cfg return c, nil diff --git a/components/fctl/membership-swagger.yaml b/components/fctl/membership-swagger.yaml index 982f070ec9..c1dc2e6013 100644 --- a/components/fctl/membership-swagger.yaml +++ b/components/fctl/membership-swagger.yaml @@ -46,6 +46,13 @@ paths: application/json: schema: $ref: '#/components/schemas/CreateOrganizationResponse' + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /organizations/expanded: get: summary: List organizations of the connected user with expanded data @@ -197,15 +204,16 @@ paths: schema: type: string required: true - - name: deleted + - name: all in: query - description: Include deleted stacks + description: Include deleted and disabled stacks schema: type: boolean required: false - - name: disabled + - name: deleted in: query - description: Include disabled stacks + description: Include deleted stacks + deprecated: true schema: type: boolean required: false @@ -784,6 +792,11 @@ components: - regionID - stargateEnabled - status + - state + - expectedStatus + - lastStateUpdate + - lastExpectedStatusUpdate + - lastStatusUpdate properties: id: type: string @@ -814,6 +827,31 @@ components: - UNKNOWN - PROGRESSING - READY + - DISABLED + - DELETED + state: + type: string + enum: + - ACTIVE + - DISABLED + - DELETED + expectedStatus: + type: string + enum: + - UNKNOWN + - PROGRESSING + - READY + - DISABLED + - DELETED + lastStateUpdate: + type: string + format: date-time + lastExpectedStatusUpdate: + type: string + format: date-time + lastStatusUpdate: + type: string + format: date-time UpdatableUserData: type: object properties: diff --git a/components/fctl/membershipclient/api/openapi.yaml b/components/fctl/membershipclient/api/openapi.yaml index 060b27d9d5..84a9691a84 100644 --- a/components/fctl/membershipclient/api/openapi.yaml +++ b/components/fctl/membershipclient/api/openapi.yaml @@ -45,6 +45,12 @@ paths: schema: $ref: '#/components/schemas/CreateOrganizationResponse' description: Organization created + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Error summary: Create organization /organizations/expanded: get: @@ -241,18 +247,19 @@ paths: schema: type: string style: simple - - description: Include deleted stacks + - description: Include deleted and disabled stacks explode: true in: query - name: deleted + name: all required: false schema: type: boolean style: form - - description: Include disabled stacks + - deprecated: true + description: Include deleted stacks explode: true in: query - name: disabled + name: deleted required: false schema: type: boolean @@ -1208,12 +1215,42 @@ components: - UNKNOWN - PROGRESSING - READY + - DISABLED + - DELETED + type: string + state: + enum: + - ACTIVE + - DISABLED + - DELETED + type: string + expectedStatus: + enum: + - UNKNOWN + - PROGRESSING + - READY + - DISABLED + - DELETED + type: string + lastStateUpdate: + format: date-time + type: string + lastExpectedStatusUpdate: + format: date-time + type: string + lastStatusUpdate: + format: date-time type: string required: + - expectedStatus - id + - lastExpectedStatusUpdate + - lastStateUpdate + - lastStatusUpdate - organizationId - regionID - stargateEnabled + - state - status - uri type: object diff --git a/components/fctl/membershipclient/api_default.go b/components/fctl/membershipclient/api_default.go index 74e8be61c2..e971aec63f 100644 --- a/components/fctl/membershipclient/api_default.go +++ b/components/fctl/membershipclient/api_default.go @@ -516,6 +516,16 @@ func (a *DefaultApiService) CreateOrganizationExecute(r ApiCreateOrganizationReq body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2524,19 +2534,20 @@ type ApiListStacksRequest struct { ctx context.Context ApiService *DefaultApiService organizationId string + all *bool deleted *bool - disabled *bool } -// Include deleted stacks -func (r ApiListStacksRequest) Deleted(deleted bool) ApiListStacksRequest { - r.deleted = &deleted +// Include deleted and disabled stacks +func (r ApiListStacksRequest) All(all bool) ApiListStacksRequest { + r.all = &all return r } -// Include disabled stacks -func (r ApiListStacksRequest) Disabled(disabled bool) ApiListStacksRequest { - r.disabled = &disabled +// Include deleted stacks +// Deprecated +func (r ApiListStacksRequest) Deleted(deleted bool) ApiListStacksRequest { + r.deleted = &deleted return r } @@ -2581,12 +2592,12 @@ func (a *DefaultApiService) ListStacksExecute(r ApiListStacksRequest) (*ListStac localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.all != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "") + } if r.deleted != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "deleted", r.deleted, "") } - if r.disabled != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "disabled", r.disabled, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/components/fctl/membershipclient/docs/Stack.md b/components/fctl/membershipclient/docs/Stack.md index c37749bb23..c25d1dd9b8 100644 --- a/components/fctl/membershipclient/docs/Stack.md +++ b/components/fctl/membershipclient/docs/Stack.md @@ -15,12 +15,17 @@ Name | Type | Description | Notes **DeletedAt** | Pointer to **time.Time** | | [optional] **DisabledAt** | Pointer to **time.Time** | | [optional] **Status** | **string** | | +**State** | **string** | | +**ExpectedStatus** | **string** | | +**LastStateUpdate** | **time.Time** | | +**LastExpectedStatusUpdate** | **time.Time** | | +**LastStatusUpdate** | **time.Time** | | ## Methods ### NewStack -`func NewStack(name string, metadata map[string]string, id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string, ) *Stack` +`func NewStack(name string, metadata map[string]string, id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string, state string, expectedStatus string, lastStateUpdate time.Time, lastExpectedStatusUpdate time.Time, lastStatusUpdate time.Time, ) *Stack` NewStack instantiates a new Stack object This constructor will assign default values to properties that have it defined, @@ -270,6 +275,106 @@ and a boolean to check if the value has been set. SetStatus sets Status field to given value. +### GetState + +`func (o *Stack) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Stack) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Stack) SetState(v string)` + +SetState sets State field to given value. + + +### GetExpectedStatus + +`func (o *Stack) GetExpectedStatus() string` + +GetExpectedStatus returns the ExpectedStatus field if non-nil, zero value otherwise. + +### GetExpectedStatusOk + +`func (o *Stack) GetExpectedStatusOk() (*string, bool)` + +GetExpectedStatusOk returns a tuple with the ExpectedStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpectedStatus + +`func (o *Stack) SetExpectedStatus(v string)` + +SetExpectedStatus sets ExpectedStatus field to given value. + + +### GetLastStateUpdate + +`func (o *Stack) GetLastStateUpdate() time.Time` + +GetLastStateUpdate returns the LastStateUpdate field if non-nil, zero value otherwise. + +### GetLastStateUpdateOk + +`func (o *Stack) GetLastStateUpdateOk() (*time.Time, bool)` + +GetLastStateUpdateOk returns a tuple with the LastStateUpdate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastStateUpdate + +`func (o *Stack) SetLastStateUpdate(v time.Time)` + +SetLastStateUpdate sets LastStateUpdate field to given value. + + +### GetLastExpectedStatusUpdate + +`func (o *Stack) GetLastExpectedStatusUpdate() time.Time` + +GetLastExpectedStatusUpdate returns the LastExpectedStatusUpdate field if non-nil, zero value otherwise. + +### GetLastExpectedStatusUpdateOk + +`func (o *Stack) GetLastExpectedStatusUpdateOk() (*time.Time, bool)` + +GetLastExpectedStatusUpdateOk returns a tuple with the LastExpectedStatusUpdate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastExpectedStatusUpdate + +`func (o *Stack) SetLastExpectedStatusUpdate(v time.Time)` + +SetLastExpectedStatusUpdate sets LastExpectedStatusUpdate field to given value. + + +### GetLastStatusUpdate + +`func (o *Stack) GetLastStatusUpdate() time.Time` + +GetLastStatusUpdate returns the LastStatusUpdate field if non-nil, zero value otherwise. + +### GetLastStatusUpdateOk + +`func (o *Stack) GetLastStatusUpdateOk() (*time.Time, bool)` + +GetLastStatusUpdateOk returns a tuple with the LastStatusUpdate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastStatusUpdate + +`func (o *Stack) SetLastStatusUpdate(v time.Time)` + +SetLastStatusUpdate sets LastStatusUpdate field to given value. + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/components/fctl/membershipclient/docs/StackAllOf.md b/components/fctl/membershipclient/docs/StackAllOf.md index 192752391c..2689465a59 100644 --- a/components/fctl/membershipclient/docs/StackAllOf.md +++ b/components/fctl/membershipclient/docs/StackAllOf.md @@ -13,12 +13,17 @@ Name | Type | Description | Notes **DeletedAt** | Pointer to **time.Time** | | [optional] **DisabledAt** | Pointer to **time.Time** | | [optional] **Status** | **string** | | +**State** | **string** | | +**ExpectedStatus** | **string** | | +**LastStateUpdate** | **time.Time** | | +**LastExpectedStatusUpdate** | **time.Time** | | +**LastStatusUpdate** | **time.Time** | | ## Methods ### NewStackAllOf -`func NewStackAllOf(id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string, ) *StackAllOf` +`func NewStackAllOf(id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string, state string, expectedStatus string, lastStateUpdate time.Time, lastExpectedStatusUpdate time.Time, lastStatusUpdate time.Time, ) *StackAllOf` NewStackAllOf instantiates a new StackAllOf object This constructor will assign default values to properties that have it defined, @@ -228,6 +233,106 @@ and a boolean to check if the value has been set. SetStatus sets Status field to given value. +### GetState + +`func (o *StackAllOf) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *StackAllOf) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *StackAllOf) SetState(v string)` + +SetState sets State field to given value. + + +### GetExpectedStatus + +`func (o *StackAllOf) GetExpectedStatus() string` + +GetExpectedStatus returns the ExpectedStatus field if non-nil, zero value otherwise. + +### GetExpectedStatusOk + +`func (o *StackAllOf) GetExpectedStatusOk() (*string, bool)` + +GetExpectedStatusOk returns a tuple with the ExpectedStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpectedStatus + +`func (o *StackAllOf) SetExpectedStatus(v string)` + +SetExpectedStatus sets ExpectedStatus field to given value. + + +### GetLastStateUpdate + +`func (o *StackAllOf) GetLastStateUpdate() time.Time` + +GetLastStateUpdate returns the LastStateUpdate field if non-nil, zero value otherwise. + +### GetLastStateUpdateOk + +`func (o *StackAllOf) GetLastStateUpdateOk() (*time.Time, bool)` + +GetLastStateUpdateOk returns a tuple with the LastStateUpdate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastStateUpdate + +`func (o *StackAllOf) SetLastStateUpdate(v time.Time)` + +SetLastStateUpdate sets LastStateUpdate field to given value. + + +### GetLastExpectedStatusUpdate + +`func (o *StackAllOf) GetLastExpectedStatusUpdate() time.Time` + +GetLastExpectedStatusUpdate returns the LastExpectedStatusUpdate field if non-nil, zero value otherwise. + +### GetLastExpectedStatusUpdateOk + +`func (o *StackAllOf) GetLastExpectedStatusUpdateOk() (*time.Time, bool)` + +GetLastExpectedStatusUpdateOk returns a tuple with the LastExpectedStatusUpdate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastExpectedStatusUpdate + +`func (o *StackAllOf) SetLastExpectedStatusUpdate(v time.Time)` + +SetLastExpectedStatusUpdate sets LastExpectedStatusUpdate field to given value. + + +### GetLastStatusUpdate + +`func (o *StackAllOf) GetLastStatusUpdate() time.Time` + +GetLastStatusUpdate returns the LastStatusUpdate field if non-nil, zero value otherwise. + +### GetLastStatusUpdateOk + +`func (o *StackAllOf) GetLastStatusUpdateOk() (*time.Time, bool)` + +GetLastStatusUpdateOk returns a tuple with the LastStatusUpdate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastStatusUpdate + +`func (o *StackAllOf) SetLastStatusUpdate(v time.Time)` + +SetLastStatusUpdate sets LastStatusUpdate field to given value. + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/components/fctl/membershipclient/model_stack.go b/components/fctl/membershipclient/model_stack.go index 7e39afdd28..b3badbe73c 100644 --- a/components/fctl/membershipclient/model_stack.go +++ b/components/fctl/membershipclient/model_stack.go @@ -36,13 +36,18 @@ type Stack struct { DeletedAt *time.Time `json:"deletedAt,omitempty"` DisabledAt *time.Time `json:"disabledAt,omitempty"` Status string `json:"status"` + State string `json:"state"` + ExpectedStatus string `json:"expectedStatus"` + LastStateUpdate time.Time `json:"lastStateUpdate"` + LastExpectedStatusUpdate time.Time `json:"lastExpectedStatusUpdate"` + LastStatusUpdate time.Time `json:"lastStatusUpdate"` } // NewStack instantiates a new Stack object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStack(name string, metadata map[string]string, id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string) *Stack { +func NewStack(name string, metadata map[string]string, id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string, state string, expectedStatus string, lastStateUpdate time.Time, lastExpectedStatusUpdate time.Time, lastStatusUpdate time.Time) *Stack { this := Stack{} this.Name = name this.Metadata = metadata @@ -52,6 +57,11 @@ func NewStack(name string, metadata map[string]string, id string, organizationId this.RegionID = regionID this.StargateEnabled = stargateEnabled this.Status = status + this.State = state + this.ExpectedStatus = expectedStatus + this.LastStateUpdate = lastStateUpdate + this.LastExpectedStatusUpdate = lastExpectedStatusUpdate + this.LastStatusUpdate = lastStatusUpdate return &this } @@ -351,6 +361,126 @@ func (o *Stack) SetStatus(v string) { o.Status = v } +// GetState returns the State field value +func (o *Stack) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *Stack) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *Stack) SetState(v string) { + o.State = v +} + +// GetExpectedStatus returns the ExpectedStatus field value +func (o *Stack) GetExpectedStatus() string { + if o == nil { + var ret string + return ret + } + + return o.ExpectedStatus +} + +// GetExpectedStatusOk returns a tuple with the ExpectedStatus field value +// and a boolean to check if the value has been set. +func (o *Stack) GetExpectedStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpectedStatus, true +} + +// SetExpectedStatus sets field value +func (o *Stack) SetExpectedStatus(v string) { + o.ExpectedStatus = v +} + +// GetLastStateUpdate returns the LastStateUpdate field value +func (o *Stack) GetLastStateUpdate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastStateUpdate +} + +// GetLastStateUpdateOk returns a tuple with the LastStateUpdate field value +// and a boolean to check if the value has been set. +func (o *Stack) GetLastStateUpdateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastStateUpdate, true +} + +// SetLastStateUpdate sets field value +func (o *Stack) SetLastStateUpdate(v time.Time) { + o.LastStateUpdate = v +} + +// GetLastExpectedStatusUpdate returns the LastExpectedStatusUpdate field value +func (o *Stack) GetLastExpectedStatusUpdate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastExpectedStatusUpdate +} + +// GetLastExpectedStatusUpdateOk returns a tuple with the LastExpectedStatusUpdate field value +// and a boolean to check if the value has been set. +func (o *Stack) GetLastExpectedStatusUpdateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastExpectedStatusUpdate, true +} + +// SetLastExpectedStatusUpdate sets field value +func (o *Stack) SetLastExpectedStatusUpdate(v time.Time) { + o.LastExpectedStatusUpdate = v +} + +// GetLastStatusUpdate returns the LastStatusUpdate field value +func (o *Stack) GetLastStatusUpdate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastStatusUpdate +} + +// GetLastStatusUpdateOk returns a tuple with the LastStatusUpdate field value +// and a boolean to check if the value has been set. +func (o *Stack) GetLastStatusUpdateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastStatusUpdate, true +} + +// SetLastStatusUpdate sets field value +func (o *Stack) SetLastStatusUpdate(v time.Time) { + o.LastStatusUpdate = v +} + func (o Stack) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -378,6 +508,11 @@ func (o Stack) ToMap() (map[string]interface{}, error) { toSerialize["disabledAt"] = o.DisabledAt } toSerialize["status"] = o.Status + toSerialize["state"] = o.State + toSerialize["expectedStatus"] = o.ExpectedStatus + toSerialize["lastStateUpdate"] = o.LastStateUpdate + toSerialize["lastExpectedStatusUpdate"] = o.LastExpectedStatusUpdate + toSerialize["lastStatusUpdate"] = o.LastStatusUpdate return toSerialize, nil } diff --git a/components/fctl/membershipclient/model_stack_all_of.go b/components/fctl/membershipclient/model_stack_all_of.go index 6de88573af..94bd891bf4 100644 --- a/components/fctl/membershipclient/model_stack_all_of.go +++ b/components/fctl/membershipclient/model_stack_all_of.go @@ -33,13 +33,18 @@ type StackAllOf struct { DeletedAt *time.Time `json:"deletedAt,omitempty"` DisabledAt *time.Time `json:"disabledAt,omitempty"` Status string `json:"status"` + State string `json:"state"` + ExpectedStatus string `json:"expectedStatus"` + LastStateUpdate time.Time `json:"lastStateUpdate"` + LastExpectedStatusUpdate time.Time `json:"lastExpectedStatusUpdate"` + LastStatusUpdate time.Time `json:"lastStatusUpdate"` } // NewStackAllOf instantiates a new StackAllOf object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStackAllOf(id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string) *StackAllOf { +func NewStackAllOf(id string, organizationId string, uri string, regionID string, stargateEnabled bool, status string, state string, expectedStatus string, lastStateUpdate time.Time, lastExpectedStatusUpdate time.Time, lastStatusUpdate time.Time) *StackAllOf { this := StackAllOf{} this.Id = id this.OrganizationId = organizationId @@ -47,6 +52,11 @@ func NewStackAllOf(id string, organizationId string, uri string, regionID string this.RegionID = regionID this.StargateEnabled = stargateEnabled this.Status = status + this.State = state + this.ExpectedStatus = expectedStatus + this.LastStateUpdate = lastStateUpdate + this.LastExpectedStatusUpdate = lastExpectedStatusUpdate + this.LastStatusUpdate = lastStatusUpdate return &this } @@ -298,6 +308,126 @@ func (o *StackAllOf) SetStatus(v string) { o.Status = v } +// GetState returns the State field value +func (o *StackAllOf) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *StackAllOf) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *StackAllOf) SetState(v string) { + o.State = v +} + +// GetExpectedStatus returns the ExpectedStatus field value +func (o *StackAllOf) GetExpectedStatus() string { + if o == nil { + var ret string + return ret + } + + return o.ExpectedStatus +} + +// GetExpectedStatusOk returns a tuple with the ExpectedStatus field value +// and a boolean to check if the value has been set. +func (o *StackAllOf) GetExpectedStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpectedStatus, true +} + +// SetExpectedStatus sets field value +func (o *StackAllOf) SetExpectedStatus(v string) { + o.ExpectedStatus = v +} + +// GetLastStateUpdate returns the LastStateUpdate field value +func (o *StackAllOf) GetLastStateUpdate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastStateUpdate +} + +// GetLastStateUpdateOk returns a tuple with the LastStateUpdate field value +// and a boolean to check if the value has been set. +func (o *StackAllOf) GetLastStateUpdateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastStateUpdate, true +} + +// SetLastStateUpdate sets field value +func (o *StackAllOf) SetLastStateUpdate(v time.Time) { + o.LastStateUpdate = v +} + +// GetLastExpectedStatusUpdate returns the LastExpectedStatusUpdate field value +func (o *StackAllOf) GetLastExpectedStatusUpdate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastExpectedStatusUpdate +} + +// GetLastExpectedStatusUpdateOk returns a tuple with the LastExpectedStatusUpdate field value +// and a boolean to check if the value has been set. +func (o *StackAllOf) GetLastExpectedStatusUpdateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastExpectedStatusUpdate, true +} + +// SetLastExpectedStatusUpdate sets field value +func (o *StackAllOf) SetLastExpectedStatusUpdate(v time.Time) { + o.LastExpectedStatusUpdate = v +} + +// GetLastStatusUpdate returns the LastStatusUpdate field value +func (o *StackAllOf) GetLastStatusUpdate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastStatusUpdate +} + +// GetLastStatusUpdateOk returns a tuple with the LastStatusUpdate field value +// and a boolean to check if the value has been set. +func (o *StackAllOf) GetLastStatusUpdateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastStatusUpdate, true +} + +// SetLastStatusUpdate sets field value +func (o *StackAllOf) SetLastStatusUpdate(v time.Time) { + o.LastStatusUpdate = v +} + func (o StackAllOf) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -323,6 +453,11 @@ func (o StackAllOf) ToMap() (map[string]interface{}, error) { toSerialize["disabledAt"] = o.DisabledAt } toSerialize["status"] = o.Status + toSerialize["state"] = o.State + toSerialize["expectedStatus"] = o.ExpectedStatus + toSerialize["lastStateUpdate"] = o.LastStateUpdate + toSerialize["lastExpectedStatusUpdate"] = o.LastExpectedStatusUpdate + toSerialize["lastStatusUpdate"] = o.LastStatusUpdate return toSerialize, nil } diff --git a/components/fctl/pkg/command.go b/components/fctl/pkg/command.go index e1da965b55..8f923e4aee 100644 --- a/components/fctl/pkg/command.go +++ b/components/fctl/pkg/command.go @@ -225,6 +225,12 @@ func WithPreRunE(fn func(cmd *cobra.Command, args []string) error) CommandOption } } +func WithDeprecatedFlag(name, message string) CommandOptionFn { + return func(cmd *cobra.Command) { + cmd.Flags().MarkDeprecated(name, message) + } +} + func WithDeprecated(message string) CommandOptionFn { return func(cmd *cobra.Command) { cmd.Deprecated = message