cloudops

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 GetIpReq

type GetIpReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*GetIpReq) Body

func (r *GetIpReq) Body() any

func (*GetIpReq) Form

func (r *GetIpReq) Form() (form url.Values)

func (*GetIpReq) Header

func (r *GetIpReq) Header() http.Header

func (*GetIpReq) Method

func (r *GetIpReq) Method() string

func (*GetIpReq) Url

func (r *GetIpReq) Url() string

func (*GetIpReq) Values

func (r *GetIpReq) Values() (values url.Values)

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地址
}

func GetIp

func GetIp(ctx *cloudplatform.Context, req *GetIpReq) (*GetIpResp, error)

GetIp 获取实例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

type HostnameReq struct {
	ID       uint   `json:"-"`        // 实例ID
	Hostname string `json:"hostname"` // 主机名
}

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 IpNumReq struct {
	ID           uint `json:"-"`              // 实例ID
	Num          uint `json:"num"`            // 目标IP数量
	IpGroup      uint `json:"ip_group"`       // IP分组ID(增加IP时生效分配指定分组的IP,v2.3.0+)
	IsForceGroup uint `json:"is_force_group"` // 是否强制使用IP分组,不强制指定分组不够会使用其他的组(0不强制,1强制,v2.3.0+)
}

func (*IpNumReq) Body

func (r *IpNumReq) Body() any

func (*IpNumReq) Form

func (r *IpNumReq) Form() (form url.Values)

func (*IpNumReq) Header

func (r *IpNumReq) Header() http.Header

func (*IpNumReq) Method

func (r *IpNumReq) Method() string

func (*IpNumReq) Url

func (r *IpNumReq) Url() string

func (*IpNumReq) Values

func (r *IpNumReq) Values() (values url.Values)

type IpNumResp

type IpNumResp struct{}

func IpNum

func IpNum(ctx *cloudplatform.Context, req *IpNumReq) (*IpNumResp, error)

IpNum 修改实例IP数量 修改实例IP数量,第一个网卡

type LockReq

type LockReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*LockReq) Body

func (r *LockReq) Body() any

func (*LockReq) Form

func (r *LockReq) Form() (form url.Values)

func (*LockReq) Header

func (r *LockReq) Header() http.Header

func (*LockReq) Method

func (r *LockReq) Method() string

func (*LockReq) Url

func (r *LockReq) Url() string

func (*LockReq) Values

func (r *LockReq) Values() (values url.Values)

type LockResp

type LockResp struct{}

func Lock

func Lock(ctx *cloudplatform.Context, req *LockReq) (*LockResp, error)

Lock 实例锁定

type MainipReq

type MainipReq struct {
	ID uint `json:"id"` // 实例ID
	Ip uint `json:"ip"` // IP ID
}

func (*MainipReq) Body

func (r *MainipReq) Body() any

func (*MainipReq) Form

func (r *MainipReq) Form() (form url.Values)

func (*MainipReq) Header

func (r *MainipReq) Header() http.Header

func (*MainipReq) Method

func (r *MainipReq) Method() string

func (*MainipReq) Url

func (r *MainipReq) Url() string

func (*MainipReq) Values

func (r *MainipReq) Values() (values url.Values)

type MainipResp

type MainipResp struct{}

func Mainip

func Mainip(ctx *cloudplatform.Context, req *MainipReq) (*MainipResp, error)

Mainip 设置主IP

type OffReq

type OffReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*OffReq) Body

func (r *OffReq) Body() any

func (*OffReq) Form

func (r *OffReq) Form() (form url.Values)

func (*OffReq) Header

func (r *OffReq) Header() http.Header

func (*OffReq) Method

func (r *OffReq) Method() string

func (*OffReq) Url

func (r *OffReq) Url() string

func (*OffReq) Values

func (r *OffReq) Values() (values url.Values)

type OffResp

type OffResp struct {
	TaskID string `json:"taskid"`
}

func Off

