api

package
v1.16.0-pre.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	VPCID = "VPCID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client an AlibabaCloud API client

func NewClient

func NewClient(vpcClient *vpc.Client, client *ecs.Client, metrics MetricsAPI, rateLimit float64, burst int, filters map[string]string) *Client

NewClient create the client

func (*Client) AssignPrivateIPAddresses

func (c *Client) AssignPrivateIPAddresses(ctx context.Context, eniID string, toAllocate int) ([]string, error)

AssignPrivateIPAddresses assigns the specified number of secondary IP return allocated IPs

func (*Client) AttachNetworkInterface

func (c *Client) AttachNetworkInterface(ctx context.Context, instanceID, eniID string) error

AttachNetworkInterface attaches a previously created ENI to an instance

func (*Client) CreateNetworkInterface

func (c *Client) CreateNetworkInterface(ctx context.Context, secondaryPrivateIPCount int, vSwitchID string, groups []string, tags map[string]string) (string, *eniTypes.ENI, error)

CreateNetworkInterface creates an ENI with the given parameters

func (*Client) DeleteNetworkInterface

func (c *Client) DeleteNetworkInterface(ctx context.Context, eniID string) error

DeleteNetworkInterface deletes an ENI with the specified ID

func (*Client) DescribeNetworkInterface

func (c *Client) DescribeNetworkInterface(ctx context.Context, eniID string) (*ecs.NetworkInterfaceSet, error)

DescribeNetworkInterface get ENI by id

func (*Client) GetInstance

func (c *Client) GetInstance(ctx context.Context, vpcs ipamTypes.VirtualNetworkMap, subnets ipamTypes.SubnetMap, instanceID string) (*ipamTypes.Instance, error)

GetInstance returns the instance including its ENIs by the given instanceID

func (*Client) GetInstanceTypes

func (c *Client) GetInstanceTypes(ctx context.Context) ([]ecs.InstanceType, error)

GetInstanceTypes returns all the known ECS instance types in the configured region

func (*Client) GetInstances

GetInstances returns the list of all instances including their ENIs as instanceMap

func (*Client) GetSecurityGroups

func (c *Client) GetSecurityGroups(ctx context.Context) (types.SecurityGroupMap, error)

GetSecurityGroups return all sg

func (*Client) GetVPC

func (c *Client) GetVPC(ctx context.Context, vpcID string) (*ipamTypes.VirtualNetwork, error)

GetVPC get vpc by id

func (*Client) GetVPCs

GetVPCs retrieves and returns all VPCs

func (*Client) GetVSwitches

func (c *Client) GetVSwitches(ctx context.Context) (ipamTypes.SubnetMap, error)

GetVSwitches returns all ecs vSwitches as a subnetMap

func (*Client) UnassignPrivateIPAddresses

func (c *Client) UnassignPrivateIPAddresses(ctx context.Context, eniID string, addresses []string) error

PrUnassignivateIPAddresses unassign specified IP addresses from ENI should not provide Primary IP

func (*Client) WaitENIAttached

func (c *Client) WaitENIAttached(ctx context.Context, eniID string) (string, error)

WaitENIAttached check ENI is attached to ECS and return attached ECS instanceID

type MetricsAPI

type MetricsAPI interface {
	helpers.MetricsAPI
	ObserveAPICall(call, status string, duration float64)
}

MetricsAPI represents the metrics maintained by the AlibabaCloud API client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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