rainbond: github.com/goodrain/rainbond/api/handler/group Index | Files

package group

import "github.com/goodrain/rainbond/api/handler/group"

Index

Package Files

group_backup.go

type AppSnapshot Uses

type AppSnapshot struct {
    Services            []*RegionServiceSnapshot
    Plugins             []*dbmodel.TenantPlugin
    PluginBuildVersions []*dbmodel.TenantPluginBuildVersion
}

AppSnapshot holds a snapshot of your app

type Backup Uses

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"`
        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 Uses

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 Uses

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

BackupHandle group app backup handle

func CreateBackupHandle Uses

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

CreateBackupHandle CreateBackupHandle

func (*BackupHandle) BackupCopy Uses

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

BackupCopy BackupCopy

func (*BackupHandle) DeleteBackup Uses

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

DeleteBackup delete backup

func (*BackupHandle) GetBackup Uses

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

GetBackup get one backup info

func (*BackupHandle) GetBackupByGroupID Uses

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

GetBackupByGroupID get some backup info by group id

func (*BackupHandle) NewBackup Uses

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

NewBackup new backup task

func (*BackupHandle) RestoreBackup Uses

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

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

func (*BackupHandle) RestoreBackupResult Uses

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

RestoreBackupResult RestoreBackupResult

type BackupRestore Uses

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 Uses

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

Info service cache info

type RegionServiceSnapshot Uses

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 Uses

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

Package group imports 18 packages (graph) and is imported by 2 packages. Updated 2019-12-11. Refresh now. Tools for package owners.