routes

package
v0.0.0-...-e794f14 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

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

Delete is a method to remove an existing route from a specified route table.

Types

type Attachment

type Attachment struct {
	// The resource ID for the corresponding attachment.
	ResourceId string `json:"resource_id"`
	// The resource type for the corresponding attachment.
	ResourceType string `json:"resource_type"`
	// The ID of the corresponding attachment.
	AttachmentId string `json:"attachment_id"`
}

Attachment is an object that represents the details of the corresponding route.

type CreateOpts

type CreateOpts struct {
	// The destination of the route.
	Destination string `json:"destination" required:"true"`
	// The ID of the corresponding attachment.
	AttachmentId string `json:"attachment_id,omitempty"`
	// Whether route is the black hole route.
	IsBlackHole *bool `json:"is_blackhole,omitempty"`
}

CreateOpts is the structure used to create the route under a specified route table.

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 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 the destinations, support for querying multiple routes.
	Destination []string `q:"destination"`
	// The list of attachment IDs, support for querying multiple routes.
	AttachmentIds []string `json:"attachment_id"`
	// The list of attachment resource types, support for querying multiple routes.
	ResourceType []string `json:"resource_type"`
	// The list of keyword to sort the associations 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 Route

type Route struct {
	// The ID of the route.
	ID string `json:"id"`
	// The type of the route.
	Type string `json:"type"`
	// Whether route is the black hole route.
	IsBlackHole bool `json:"is_blackhole"`
	// The destination of the route.
	Destination string `json:"destination"`
	// The corresponding attachments.
	Attachments []Attachment `json:"attachments"`
	// The ID of the route table to which the route belongs.
	RouteTableId string `json:"route_table_id"`
	// The current status of the route.
	Status string `json:"state"`
	// The creation time of the association.
	CreatedAt string `json:"created_at"`
	// The last update time of the association.
	UpdatedAt string `json:"updated_at"`
}

Route is the structure that represents the details of the route under a specified route table.

func Create

func Create(client *golangsdk.ServiceClient, routeTableId string, opts CreateOpts) (*Route, error)

Create is a method to create a new route under a specified route table.

func Get

func Get(client *golangsdk.ServiceClient, routeTableId, routeId string) (*Route, error)

Get is a method to obtain the route details using given parameters.

func List

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

List is a method to query the list of the routes under a specified route table using given parameters.

func Update

func Update(client *golangsdk.ServiceClient, routeTableId, routeId string, opts UpdateOpts) (*Route, error)

Update is a method to update route configuration using update option.

type RoutePage

type RoutePage struct {
	pagination.MarkerPageBase
}

RoutePage represents the response pages of the List method.

func (RoutePage) IsEmpty

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

IsEmpty returns true if a ListResult no route.

func (RoutePage) LastMarker

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

LastMarker returns the last marker index in a ListResult.

type UpdateOpts

type UpdateOpts struct {
	// The ID of the corresponding attachment.
	AttachmentId string `json:"attachment_id,omitempty"`
	// Whether route is the black hole route.
	IsBlackHole *bool `json:"is_blackhole,omitempty"`
}

UpdateOpts is the structure used to update the route configuration.

Jump to

Keyboard shortcuts

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