eni

package
v0.9.208 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 18

Documentation

Overview

eni.go - the eni APIs definition supported by the eni service

Index

Constants

View Source
const (
	URI_PREFIX = bce.URI_PREFIX + "v1"

	DEFAULT_ENI = "bcc." + bce.DEFAULT_REGION + ".baidubce.com"

	REQUEST_ENI_URL = "/eni"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPrivateIpResult added in v0.9.49

type AddPrivateIpResult struct {
	PrivateIpAddress string `json:"privateIpAddress"`
}

type BatchAddPrivateIpResult added in v0.9.113

type BatchAddPrivateIpResult struct {
	PrivateIpAddresses []string `json:"privateIpAddresses"`
}

type BindEniPublicIpArgs

type BindEniPublicIpArgs struct {
	EniId            string `json:"-"`
	ClientToken      string `json:"-"`
	PrivateIpAddress string `json:"privateIpAddress"`
	PublicIpAddress  string `json:"publicIpAddress"`
}

type Client

type Client struct {
	*bce.BceClient
}

Client of ENI service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) AddPrivateIp added in v0.9.49

func (c *Client) AddPrivateIp(args *EniPrivateIpArgs) (*AddPrivateIpResult, error)

AddPrivateIp - add private ip

PARAMS:

  • args: the arguments to add private ip

RETURNS:

  • *AddPrivateIpResult: the private ip
  • error: nil if success otherwise the specific error

func (*Client) AttachEniInstance

func (c *Client) AttachEniInstance(args *EniInstance) error

AttachEniInstance - eni attach instance

PARAMS:

  • args: the arguments to attach instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) BatchAddPrivateIp added in v0.9.113

func (c *Client) BatchAddPrivateIp(args *EniBatchPrivateIpArgs) (*BatchAddPrivateIpResult, error)

BatchAddPrivateIp - batch add private ips

PARAMS:

  • args: the arguments to batch add private ips, property PrivateIpAddresses or PrivateIpAddressCount is required; when PrivateIpAddressCount is set, private ips will be auto allocated, and if you want assign private ips, please just set PrivateIpAddresses;

RETURNS:

  • *BatchAddPrivateIpResult: the private ips
  • error: nil if success otherwise the specific error

func (*Client) BatchAddPrivateIpCrossSubnet added in v0.9.113

func (c *Client) BatchAddPrivateIpCrossSubnet(args *EniBatchAddPrivateIpCrossSubnetArgs) (*BatchAddPrivateIpResult, error)

BatchAddPrivateIpCrossSubnet - batch add private ips that support cross subnet, white list function

PARAMS:

  • args: the arguments to batch add private ips, property PrivateIps or PrivateIpAddressCount is required; when PrivateIpAddressCount is set, private ips in subnet assigned by 'SubnetId' property will be auto allocated; if you want assign private ips, please just set PrivateIps, and you can also assgin subnet with property 'PrivateIpArgs.SubnetId';

RETURNS:

  • *BatchAddPrivateIpResult: the private ips
  • error: nil if success otherwise the specific error

func (*Client) BatchDeletePrivateIp added in v0.9.113

func (c *Client) BatchDeletePrivateIp(args *EniBatchPrivateIpArgs) error

BatchDeletePrivateIp - batch delete private ip

PARAMS:

  • args: the arguments to batch delete private ipa

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) BindEniPublicIp

func (c *Client) BindEniPublicIp(args *BindEniPublicIpArgs) error

BindEniPublicIp - eni bind public ip

PARAMS:

  • args: the arguments to bind public ip

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateEni

func (c *Client) CreateEni(args *CreateEniArgs) (*CreateEniResult, error)

CreateEni - create an eni with the specific parameters

PARAMS:

  • args: the arguments to create an eni

RETURNS:

  • *CreateEniResult: the result of create eni
  • error: nil if success otherwise the specific error

func (*Client) DeleteEni

func (c *Client) DeleteEni(args *DeleteEniArgs) error

DeleteEni - delete an eni

PARAMS:

  • DeleteEniArgs: the arguments to delete an eni

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeletePrivateIp added in v0.9.49

