options

package
v2.3.20181123+incompat... Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListOrderAsc  = "asc"
	ListOrderDesc = "desc"
)

Variables

View Source
var BaseListOptionsType = reflect.TypeOf((*BaseListOptions)(nil)).Elem()

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer to bool type with the same value as the argument. This is intended to be used for literal initialization of options

func BoolV

func BoolV(p *bool) bool

BoolV returns the bool value as pointed to by the argument if it's non-nil, return false otherwise

func Int

func Int(v int) *int

Int returns a pointer to int type with the same value as the argument. This is intended to be used for literal initialization of options

func IntV

func IntV(p *int) int

IntV returns the integer value as pointed to by the argument if it's non-nil, return 0 otherwise

func ListStructToParams

func ListStructToParams(v interface{}) (*jsonutils.JSONDict, error)

ListStructToParams converts the struct as pointed to by the argument to JSON dict params, taking into account .BaseListOptions.Params() if it exists

func ParseServerDeployInfoList

func ParseServerDeployInfoList(list []string) (*jsonutils.JSONDict, error)

func StructToParams

func StructToParams(v interface{}) (*jsonutils.JSONDict, error)

StructToParams converts the struct as pointed to by the argument to JSON dict params, ignoring any embedded in struct

Types

type AclEntries

type AclEntries []*AclEntry

func NewAclEntries

func NewAclEntries(ss []string) AclEntries

func (AclEntries) String

func (entries AclEntries) String() string

type AclEntry

type AclEntry struct {
	Cidr    string
	Comment string
}

func NewAclEntry

func NewAclEntry(s string) *AclEntry

func (*AclEntry) String

func (entry *AclEntry) String() string

type AlarmEventListOptions

type AlarmEventListOptions struct {
	BaseListOptions
	NodeLabels     string `help:"Service tree node labels"`
	MetricName     string `help:"Metric name"`
	HostName       string `help:"Host name"`
	HostIp         string `help:"Host IP address"`
	AlarmLevel     string `help:"Alarm level"`
	AlarmCondition string `help:"Concrete alarm rule"`
	Template       string `help:"Template number of the alarm condition"`
	AckStatus      string `help:"Alarm event ack status"`
}

type BaseListOptions

type BaseListOptions struct {
	Limit            *int     `default:"20" help:"Page limit"`
	Offset           *int     `default:"0" help:"Page offset"`
	OrderBy          []string `help:"Name of the field to be ordered by"`
	Order            string   `help:"List order" choices:"desc|asc"`
	Details          *bool    `help:"Show more details" default:"false"`
	Search           string   `help:"Filter results by a simple keyword search"`
	Meta             *bool    `help:"Piggyback metadata information"`
	Filter           []string `help:"Filters"`
	JointFilter      []string `help:"Filters with joint table col; joint_tbl.related_key(origin_key).filter_col.filter_cond(filters)"`
	FilterAny        *bool    `help:"If true, match if any of the filters matches; otherwise, match if all of the filters match"`
	Admin            *bool    `help:"Is an admin call?"`
	Tenant           string   `help:"Tenant ID or Name"`
	User             string   `help:"User ID or Name"`
	System           *bool    `help:"Show system resource"`
	PendingDelete    *bool    `help:"Show only pending deleted resource"`
	PendingDeleteAll *bool    `help:"Show all resources including pending deleted" json:"-"`
	Field            []string `help:"Show only specified fields"`
	ShowEmulated     *bool    `help:"Show all resources including the emulated resources"`
	ExportFile       string   `help:"Export to file" metavar:"<EXPORT_FILE_PATH>" json:"-"`
	ExportKeys       string   `help:"Export field keys"`
	ExportTexts      string   `help:"Export field displayname texts" json:"-"`
}

func (*BaseListOptions) Params

func (opts *BaseListOptions) Params() (*jsonutils.JSONDict, error)

type DNSCreateOptions

