Skip to content

Commit

Permalink
chore: auto update client api apecloud/apecloud@3f11db3
Browse files Browse the repository at this point in the history
  • Loading branch information
apecloud-bot committed Feb 8, 2025
1 parent ea37e81 commit ce10d0d
Show file tree
Hide file tree
Showing 11 changed files with 570 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .generator/schemas/adminapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15258,6 +15258,9 @@ components:
default: false
description: PITREnabled or not
type: boolean
continuousBackupMethod:
description: continuous backup method for pitr
type: string
autoBackup:
default: false
description: autoBackup or not
Expand Down Expand Up @@ -20070,6 +20073,9 @@ components:
description: specify whether to enable point-in-time recovery
default: false
type: boolean
continuousBackupMethod:
description: continuous backup method for pitr
type: string
cronExpression:
description: the crop expression for schedule
type: string
Expand Down
76 changes: 76 additions & 0 deletions .generator/schemas/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3921,6 +3921,58 @@ paths:
$ref: '#/components/responses/409'
tags:
- analyze
/api/v1/organizations/{orgName}/{engineName}/clusterBackupMethod:
get:
operationId: getBackupMethod
summary: get backup method
parameters:
- name: orgName
in: path
description: name of the org
required: true
schema:
type: string
- name: engineName
in: path
description: engine name
required: true
schema:
type: string
- description: clusterID is required when you want to get the backup method of a existing cluster
in: query
name: clusterID
schema:
type: string
- name: enablePITR
in: query
description: define whether to enable PITR (Point-In-Time Recovery). This setting is required when clusterId is not empty.
schema:
type: boolean
- name: withRebuildInstance
in: query
description: defined whether to search for rebuilding instance.
schema:
type: boolean
- name: component
in: query
description: The component type is required when withRebuildInstance is true.
schema:
type: string
responses:
'200':
content:
'*/*':
schema:
$ref: '#/components/schemas/clusterBackupMethod'
description: A successful response.
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
tags:
- backupMethod
/api/v1/organizations/{orgName}/clusters/{clusterName}/backups:
post:
operationId: createClusterBackup
Expand Down Expand Up @@ -4078,6 +4130,11 @@ paths:
description: type of the backup
schema:
type: string
- name: withRebuildInstance
in: query
description: defined whether to search for rebuilding instance.
schema:
type: boolean
- name: componentName
in: query
description: get the backups belong to the component
Expand Down Expand Up @@ -12927,6 +12984,9 @@ components:
default: false
description: PITREnabled or not
type: boolean
continuousBackupMethod:
description: continuous backup method for pitr
type: string
autoBackup:
default: false
description: autoBackup or not
Expand Down Expand Up @@ -14261,6 +14321,19 @@ components:
description: Enable TLS or not
type: boolean
type: object
clusterBackupMethod:
description: the backup method for cluster
properties:
full:
description: full backup method
type: string
incremental:
description: incremental backup method
type: string
continuous:
description: continuous backup method
type: string
type: object
backupType:
enum:
- Full
Expand Down Expand Up @@ -14429,6 +14502,9 @@ components:
description: specify whether to enable point-in-time recovery
default: false
type: boolean
continuousBackupMethod:
description: continuous backup method for pitr
type: string
cronExpression:
description: the crop expression for schedule
type: string
Expand Down
2 changes: 1 addition & 1 deletion apecloud
Submodule apecloud updated from 9e95cd to 3f11db
37 changes: 36 additions & 1 deletion api/kbcloud/admin/model_backup_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type BackupPolicy struct {
AutoBackupMethod *string `json:"autoBackupMethod,omitempty"`
// specify whether to enable point-in-time recovery
PitrEnabled *bool `json:"pitrEnabled,omitempty"`
// continuous backup method for pitr
ContinuousBackupMethod *string `json:"continuousBackupMethod,omitempty"`
// the crop expression for schedule
CronExpression *string `json:"cronExpression,omitempty"`
// specify whether to enable incremental backup
Expand Down Expand Up @@ -150,6 +152,34 @@ func (o *BackupPolicy) SetPitrEnabled(v bool) {
o.PitrEnabled = &v
}

// GetContinuousBackupMethod returns the ContinuousBackupMethod field value if set, zero value otherwise.
func (o *BackupPolicy) GetContinuousBackupMethod() string {
if o == nil || o.ContinuousBackupMethod == nil {
var ret string
return ret
}
return *o.ContinuousBackupMethod
}

// GetContinuousBackupMethodOk returns a tuple with the ContinuousBackupMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BackupPolicy) GetContinuousBackupMethodOk() (*string, bool) {
if o == nil || o.ContinuousBackupMethod == nil {
return nil, false
}
return o.ContinuousBackupMethod, true
}