func (c *Client) DeletePrivateIp(args *EniPrivateIpArgs) error

DeletePrivateIp - delete private ip

PARAMS:

  • args: the arguments to delete private ip

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DetachEniInstance

func (c *Client) DetachEniInstance(args *EniInstance) error

DetachEniInstance - eni detach instance

PARAMS:

  • args: the arguments to detach instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetEniDetail

func (c *Client) GetEniDetail(eniId string) (*Eni, error)

GetEniDetail - get the eni detail

PARAMS:

  • eniId: the specific eniId

RETURNS:

  • *Eni: the eni
  • error: nil if success otherwise the specific error

func (*Client) GetEniQuota added in v0.9.95

func (c *Client) GetEniQuota(args *EniQuoteArgs) (*EniQuoteInfo, error)

func (*Client) GetEniStatus added in v0.9.162

func (c *Client) GetEniStatus(eniId string) (*EniStatusInfo, error)

GetEniStatus - get an eni status

PARAMS:

  • eniId: the arguments to get an eni status

RETURNS:

  • *EniStatusInfo: the result of get an eni status
  • error: nil if success otherwise the specific error

func (*Client) ListEni

func (c *Client) ListEni(args *ListEniArgs) (*ListEniResult, error)

ListEnis - list all eni with the specific parameters

PARAMS:

  • args: the arguments to list all eni

RETURNS:

  • *ListEniResult: the result of list all eni
  • error: nil if success otherwise the specific error

func (*Client) UnBindEniPublicIp

func (c *Client) UnBindEniPublicIp(args *UnBindEniPublicIpArgs) error

UnBindEniPublicIp - eni unbind public ip

PARAMS:

  • args: the arguments to unbind public ip

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateEni

func (c *Client) UpdateEni(args *UpdateEniArgs) error

UpdateEni - update an eni

PARAMS:

  • UpdateEniArgs: the arguments to update an eni

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateEniEnterpriseSecurityGroup added in v0.9.117

func (c *Client) UpdateEniEnterpriseSecurityGroup(args *UpdateEniEnterpriseSecurityGroupArgs) error

UpdateEniEnterpriseSecurityGroup - update eni enterprise security group

PARAMS:

  • args: the arguments to update eni enterprise security group

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateEniSecurityGroup

func (c *Client) UpdateEniSecurityGroup(args *UpdateEniSecurityGroupArgs) error

UpdateEniSecurityGroup - update eni sg

PARAMS:

  • args: the arguments to update eni sg

RETURNS:

  • error: nil if success otherwise the specific error

type CreateEniArgs

type CreateEniArgs struct {
	ClientToken                string           `json:"-"`
	Name                       string           `json:"name"`
	SubnetId                   string           `json:"subnetId"`
	InstanceId                 string           `json:"instanceId,omitempty"`
	SecurityGroupIds           []string         `json:"securityGroupIds"`
	EnterpriseSecurityGroupIds []string         `json:"enterpriseSecurityGroupIds"`
	PrivateIpSet               []PrivateIp      `json:"privateIpSet"`
	Ipv6PrivateIpSet           []PrivateIp      `json:"ipv6PrivateIpSet,omitempty"`
	Description                string           `json:"description,omitempty"`
	Tags                       []model.TagModel `json:"tags,omitempty"`
}

type CreateEniResult

type CreateEniResult struct {
	EniId string `json:"eniId"`
}

type DeleteEniArgs

type DeleteEniArgs struct {
	EniId       string
	ClientToken string
}

type Eni

type Eni struct {
	EniId                      string           `json:"eniId"`
	Name                       string           `json:"name"`
	ZoneName                   string           `json:"zoneName"`
	Description                string           `json:"description"`
	InstanceId                 string           `json:"instanceId"`
	MacAddress                 string           `json:"macAddress"`
	VpcId                      string           `json:"vpcId"`
	SubnetId                   string           `json:"subnetId"`
	Status                     string           `json:"status"`
	PrivateIpSet               []PrivateIp      `json:"privateIpSet"`
	Ipv6PrivateIpSet           []PrivateIp      `json:"ipv6PrivateIpSet"`
	SecurityGroupIds           []string         `json:"securityGroupIds"`
	EnterpriseSecurityGroupIds []string         `json:"enterpriseSecurityGroupIds"`
	CreatedTime                string           `json:"createdTime"`
	Tags                       []model.TagModel `json:"tags,omitempty"`
}