type DNSCreateOptions struct {
	NAME     string `help:"DNS name to create"`
	TTL      int64  `help:"TTL in seconds" positional:"false"`
	Desc     string `help:"Description" json:"description"`
	IsPublic *bool  `help:"Make the newly created record public to all"`

	DNSRecordOptions
}

func (*DNSCreateOptions) Params

func (opts *DNSCreateOptions) Params() (*jsonutils.JSONDict, error)

type DNSGetOptions

type DNSGetOptions struct {
	ID string `help:"ID of DNS record to show" json:"-"`
}

type DNSListOptions

type DNSListOptions struct {
	BaseListOptions

	IsPublic string `choices:"0|1"`
}

type DNSRecordOptions

type DNSRecordOptions struct {
	A     []string `help:"DNS A record" metavar:"A_RECORD" positional:"false"`
	AAAA  []string `help:"DNS AAAA record" metavar:"AAAA_RECORD" positional:"false"`
	CNAME string   `help:"DNS CNAME record" metavar:"CNAME_RECORD" positional:"false"`
	PTR   string   `help:"DNS PTR record" metavar:"PTR_RECORD" positional:"false"`

	SRVHost string   `help:"(deprecated) DNS SRV record, server of service" metavar:"SRV_RECORD_HOST" positional:"false"`
	SRVPort int64    `help:"(deprecated) DNS SRV record, port of service" metavar:"SRV_RECORD_PORT" positional:"false"`
	SRV     []string `help:"DNS SRV record, in the format of host:port:weight:priority" metavar:"SRV_RECORD" positional:"false"`
}

type DNSUpdateOptions

type DNSUpdateOptions struct {
	ID   string `help:"ID of DNS record to update" json:"-"`
	Name string `help:"Domain name"`
	TTL  int64  `help:"TTL in seconds" positional:"false"`
	Desc string `help:"Description" json:"description"`

	DNSRecordOptions
}

func (*DNSUpdateOptions) Params

func (opts *DNSUpdateOptions) Params() (*jsonutils.JSONDict, error)

type DNSUpdateRecordsOptions

type DNSUpdateRecordsOptions struct {
	ID string `help:"ID of dns record to modify" json:"-"`

	DNSRecordOptions
}

func (*DNSUpdateRecordsOptions) Params

func (opts *DNSUpdateRecordsOptions) Params() (*jsonutils.JSONDict, error)

type IParamsOptions

type IParamsOptions interface {
	Params() (*jsonutils.JSONDict, error)
}

type LoadbalancerAclActionPatchOptions

type LoadbalancerAclActionPatchOptions struct {
	ID  string   `json:"-"`
	Add []string `help:"acl entry with cidr and comment separated by #, e.g. 10.9.0.0/16#no comment" json:"-"`
	Del []string `help:"acl entry with cidr and comment separated by #, e.g. 10.9.0.0/16#no comment" json:"-"`
}

func (*LoadbalancerAclActionPatchOptions) Params

type LoadbalancerAclCreateOptions

type LoadbalancerAclCreateOptions struct {
	NAME     string
	AclEntry []string `help:"acl entry with cidr and comment separated by #, e.g. 10.9.0.0/16#no comment" json:"-"`
}

func (*LoadbalancerAclCreateOptions) Params

type LoadbalancerAclDeleteOptions

type LoadbalancerAclDeleteOptions struct {
	ID string `json:"-"`
}

type LoadbalancerAclGetOptions

type LoadbalancerAclGetOptions struct {
	ID string
}

type LoadbalancerAclListOptions

type LoadbalancerAclListOptions struct {
	BaseListOptions
}

type LoadbalancerAclUpdateOptions

type LoadbalancerAclUpdateOptions struct {
	ID   string `json:"-"`
	Name string

	AclEntry []string `help:"acl entry with cidr and comment separated by #, e.g. 10.9.0.0/16#no comment" json:"-"`
}

func (*LoadbalancerAclUpdateOptions) Params

