group

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppSnapshot

type AppSnapshot struct {
	Services            []*RegionServiceSnapshot
	Plugins             []*dbmodel.TenantEnvPlugin
	PluginBuildVersions []*dbmodel.TenantEnvPluginBuildVersion
}

AppSnapshot holds a snapshot of your app

type Backup

type Backup struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	Body          struct {
		EventID       string   `json:"event_id" validate:"event_id|required"`
		GroupID       string   `json:"group_id" validate:"group_name|required"`
		Metadata      string   `json:"metadata,omitempty" validate:"metadata|required"`
		ServiceIDs    []string `json:"service_ids" validate:"service_ids|required"`
		Version       string   `json:"version" validate:"version|required"`
		SourceDir     string   `json:"source_dir"`
		BackupID      string   `json:"backup_id,omitempty"`
		WithImageData bool     `json:"with_image_data"`

		Mode     string `json:"mode" validate:"mode|required|in:full-online,full-offline"`
		Force    bool   `json:"force"`
		S3Config struct {
			Provider   string `json:"provider"`
			Endpoint   string `json:"endpoint"`
			AccessKey  string `json:"access_key"`
			SecretKey  string `json:"secret_key"`
			BucketName string `json:"bucket_name"`
		} `json:"s3_config"`
	}
}

Backup GroupBackup swagger:parameters groupBackup

type BackupCopy

type BackupCopy struct {
	Body struct {
		EventID string `json:"event_id" validate:"event_id|required"`
		GroupID string `json:"group_id" validate:"group_id|required"`
		//Status in starting,failed,success,restore
		Status     string `json:"status" validate:"status|required"`
		Version    string `json:"version" validate:"version|required"`
		SourceDir  string `json:"source_dir" validate:"source_dir|required"`
		SourceType string ` json:"source_type" validate:"source_type|required"`
		BackupMode string `json:"backup_mode" validate:"backup_mode|required"`
		BuckupSize int64  `json:"backup_size" validate:"backup_size|required"`
	}
}

BackupCopy BackupCopy

type BackupHandle

type BackupHandle struct {
	// contains filtered or unexported fields
}

BackupHandle group app backup handle

func CreateBackupHandle

func CreateBackupHandle(MQClient mqclient.MQClient, statusCli *client.AppRuntimeSyncClient, etcdCli *clientv3.Client) *BackupHandle

CreateBackupHandle CreateBackupHandle

func (*BackupHandle) BackupCopy

BackupCopy BackupCopy

func (*BackupHandle) DeleteBackup

func (h *BackupHandle) DeleteBackup(backupID string) error

DeleteBackup delete backup

func (*BackupHandle) GetBackup

func (h *BackupHandle) GetBackup(backupID string) (*dbmodel.AppBackup, *util.APIHandleError)

GetBackup get one backup info

func (*BackupHandle) GetBackupByGroupID

func (h *BackupHandle) GetBackupByGroupID(groupID string) ([]*dbmodel.AppBackup, *util.APIHandleError)

GetBackupByGroupID get some backup info by group id

func (*BackupHandle) NewBackup

func (h *BackupHandle) NewBackup(b Backup) (*dbmodel.AppBackup, *util.APIHandleError)

NewBackup new backup task

func (*BackupHandle) RestoreBackup

func (h *BackupHandle) RestoreBackup(br BackupRestore) (*RestoreResult, *util.APIHandleError)

RestoreBackup restore a backup version all app could be closed before restore

func (*BackupHandle) RestoreBackupResult

func (h *BackupHandle) RestoreBackupResult(restoreID string) (*RestoreResult, *util.APIHandleError)

RestoreBackupResult RestoreBackupResult

type BackupRestore

type BackupRestore struct {
	BackupID string `json:"backup_id"`
	Body     struct {
		EventID string `json:"event_id"`
		//need restore target tenant env id
		TenantEnvID string `json:"tenant_env_id"`
		//RestoreMode(cdct) current datacenter and current tenantEnv
		//RestoreMode(cdot) current datacenter and other tenantEnv
		//RestoreMode(od)     other datacenter
		RestoreMode string `json:"restore_mode"`

		S3Config struct {
			Provider   string `json:"provider"`
			Endpoint   string `json:"endpoint"`
			AccessKey  string `json:"access_key"`
			SecretKey  string `json:"secret_key"`
			BucketName string `json:"bucket_name"`
		} `json:"s3_config"`
	}
}

BackupRestore BackupRestore

type Info

type Info struct {
	ServiceID    string
	ServiceAlias string
	Status       string
	LBPorts      map[int]int
}

Info service cache info

type RegionServiceSnapshot

type RegionServiceSnapshot struct {
	ServiceID                    string
	Service                      *dbmodel.TenantEnvServices
	ServiceProbe                 []*dbmodel.TenantEnvServiceProbe
	LBMappingPort                []*dbmodel.TenantEnvServiceLBMappingPort
	ServiceEnv                   []*dbmodel.TenantEnvServiceEnvVar
	ServiceSchedulingLabels      []*dbmodel.TenantEnvServiceSchedulingLabel
	ServiceSchedulingTolerations []*dbmodel.TenantEnvServiceSchedulingToleration
	ServiceLabel                 []*dbmodel.TenantEnvServiceLabel
	ServiceMntRelation           []*dbmodel.TenantEnvServiceMountRelation
	ServiceRelation              []*dbmodel.TenantEnvServiceRelation
	ServiceStatus                string
	ServiceVolume                []*dbmodel.TenantEnvServiceVolume
	ServiceConfigFile            []*dbmodel.TenantEnvServiceConfigFile
	ServicePort                  []*dbmodel.TenantEnvServicesPort
	Versions                     []*dbmodel.VersionInfo

	PluginRelation    []*dbmodel.TenantEnvServicePluginRelation
	PluginConfigs     []*dbmodel.TenantEnvPluginVersionDiscoverConfig
	PluginEnvs        []*dbmodel.TenantEnvPluginVersionEnv
	PluginStreamPorts []*dbmodel.TenantEnvServicesStreamPluginPort
}

RegionServiceSnapshot RegionServiceSnapshot

type RestoreResult

type RestoreResult struct {
	Status        string           `json:"status"`
	Message       string           `json:"message"`
	CreateTime    time.Time        `json:"create_time"`
	ServiceChange map[string]*Info `json:"service_change"`
	BackupID      string           `json:"backup_id"`
	RestoreMode   string           `json:"restore_mode"`
	EventID       string           `json:"event_id"`
	RestoreID     string           `json:"restore_id"`
	Metadata      string           `json:"metadata"`
	CacheDir      string           `json:"cache_dir"`
}

RestoreResult RestoreResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL