Documentation
¶
Index ¶
- type BandwidthReq
- type BandwidthResp
- type GetIpReq
- type GetIpResp
- type HardOffReq
- type HardOffResp
- type HardRebootReq
- type HardRebootResp
- type HostnameReq
- type HostnameResp
- type IpNumReq
- type IpNumResp
- type LockReq
- type LockResp
- type MainipReq
- type MainipResp
- type OffReq
- type OffResp
- type OnReq
- type OnResp
- type PanelPassReq
- type PanelPassResp
- type PasswordReq
- type PasswordResp
- type RealDataReq
- type RealDataResp
- type RebootReq
- type RebootResp
- type ReinstallReq
- type ReinstallResp
- type RescueEnterReq
- type RescueEnterResp
- type RescueExitReq
- type RescueExitResp
- type ResumeReq
- type ResumeResp
- type StatusReq
- type StatusResp
- type SuspendReq
- type SuspendResp
- type SwitchVpcReq
- type SwitchVpcResp
- type UnSuspendReq
- type UnSuspendResp
- type UnlockReq
- type UnlockResp
- type VncReq
- type VncResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BandwidthReq ¶
type BandwidthReq struct {
ID uint `json:"-"` // 实例ID
InBw int `json:"in_bw"` // 进带宽
OutBw int `json:"out_bw"` // 出带宽
}
func (*BandwidthReq) Body ¶
func (r *BandwidthReq) Body() any
func (*BandwidthReq) Form ¶
func (r *BandwidthReq) Form() (form url.Values)
func (*BandwidthReq) Header ¶
func (r *BandwidthReq) Header() http.Header
func (*BandwidthReq) Method ¶
func (r *BandwidthReq) Method() string
func (*BandwidthReq) Url ¶
func (r *BandwidthReq) Url() string
func (*BandwidthReq) Values ¶
func (r *BandwidthReq) Values() (values url.Values)
type BandwidthResp ¶
type BandwidthResp struct{}
func Bandwidth ¶
func Bandwidth(ctx *cloudplatform.Context, req *BandwidthReq) (*BandwidthResp, error)
Bandwidth 修改实例带宽
type GetIpResp ¶
type GetIpResp struct {
NetworkType string `json:"network_type"` // 网络类型(normal=经典网络,vpc=VPC网络)
Interface []struct {
Name string `json:"name"` // 网卡名称
PublicIp []struct {
Id int `json:"id"` // 网卡公网IP ID
Ip string `json:"ip"` // 网卡公网IP地址
} `json:"public_ip"`
PrivateIp string `json:"private_ip"` // 网卡内网IP地址
} `json:"interface"`
PublicIp []struct {
Id int `json:"id"` // 网卡公网IP ID
Ip string `json:"ip"` // 网卡公网IP地址
} `json:"public_ip"`
PrivateIp []string `json:"private_ip"` // 网卡内网IP地址
}
type HardOffReq ¶
type HardOffReq struct {
ID uint `json:"-"` // 实例ID
}
func (*HardOffReq) Body ¶
func (r *HardOffReq) Body() any
func (*HardOffReq) Form ¶
func (r *HardOffReq) Form() (form url.Values)
func (*HardOffReq) Header ¶
func (r *HardOffReq) Header() http.Header
func (*HardOffReq) Method ¶
func (r *HardOffReq) Method() string
func (*HardOffReq) Url ¶
func (r *HardOffReq) Url() string
func (*HardOffReq) Values ¶
func (r *HardOffReq) Values() (values url.Values)
type HardOffResp ¶
type HardOffResp struct {
TaskID string `json:"taskid"`
}
func HardOff ¶
func HardOff(ctx *cloudplatform.Context, req *HardOffReq) (*HardOffResp, error)
HardOff 硬关机
type HardRebootReq ¶
type HardRebootReq struct {
ID uint `json:"-"` // 实例ID
}
func (*HardRebootReq) Body ¶
func (r *HardRebootReq) Body() any
func (*HardRebootReq) Form ¶
func (r *HardRebootReq) Form() (form url.Values)
func (*HardRebootReq) Header ¶
func (r *HardRebootReq) Header() http.Header
func (*HardRebootReq) Method ¶
func (r *HardRebootReq) Method() string
func (*HardRebootReq) Url ¶
func (r *HardRebootReq) Url() string
func (*HardRebootReq) Values ¶
func (r *HardRebootReq) Values() (values url.Values)
type HardRebootResp ¶
type HardRebootResp struct {
TaskID string `json:"taskid"`
}
func HardReboot ¶
func HardReboot(ctx *cloudplatform.Context, req *HardRebootReq) (*HardRebootResp, error)
HardReboot 硬重启
type HostnameReq ¶
func (*HostnameReq) Body ¶
func (r *HostnameReq) Body() any
func (*HostnameReq) Form ¶
func (r *HostnameReq) Form() (form url.Values)
func (*HostnameReq) Header ¶
func (r *HostnameReq) Header() http.Header
func (*HostnameReq) Method ¶
func (r *HostnameReq) Method() string
func (*HostnameReq) Url ¶
func (r *HostnameReq) Url() string
func (*HostnameReq) Values ¶
func (r *HostnameReq) Values() (values url.Values)
type HostnameResp ¶
type HostnameResp struct{}
func Hostname ¶
func Hostname(ctx *cloudplatform.Context, req *HostnameReq) (*HostnameResp, error)
Hostname 修改主机名
type IpNumReq ¶
type MainipResp ¶
type MainipResp struct{}
func Mainip ¶
func Mainip(ctx *cloudplatform.Context, req *MainipReq) (*MainipResp, error)
Mainip 设置主IP
type PanelPassReq ¶
type PanelPassReq struct {
ID uint `json:"-"` // 实例ID
PanelPass string `json:"panel_pass"` // 面板管理密码
}
func (*PanelPassReq) Body ¶
func (r *PanelPassReq) Body() any
func (*PanelPassReq) Form ¶
func (r *PanelPassReq) Form() (form url.Values)
func (*PanelPassReq) Header ¶
func (r *PanelPassReq) Header() http.Header
func (*PanelPassReq) Method ¶
func (r *PanelPassReq) Method() string
func (*PanelPassReq) Url ¶
func (r *PanelPassReq) Url() string
func (*PanelPassReq) Values ¶
func (r *PanelPassReq) Values() (values url.Values)
type PanelPassResp ¶
type PanelPassResp struct{}
func PanelPass ¶
func PanelPass(ctx *cloudplatform.Context, req *PanelPassReq) (*PanelPassResp, error)
PanelPass 修改面板管理密码 修改面板管理密码(v2.2.2+)
type PasswordReq ¶
func (*PasswordReq) Body ¶
func (r *PasswordReq) Body() any
func (*PasswordReq) Form ¶
func (r *PasswordReq) Form() (form url.Values)
func (*PasswordReq) Header ¶
func (r *PasswordReq) Header() http.Header
func (*PasswordReq) Method ¶
func (r *PasswordReq) Method() string
func (*PasswordReq) Url ¶
func (r *PasswordReq) Url() string
func (*PasswordReq) Values ¶
func (r *PasswordReq) Values() (values url.Values)
type PasswordResp ¶
type PasswordResp struct {
TaskID string `json:"taskid"` // 任务ID(v2.1.8+)
}
func Password ¶
func Password(ctx *cloudplatform.Context, req *PasswordReq) (*PasswordResp, error)
Password 重置密码
type RealDataReq ¶
type RealDataReq struct {
ID []uint `json:"id"`
}
func (*RealDataReq) Body ¶
func (r *RealDataReq) Body() any
func (*RealDataReq) Form ¶
func (r *RealDataReq) Form() (form url.Values)
func (*RealDataReq) Header ¶
func (r *RealDataReq) Header() http.Header
func (*RealDataReq) Method ¶
func (r *RealDataReq) Method() string
func (*RealDataReq) Url ¶
func (r *RealDataReq) Url() string
func (*RealDataReq) Values ¶
func (r *RealDataReq) Values() (values url.Values)
type RealDataResp ¶
type RealDataResp struct {
Id int `json:"id"` // 实例ID
Kvm string `json:"kvm"` // 实例KVMID
CpuUsage string `json:"cpu_usage"` // CPU使用率
MemoryUsage string `json:"memory_usage"` // 内存使用百分比(v2.1.7改,-1未获取到v2.1.8改)
MemoryTotal string `json:"memory_total"` // 总内存(v2.1.7+)
MemoryUsable string `json:"memory_usable"` // 已用内存(v2.1.7+,v2.2.6+改为已用内存)
CurrentInBw string `json:"current_in_bw"` // 进带宽(v2.1.8+)
CurrentOutBw string `json:"current_out_bw"` // 出带宽(v2.1.8+)
CurrentReadByte int `json:"current_read_byte"` // 磁盘读取速度(MB/s,v2.4.7+)
CurrentWriteByte float64 `json:"current_write_byte"` // 磁盘写入速度(MB/s,v2.4.7+)
}
func RealData ¶
func RealData(ctx *cloudplatform.Context, req *RealDataReq) (*RealDataResp, error)
RealData 获取实例实时CPU/内存
type RebootResp ¶
type RebootResp struct {
TaskID string `json:"taskid"`
}
func Reboot ¶
func Reboot(ctx *cloudplatform.Context, req *RebootReq) (*RebootResp, error)
Reboot 重启
type ReinstallReq ¶
type ReinstallReq struct {
ID uint `json:"-"` // 实例ID
Os uint `json:"os"` // 镜像ID/模板ID必须有一个,都有为镜像ID镜像ID
Template uint `json:"template"` // 镜像ID/模板ID必须有一个,都有为镜像ID模板ID
Password string `json:"password"` // 自动生成新密码
Port uint `json:"port"` // 端口(可选,专业版支持)
SystemDiskSize uint `json:"system_disk_size"` // 系统盘大小(可以传入数组如[20,30],第一个为windows,第二个为其他,v2.3.9+,v2.4.1改为不传不修改磁盘大小)
FormatDataDisk uint `json:"format_data_disk"` // 是否格式化数据盘(0=不格式,1=格式化)
Key string `json:"key"` // 镜像设置的密钥密钥(重装为Windows可选)
PasswordType uint `json:"image_client_hidden"` // query参数是否验证镜像是否客户端隐藏(0=客户端可见,1=客户端隐藏)
}
func (*ReinstallReq) Body ¶
func (r *ReinstallReq) Body() any
func (*ReinstallReq) Form ¶
func (r *ReinstallReq) Form() (form url.Values)
func (*ReinstallReq) Header ¶
func (r *ReinstallReq) Header() http.Header
func (*ReinstallReq) Method ¶
func (r *ReinstallReq) Method() string
func (*ReinstallReq) Url ¶
func (r *ReinstallReq) Url() string
func (*ReinstallReq) Values ¶
func (r *ReinstallReq) Values() (values url.Values)
type ReinstallResp ¶
type ReinstallResp struct {
TaskID string `json:"taskid"`
User string `json:"user"` // 操作系统用户
Password string `json:"password"` // 操作系统密码
Port uint `json:"port"` // 重装随机端口(v2.2.2+)
SystemDiskSize uint `json:"system_disk_size"` // 重装后系统盘大小(0表示未变更,v2.3.9+)
}
func Reinstall ¶
func Reinstall(ctx *cloudplatform.Context, req *ReinstallReq) (*ReinstallResp, error)
Reinstall 重装
type RescueEnterReq ¶
type RescueEnterReq struct {
ID uint `json:"-"` // 实例ID
Type string `json:"type"` // 指定救援系统类型(0=跟随实例,1=windows,2=linux)
TempPass string `json:"temp_pass"` // 救援系统临时密码,当前系统密码
}
func (*RescueEnterReq) Body ¶
func (r *RescueEnterReq) Body() any
func (*RescueEnterReq) Form ¶
func (r *RescueEnterReq) Form() (form url.Values)
func (*RescueEnterReq) Header ¶
func (r *RescueEnterReq) Header() http.Header
func (*RescueEnterReq) Method ¶
func (r *RescueEnterReq) Method() string
func (*RescueEnterReq) Url ¶
func (r *RescueEnterReq) Url() string
func (*RescueEnterReq) Values ¶
func (r *RescueEnterReq) Values() (values url.Values)
type RescueEnterResp ¶
type RescueEnterResp struct{}
func RescueEnter ¶
func RescueEnter(ctx *cloudplatform.Context, req *RescueEnterReq) (*RescueEnterResp, error)
type RescueExitReq ¶
type RescueExitReq struct {
ID uint `json:"-"` // 实例ID
}
func (*RescueExitReq) Body ¶
func (r *RescueExitReq) Body() any
func (*RescueExitReq) Form ¶
func (r *RescueExitReq) Form() (form url.Values)
func (*RescueExitReq) Header ¶
func (r *RescueExitReq) Header() http.Header
func (*RescueExitReq) Method ¶
func (r *RescueExitReq) Method() string
func (*RescueExitReq) Url ¶
func (r *RescueExitReq) Url() string
func (*RescueExitReq) Values ¶
func (r *RescueExitReq) Values() (values url.Values)
type RescueExitResp ¶
type RescueExitResp struct{}
func RescueExit ¶
func RescueExit(ctx *cloudplatform.Context, req *RescueExitReq) (*RescueExitResp, error)
type ResumeResp ¶
type ResumeResp struct{}
func Resume ¶
func Resume(ctx *cloudplatform.Context, req *ResumeReq) (*ResumeResp, error)
Resume 解除挂起
type StatusResp ¶
type StatusResp struct {
Status string `json:"status"` // 实例状态(unknown未知,wait_reboot等待重启,on开机,off关机,task任务中,suspend暂停,recycle回收站中,paused挂起,cold_migrate冷迁移,hot_migrate热迁移)
Task string `json:"task"` // 任务类型(当status=task时返回)
TaskName string `json:"task_name"` // 任务类型名称(当status=task时返回)
}
func Status ¶
func Status(ctx *cloudplatform.Context, req *StatusReq) (*StatusResp, error)
Status 获取实例状态
type SuspendReq ¶
type SuspendReq struct {
ID uint `json:"-"` // 实例ID
Type string `json:"type"` // 暂停类型(traffic=流量超额,due=到期,v2.3.9+)
}
func (*SuspendReq) Body ¶
func (r *SuspendReq) Body() any
func (*SuspendReq) Form ¶
func (r *SuspendReq) Form() (form url.Values)
func (*SuspendReq) Header ¶
func (r *SuspendReq) Header() http.Header
func (*SuspendReq) Method ¶
func (r *SuspendReq) Method() string
func (*SuspendReq) Url ¶
func (r *SuspendReq) Url() string
func (*SuspendReq) Values ¶
func (r *SuspendReq) Values() (values url.Values)
type SuspendResp ¶
type SuspendResp struct{}
func Suspend ¶
func Suspend(ctx *cloudplatform.Context, req *SuspendReq) (*SuspendResp, error)
Suspend 暂停
type SwitchVpcReq ¶
type SwitchVpcReq struct {
ID int `json:"-"`
Vpc uint `json:"vpc"` // VPCID
VpcIps string `json:"vpc_ips"` // 要新建的VPC IP段(没有vpc时生效)
}
func (*SwitchVpcReq) Body ¶
func (r *SwitchVpcReq) Body() any
func (*SwitchVpcReq) Form ¶
func (r *SwitchVpcReq) Form() (form url.Values)
func (*SwitchVpcReq) Header ¶
func (r *SwitchVpcReq) Header() http.Header
func (*SwitchVpcReq) Method ¶
func (r *SwitchVpcReq) Method() string
func (*SwitchVpcReq) Url ¶
func (r *SwitchVpcReq) Url() string
func (*SwitchVpcReq) Values ¶
func (r *SwitchVpcReq) Values() (values url.Values)
type SwitchVpcResp ¶
type SwitchVpcResp struct {
TaskID string `json:"taskid"`
}
func SwitchVpc ¶
func SwitchVpc(ctx *cloudplatform.Context, req *SwitchVpcReq) (*SwitchVpcResp, error)
type UnSuspendReq ¶
type UnSuspendReq struct {
ID uint `json:"-"` // 实例ID
}
func (*UnSuspendReq) Body ¶
func (r *UnSuspendReq) Body() any
func (*UnSuspendReq) Form ¶
func (r *UnSuspendReq) Form() (form url.Values)
func (*UnSuspendReq) Header ¶
func (r *UnSuspendReq) Header() http.Header
func (*UnSuspendReq) Method ¶
func (r *UnSuspendReq) Method() string
func (*UnSuspendReq) Url ¶
func (r *UnSuspendReq) Url() string
func (*UnSuspendReq) Values ¶
func (r *UnSuspendReq) Values() (values url.Values)
type UnSuspendResp ¶
type UnSuspendResp struct{}
func UnSuspend ¶
func UnSuspend(ctx *cloudplatform.Context, req *UnSuspendReq) (*UnSuspendResp, error)
UnSuspend 解除暂停
type UnlockResp ¶
type UnlockResp struct{}
func Unlock ¶
func Unlock(ctx *cloudplatform.Context, req *UnlockReq) (*UnlockResp, error)
Unlock 实例解除锁定
type VncResp ¶
type VncResp struct {
Path int `json:"path"` // 路径
Token string `json:"token"` // vnc凭证
VncPass string `json:"vnc_pass"` // vnc密码
Password string `json:"password"` // 实例密码
VncUrl string `json:"vnc_url"` // vnc wss地址
VncUrlHttp string `json:"vnc_url_http"` // 外部vnc http地址,未启用时没有
VncUrlHttps string `json:"vnc_url_https"` // 外部vnc https页面地址,未启用时没有
}
Click to show internal directories.
Click to hide internal directories.