type LoadbalancerActionStatusOptions

type LoadbalancerActionStatusOptions struct {
	ID     string
	Status string `choices:"enabled|disabled"`
}

type LoadbalancerAgentActionHbOptions

type LoadbalancerAgentActionHbOptions struct {
	ID string
}

type LoadbalancerAgentActionPatchParamsOptions

type LoadbalancerAgentActionPatchParamsOptions struct {
	ID string

	LoadbalancerAgentParamsOptions
}

func (*LoadbalancerAgentActionPatchParamsOptions) Params

type LoadbalancerAgentCreateOptions

type LoadbalancerAgentCreateOptions struct {
	NAME      string
	HbTimeout *int

	LoadbalancerAgentParamsOptions
}

func (*LoadbalancerAgentCreateOptions) Params

type LoadbalancerAgentDeleteOptions

type LoadbalancerAgentDeleteOptions struct {
	ID string
}

type LoadbalancerAgentGetOptions

type LoadbalancerAgentGetOptions struct {
	ID string
}

type LoadbalancerAgentListOptions

type LoadbalancerAgentListOptions struct {
	BaseListOptions
}

type LoadbalancerAgentParamsOptions

type LoadbalancerAgentParamsOptions struct {
	KeepalivedConfTmpl string
	HaproxyConfTmpl    string

	VrrpPriority          *int // required
	VrrpVirtualRouterId   *int // required
	VrrpGarpMasterRefresh *int
	VrrpPreempt           string `choices:"true|false"`
	VrrpInterface         string // required
	VrrpAdvertInt         *int
	VrrpPass              string

	HaproxyGlobalLog      string
	HaproxyGlobalNbthread *int   `help:"enable experimental multi-threading support available since haproxy 1.8"`
	HaproxyLogHttp        string `choices:"true|false"`
	HaproxyLogTcp         string `choices:"true|false"`
	HaproxyLogNormal      string `choices:"true|false"`

	TelegrafInfluxDbOutputUrl    string
	TelegrafInfluxDbOutputName   string
	TelegrafHaproxyInputInterval int
}

func (*LoadbalancerAgentParamsOptions) Params

type LoadbalancerAgentUpdateOptions

type LoadbalancerAgentUpdateOptions struct {
	ID   string
	Name string

	HbTimeout *int

	Loadbalancers             *time.Time
	LoadbalancerListeners     *time.Time
	LoadbalancerListenerRules *time.Time
	LoadbalancerBackendGroups *time.Time
	LoadbalancerBackends      *time.Time
	LoadbalancerAcls          *time.Time
	LoadbalancerCertificates  *time.Time
}

type LoadbalancerBackendCreateOptions

type LoadbalancerBackendCreateOptions struct {
	BackendGroup string `required:"true"`
	Backend      string `required:"true"`
	BackendType  string `default:"guest"`
	Port         *int   `required:"true"`
	Weight       *int   `default:"1"`
}

type LoadbalancerBackendDeleteOptions

type LoadbalancerBackendDeleteOptions struct {
	ID string
}

type LoadbalancerBackendGetOptions

type LoadbalancerBackendGetOptions struct {
	ID string
}

type LoadbalancerBackendGroupCreateOptions

type LoadbalancerBackendGroupCreateOptions struct {
	NAME         string
	Loadbalancer string
}

type LoadbalancerBackendGroupDeleteOptions

type LoadbalancerBackendGroupDeleteOptions struct {
	ID string
}

type LoadbalancerBackendGroupGetOptions

type LoadbalancerBackendGroupGetOptions struct {
	ID string
}

type LoadbalancerBackendGroupListOptions

type LoadbalancerBackendGroupListOptions struct {
	BaseListOptions
	Loadbalancer string
}

type LoadbalancerBackendGroupUpdateOptions

type LoadbalancerBackendGroupUpdateOptions struct {
	ID   string
	Name string
}

type LoadbalancerBackendListOptions