type EniBatchAddPrivateIpCrossSubnetArgs added in v0.9.113

type EniBatchAddPrivateIpCrossSubnetArgs struct {
	EniId                 string          `json:"-"`
	ClientToken           string          `json:"-"`
	SubnetId              string          `json:"subnetId"`
	IsIpv6                bool            `json:"isIpv6,omitempty"`
	PrivateIps            []PrivateIpArgs `json:"privateIps"`
	PrivateIpAddressCount int             `json:"privateIpAddressCount,omitempty"`
}

type EniBatchPrivateIpArgs added in v0.9.113

type EniBatchPrivateIpArgs struct {
	EniId                 string   `json:"-"`
	ClientToken           string   `json:"-"`
	IsIpv6                bool     `json:"isIpv6,omitempty"`
	PrivateIpAddresses    []string `json:"privateIpAddresses"`
	PrivateIpAddressCount int      `json:"privateIpAddressCount,omitempty"`
}

type EniInstance

type EniInstance struct {
	EniId       string `json:"-"`
	InstanceId  string `json:"instanceId"`
	ClientToken string `json:"-"`
}

type EniPrivateIpArgs added in v0.9.49

type EniPrivateIpArgs struct {
	EniId            string `json:"-"`
	ClientToken      string `json:"-"`
	IsIpv6           bool   `json:"isIpv6,omitempty"`
	PrivateIpAddress string `json:"privateIpAddress"`
}

type EniQuoteArgs added in v0.9.95

type EniQuoteArgs struct {
	EniId      string `json:"-"`
	InstanceId string `json:"-"`
}

type EniQuoteInfo added in v0.9.95

type EniQuoteInfo struct {
	TotalQuantity     int `json:"totalQuantity"`
	AvailableQuantity int `json:"availableQuantity"`
}

type EniStatusInfo added in v0.9.162

type EniStatusInfo struct {
	Status string `json:"status"`
}

type ListEniArgs

type ListEniArgs struct {
	VpcId            string
	InstanceId       string
	Name             string
	Marker           string
	MaxKeys          int
	PrivateIpAddress []string `json:"privateIpAddress,omitempty"`
}

type ListEniResult

type ListEniResult struct {
	Eni         []Eni  `json:"enis"`
	Marker      string `json:"marker"`
	IsTruncated bool   `json:"isTruncated"`
	NextMarker  string `json:"nextMarker"`
	MaxKeys     int    `json:"maxKeys"`
}

type PrivateIp

type PrivateIp struct {
	PublicIpAddress  string `json:"publicIpAddress"`
	Primary          bool   `json:"primary"`
	PrivateIpAddress string `json:"privateIpAddress"`
}

type PrivateIpArgs added in v0.9.113

type PrivateIpArgs struct {
	PrivateIpAddress string `json:"privateIpAddress"`
	SubnetId         string `json:"subnetId"`
}

type UnBindEniPublicIpArgs

type UnBindEniPublicIpArgs struct {
	EniId           string `json:"-"`
	ClientToken     string `json:"-"`
	PublicIpAddress string `json:"publicIpAddress"`
}

type UpdateEniArgs

type UpdateEniArgs struct {
	EniId       string `json:"-"`
	ClientToken string `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type UpdateEniEnterpriseSecurityGroupArgs added in v0.9.117

type UpdateEniEnterpriseSecurityGroupArgs struct {
	EniId                      string   `json:"-"`
	ClientToken                string   `json:"-"`
	EnterpriseSecurityGroupIds []string `json:"enterpriseSecurityGroupIds"`
}

type UpdateEniSecurityGroupArgs

type UpdateEniSecurityGroupArgs struct {
	EniId            string   `json:"-"`
	ClientToken      string   `json:"-"`
	SecurityGroupIds []string `json:"securityGroupIds"`
}

Jump to

Keyboard shortcuts

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