func Off(ctx *cloudplatform.Context, req *OffReq) (*OffResp, error)

Off 关机

type OnReq

type OnReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*OnReq) Body

func (r *OnReq) Body() any

func (*OnReq) Form

func (r *OnReq) Form() (form url.Values)

func (*OnReq) Header

func (r *OnReq) Header() http.Header

func (*OnReq) Method

func (r *OnReq) Method() string

func (*OnReq) Url

func (r *OnReq) Url() string

func (*OnReq) Values

func (r *OnReq) Values() (values url.Values)

type OnResp

type OnResp struct {
	TaskID string `json:"taskid"`
}

func On

func On(ctx *cloudplatform.Context, req *OnReq) (*OnResp, error)

On 开机

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

type PasswordReq struct {
	ID       uint   `json:"-"`
	Password string `json:"password"`
}

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 RebootReq

type RebootReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*RebootReq) Body

func (r *RebootReq) Body() any

func (*RebootReq) Form

func (r *RebootReq) Form() (form url.Values)

func (*RebootReq) Header

func (r *RebootReq) Header() http.Header

func (*RebootReq) Method

func (r *RebootReq) Method() string

func (*RebootReq) Url

func (r *RebootReq) Url() string

func (*RebootReq) Values

func (r *RebootReq) Values() (values url.Values)

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 ResumeReq

type ResumeReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*ResumeReq) Body

func (r *ResumeReq) Body() any

func (*ResumeReq) Form

func (r *ResumeReq) Form() (form url.Values)

func (*ResumeReq) Header

func (r *ResumeReq) Header() http.Header

func (*ResumeReq) Method

func (r *ResumeReq) Method() string

func (*ResumeReq) Url

func (r *ResumeReq) Url() string

func (*ResumeReq) Values

func (r *ResumeReq) Values() (values url.Values)

type ResumeResp

type ResumeResp struct{}

func Resume

func Resume(ctx *cloudplatform.Context, req *ResumeReq) (*ResumeResp, error)

Resume 解除挂起

type StatusReq

type StatusReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*StatusReq) Body

func (r *StatusReq) Body() any

func (*StatusReq) Form

func (r *StatusReq) Form() (form url.Values)

func (*StatusReq) Header

func (r *StatusReq) Header() http.Header

func (*StatusReq) Method

func (r *StatusReq) Method() string

func (*StatusReq) Url

func (r *StatusReq) Url() string

func (*StatusReq) Values

func (r *StatusReq) Values() (values url.Values)

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 UnlockReq

type UnlockReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*UnlockReq) Body

func (r *UnlockReq) Body() any

func (*UnlockReq) Form

func (r *UnlockReq) Form() (form url.Values)

func (*UnlockReq) Header

func (r *UnlockReq) Header() http.Header

func (*UnlockReq) Method

func (r *UnlockReq) Method() string

func (*UnlockReq) Url

func (r *UnlockReq) Url() string

func (*UnlockReq) Values

func (r *UnlockReq) Values() (values url.Values)

type UnlockResp

type UnlockResp struct{}

func Unlock

func Unlock(ctx *cloudplatform.Context, req *UnlockReq) (*UnlockResp, error)

Unlock 实例解除锁定

type VncReq

type VncReq struct {
	ID uint `json:"-"` // 实例ID
}

func (*VncReq) Body

func (r *VncReq) Body() any

func (*VncReq) Form

func (r *VncReq) Form() (form url.Values)

func (*VncReq) Header

func (r *VncReq) Header() http.Header

func (*VncReq) Method

func (r *VncReq) Method() string

func (*VncReq) Url

func (r *VncReq) Url() string

func (*VncReq) Values

func (r *VncReq) Values() (values url.Values)

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页面地址,未启用时没有
}

func Vnc

func Vnc(ctx *cloudplatform.Context, req *VncReq) (*VncResp, error)

Vnc VNC

Jump to

Keyboard shortcuts

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