type LoadbalancerBackendListOptions struct {
	BaseListOptions
	BackendGroup string
	Backend      string
	BackendType  string
	Weight       *int
	Address      string
	Port         *int
}

type LoadbalancerBackendUpdateOptions

type LoadbalancerBackendUpdateOptions struct {
	ID   string
	Name string

	Weight *int
	Port   *int
}

type LoadbalancerCertificateCreateOptions

type LoadbalancerCertificateCreateOptions struct {
	NAME string

	Cert string `required:"true" json:"-" help:"path to certificate file"`
	Pkey string `required:"true" json:"-" help:"path to private key file"`
}

func (*LoadbalancerCertificateCreateOptions) Params

type LoadbalancerCertificateDeleteOptions

type LoadbalancerCertificateDeleteOptions struct {
	ID string
}

type LoadbalancerCertificateGetOptions

type LoadbalancerCertificateGetOptions struct {
	ID string
}

type LoadbalancerCertificateListOptions

type LoadbalancerCertificateListOptions struct {
	BaseListOptions

	PublicKeyAlgorithm string
	PublicKeyBitLen    *int
	SignatureAlgorithm string
}

type LoadbalancerCertificateUpdateOptions

type LoadbalancerCertificateUpdateOptions struct {
	ID   string
	Name string

	Cert string `json:"-" help:"path to certificate file"`
	Pkey string `json:"-" help:"path to private key file"`
}

func (*LoadbalancerCertificateUpdateOptions) Params

type LoadbalancerCreateOptions

type LoadbalancerCreateOptions struct {
	NAME    string
	Network string
	Address string
}

type LoadbalancerDeleteOptions

type LoadbalancerDeleteOptions struct {
	ID string
}

type LoadbalancerGetOptions

type LoadbalancerGetOptions struct {
	ID string
}

type LoadbalancerListOptions

type LoadbalancerListOptions struct {
	BaseListOptions
	Zone         string
	Address      string
	AddressType  string `choices:"intranet|internet"`
	NetworkType  string `choices:"classic|vpc"`
	Network      string
	BackendGroup string
}

type LoadbalancerListenerActionStatusOptions

type LoadbalancerListenerActionStatusOptions struct {
	ID     string
	Status string `choices:"enabled|disabled"`
}

type LoadbalancerListenerCreateOptions

type LoadbalancerListenerCreateOptions struct {
	NAME string

	Loadbalancer string `required:"true"`
	ListenerType string `required:"true" choices:"tcp|udp|http|https"`
	ListenerPort *int   `required:"true"`
	BackendGroup string

	Scheduler string `required:"true" choices:"rr|wrr|wlc|sch|tch"`
	Bandwidth *int

	ClientRequestTimeout  *int
	ClientIdleTimeout     *int
	BackendConnectTimeout *int
	BackendIdleTimeout    *int

	AclStatus string `choices:"on|off"`
	AclType   string `choices:"black|white"`
	Acl       string

	HealthCheck     string `choices:"on|off"`
	HealthCheckType string `choices:"tcp|http"`

	HealthCheckDomain   string
	HealthCheckURI      string
	HealthCheckHttpCode string

	HealthCheckRise     *int
	HealthCheckFall     *int
	HealthCheckInterval *int
	HealthCheckTimeout  *int

	HealthCheckReq string
	HealthCheckExp string

	StickySession              string
	StickySessionType          string
	StickySessionCookie        string
	StickySessionCookieTimeout *int

	XForwardedFor string `choices:"true|false"`
	Gzip          string `choices:"true|false"`

	Certificate     string
	TLSCipherPolicy string
	EnableHttp2     string `choices:"true|false"`
}

type LoadbalancerListenerDeleteOptions

type LoadbalancerListenerDeleteOptions struct {
	ID string
}

type LoadbalancerListenerGetOptions

type LoadbalancerListenerGetOptions struct {
	ID string
}

type LoadbalancerListenerListOptions

