eip

package
v0.9.107 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Overview

Package eip defines the EIP services of BCE. The supported APIs are all defined in sub-package

eip.go - the eip APIs definition supported by the EIP service

model.go - definitions of the request arguments and results data structure model

Index

Constants

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

	DEFAULT_ENDPOINT = "eip." + bce.DEFAULT_REGION + ".baidubce.com"

	REQUEST_EIP_URL = "/eip"

	REQUEST_EIP_CLUSTER_URL = "/eipcluster"

	REQUEST_EIP_TP_URL = "/eiptp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Billing

type Billing struct {
	PaymentTiming string       `json:"paymentTiming,omitempty"`
	BillingMethod string       `json:"billingMethod,omitempty"`
	Reservation   *Reservation `json:"reservation,omitempty"`
}

type BindEipArgs

type BindEipArgs struct {
	InstanceType string `json:"instanceType"`
	InstanceId   string `json:"instanceId"`
	ClientToken  string `json:"-"`
}

type Client

type Client struct {
	*bce.BceClient
}

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

func NewClient

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

func (*Client) BindEip

func (c *Client) BindEip(eip string, args *BindEipArgs) error

BindEip - bind an EIP to an instance with the specific parameters

PARAMS:

  • eip: the specific EIP
  • args: the arguments to bind an EIP

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateEip

func (c *Client) CreateEip(args *CreateEipArgs) (*CreateEipResult, error)

CreateEip - create an EIP with the specific parameters

PARAMS:

  • args: the arguments to create an eip

RETURNS:

  • *CreateEipResult: the result of create EIP, contains new EIP's address
  • error: nil if success otherwise the specific error

func (*Client) CreateEipTp added in v0.9.87

func (c *Client) CreateEipTp(args *CreateEipTpArgs) (*CreateEipTpResult, error)

CreateEipTp - create an EIP TP with the specific parameters

PARAMS:

  • args: the arguments to create an eiptp

RETURNS:

  • *CreateEipTpResult: the created eiptp id.
  • error: nil if success otherwise the specific error

func (*Client) DeleteEip

func (c *Client) DeleteEip(eip, clientToken string) error

DeleteEip - delete an EIP

PARAMS:

  • eip: the specific EIP
  • clientToken: optional parameter, an Idempotent Token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DirectEip added in v0.9.65

func (c *Client) DirectEip(eip, clientToken string) error

DirectEip - turn on EIP pass through with the specific parameters

PARAMS:

  • eip: the specific EIP

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetEipCluster added in v0.9.35

func (c *Client) GetEipCluster(clusterId string) (*ClusterDetail, error)

func (*Client) GetEipTp added in v0.9.87

func (c *Client) GetEipTp(id string) (*EipTpDetail, error)

func (*Client) ListEip

func (c *Client) ListEip(args *ListEipArgs) (*ListEipResult, error)

ListEip - list all EIP with the specific parameters

PARAMS:

  • args: the arguments to list all eip

RETURNS:

  • *ListEipResult: the result of list all eip, contains new EIP's ID
  • error: nil if success otherwise the specific error

func (*Client) ListEipCluster added in v0.9.35

func (c *Client) ListEipCluster(args *ListEipArgs) (*ListClusterResult, error)

func (*Client) ListEipTp added in v0.9.87

func (c *Client) ListEipTp(args *ListEipTpArgs) (*ListEipTpResult, error)

ListEipTp - list all EIP TPs with the specific parameters

PARAMS:

  • args: the arguments to list all eiptps

RETURNS:

  • *ListEipTpResult: the result of listing all eiptps
  • error: nil if success otherwise the specific error

func (*Client) PurchaseReservedEip

func (c *Client) PurchaseReservedEip(eip string, args *PurchaseReservedEipArgs) error

PurchaseReservedEip - purchase reserve an eip with the specific parameters

PARAMS:

  • eip: the specific EIP
  • args: the arguments to purchase reserve an eip

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ResizeEip

func (c *Client) ResizeEip(eip string, args *ResizeEipArgs) error

ResizeEip - resize an EIP with the specific parameters

PARAMS:

  • eip: the specific EIP
  • args: the arguments to resize an EIP

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) StartAutoRenew added in v0.9.8

func (c *Client) StartAutoRenew(eip string, args *StartAutoRenewArgs) error

StartAutoRenew - start auto renew an eip

PARAMS:

  • eip: the specific EIP
  • args: the arguments to start auto renew an eip

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) StopAutoRenew added in v0.9.8

func (c *Client) StopAutoRenew(eip string, clientToken string) error

StopAutoRenew - stop eip auto renew

PARAMS:

  • eip: the specific EIP
  • clientToken: optional parameter, an Idempotent Token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnBindEip

func (c *Client) UnBindEip(eip, clientToken string) error

UnBindEip - unbind an EIP

PARAMS:

  • eip: the specific EIP
  • clientToken: optional parameter, an Idempotent Token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnDirectEip added in v0.9.65

func (c *Client) UnDirectEip(eip, clientToken string) error

UnDirectEip - turn off EIP pass through with the specific parameters

PARAMS:

  • eip: the specific EIP

RETURNS:

  • error: nil if success otherwise the specific error

type ClusterDetail added in v0.9.35

type ClusterDetail struct {
	ClusterId     string `json:"clusterId"`
	ClusterName   string `json:"clusterName"`
	ClusterRegion string `json:"clusterRegion"`
	ClusterAz     string `json:"clusterAz"`
	NetworkInBps  int64  `json:"networkInBps"`
	NetworkOutBps int64  `json:"networkOutBps"`
	NetworkInPps  int64  `json:"networkInPps"`
	NetworkOutPps int64  `json:"networkOutPps"`
}

