routetables

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

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

Delete is a method to remove an existing route table under a specified ER instance.

Types

type BgpOptions

type BgpOptions struct {
	// Whether the AS path attributes of the routes are not compared during load balancing.
	LoadBalancingAsPathIgnore *bool `json:"load_balancing_as_path_ignore,omitempty"`
	// Whether the AS path attributes of the same length are not compared during load balancing.
	LoadBalancingAsPathRelax *bool `json:"load_balancing_as_path_relax,omitempty"`
}

BgpOptions is an object that represents the BGP configuration for routing.

type CreateOpts

type CreateOpts struct {
	// The name of the route table.
	// The value can contain 1 to 64 characters, only english and chinese letters, digits, underscore (_), hyphens (-)
	// and dots (.) are allowed.
	Name string `json:"name" required:"true"`
	// The description of the route table.
	// The value contain a maximum of 255 characters, and the angle brackets (< and >) are not allowed.
	Description string `json:"description,omitempty"`
	// The configuration of the BGP route selection.
	BgpOptions BgpOptions `json:"bgp_options,omitempty"`
	// The key/value pairs to associate with the route table.
	Tags []tags.ResourceTag `json:"tags,omitempty"`
}

CreateOpts is the structure required by the 'Create' method to create a route table under a specified ER instance.

type ListOpts

type ListOpts struct {
	// Number of records to be queried.
	// The valid value is range from 0 to 2000.
	Limit int `q:"limit"`
	// The ID of the route table of the last record on the previous page.
	// If it is empty, it is the first page of the query.
	// This parameter must be used together with limit.
	// The valid value is range from 1 to 128.
	Marker string `q:"marker"`
	// The list of current status of the route tables, support for querying multiple route tables.
	Status []string `q:"state"`
	// Whether this route table is the default association route table.
	IsDefaultAssociation bool `q:"is_default_association"`
	// Whether this route table is the default propagation route table.
	IsDefaultPropagation bool `q:"is_default_propagation"`
	// The list of keyword to sort the route tables result, sort by ID by default.
	// The optional values are as follow:
	// + id
	// + name
	// + state
	SortKey []string `q:"sort_key"`
	// The returned results are arranged in ascending or descending order, the default is asc.
	SortDir []string `q:"sort_dir"`
}

ListOpts allows to filter list data using given parameters.

type RouteTable

type RouteTable struct {
	// The ID of the route table.
	ID string `json:"id"`
	// The name of the route table.
	// The value can contain 1 to 64 characters, only english and chinese letters, digits, underscore (_), hyphens (-)
	// and dots (.) are allowed.
	Name string `json:"name"`
	// The description of the route table.
	// The value contain a maximum of 255 characters, and the angle brackets (< and >) are not allowed.
	Description string `json:"description"`
	// The configuration of the BGP route selection.
	BgpOptions BgpOptions `json:"bgp_options"`
	// The key/value pairs to associate with the route table.
	Tags []tags.ResourceTag `json:"tags"`
	// Whether this route table is the default association route table.
	IsDefaultAssociation bool `json:"is_default_association"`
	// Whether this route table is the default propagation route table.
	IsDefaultPropagation bool `json:"is_default_propagation"`
	// The current status of the route table.
	Status string `json:"state"`
	// The creation time of the route table.
	CreatedAt string `json:"created_at"`
	// The last update time of the route table.
	UpdatedAt string `json:"updated_at"`
}

RouteTable is the structure that represents the details of the route table for ER service.

func Create

func Create(client *golangsdk.ServiceClient, instanceId string, opts CreateOpts) (*RouteTable, error)

Create is a method to create a new route table under a specified ER instance using given parameters.

func Get

func Get(client *golangsdk.ServiceClient, instanceId, routeTableId string) (*RouteTable, error)

Get is a method to obtain the route table details under a specified ER instance.

func List

func List(client *golangsdk.ServiceClient, instanceId string, opts ListOpts) ([]RouteTable, error)

List is a method to query the list of the route tables under a specified ER instance using given parameters.

func Update

func Update(client *golangsdk.ServiceClient, instanceId, routeTableId string, opts UpdateOpts) (*RouteTable, error)

Update is a method to update the route table under a specified ER instance using parameters.

type RouteTablePage

type RouteTablePage struct {
	pagination.MarkerPageBase
}

RouteTablePage represents the response pages of the List method.

func (RouteTablePage) IsEmpty

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

IsEmpty returns true if a ListResult no route table.

func (RouteTablePage) LastMarker

func (r RouteTablePage) LastMarker() (string, error)

LastMarker returns the last marker index in a ListResult.

type UpdateOpts

type UpdateOpts struct {
	// The name of the route table.
	// The value can contain 1 to 64 characters, only english and chinese letters, digits, underscore (_), hyphens (-)
	// and dots (.) are allowed.
	Name string `json:"name,omitempty"`
	// The description of the route table.
	// The value contain a maximum of 255 characters, and the angle brackets (< and >) are not allowed.
	Description *string `json:"description,omitempty"`
}

UpdateOpts is the structure required by the 'Update' method to update the route table configuration.

Jump to

Keyboard shortcuts

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