type LoadbalancerListenerListOptions struct {
	BaseListOptions

	Loadbalancer string
	ListenerType string `choices:"tcp|udp|http|https"`
	ListenerPort *int
	BackendGroup string

	Scheduler string `choices:"rr|wrr|wlc|sch|tch"`
	Bandwidth *int

	ClientRequestTimeout  *int
	ClientIdleTimeout     *int
	BackendConnectTimeout *int
	BackendIdleTimeout    *int

	AclStatus string `choices:"on|off"`
	AclType   string `choices:"black|white"`
	Acl       string

	HealthCheck     string `choices:"on|off"`
	HealthCheckType string `choices:"tcp|http"`

	HealthCheckDomain   string
	HealthCheckURI      string
	HealthCheckHttpCode string

	HealthCheckRise     *int
	HealthCheckFall     *int
	HealthCheckInterval *int
	HealthCheckTimeout  *int

	HealthCheckReq string
	HealthCheckExp string

	StickySession              string
	StickySessionType          string
	StickySessionCookie        string
	StickySessionCookieTimeout *int

	XForwardedFor string `choices:"true|false"`
	Gzip          string `choices:"true|false"`

	Certificate     string
	TLSCipherPolicy string
	EnableHttp2     string `choices:"true|false"`
}

type LoadbalancerListenerRuleActionStatusOptions

type LoadbalancerListenerRuleActionStatusOptions struct {
	ID     string
	Status string `choices:"enabled|disabled"`
}

type LoadbalancerListenerRuleCreateOptions

type LoadbalancerListenerRuleCreateOptions struct {
	NAME         string
	Listener     string `required:"true"`
	BackendGroup string
	Domain       string
	Path         string
}

type LoadbalancerListenerRuleDeleteOptions

type LoadbalancerListenerRuleDeleteOptions struct {
	ID string
}

type LoadbalancerListenerRuleGetOptions

type LoadbalancerListenerRuleGetOptions struct {
	ID string
}

type LoadbalancerListenerRuleListOptions

type LoadbalancerListenerRuleListOptions struct {
	BaseListOptions

	BackendGroup string
	Listener     string
	Domain       string
	Path         string
}

type LoadbalancerListenerRuleUpdateOptions

type LoadbalancerListenerRuleUpdateOptions struct {
	ID   string
	Name string

	BackendGroup string
}

type LoadbalancerListenerUpdateOptions

type LoadbalancerListenerUpdateOptions struct {
	ID   string
	Name string

	BackendGroup string

	Scheduler string `choices:"rr|wrr|wlc|sch|tch"`
	Bandwidth *int

	ClientRequestTimeout  *int
	ClientIdleTimeout     *int
	BackendConnectTimeout *int
	BackendIdleTimeout    *int

	AclStatus string `choices:"on|off"`
	AclType   string `choices:"black|white"`
	Acl       string

	HealthCheck     string `choices:"on|off"`
	HealthCheckType string `choices:"tcp|http"`

	HealthCheckDomain   string
	HealthCheckURI      string
	HealthCheckHttpCode string

	HealthCheckRise     *int
	HealthCheckFall     *int
	HealthCheckInterval *int
	HealthCheckTimeout  *int

	HealthCheckReq string
	HealthCheckExp string

	StickySession              string
	StickySessionType          string
	StickySessionCookie        string
	StickySessionCookieTimeout *int

	XForwardedFor string `choices:"true|false"`
	Gzip          string `choices:"true|false"`

	Certificate     string
	TLSCipherPolicy string
	EnableHttp2     string `choices:"true|false"`
}

type LoadbalancerUpdateOptions

type LoadbalancerUpdateOptions struct {
	ID   string
	Name string

	BackendGroup string
}

type PodBaseOptions