type ClusterModel added in v0.9.35

type ClusterModel struct {
	ClusterId     string `json:"clusterId"`
	ClusterName   string `json:"clusterName"`
	ClusterRegion string `json:"clusterRegion"`
	ClusterAz     string `json:"clusterAz"`
}

type CreateEipArgs

type CreateEipArgs struct {
	Name              string           `json:"name,omitempty"`
	BandWidthInMbps   int              `json:"bandwidthInMbps"`
	Billing           *Billing         `json:"billing"`
	Tags              []model.TagModel `json:"tags"`
	AutoRenewTimeUnit string           `json:"autoRenewTimeUnit,omitempty"`
	AutoRenewTime     int              `json:"autoRenewTime,omitempty"`
	RouteType         string           `json:"routeType,omitempty"`
	ClientToken       string           `json:"-"`
}

type CreateEipResult

type CreateEipResult struct {
	Eip string `json:"eip"`
}

type CreateEipTpArgs added in v0.9.87

type CreateEipTpArgs struct {
	ReservationLength int    `json:"reservationLength,omitempty"`
	Capacity          string `json:"capacity,omitempty"`
	DeductPolicy      string `json:"deductPolicy,omitempty"`
	PackageType       string `json:"packageType,omitempty"`
	ClientToken       string `json:"-"`
}

type CreateEipTpResult added in v0.9.87

type CreateEipTpResult struct {
	Id string `json:"id,omitempty"`
}

type EipModel

type EipModel struct {
	Name            string           `json:"name"`
	Eip             string           `json:"eip"`
	EipId           string           `json:"eipId"`
	Status          string           `json:"status"`
	EipInstanceType string           `json:"eipInstanceType"`
	InstanceType    string           `json:"instanceType"`
	InstanceId      string           `json:"instanceId"`
	ShareGroupId    string           `json:"shareGroupId"`
	ClusterId       string           `json:"clusterId"`
	BandWidthInMbps int              `json:"bandwidthInMbps"`
	PaymentTiming   string           `json:"paymentTiming"`
	BillingMethod   string           `json:"billingMethod"`
	CreateTime      string           `json:"createTime"`
	ExpireTime      string           `json:"expireTime"`
	Tags            []model.TagModel `json:"tags"`
}

type EipTpDetail added in v0.9.87

type EipTpDetail struct {
	Id           string `json:"id,omitempty"`
	DeductPolicy string `json:"deductPolicy,omitempty"`
	PackageType  string `json:"packageType,omitempty"`
	Status       string `json:"status,omitempty"`
	Capacity     string `json:"capacity,omitempty"`
	UsedCapacity string `json:"usedCapacity,omitempty"`
	ActiveTime   string `json:"activeTime,omitempty"`
	ExpireTime   string `json:"expireTime,omitempty"`
	CreateTime   string `json:"createTime,omitempty"`
}

type ListClusterResult added in v0.9.35

type ListClusterResult struct {
	Marker      string         `json:"marker"`
	MaxKeys     int            `json:"maxKeys"`
	NextMarker  string         `json:"nextMarker"`
	IsTruncated bool           `json:"isTruncated"`
	ClusterList []ClusterModel `json:"clusterList"`
}

type ListEipArgs

type ListEipArgs struct {
	Eip          string
	InstanceType string
	InstanceId   string
	Marker       string
	MaxKeys      int
	Status       string
}

type ListEipResult

type ListEipResult struct {
	Marker      string     `json:"marker"`
	MaxKeys     int        `json:"maxKeys"`
	NextMarker  string     `json:"nextMarker"`
	IsTruncated bool       `json:"isTruncated"`
	EipList     []EipModel `json:"eipList"`
}

type ListEipTpArgs added in v0.9.87

type ListEipTpArgs struct {
	Id           string `json:"id,omitempty"`
	DeductPolicy string `json:"deductPolicy,omitempty"`
	Status       string `json:"status,omitempty"`
	Marker       string `json:"marker"`
	MaxKeys      int    `json:"maxKeys"`
}

type ListEipTpResult added in v0.9.87

type ListEipTpResult struct {
	Marker      string    `json:"marker"`
	MaxKeys     int       `json:"maxKeys"`
	NextMarker  string    `json:"nextMarker"`
	IsTruncated bool      `json:"isTruncated"`
	PackageList []Package `json:"packageList"`
}

type Package added in v0.9.87

type Package struct {
	Id           string `json:"id,omitempty"`
	DeductPolicy string `json:"deductPolicy,omitempty"`
	PackageType  string `json:"packageType,omitempty"`
	Status       string `json:"status,omitempty"`
	Capacity     string `json:"capacity,omitempty"`
	UsedCapacity string `json:"usedCapacity,omitempty"`
	ActiveTime   string `json:"activeTime"`
	ExpireTime   string `json:"expireTime"`
	CreateTime   string `json:"createTime"`
}

type PurchaseReservedEipArgs

type PurchaseReservedEipArgs struct {
	Billing     *Billing `json:"billing"`
	ClientToken string   `json:"clientToken"`
}

type Reservation

type Reservation struct {
	ReservationLength   int    `json:"reservationLength,omitempty"`
	ReservationTimeUnit string `json:"reservationTimeUnit,omitempty"`
}

type ResizeEipArgs

type ResizeEipArgs struct {
	NewBandWidthInMbps int    `json:"newBandwidthInMbps"`
	ClientToken        string `json:"-"`
}

type StartAutoRenewArgs added in v0.9.8

type StartAutoRenewArgs struct {
	AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"`
	AutoRenewTime     int    `json:"autoRenewTime,omitempty"`
	ClientToken       string `json:"-"`
}

Jump to

Keyboard shortcuts

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