group

package
v5.1.1-release+incompa... Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 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 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"`
		Mode       string   `json:"mode" validate:"mode|required|in:full-online,full-offline"`
		Version    string   `json:"version" validate:"version|required"`
		SlugInfo   struct {
			Namespace   string `json:"namespace"`
			FTPHost     string `json:"ftp_host"`
			FTPPort     string `json:"ftp_port"`
			FTPUser     string `json:"ftp_username"`
			FTPPassword string `json:"ftp_password"`
		} `json:"slug_info,omitempty"`
		ImageInfo struct {
			HubURL      string `json:"hub_url"`
			HubUser     string `json:"hub_user"`
			HubPassword string `json:"hub_password"`
			Namespace   string `json:"namespace"`
			IsTrust     bool   `json:"is_trust,omitempty"`
		} `json:"image_info,omitempty"`
		SourceDir string `json:"source_dir"`
		BackupID  string `json:"backup_id,omitempty"`
	}
}

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 int    `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) *util.APIHandleError

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 {
		SlugInfo struct {
			Namespace   string `json:"namespace"`
			FTPHost     string `json:"ftp_host"`
			FTPPort     string `json:"ftp_port"`
			FTPUser     string `json:"ftp_username"`
			FTPPassword string `json:"ftp_password"`
		} `json:"slug_info,omitempty"`
		ImageInfo struct {
			HubURL      string `json:"hub_url"`
			HubUser     string `json:"hub_user"`
			HubPassword string `json:"hub_password"`
			Namespace   string `json:"namespace"`
			IsTrust     bool   `json:"is_trust,omitempty"`
		} `json:"image_info,omitempty"`
		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"`
	}
}

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
	PluginRelation     []*dbmodel.TenantServicePluginRelation
	ServiceRelation    []*dbmodel.TenantServiceRelation
	ServiceStatus      string
	ServiceVolume      []*dbmodel.TenantServiceVolume
	ServicePort        []*dbmodel.TenantServicesPort
	Versions           []*dbmodel.VersionInfo
	PluginConfigs      []*dbmodel.TenantPluginVersionDiscoverConfig
}

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