type PodBaseOptions struct {
	WebConsoleOptions
	NAME      string `help:"Name of k8s pod to connect"`
	Namespace string `help:"Namespace of this pod"`
	Container string `help:"Container in this pod"`
	Cluster   string `default:"$K8S_CLUSTER|default" help:"Kubernetes cluster name"`
}

func (*PodBaseOptions) Params

func (opt *PodBaseOptions) Params() (*jsonutils.JSONDict, error)

type PodLogOptoins

type PodLogOptoins struct {
	PodBaseOptions
}

type PodShellOptions

type PodShellOptions struct {
	PodBaseOptions
}

type ScheduleOptions

type ScheduleOptions struct {
	Zone       string   `help:"Preferred zone where virtual server should be created" json:"prefer_zone"`
	Host       string   `help:"Preferred host where virtual server should be created" json:"prefer_host"`
	Schedtag   []string `help:"Schedule policy, key = aggregate name, value = require|exclude|prefer|avoid" metavar:"<KEY:VALUE>"`
	Hypervisor string   `help:"Hypervisor type" choices:"kvm|esxi|baremetal|container|aliyun|azure|qcloud"`
}

func (*ScheduleOptions) Params

func (opts *ScheduleOptions) Params() (*jsonutils.JSONDict, error)

type ServerChangeConfigOptions

type ServerChangeConfigOptions struct {
	ID   string   `help:"Server to rebuild root" json:"-"`
	Ncpu *int     `help:"New number of Virtual CPU cores" json:"vcpu_count"`
	Vmem string   `help:"New memory size" json:"vmem_size"`
	Disk []string `help:"Data disk description, from the 1st data disk to the last one, empty string if no change for this data disk"`
}

type ServerCreateOptions

type ServerCreateOptions struct {
	ScheduleOptions
	NAME             string   `help:"Name of server"`
	MEM              string   `help:"Memory size" metavar:"MEMORY" json:"vmem_size"`
	Disk             []string `help:"Disk descriptions" nargs:"+"`
	Net              []string `help:"Network descriptions" metavar:"NETWORK"`
	IsolatedDevice   []string `help:"Isolated device model or ID" metavar:"ISOLATED_DEVICE"`
	Keypair          string   `help:"SSH Keypair"`
	Password         string   `help:"Default user password"`
	Iso              string   `help:"ISO image ID" metavar:"IMAGE_ID" json:"cdrom"`
	Ncpu             *int     `help:"#CPU cores of VM server, default 1" default:"1" metavar:"<SERVER_CPU_COUNT>" json:"vcpu_count"`
	Vga              string   `help:"VGA driver" choices:"std|vmware|cirrus|qxl"`
	Vdi              string   `help:"VDI protocool" choices:"vnc|spice"`
	Bios             string   `help:"BIOS" choices:"BIOS|UEFI"`
	Desc             string   `help:"Description" metavar:"<DESCRIPTION>" json:"description"`
	Boot             string   `help:"Boot device" metavar:"<BOOT_DEVICE>" choices:"disk|cdrom" json:"-"`
	NoAccountInit    *bool    `help:"Not reset account password"`
	AllowDelete      *bool    `help:"Unlock server to allow deleting" json:"-"`
	ShutdownBehavior string   `help:"Behavior after VM server shutdown, stop or terminate server" metavar:"<SHUTDOWN_BEHAVIOR>" choices:"stop|terminate"`
	AutoStart        *bool    `help:"Auto start server after it is created"`
	Deploy           []string `help:"Specify deploy files in virtual server file system" json:"-"`
	Group            []string `help:"Group of virtual server"`
	Project          string   `help:"'Owner project ID or Name" json:"tenant"`
	User             string   `help:"Owner user ID or Name"`
	System           *bool    `help:"Create a system VM, sysadmin ONLY option" json:"is_system"`
	TaskNotify       *bool    `help:"Setup task notify" json:"-"`
	Count            *int     `help:"Create multiple simultaneously" default:"1" json:"-"`
	DryRun           *bool    `help:"Dry run to test scheduler" json:"-"`
	RaidConfig       []string `help:"Baremetal raid config" json:"-"`
	UserDataFile     string   `help:"user_data file path" json:"-"`
}

