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
- type Billing
- type BindEipArgs
- type Client
- func (c *Client) BindEip(eip string, args *BindEipArgs) error
- func (c *Client) CreateEip(args *CreateEipArgs) (*CreateEipResult, error)
- func (c *Client) DeleteEip(eip, clientToken string) error
- func (c *Client) ListEip(args *ListEipArgs) (*ListEipResult, error)
- func (c *Client) PurchaseReservedEip(eip string, args *PurchaseReservedEipArgs) error
- func (c *Client) ResizeEip(eip string, args *ResizeEipArgs) error
- func (c *Client) StartAutoRenew(eip string, args *StartAutoRenewArgs) error
- func (c *Client) StopAutoRenew(eip string, clientToken string) error
- func (c *Client) UnBindEip(eip, clientToken string) error
- type CreateEipArgs
- type CreateEipResult
- type EipModel
- type ListEipArgs
- type ListEipResult
- type PurchaseReservedEipArgs
- type Reservation
- type ResizeEipArgs
- type StartAutoRenewArgs
Constants ¶
const ( URI_PREFIX = bce.URI_PREFIX + "v1" DEFAULT_ENDPOINT = "eip." + bce.DEFAULT_REGION + ".baidubce.com" REQUEST_EIP_URL = "/eip" )
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 Client ¶
Client of EIP service is a kind of BceClient, so derived from BceClient
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) DeleteEip ¶
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) 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) 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.22
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.22
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
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"` ClientToken string `json:"-"` }
type CreateEipResult ¶
type CreateEipResult struct {
Eip string `json:"eip"`
}
type EipModel ¶
type EipModel struct { Name string `json:"name"` Eip string `json:"eip"` Status string `json:"status"` EipInstanceType string `json:"eipInstanceType"` InstanceType string `json:"instanceType"` InstanceId string `json:"instanceId"` 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"` }