eip

package
v0.0.0-...-30e57c9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// PAYMENTTIMING_PREPAID eip
	PAYMENTTIMING_PREPAID string = "Prepaid"
	// PAYMENTTIMING_POSTPAID eip
	PAYMENTTIMING_POSTPAID string = "Postpaid"
	// BILLINGMETHOD_BYTRAFFIC eip
	BILLINGMETHOD_BYTRAFFIC string = "ByTraffic"
	// BILLINGMETHOD_BYBANDWIDTH eip
	BILLINGMETHOD_BYBANDWIDTH string = "ByBandwidth"
)

Variables

View Source
var Endpoint = map[string]string{
	"bj": "eip.bj.baidubce.com",
	"gz": "eip.gz.baidubce.com",
	"bd": "eip.bd.baidubce.com",
	"su": "eip.su.baidubce.com",
	"hk": "eip.hkg.baidubce.com",
}

Endpoint contains all endpoints of Baidu Cloud BCC.

Functions

This section is empty.

Types

type Billing

type Billing struct {
	PaymentTiming string `json:"paymentTiming"`
	BillingMethod string `json:"billingMethod"`
}

Billing json

type BindEipArgs

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

BindEipArgs json

type Client

type Client struct {
	*bce.Client
}

Client is the EIP client implemention for Baidu Cloud EIP API.

func NewEIPClient

func NewEIPClient(config *bce.Config) *Client

NewEIPClient returns client for EIP

func (*Client) BindEip

func (c *Client) BindEip(args *BindEipArgs) error

BindEip bind a eip

func (*Client) CreateEip

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

CreateEip create a eip

func (*Client) DeleteEip

func (c *Client) DeleteEip(args *EipArgs) error

DeleteEip delete a eip

func (*Client) GetEips

func (c *Client) GetEips(args *GetEipsArgs) ([]Eip, error)

GetEips get eips

func (*Client) GetURL

func (c *Client) GetURL(version string, params map[string]string) string

GetURL generates the full URL of http request for Baidu Cloud EIP API.

func (*Client) ResizeEip

func (c *Client) ResizeEip(args *ResizeEipArgs) error

ResizeEip resize a eip

func (*Client) UnbindEip

func (c *Client) UnbindEip(args *EipArgs) error

UnbindEip unbind a eip

type CreateEipArgs

type CreateEipArgs struct {
	//  公网带宽,单位为Mbps。
	// 对于prepay以及bandwidth类型的EIP,限制为为1~200之间的整数,
	// 对于traffic类型的EIP,限制为1~1000之前的整数。
	BandwidthInMbps int      `json:"bandwidthInMbps"`
	Billing         *Billing `json:"billing"`
	Name            string   `json:"name,omitempty"`
}

CreateEipArgs json

type CreateEipResponse

type CreateEipResponse struct {
	Ip string `json:"eip"`
}

CreateEipResponse json

type Eip

type Eip struct {
	Name            string          `json:"name"`
	Eip             string          `json:"eip"`
	Status          string          `json:"status"`
	EipInstanceType EipInstanceType `json:"eipInstanceType"`
	InstanceType    InstanceType    `json:"instanceType"`
	InstanceId      string          `json:"instanceId"`
	ShareGroupId    string          `json:"shareGroupId"`
	BandwidthInMbps int             `json:"bandwidthInMbps"`
	PaymentTiming   string          `json:"paymentTiming"`
	BillingMethod   string          `json:"billingMethod"`
	CreateTime      string          `json:"createTime"`
	ExpireTime      string          `json:"expireTime"`
}

Eip json

type EipArgs

type EipArgs struct {
	Ip string `json:"-"`
}

EipArgs json

type EipInstanceType

type EipInstanceType string

EipInstanceType type

const (
	// NORMAL type
	NORMAL EipInstanceType = "normal"
	// SHARED type
	SHARED EipInstanceType = "shared"
)

type GetEipsArgs

type GetEipsArgs struct {
	Ip           string       `json:"-"`
	InstanceType InstanceType `json:"instanceType"`
	InstanceId   string       `json:"instanceId"`
}

GetEipsArgs json

type GetEipsResponse

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

GetEipsResponse json

type InstanceType

type InstanceType string

InstanceType json

const (
	// BCC instance
	BCC InstanceType = "BCC"
	// BLB instance
	BLB InstanceType = "BLB"
)

type Reservation

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

Reservation json

type ResizeEipArgs

type ResizeEipArgs struct {
	BandwidthInMbps int    `json:"newBandwidthInMbps"`
	Ip              string `json:"-"`
}

ResizeEipArgs json

Jump to

Keyboard shortcuts

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