func (*ServerCreateOptions) Params

func (opts *ServerCreateOptions) Params() (*jsonutils.JSONDict, error)

type ServerDeleteOptions

type ServerDeleteOptions struct {
	ID                    []string `help:"ID of servers to operate" metavar:"SERVER" json:"-"`
	OverridePendingDelete *bool    `help:"Delete server directly instead of pending delete"`
}

type ServerDeployInfo

type ServerDeployInfo struct {
	Action  string
	Path    string
	Content string
}

func ParseServerDeployInfo

func ParseServerDeployInfo(info string) (*ServerDeployInfo, error)

type ServerDeployOptions

type ServerDeployOptions struct {
	ID            string   `help:"ID or Name of server" json:"-"`
	Keypair       string   `help:"ssh Keypair used for login" json:"-"`
	DeleteKeypair *bool    `help:"Remove ssh Keypairs" json:"-"`
	Deploy        []string `help:"Specify deploy files in virtual server file system" json:"-"`
	ResetPassword *bool    `help:"Force reset password"`
	Password      string   `help:"Default user password"`
	AutoStart     *bool    `help:"Auto start server after deployed"`
}

func (*ServerDeployOptions) Params

func (opts *ServerDeployOptions) Params() (*jsonutils.JSONDict, error)

type ServerIdOptions

type ServerIdOptions struct {
	ID string `help:"ID or name of the server" json:"-"`
}

type ServerIdsOptions

type ServerIdsOptions struct {
	ID []string `help:"ID of servers to operate" metavar:"SERVER" json:"-"`
}

type ServerListOptions

type ServerListOptions struct {
	Zone          string `help:"Zone ID or Name"`
	Wire          string `help:"Wire ID or Name"`
	Network       string `help:"Network ID or Name"`
	Disk          string `help:"Disk ID or Name"`
	Host          string `help:"Host ID or Name"`
	Baremetal     *bool  `help:"Show baremetal servers"`
	Gpu           *bool  `help:"Show gpu servers"`
	Secgroup      string `help:"Secgroup ID or Name"`
	AdminSecgroup string `help:"AdminSecgroup ID or Name"`
	Hypervisor    string `help:"Show server of hypervisor" choices:"kvm|esxi|container|baremetal|aliyun|azure"`
	Manager       string `help:"Show servers imported from manager"`
	Region        string `help:"Show servers in cloudregion"`
	WithEip       *bool  `help:"Show Servers with EIP"`
	WithoutEip    *bool  `help:"Show Servers without EIP"`

	BaseListOptions
}

type ServerLiveMigrateOptions

type ServerLiveMigrateOptions struct {
	ID         string `help:"ID of server" json:"-"`
	PreferHost string `help:"Server migration prefer host id or name" json:"prefer_host"`
}

type ServerLoginInfoOptions

type ServerLoginInfoOptions struct {
	ID  string `help:"ID or name of the server" json:"-"`
	Key string `help:"File name of private key, if password is encrypted by key"`
}

type ServerMigrateOptions

type ServerMigrateOptions struct {
	ID         string `help:"ID of server" json:"-"`
	PreferHost string `help:"Server migration prefer host id or name" json:"prefer_host"`
	RescueMode *bool  `help:"Migrate server in rescue mode,
					  all disk must store in shared storage;
					  default false" json:"rescue_mode"`
}

type ServerMonitorOptions

type ServerMonitorOptions struct {
	ID      string `help:"ID or Name of server" json:"-"`
	COMMAND string `help:"Qemu Monitor command to send"`
}

type ServerRebuildRootOptions

type ServerRebuildRootOptions struct {
	ID            string `help:"Server to rebuild root" json:"-"`
	Image         string `help:"New root Image template ID" json:"image_id"`
	Keypair       string `help:"ssh Keypair used for login"`
	Password      string `help:"Default user password"`
	NoAccountInit *bool  `help:"Not reset account password"`
	AutoStart     *bool  `help:"Auto start server after it is created"`
}

