eni

package
v0.9.71 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 4 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 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) 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) 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 bind 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) 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"`
	SecurityGroupIds []string    `json:"securityGroupIds"`
	PrivateIpSet     []PrivateIp `json:"privateIpSet"`
	Description      string      `json:"description,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"`
	SecurityGroupIds []string    `json:"securityGroupIds"`
	CreatedTime      string      `json:"createdTime"`
}

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:"-"`
	PrivateIpAddress string `json:"privateIpAddress"`
}

type ListEniArgs

type ListEniArgs struct {
	VpcId   string
	Marker  string
	MaxKeys int
}

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 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 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