Help us shape the future of Go! Take the 2026 Go Developer Survey

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: 3 Imported by: 0

Documentation

Overview

Package bandwidths manages shared bandwidths through the VPC v2.0 API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

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

Delete removes a shared bandwidth. Only a shared bandwidth can be deleted.

func RemoveEip

func RemoveEip(client *golangsdk.ServiceClient, id string, opts RemoveEipOpts) error

RemoveEip removes one or more EIPs from a shared bandwidth.

Types

type AddEipOpts

type AddEipOpts struct {
	// Specifies information about the EIP(s) to be added to the shared
	// bandwidth. A shared bandwidth can be used by up to 20 EIPs by
	// default.
	PublicipInfo []InsertPublicIPInfo `json:"publicip_info" required:"true"`
}

type Bandwidth

type Bandwidth struct {
	// Specifies the bandwidth name. The value can contain 1 to 64
	// characters, including letters, digits, underscores (_), hyphens (-),
	// and periods (.).
	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 dedicated. 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 WHOLE can be used by multiple EIPs, a
	// bandwidth whose type is PER can be used by only one EIP.
	PublicipInfo []PublicIPInfo `json:"publicip_info"`

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

	// Specifies the bandwidth type. The default value for a shared
	// bandwidth is "share".
	BandwidthType string `json:"bandwidth_type"`

	// Specifies that the bandwidth is billed by bandwidth. The value can be
	// "traffic".
	ChargeMode string `json:"charge_mode"`

	// Specifies the billing information. If specified, the bandwidth is in
	// yearly/monthly billing mode.
	BillingInfo string `json:"billing_info"`

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

	// Specifies the bandwidth status. Possible values are FREEZED (frozen)
	// and NORMAL (normal).
	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 shared bandwidth.

func AddEip

func AddEip(client *golangsdk.ServiceClient, id string, opts AddEipOpts) (*Bandwidth, error)

AddEip adds one or more EIPs to a shared bandwidth.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Bandwidth, error)

Create assigns a new shared bandwidth.

type CreateOpts

type CreateOpts struct {
	// Specifies the bandwidth name. The value can contain 1 to 64
	// characters, including letters, digits, underscores (_), hyphens (-),
	// and periods (.).
	Name string `json:"name" required:"true"`

	// Specifies the bandwidth size. The shared bandwidth has a minimum
	// limit, which may vary depending on sites. The default minimum value
	// is 5 Mbit/s. The value ranges from 1 Mbit/s to 1000 Mbit/s by
	// default.
	Size int `json:"size" required:"true"`

	// Specifies the enterprise project ID.
	EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`

	// Specifies whether it is in a central site or an edge site. This
	// resource can only be associated with an EIP of the same region.
	PublicBorderGroup string `json:"public_border_group,omitempty"`
}

type InsertPublicIPInfo

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

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

InsertPublicIPInfo describes an EIP to be added to a shared bandwidth.

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"`

	// Specifies the obtained EIP if IPv6 EIPs are available. This parameter
	// does not exist if only IPv4 EIPs are available.
	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 shared bandwidth.

type RemoveEipOpts

type RemoveEipOpts struct {
	// Specifies information about the EIP(s) to be removed from the shared
	// bandwidth.
	PublicipInfo []RemovePublicIPInfo `json:"publicip_info" required:"true"`

	// After an EIP is removed from a shared bandwidth, a dedicated
	// bandwidth is allocated to the EIP. Specifies whether that dedicated
	// bandwidth is billed by traffic or by bandwidth. The value can be
	// "bandwidth" or "traffic".
	ChargeMode string `json:"charge_mode" required:"true"`

	// After an EIP is removed from a shared bandwidth, a dedicated
	// bandwidth is allocated to the EIP. Specifies the size (Mbit/s) of
	// that dedicated bandwidth.
	Size int `json:"size" required:"true"`
}

type RemovePublicIPInfo

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

RemovePublicIPInfo describes an EIP to be removed from a shared bandwidth.

Jump to

Keyboard shortcuts

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