type ServerResetOptions

type ServerResetOptions struct {
	ID   []string `help:"ID of servers to operate" metavar:"SERVER" json:"-"`
	Hard *bool    `help:"Hard reset or not; default soft" json:"is_hard"`
}

type ServerRestartOptions

type ServerRestartOptions struct {
	ID      []string `help:"ID of servers to operate" metavar:"SERVER" json:"-"`
	IsForce *bool    `help:"Force reset or not; default false" json:"is_force"`
}

type ServerSaveImageOptions

type ServerSaveImageOptions struct {
	ID        string `help:"ID or name of server" json:"-"`
	IMAGE     string `help:"Image name" json:"name"`
	Public    *bool  `help:"Make the image public available" json:"is_public"`
	Format    string `help:"image format" choices:"vmdk|qcow2"`
	Notes     string `help:"Notes about the image"`
	AutoStart *bool  `help:"Auto start server after image saved"`
}

type ServerSecGroupOptions

type ServerSecGroupOptions struct {
	ID     string `help:"ID or Name of server" metavar:"Guest" json:"-"`
	Secgrp string `help:"ID of Security Group" metavar:"Security Group" positional:"true"`
}

type ServerSendKeyOptions

type ServerSendKeyOptions struct {
	ID   string `help:"ID or Name of server" metavar:"Guest" json:"-"`
	KEYS string `help:"Special keys to send, eg. ctrl, alt, f12, shift, etc, separated by \"-\""`
	Hold *uint  `help:"Hold key for specified milliseconds" json:"duration"`
}

type ServerShowOptions

type ServerShowOptions struct {
	ID       string `help:"ID or name of the server" json:"-"`
	WithMeta *bool  `help:"With meta data"`
}

type ServerStopOptions

type ServerStopOptions struct {
	ID    []string `help:"ID or Name of server" json:"-"`
	Force *bool    `help:"Stop server forcefully" json:"is_force"`
}

type ServerUpdateOptions

type ServerUpdateOptions struct {
	ID               []string `help:"IDs or Names of servers to update" json:"-"`
	Name             string   `help:"New name to change"`
	Vmem             string   `help:"Memory size" json:"vmem_size"`
	Ncpu             *int     `help:"CPU count" json:"vcpu_count"`
	Vga              string   `help:"VGA driver" choices:"std|vmware|cirrus|qxl"`
	Vdi              string   `help:"VDI protocol" choices:"vnc|spice"`
	Bios             string   `help:"BIOS" choices:"BIOS|UEFI"`
	Desc             string   `help:"Description" json:"description"`
	Boot             string   `help:"Boot device" choices:"disk|cdrom"`
	Delete           string   `help:"Lock server to prevent from deleting" choices:"enable|disable" json:"-"`
	ShutdownBehavior string   `help:"Behavior after VM server shutdown, stop or terminate server" choices:"stop|terminate"`
}

func (*ServerUpdateOptions) Params

func (opts *ServerUpdateOptions) Params() (*jsonutils.JSONDict, error)

type WebConsoleBaremetalOptions

type WebConsoleBaremetalOptions struct {
	WebConsoleOptions
	ID string `help:"Baremetal host id or name"`
}

func (*WebConsoleBaremetalOptions) Params

type WebConsoleOptions

type WebConsoleOptions struct {
	WebconsoleUrl string `help:"Frontend webconsole url" short-token:"w" default:"$WEBCONSOLE_URL"`
}

type WebConsoleServerOptions

type WebConsoleServerOptions struct {
	WebConsoleOptions
	ID string `help:"Server id or name"`
}

type WebConsoleSshOptions

type WebConsoleSshOptions struct {
	WebConsoleOptions
	IP string `help:"IP to connect"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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