Documentation ¶
Index ¶
- Constants
- type EIP
- type NetworkInterface
- type OpenAPI
- func (a *OpenAPI) AddCommonBandwidthPackageIP(eipID, packageID string) error
- func (a *OpenAPI) AllocateEIPAddress(bandwidth, chargeType, isp string) (*vpc.AllocateEipAddressResponse, error)
- func (a *OpenAPI) AssignIpv6Addresses(ctx context.Context, eniID string, count int) ([]net.IP, error)
- func (a *OpenAPI) AssignPrivateIPAddress(ctx context.Context, eniID string, count int) ([]net.IP, error)
- func (a *OpenAPI) AssociateEIPAddress(eipID, eniID, privateIP string) error
- func (a *OpenAPI) AttachNetworkInterface(ctx context.Context, eniID, instanceID, trunkENIID string) error
- func (a *OpenAPI) CreateNetworkInterface(ctx context.Context, trunk bool, vSwitch string, securityGroups []string, ...) (*NetworkInterface, error)
- func (a *OpenAPI) DeleteNetworkInterface(ctx context.Context, eniID string) error
- func (a *OpenAPI) DescribeInstanceTypes(ctx context.Context, types []string) ([]ecs.InstanceType, error)
- func (a *OpenAPI) DescribeNetworkInterface(ctx context.Context, vpcID string, eniID []string, instanceID string, ...) ([]*NetworkInterface, error)
- func (a *OpenAPI) DescribeVSwitchByID(ctx context.Context, vSwitchID string) (*vpc.VSwitch, error)
- func (a *OpenAPI) DetachNetworkInterface(ctx context.Context, eniID, instanceID, trunkENIID string) error
- func (a *OpenAPI) ModifyNetworkInterfaceAttribute(ctx context.Context, eniID string, securityGroupIDs []string) error
- func (a *OpenAPI) ReleaseEIPAddress(eipID string) error
- func (a *OpenAPI) RemoveCommonBandwidthPackageIP(eipID, packageID string) error
- func (a *OpenAPI) UnAssignIpv6Addresses(ctx context.Context, eniID string, ips []net.IP) error
- func (a *OpenAPI) UnAssignPrivateIPAddresses(ctx context.Context, eniID string, ips []net.IP) error
- func (a *OpenAPI) UnAssociateEIPAddress(eipID, eniID, eniIP string) error
- func (a *OpenAPI) WaitForNetworkInterface(ctx context.Context, eniID string, status string, backoff wait.Backoff, ...) (*NetworkInterface, error)
- type VSwitch
Constants ¶
const ( LogFieldAPI = "api" LogFieldRequestID = "requestID" LogFieldInstanceID = "instanceID" LogFieldSecondaryIPCount = "secondaryIPCount" LogFieldENIID = "eni" LogFieldEIPID = "eip" LogFieldPrivateIP = "privateIP" LogFieldVSwitchID = "vSwitchID" )
log fields
const ( ENIStatusInUse string = "InUse" ENIStatusAvailable string = "Available" )
status for eni
const ( ENITypePrimary string = "Primary" ENITypeSecondary string = "Secondary" ENITypeTrunk string = "Trunk" ENITypeMember string = "Member" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EIP ¶
type EIP interface { AllocateEIPAddress(bandwidth, chargeType, isp string) (*vpc.AllocateEipAddressResponse, error) AssociateEIPAddress(eipID, eniID, privateIP string) error UnAssociateEIPAddress(eipID, eniID, eniIP string) error ReleaseEIPAddress(eipID string) error AddCommonBandwidthPackageIP(eipID, packageID string) error }
type NetworkInterface ¶ added in v1.4.1
type NetworkInterface struct { Status string `json:"status,omitempty"` MacAddress string `json:"mac_address,omitempty"` NetworkInterfaceID string `json:"network_interface_id,omitempty"` VSwitchID string `json:"v_switch_id,omitempty"` PrivateIPAddress string `json:"private_ip_address,omitempty"` PrivateIPSets []ecs.PrivateIpSet `json:"private_ip_sets"` ZoneID string `json:"zone_id,omitempty"` SecurityGroupIDs []string `json:"security_group_ids,omitempty"` IPv6Set []ecs.Ipv6Set `json:"ipv6_set,omitempty"` Tags []ecs.Tag `json:"tags,omitempty"` // fields for DescribeNetworkInterface Type string `json:"type,omitempty"` InstanceID string `json:"instance_id,omitempty"` TrunkNetworkInterfaceID string `json:"trunk_network_interface_id,omitempty"` DeviceIndex int `json:"device_index,omitempty"` CreationTime string `json:"creation_time,omitempty"` }
NetworkInterface openAPI result for ecs.CreateNetworkInterfaceResponse and ecs.NetworkInterfaceSet
func FromCreateResp ¶ added in v1.4.1
func FromCreateResp(in *ecs.CreateNetworkInterfaceResponse) *NetworkInterface
func FromDescribeResp ¶ added in v1.4.1
func FromDescribeResp(in *ecs.NetworkInterfaceSet) *NetworkInterface
type OpenAPI ¶
type OpenAPI struct { ClientSet credential.Client ReadOnlyRateLimiter flowcontrol.RateLimiter MutatingRateLimiter flowcontrol.RateLimiter }
func New ¶
func New(c credential.Client, readOnly, mutating flowcontrol.RateLimiter) (*OpenAPI, error)
func (*OpenAPI) AddCommonBandwidthPackageIP ¶ added in v1.2.3
AddCommonBandwidthPackageIP add EIP to bandwidth package
func (*OpenAPI) AllocateEIPAddress ¶
func (a *OpenAPI) AllocateEIPAddress(bandwidth, chargeType, isp string) (*vpc.AllocateEipAddressResponse, error)
AllocateEIPAddress create EIP
func (*OpenAPI) AssignIpv6Addresses ¶
func (a *OpenAPI) AssignIpv6Addresses(ctx context.Context, eniID string, count int) ([]net.IP, error)
AssignIpv6Addresses assign ipv6 address
func (*OpenAPI) AssignPrivateIPAddress ¶
func (a *OpenAPI) AssignPrivateIPAddress(ctx context.Context, eniID string, count int) ([]net.IP, error)
AssignPrivateIPAddress assign secondary ip
func (*OpenAPI) AssociateEIPAddress ¶
AssociateEIPAddress bind eip to ip
func (*OpenAPI) AttachNetworkInterface ¶
func (a *OpenAPI) AttachNetworkInterface(ctx context.Context, eniID, instanceID, trunkENIID string) error
AttachNetworkInterface attach eni
func (*OpenAPI) CreateNetworkInterface ¶
func (a *OpenAPI) CreateNetworkInterface(ctx context.Context, trunk bool, vSwitch string, securityGroups []string, ipCount, ipv6Count int, eniTags map[string]string) (*NetworkInterface, error)
CreateNetworkInterface instanceType Secondary Trunk
func (*OpenAPI) DeleteNetworkInterface ¶
DeleteNetworkInterface del eni by id
func (*OpenAPI) DescribeInstanceTypes ¶ added in v1.3.0
func (*OpenAPI) DescribeNetworkInterface ¶
func (a *OpenAPI) DescribeNetworkInterface(ctx context.Context, vpcID string, eniID []string, instanceID string, instanceType string, status string, tags map[string]string) ([]*NetworkInterface, error)
DescribeNetworkInterface list eni
func (*OpenAPI) DescribeVSwitchByID ¶
DescribeVSwitchByID get vsw by id
func (*OpenAPI) DetachNetworkInterface ¶
func (a *OpenAPI) DetachNetworkInterface(ctx context.Context, eniID, instanceID, trunkENIID string) error
DetachNetworkInterface detach eni
func (*OpenAPI) ModifyNetworkInterfaceAttribute ¶ added in v1.4.1
func (*OpenAPI) ReleaseEIPAddress ¶
ReleaseEIPAddress delete EIP
func (*OpenAPI) RemoveCommonBandwidthPackageIP ¶ added in v1.2.3
RemoveCommonBandwidthPackageIP remove EIP from bandwidth package
func (*OpenAPI) UnAssignIpv6Addresses ¶
UnAssignIpv6Addresses remove ip from eni return ok if 1. eni is released 2. ip is already released 3. release success
func (*OpenAPI) UnAssignPrivateIPAddresses ¶
UnAssignPrivateIPAddresses remove ip from eni return ok if 1. eni is released 2. ip is already released 3. release success for primaryIP err is InvalidIp.IpUnassigned
func (*OpenAPI) UnAssociateEIPAddress ¶
UnAssociateEIPAddress un-bind eip