group

package
v5.2.0-beta2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: LGPL-3.0 Imports: 18 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.TenantPlugin
	PluginBuildVersions []*dbmodel.TenantPluginBuildVersion
}

AppSnapshot holds a snapshot of your app

type Backup

type Backup struct {
	// in: path
	// required: true
	TenantName string `json:"tenant_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"`

		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 id
		TenantID string `json:"tenant_id"`
		//RestoreMode(cdct) current datacenter and current tenant
		//RestoreMode(cdot) current datacenter and other tenant
		//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.TenantServices
	ServiceProbe       []*dbmodel.TenantServiceProbe
	LBMappingPort      []*dbmodel.TenantServiceLBMappingPort
	ServiceEnv         []*dbmodel.TenantServiceEnvVar
	ServiceLabel       []*dbmodel.TenantServiceLable
	ServiceMntRelation []*dbmodel.TenantServiceMountRelation
	ServiceRelation    []*dbmodel.TenantServiceRelation
	ServiceStatus      string
	ServiceVolume      []*dbmodel.TenantServiceVolume
	ServicePort        []*dbmodel.TenantServicesPort
	Versions           []*dbmodel.VersionInfo

	PluginRelation    []*dbmodel.TenantServicePluginRelation
	PluginConfigs     []*dbmodel.TenantPluginVersionDiscoverConfig
	PluginEnvs        []*dbmodel.TenantPluginVersionEnv
	PluginStreamPorts []*dbmodel.TenantServicesStreamPluginPort
}

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