Documentation
¶
Index ¶
- func Delete(ctx *dcimsdk.Context, request *DeleteReq) (resp dcimsdk.CreateUpdateResp, err error)
- func Update(ctx *dcimsdk.Context, request *UpdateReq) (resp dcimsdk.CreateUpdateResp, err error)
- type Block
- type CalcReq
- type CalcResp
- type CidrInfo
- type CreateReq
- type CreateResp
- type DeleteReq
- type DetailReq
- type DetailResp
- type GroupsListReq
- type GroupsListResp
- type ListReq
- type ListResp
- type SimpleGroup
- type UpdateReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Delete 删除数据中心 https://www.eolink.com/share/inside/XIPzIs/api/1399365/detail/5784268
func Update ¶
Update 修改IP段 https://www.eolink.com/share/inside/XIPzIs/api/1392256/detail/5748038
Types ¶
type Block ¶
type Block struct {
Id uint `json:"id"` // ip地址id
Path string `json:"path"` // 子网
Gid uint `json:"gid"` // 分组id
Type string `json:"type"` // 类型
Label string `json:"label"` // 标签
Disabled int `json:"disabled"` // 状态
Netmask string `json:"netmask"` // 掩码
Gateway string `json:"gateway"` // 网关
Vlan string `json:"vlan"` // VLAN
AssignTime any `json:"assign_time"` // 分配时间
ServerId int `json:"server_id"` // 服务器id
UserId any `json:"user_id"` // 用户id
Auto int `json:"auto"` // 是否自动分配
UsableipNum int `json:"usableip_num"` // 可使用的ip数量
UsingipNum int `json:"usingip_num"` // 使用中的ip数量
TotalipNum int `json:"totalip_num"` // 使用中的ip数量
SpecialipNum int `json:"specialip_num"` // 特殊ip数量
Remark string `json:"remark"` // 备注
IsLock int `json:"is_lock"` // 是否锁定
CreatedAt string `json:"created_at"` // 创建时间
UpdatedAt string `json:"updated_at"` // 修改时间
ServerName string `json:"server_name"` // 服务器名称
Dns1 string `json:"dns_1"` // DNS1
Dns2 string `json:"dns_2"` // DNS2
GroupName string `json:"group_name"` // 分组名称
Cidr string `json:"cidr"` // CIDR
IsPiecewise bool `json:"is_piecewise"` // 是否分段
FillIp bool `json:"fill_ip"` // 是否自动填充ip
CanAllocate bool `json:"can_allocate"` // 是否可分配
Username string `json:"username"` // 用户名
DatacenterId []uint `json:"datacenter_id"` // 机房id
DatacenterName []string `json:"datacenter_name"` // 机房名称
Child []any `json:"child"`
AllIp bool `json:"all_ip"` // 是否全ip
Ipv4Datacenters []struct {
Id int `json:"id"`
BlockId int `json:"block_id"` // ip段id
DatacenterId int `json:"datacenter_id"` // 机房id
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Datacenter struct {
Id int `json:"id"`
Name string `json:"name"` // 机房名称
Geographicg string `json:"geographicg"` // 位置
Bandwidth int `json:"bandwidth"` // 带宽
Voltage int `json:"voltage"` // 电力
Contact struct {
Name string `json:"name"` // 姓名
Tel string `json:"tel"` // 电话
Email string `json:"email"` // 邮箱
} `json:"contact"` // 联系信息
InternalCidr string `json:"internal_cidr"` // 重装系统使用网段
VlanOs int `json:"vlan_os"` // 重装系统临时VLAN
SpeedOs int `json:"speed_os"` // 重装系统端口限速
ArpOs int `json:"arp_os"` // 重装系统Arp绑定
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
} `json:"datacenter"` // 机房
} `json:"ipv4datacenters"` // IP段绑定机房列表
}
type CalcResp ¶
type CalcResp struct {
Success bool `json:"success"`
Error string `json:"error"`
CidrInfo CidrInfo `json:"cidr_info"`
}
func Calc ¶
Calc IP段计算器 https://www.eolink.com/share/inside/XIPzIs/api/1392256/detail/5747435
type CidrInfo ¶
type CidrInfo struct {
FirstIp string `json:"first_ip"` // 首位ip
LastIp string `json:"last_ip"` // 末尾ip
NetworkIp string `json:"network_ip"` // 网络ip
BroadcastIp string `json:"broadcast_ip"` // 广播
Cidr string `json:"cidr"` // CIDR(ipv4段)
Netmask string `json:"netmask"` // 子网掩码
Total int `json:"total"` // 总条数
GatewayFirstIp string `json:"gateway_first_ip"` // 网关首位ip
GatewayLastIp string `json:"gateway_last_ip"` // 网关末尾ip
}
type CreateReq ¶
type CreateReq struct {
DatacenterId []uint `json:"datacenter_id"` // 机房Ids
Gid uint `json:"gid"` // 分组Id
Cidr string `json:"cidr"` // IPV4段
FirstIp string `json:"first_ip"` // 第一个IP
LastIp string `json:"last_ip"` // 最后一个IP
Type string `json:"type"` // ip段类别 IPMI:IPMI;Temporary:临时IP;Public:公网IP;Private:内网IP;UserPrivate:客户内网IP;Other:其他
Netmask string `json:"netmask"` // 子网掩码
Dns1 string `json:"dns1"` // 首选DNS
Dns2 string `json:"dns2"` // 备用DNS
Gateway string `json:"gateway"` // 网关
Label string `json:"label"` // 标签(页面不填写,后端调用接口传固定值)
Remark string `json:"remark"` // 备注
}
type CreateResp ¶
type CreateResp struct {
Success bool `json:"success"`
Error string `json:"error"`
BlockId uint `json:"block_id"`
Pending bool `json:"pending"` // 是否等待
}
func Create ¶
func Create(ctx *dcimsdk.Context, request *CreateReq) (resp CreateResp, err error)
Create 创建IP段 https://www.eolink.com/share/inside/XIPzIs/api/1392256/detail/5745856
func (CreateResp) Err ¶
func (c CreateResp) Err() (err error)
func (CreateResp) ID ¶
func (c CreateResp) ID() uint
func (CreateResp) Ok ¶
func (c CreateResp) Ok() (ok bool)
type DetailResp ¶
func Detail ¶
func Detail(ctx *dcimsdk.Context, request *DetailReq) (resp DetailResp, err error)
Detail 获取IP段详情 https://www.eolink.com/share/inside/XIPzIs/api/1392256/detail/5758800
type GroupsListReq ¶
type GroupsListReq struct{}
func (*GroupsListReq) Body ¶
func (r *GroupsListReq) Body() (body any)
func (*GroupsListReq) Method ¶
func (r *GroupsListReq) Method() (method string)
func (*GroupsListReq) Url ¶
func (r *GroupsListReq) Url() (url string)
func (*GroupsListReq) Values ¶
func (r *GroupsListReq) Values() (values url.Values)
type GroupsListResp ¶
type GroupsListResp struct {
Success bool `json:"success"`
Error string `json:"error"`
Groups []SimpleGroup `json:"groups"`
}
func GroupsList ¶
func GroupsList(ctx *dcimsdk.Context, request *GroupsListReq) (resp GroupsListResp, err error)
GroupsList 获取IP分组列表(简易) https://www.eolink.com/share/inside/XIPzIs/api/1392254/detail/5745551
func (GroupsListResp) Err ¶
func (r GroupsListResp) Err() (err error)
func (GroupsListResp) Ok ¶
func (r GroupsListResp) Ok() (ok bool)
type ListReq ¶
type ListResp ¶
type ListResp struct {
Success bool `json:"success"`
Error string `json:"error"`
Ipv4Blocks []Block `json:"ipv4blocks"` // IP段列表
Total int `json:"total"`
}
func List ¶
List 获取IP段列表 https://www.eolink.com/share/inside/XIPzIs/api/1392256/detail/5745855
type SimpleGroup ¶
type UpdateReq ¶
type UpdateReq struct {
Id uint `json:"-"`
DatacenterId []uint `json:"datacenter_id"` // 机房Ids
Gid uint `json:"gid,omitempty"` // 分组Id
Type string `json:"type,omitempty"` // ip段类别 IPMI:IPMI;Temporary:临时IP;Public:公网IP;Private:内网IP;UserPrivate:客户内网IP;Other:其他
Dns1 string `json:"dns1,omitempty"` // 首选DNS
Dns2 string `json:"dns2,omitempty"` // 备用DNS
Gateway string `json:"gateway,omitempty"` // 网关
Label string `json:"label,omitempty"` // 标签(页面不填写,后端调用接口传固定值)
Remark string `json:"remark,omitempty"` // 备注
}
Click to show internal directories.
Click to hide internal directories.