Documentation ¶
Index ¶
- Variables
- func Bool(v bool) *bool
- func BoolV(p *bool) bool
- func Int(v int) *int
- func IntV(p *int) int
- func ListStructToParams(v interface{}) (*jsonutils.JSONDict, error)
- func ParseServerDeployInfoList(list []string) (*jsonutils.JSONDict, error)
- func StructToParams(v interface{}) (*jsonutils.JSONDict, error)
- type AlarmEventListOptions
- type BaseListOptions
- type IParamsOptions
- type PodBaseOptions
- type PodLogOptoins
- type PodShellOptions
- type ServerChangeConfigOptions
- type ServerCreateOptions
- type ServerDeleteOptions
- type ServerDeployInfo
- type ServerDeployOptions
- type ServerIdOptions
- type ServerIdsOptions
- type ServerListOptions
- type ServerMonitorOptions
- type ServerRebuildRootOptions
- type ServerResetOptions
- type ServerSaveImageOptions
- type ServerSecGroupOptions
- type ServerSendKeyOptions
- type ServerShowOptions
- type ServerStopOptions
- type ServerUpdateOptions
- type WebConsoleBaremetalOptions
- type WebConsoleOptions
Constants ¶
This section is empty.
Variables ¶
var BaseListOptionsType = reflect.TypeOf((*BaseListOptions)(nil)).Elem()
Functions ¶
func 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 ¶
BoolV returns the bool value as pointed to by the argument if it's non-nil, return false otherwise
func 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 ¶
IntV returns the integer value as pointed to by the argument if it's non-nil, return 0 otherwise
func ListStructToParams ¶
ListStructToParams converts the struct as pointed to by the argument to JSON dict params, taking into account .BaseListOptions.Params() if it exists
func StructToParams ¶
StructToParams converts the struct as pointed to by the argument to JSON dict params, ignoring any embedded in struct
Types ¶
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:"-"` }
type IParamsOptions ¶
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"` }
type PodLogOptoins ¶
type PodLogOptoins struct {
PodBaseOptions
}
type PodShellOptions ¶
type PodShellOptions struct {
PodBaseOptions
}
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 { 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"` 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>"` 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"` Hypervisor string `help:"Hypervisor type" choices:"kvm|esxi|baremetal|container|aliyun"` 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:"-"` }
type ServerDeleteOptions ¶
type ServerDeployInfo ¶
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"` }
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"` 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 ServerMonitorOptions ¶
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 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 ServerSendKeyOptions ¶
type ServerShowOptions ¶
type ServerStopOptions ¶
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"` }
type WebConsoleBaremetalOptions ¶
type WebConsoleBaremetalOptions struct { WebConsoleOptions ID string `help:"Baremetal host id or name"` }
type WebConsoleOptions ¶
type WebConsoleOptions struct {
WebconsoleUrl string `help:"Frontend webconsole url" short-token:"w" default:"$WEBCONSOLE_URL"`
}