Documentation
¶
Index ¶
- Constants
- 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 AclEntries
- type AclEntry
- type AlarmEventListOptions
- type BaseListOptions
- type IParamsOptions
- type LoadbalancerAclActionPatchOptions
- type LoadbalancerAclCreateOptions
- type LoadbalancerAclDeleteOptions
- type LoadbalancerAclGetOptions
- type LoadbalancerAclListOptions
- type LoadbalancerAclUpdateOptions
- type LoadbalancerActionStatusOptions
- type LoadbalancerAgentActionHbOptions
- type LoadbalancerAgentActionPatchParamsOptions
- type LoadbalancerAgentCreateOptions
- type LoadbalancerAgentDeleteOptions
- type LoadbalancerAgentGetOptions
- type LoadbalancerAgentListOptions
- type LoadbalancerAgentParamsOptions
- type LoadbalancerAgentUpdateOptions
- type LoadbalancerBackendCreateOptions
- type LoadbalancerBackendDeleteOptions
- type LoadbalancerBackendGetOptions
- type LoadbalancerBackendGroupCreateOptions
- type LoadbalancerBackendGroupDeleteOptions
- type LoadbalancerBackendGroupGetOptions
- type LoadbalancerBackendGroupListOptions
- type LoadbalancerBackendListOptions
- type LoadbalancerBackendUpdateOptions
- type LoadbalancerCertificateCreateOptions
- type LoadbalancerCertificateDeleteOptions
- type LoadbalancerCertificateGetOptions
- type LoadbalancerCertificateListOptions
- type LoadbalancerCertificateUpdateOptions
- type LoadbalancerCreateOptions
- type LoadbalancerDeleteOptions
- type LoadbalancerGetOptions
- type LoadbalancerListOptions
- type LoadbalancerListenerActionStatusOptions
- type LoadbalancerListenerCreateOptions
- type LoadbalancerListenerDeleteOptions
- type LoadbalancerListenerGetOptions
- type LoadbalancerListenerListOptions
- type LoadbalancerListenerRuleActionStatusOptions
- type LoadbalancerListenerRuleCreateOptions
- type LoadbalancerListenerRuleDeleteOptions
- type LoadbalancerListenerRuleGetOptions
- type LoadbalancerListenerRuleListOptions
- type LoadbalancerListenerRuleUpdateOptions
- type LoadbalancerListenerUpdateOptions
- type LoadbalancerUpdateOptions
- type PodBaseOptions
- type PodLogOptoins
- type PodShellOptions
- type ServerChangeConfigOptions
- type ServerCreateOptions
- type ServerDeleteOptions
- type ServerDeployInfo
- type ServerDeployOptions
- type ServerIdOptions
- type ServerIdsOptions
- type ServerListOptions
- type ServerLoginInfoOptions
- type ServerMonitorOptions
- type ServerRebuildRootOptions
- type ServerResetOptions
- type ServerRestartOptions
- type ServerSaveImageOptions
- type ServerSecGroupOptions
- type ServerSendKeyOptions
- type ServerShowOptions
- type ServerStopOptions
- type ServerUpdateOptions
- type WebConsoleBaremetalOptions
- type WebConsoleOptions
- type WebConsoleServerOptions
- type WebConsoleSshOptions
Constants ¶
const ( ListOrderAsc = "asc" ListOrderDesc = "desc" )
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 AclEntries ¶
type AclEntries []*AclEntry
func NewAclEntries ¶
func NewAclEntries(ss []string) AclEntries
func (AclEntries) String ¶
func (entries AclEntries) String() string
type AclEntry ¶
func NewAclEntry ¶
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 LoadbalancerAclActionPatchOptions ¶
type LoadbalancerAclCreateOptions ¶
type LoadbalancerAclDeleteOptions ¶
type LoadbalancerAclDeleteOptions struct {
ID string `json:"-"`
}
type LoadbalancerAclGetOptions ¶
type LoadbalancerAclGetOptions struct {
ID string
}
type LoadbalancerAclListOptions ¶
type LoadbalancerAclListOptions struct {
BaseListOptions
}
type LoadbalancerAclUpdateOptions ¶
type LoadbalancerAgentActionHbOptions ¶
type LoadbalancerAgentActionHbOptions struct {
ID string
}
type LoadbalancerAgentActionPatchParamsOptions ¶
type LoadbalancerAgentActionPatchParamsOptions struct {
ID string
LoadbalancerAgentParamsOptions
}
type LoadbalancerAgentCreateOptions ¶
type LoadbalancerAgentCreateOptions struct {
NAME string
HbTimeout *int
LoadbalancerAgentParamsOptions
}
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
}
type LoadbalancerBackendDeleteOptions ¶
type LoadbalancerBackendDeleteOptions struct {
ID string
}
type LoadbalancerBackendGetOptions ¶
type LoadbalancerBackendGetOptions struct {
ID string
}
type LoadbalancerBackendGroupDeleteOptions ¶
type LoadbalancerBackendGroupDeleteOptions struct {
ID string
}
type LoadbalancerBackendGroupGetOptions ¶
type LoadbalancerBackendGroupGetOptions struct {
ID string
}
type LoadbalancerBackendGroupListOptions ¶
type LoadbalancerBackendGroupListOptions struct {
BaseListOptions
Loadbalancer string
}
type LoadbalancerCertificateCreateOptions ¶
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 LoadbalancerDeleteOptions ¶
type LoadbalancerDeleteOptions struct {
ID string
}
type LoadbalancerGetOptions ¶
type LoadbalancerGetOptions struct {
ID string
}
type LoadbalancerListOptions ¶
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 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 LoadbalancerListenerUpdateOptions ¶
type LoadbalancerListenerUpdateOptions struct {
ID 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 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|azure"`
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:"-"`
}
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|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 ServerLoginInfoOptions ¶
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 ServerRestartOptions ¶
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"`
}
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"`
}