associations

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: 2 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, opts DeleteOpts) error

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

Types

type Association

type Association struct {
	// The ID of the association.
	ID string `json:"id"`
	// The ID of the route table to which the association belongs.
	RouteTableId string `json:"route_table_id"`
	// The ID of the corresponding attachment.
	AttachmentId string `json:"attachment_id"`
	// The resource type for the corresponding attachment.
	ResourceType string `json:"resource_type"`
	// The resource ID for the corresponding attachment.
	ResourceId string `json:"resource_id"`
	// The configuration of the export routing policy.
	RoutePolicy ExportRoutePolicy `json:"route_policy"`
	// The current status of the association.
	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"`
}

Association is the structure that represents the details of the association under route table.

func Create

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

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

func List

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

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

type AssociationPage

type AssociationPage struct {
	pagination.MarkerPageBase
}

AssociationPage represents the response pages of the List method.

func (AssociationPage) IsEmpty

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

IsEmpty returns true if a ListResult no association.

func (AssociationPage) LastMarker

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

LastMarker returns the last marker index in a ListResult.

type CreateOpts

type CreateOpts struct {
	// The ID of the VPC attachment.
	AttachmentId string `json:"attachment_id,omitempty"`
	// The export routing policy.
	RoutePolicy ExportRoutePolicy `json:"route_policy,omitempty"`
}

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

type DeleteOpts

type DeleteOpts struct {
	// The ID of the VPC attachment.
	AttachmentId string `json:"attachment_id,omitempty"`
	// The export routing policy.
	RoutePolicy ExportRoutePolicy `json:"route_policy,omitempty"`
}

DeleteOpts is the structure used to remove an association from a specified route table.

type ExportRoutePolicy

type ExportRoutePolicy struct {
	// The export routing policy ID.
	ExportPoilicyId string `json:"export_policy_id,omitempty"`
}

ExportRoutePolicy is an object that represents the configuration of the export routing policy.

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 association 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 attachment IDs, support for querying multiple associations.
	AttachmentIds []string `q:"attachment_id"`
	// The list of attachment resource types, support for querying multiple associations.
	ResourceTypes []string `q:"resource_type"`
	// The list of current status of the associations, support for querying multiple associations.
	Statuses []string `q:"state"`
	// 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.

Jump to

Keyboard shortcuts

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