// HasContinuousBackupMethod returns a boolean if a field has been set.
func (o *BackupPolicy) HasContinuousBackupMethod() bool {
return o != nil && o.ContinuousBackupMethod != nil
}

// SetContinuousBackupMethod gets a reference to the given string and assigns it to the ContinuousBackupMethod field.
func (o *BackupPolicy) SetContinuousBackupMethod(v string) {
o.ContinuousBackupMethod = &v
}

// GetCronExpression returns the CronExpression field value if set, zero value otherwise.
func (o *BackupPolicy) GetCronExpression() string {
if o == nil || o.CronExpression == nil {
Expand Down Expand Up @@ -372,6 +402,9 @@ func (o BackupPolicy) MarshalJSON() ([]byte, error) {
if o.PitrEnabled != nil {
toSerialize["pitrEnabled"] = o.PitrEnabled
}
if o.ContinuousBackupMethod != nil {
toSerialize["continuousBackupMethod"] = o.ContinuousBackupMethod
}
if o.CronExpression != nil {
toSerialize["cronExpression"] = o.CronExpression
}
Expand Down Expand Up @@ -406,6 +439,7 @@ func (o *BackupPolicy) UnmarshalJSON(bytes []byte) (err error) {
AutoBackup *bool `json:"autoBackup,omitempty"`
AutoBackupMethod *string `json:"autoBackupMethod,omitempty"`
PitrEnabled *bool `json:"pitrEnabled,omitempty"`
ContinuousBackupMethod *string `json:"continuousBackupMethod,omitempty"`
CronExpression *string `json:"cronExpression,omitempty"`
IncrementalBackupEnabled *bool `json:"incrementalBackupEnabled,omitempty"`
IncrementalCronExpression *string `json:"incrementalCronExpression,omitempty"`
Expand All @@ -419,7 +453,7 @@ func (o *BackupPolicy) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = common.Unmarshal(bytes, &additionalProperties); err == nil {
common.DeleteKeys(additionalProperties, &[]string{"autoBackup", "autoBackupMethod", "pitrEnabled", "cronExpression", "incrementalBackupEnabled", "incrementalCronExpression", "retentionPeriod", "backupRepo", "retentionPolicy", "nextBackupTime"})
common.DeleteKeys(additionalProperties, &[]string{"autoBackup", "autoBackupMethod", "pitrEnabled", "continuousBackupMethod", "cronExpression", "incrementalBackupEnabled", "incrementalCronExpression", "retentionPeriod", "backupRepo", "retentionPolicy", "nextBackupTime"})
} else {
return err
}
Expand All @@ -428,6 +462,7 @@ func (o *BackupPolicy) UnmarshalJSON(bytes []byte) (err error) {
o.AutoBackup = all.AutoBackup
o.AutoBackupMethod = all.AutoBackupMethod
o.PitrEnabled = all.PitrEnabled
o.ContinuousBackupMethod = all.ContinuousBackupMethod
o.CronExpression = all.CronExpression
o.IncrementalBackupEnabled = all.IncrementalBackupEnabled
o.IncrementalCronExpression = all.IncrementalCronExpression
Expand Down
37 changes: 36 additions & 1 deletion api/kbcloud/admin/model_cluster_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import "github.com/apecloud/kb-cloud-client-go/api/common"
type ClusterBackup struct {
// PITREnabled or not
PitrEnabled *bool `json:"pitrEnabled,omitempty"`
// continuous backup method for pitr
ContinuousBackupMethod *string `json:"continuousBackupMethod,omitempty"`
// autoBackup or not
AutoBackup *bool `json:"autoBackup,omitempty"`
// name of the backup method
Expand Down Expand Up @@ -90,6 +92,34 @@ func (o *ClusterBackup) SetPitrEnabled(v bool) {
o.PitrEnabled = &v
}

// GetContinuousBackupMethod returns the ContinuousBackupMethod field value if set, zero value otherwise.
func (o *ClusterBackup) GetContinuousBackupMethod() string {
if o == nil || o.ContinuousBackupMethod == nil {
var ret string
return ret
}
return *o.ContinuousBackupMethod
}

// GetContinuousBackupMethodOk returns a tuple with the ContinuousBackupMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ClusterBackup) GetContinuousBackupMethodOk() (*string, bool) {
if o == nil || o.ContinuousBackupMethod == nil {
return nil, false
}
return o.ContinuousBackupMethod, true
}

// HasContinuousBackupMethod returns a boolean if a field has been set.
func (o *ClusterBackup) HasContinuousBackupMethod() bool {
return o != nil && o.ContinuousBackupMethod != nil
}

// SetContinuousBackupMethod gets a reference to the given string and assigns it to the ContinuousBackupMethod field.
func (o *ClusterBackup) SetContinuousBackupMethod(v string) {
o.ContinuousBackupMethod = &v
}

// GetAutoBackup returns the AutoBackup field value if set, zero value otherwise.
func (o *ClusterBackup) GetAutoBackup() bool {
if o == nil || o.AutoBackup == nil {
Expand Down Expand Up @@ -362,6 +392,9 @@ func (o ClusterBackup) MarshalJSON() ([]byte, error) {
if o.PitrEnabled != nil {
toSerialize["pitrEnabled"] = o.PitrEnabled
}
if o.ContinuousBackupMethod != nil {
toSerialize["continuousBackupMethod"] = o.ContinuousBackupMethod
}
if o.AutoBackup != nil {
toSerialize["autoBackup"] = o.AutoBackup
}
Expand Down Expand Up @@ -400,6 +433,7 @@ func (o ClusterBackup) MarshalJSON() ([]byte, error) {
func (o *ClusterBackup) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
PitrEnabled *bool `json:"pitrEnabled,omitempty"`
ContinuousBackupMethod *string `json:"continuousBackupMethod,omitempty"`
AutoBackup *bool `json:"autoBackup,omitempty"`
AutoBackupMethod *string `json:"autoBackupMethod,omitempty"`
BackupRepo *string `json:"backupRepo,omitempty"`
Expand All @@ -415,13 +449,14 @@ func (o *ClusterBackup) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = common.Unmarshal(bytes, &additionalProperties); err == nil {
common.DeleteKeys(additionalProperties, &[]string{"pitrEnabled", "autoBackup", "autoBackupMethod", "backupRepo", "cronExpression", "retentionPeriod", "retentionPolicy", "snapshotVolumes", "incrementalBackupEnabled", "incrementalCronExpression"})
common.DeleteKeys(additionalProperties, &[]string{"pitrEnabled", "continuousBackupMethod", "autoBackup", "autoBackupMethod", "backupRepo", "cronExpression", "retentionPeriod", "retentionPolicy", "snapshotVolumes", "incrementalBackupEnabled", "incrementalCronExpression"})
} else {
return err
}

hasInvalidField := false
o.PitrEnabled = all.PitrEnabled
o.ContinuousBackupMethod = all.ContinuousBackupMethod
o.AutoBackup = all.AutoBackup
o.AutoBackupMethod = all.AutoBackupMethod
o.BackupRepo = all.BackupRepo
Expand Down
10 changes: 10 additions & 0 deletions api/kbcloud/api_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ type ListBackupsOptionalParameters struct {
FetchWithDeletedCluster *bool
WithDeletedBackups *bool
BackupType *string
WithRebuildInstance *bool
ComponentName *string
Page *int32
PageSize *int32
Expand Down Expand Up @@ -670,6 +671,12 @@ func (r *ListBackupsOptionalParameters) WithBackupType(backupType string) *ListB
return r
}

// WithWithRebuildInstance sets the corresponding parameter name and returns the struct.
func (r *ListBackupsOptionalParameters) WithWithRebuildInstance(withRebuildInstance bool) *ListBackupsOptionalParameters {
r.WithRebuildInstance = &withRebuildInstance
return r
}

// WithComponentName sets the corresponding parameter name and returns the struct.
func (r *ListBackupsOptionalParameters) WithComponentName(componentName string) *ListBackupsOptionalParameters {
r.ComponentName = &componentName
Expand Down Expand Up @@ -742,6 +749,9 @@ func (a *BackupApi) ListBackups(ctx _context.Context, orgName string, o ...ListB
if optionalParams.BackupType != nil {
localVarQueryParams.Add("backupType", common.ParameterToString(*optionalParams.BackupType, ""))
}
if optionalParams.WithRebuildInstance != nil {
localVarQueryParams.Add("withRebuildInstance", common.ParameterToString(*optionalParams.WithRebuildInstance, ""))
}
if optionalParams.ComponentName != nil {
localVarQueryParams.Add("componentName", common.ParameterToString(*optionalParams.ComponentName, ""))
}
Expand Down
Loading

0 comments on commit ce10d0d

Please sign in to comment.