bandwidths

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package bandwidths manages dedicated bandwidths through the VPC v1 API.

You can allocate a bandwidth when assigning an EIP so that the resource bound with the EIP can use the bandwidth to access the Internet. The bandwidth displays network resource usage and can be used for service metering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BandWidth

type BandWidth struct {
	// Specifies the bandwidth name. The value is a string of 1 to 64
	// characters that can contain letters, digits, underscores (_), and
	// hyphens (-).
	Name string `json:"name"`

	// Specifies the bandwidth size in Mbit/s.
	Size int `json:"size"`

	// Specifies the bandwidth ID, which uniquely identifies the bandwidth.
	ID string `json:"id"`

	// Specifies whether the bandwidth is shared or exclusive. The value can
	// be PER (dedicated) or WHOLE (shared).
	ShareType string `json:"share_type"`

	// Specifies information about the EIP(s) that use the bandwidth. A
	// bandwidth whose type is set to WHOLE supports up to 20 EIPs. A
	// bandwidth whose type is set to PER supports only one EIP.
	PublicipInfo []PublicIpinfo `json:"publicip_info"`

	// Specifies the project ID of the user.
	TenantId string `json:"tenant_id"`

	// Specifies the bandwidth type.
	BandwidthType string `json:"bandwidth_type"`

	// Specifies the charging mode (by traffic or by bandwidth).
	ChargeMode string `json:"charge_mode"`

	// Specifies the billing information.
	BillingInfo string `json:"billing_info"`

	// Specifies the enterprise project ID.
	EnterpriseProjectID string `json:"enterprise_project_id"`

	// Specifies the bandwidth status.
	Status string `json:"status"`

	// Specifies the time (UTC) when the bandwidth was created.
	CreatedAt string `json:"created_at"`

	// Specifies the time (UTC) when the bandwidth was updated.
	UpdatedAt string `json:"updated_at"`

	// Specifies whether the bandwidth is in a central site or an edge site.
	PublicBorderGroup string `json:"public_border_group"`
}

BandWidth describes a dedicated or shared bandwidth.

func ExtractBandWidths

func ExtractBandWidths(page pagination.NewPage) ([]BandWidth, error)

func Get

func Get(client *golangsdk.ServiceClient, id string) (*BandWidth, error)

Get retrieves details of a bandwidth by its ID.

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]BandWidth, error)

List retrieves bandwidths matching the given search criteria.

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOpts) (*BandWidth, error)

Update modifies the name and/or size of a bandwidth.

type BandWidthPage

type BandWidthPage struct {
	pagination.NewPageResult
}

func (BandWidthPage) NewIsEmpty added in v0.9.9

func (p BandWidthPage) NewIsEmpty() (bool, error)

func (BandWidthPage) NewNextPageURL added in v0.9.9

func (p BandWidthPage) NewNextPageURL() (string, 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,omitempty"`

	// Specifies the number of records returned on each page.
	Limit int `q:"limit,omitempty"`

	// Specifies the enterprise project ID. This field can be used to filter
	// bandwidths under an enterprise project.
	EnterpriseProjectId string `q:"enterprise_project_id,omitempty"`
}

type PublicIpinfo

type PublicIpinfo struct {
	// Specifies the ID of the EIP that uses the bandwidth.
	PublicipId string `json:"publicip_id"`

	// Specifies the obtained EIP if only IPv4 EIPs are available.
	PublicipAddress string `json:"publicip_address"`

	// Publicipv6Address is not documented for this operation in the reviewed
	// OTC documentation.
	Publicipv6Address string `json:"publicipv6_address"`

	// Specifies the IP address version. Possible values are 4 (IPv4) and 6
	// (IPv6).
	IPVersion int `json:"ip_version"`

	// Specifies the EIP type.
	PublicipType string `json:"publicip_type"`
}

PublicIpinfo describes an EIP that uses a bandwidth.

type UpdateOpts

type UpdateOpts struct {
	// Specifies the bandwidth name. The value is a string of 1 to 64
	// characters that can contain letters, digits, underscores (_), and
	// hyphens (-). Either Name or Size must be specified.
	Name string `json:"name,omitempty"`

	// Specifies the bandwidth size in Mbit/s. Either Name or Size must be
	// specified.
	Size int `json:"size,omitempty"`
}

Jump to

Keyboard shortcuts

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