eips

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 3 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type ApplyOpts

type ApplyOpts struct {
	IP                  PublicIpOpts  `json:"publicip" required:"true"`
	Bandwidth           BandwidthOpts `json:"bandwidth" required:"true"`
	EnterpriseProjectID string        `json:"enterprise_project_id,omitempty"`

	//ExtendParam is only valid by v2.0 client
	ExtendParam *structs.ChargeInfo `json:"extendParam,omitempty"`
}

ApplyOpts is a struct which is used to create public ip

func (ApplyOpts) ToPublicIpApplyMap

func (opts ApplyOpts) ToPublicIpApplyMap() (map[string]interface{}, error)

type ApplyOptsBuilder

type ApplyOptsBuilder interface {
	ToPublicIpApplyMap() (map[string]interface{}, error)
}

ApplyOptsBuilder is an interface by which can build the request body of public ip application

type ApplyResult

type ApplyResult struct {
	golangsdk.Result
}

ApplyResult is a struct which represents the result of apply public ip

func Apply

func Apply(client *golangsdk.ServiceClient, opts ApplyOptsBuilder) (r ApplyResult)

Apply is a method by which can access to apply the public ip

func (ApplyResult) Extract

func (r ApplyResult) Extract() (PublicIp, error)

type BandwidthOpts

type BandwidthOpts struct {
	Name       string `json:"name,omitempty"`
	Size       int    `json:"size,omitempty"`
	Id         string `json:"id,omitempty"`
	ShareType  string `json:"share_type" required:"true"`
	ChargeMode string `json:"charge_mode,omitempty"`
}

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is a struct of delete result

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete is a method by which can be able to delete a private ip

type GetResult

type GetResult struct {
	golangsdk.Result
}

GetResult is a return struct of get method

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

Get is a method by which can get the detailed information of public ip

func (GetResult) Extract

func (r GetResult) Extract() (PublicIp, error)

type ListOpts

type ListOpts struct {
	// Specifies the resource ID of pagination query. If the parameter
	// is left blank, only resources on the first page are queried.
	Marker string `q:"marker"`

	// Specifies the number of records returned on each page. The
	// value ranges from 0 to intmax.
	Limit int `q:"limit"`

	// Value range: 4, 6, respectively, to create ipv4 and ipv6, when not created ipv4 by default
	IPVersion int `q:"ip_version"`

	// Associated port id
	PortId string `q:"port_id"`

	// Public IP address
	PublicIp string `q:"public_ip_address"`

	// enterprise_project_id
	// You can use this field to filter the elastic public IP under an enterprise project.
	EnterpriseProjectId string `q:"enterprise_project_id"`
}

func (ListOpts) ToListPublicIPQuery

func (opts ListOpts) ToListPublicIPQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToListPublicIPQuery() (string, error)
}

type PublicIPPage

type PublicIPPage struct {
	pagination.LinkedPageBase
}

func (PublicIPPage) IsEmpty

func (r PublicIPPage) IsEmpty() (bool, error)

IsEmpty checks whether a NetworkPage struct is empty.

func (PublicIPPage) NextPageURL

func (r PublicIPPage) NextPageURL() (string, error)

type PublicIp

type PublicIp struct {
	ID                  string `json:"id"`
	Status              string `json:"status"`
	Type                string `json:"type"`
	PublicAddress       string `json:"public_ip_address"`
	PrivateAddress      string `json:"private_ip_address"`
	PortID              string `json:"port_id"`
	TenantID            string `json:"tenant_id"`
	OrderID             string `json:"order_id"`
	CreateTime          string `json:"create_time"`
	BandwidthID         string `json:"bandwidth_id"`
	BandwidthSize       int    `json:"bandwidth_size"`
	BandwidthShareType  string `json:"bandwidth_share_type"`
	EnterpriseProjectID string `json:"enterprise_project_id"`
}

PublicIp is a struct that represents a public ip

func ExtractPublicIPs

func ExtractPublicIPs(r pagination.Page) ([]PublicIp, error)

type PublicIpOpts

type PublicIpOpts struct {
	Type    string `json:"type" required:"true"`
	Address string `json:"ip_address,omitempty"`
}

type UpdateOpts

type UpdateOpts struct {
	PortID string `json:"port_id,omitempty"`
}

UpdateOpts is a struct which represents the request body of update method

func (UpdateOpts) ToPublicIpUpdateMap

func (opts UpdateOpts) ToPublicIpUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToPublicIpUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder is an interface by which can be able to build the request body

type UpdateResult

type UpdateResult struct {
	golangsdk.Result
}

UpdateResult is a struct which contains the result of update method

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

Update is a method which can be able to update the port of public ip

func (UpdateResult) Extract

func (r UpdateResult) Extract() (PublicIp, error)

Jump to

Keyboard shortcuts

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