vpcattachments

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, attachmentId string) error

Delete is a method to remove an existing VPC attachment under specified ER instance.

Types

type Attachment

type Attachment struct {
	// The project ID.
	ProjectId string `json:"project_id"`
	// The ID of the project where the VPC is located.
	VpcProjectId string `json:"vpc_project_id"`
	// The ID of the VPC attachment.
	ID string `json:"id"`
	// The name of the VPC attachment.
	Name string `json:"name"`
	// The description of the VPC attachment.
	Description string `json:"description"`
	// The VPC ID corresponding to the VPC attachment.
	VpcId string `json:"vpc_id"`
	// The VPC subnet ID corresponding to the VPC attachment.
	SubnetId string `json:"virsubnet_id"`
	// Whether automatically configure a route pointing to the ER instance for the VPC.
	AutoCreateVpcRoutes bool `json:"auto_create_vpc_routes"`
	// The current status of the VPC attachment.
	Status string `json:"state"`
	// The creation time of the VPC attachment.
	CreatedAt string `json:"created_at"`
	// The last update time of the VPC attachment.
	UpdatedAt string `json:"updated_at"`
	// The key/value pairs to associate with the VPC attachment.
	Tags []tags.ResourceTag `json:"tags"`
}

Attachment is the structure that represents the details of the VPC attachment for ER service.

func Create

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

Create is a method to create a VPC attachment under the ER instance using create option.

func ExtractAttachments

func ExtractAttachments(r pagination.Page) ([]Attachment, error)

ExtractAttachments is a method which to extract the response to an attachment list.

func Get

func Get(client *golangsdk.ServiceClient, instanceId, attachmentId string) (*Attachment, error)

Get is a method to obtain the details of a specified VPC attachment under ER instance using its ID.

func List

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

List is a method to query the list of the VPC attachments under specified ER instance using given opts.

func Update

func Update(client *golangsdk.ServiceClient, instanceId, attachmentId string, opts UpdateOpts) (*Attachment, error)

Update is a method to update the VPC attachment under the ER instance using update option.

type AttachmentPage

type AttachmentPage struct {
	pagination.MarkerPageBase
}

AttachmentPage represents the response pages of the List method.

func (AttachmentPage) IsEmpty

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

IsEmpty returns true if current page no VPC attachment.

func (AttachmentPage) LastMarker

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

LastMarker returns the last marker index during current page.

func (AttachmentPage) NextPageURL

func (r AttachmentPage) NextPageURL() (string, error)

NextPageURL generates the URL for the page of results after this one.

type CreateOpts

type CreateOpts struct {
	// The VPC ID corresponding to the VPC attachment.
	VpcId string `json:"vpc_id" required:"true"`
	// The VPC subnet ID corresponding to the VPC attachment.
	SubnetId string `json:"virsubnet_id" required:"true"`
	// The name of the VPC attachment.
	// 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 VPC attachment.
	// The value contain a maximum of 255 characters, and the angle brackets (< and >) are not allowed.
	Description string `json:"description,omitempty"`
	// Whether automatically configure a route pointing to the ER instance for the VPC, defaults to false.
	AutoCreateVpcRoutes *bool `json:"auto_create_vpc_routes,omitempty"`
	// The key/value pairs to associate with the VPC attachment.
	Tags []tags.ResourceTag `json:"tags,omitempty"`
}

CreateOpts is the structure required by the Create method to create a VPC attachment under the 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 VPC attachment 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 VPC IDs corresponding to the VPC attachments, support for querying multiple VPC attachments.
	VpcId []string `q:"vpc_id"`
	// The list of VPC attachment IDs, support for querying multiple VPC attachments.
	AttachmentId []string `q:"id"`
	// The list of current status of the VPC attachments, support for querying multiple VPC attachments.
	Status []string `q:"state"`
	// The list of keyword to sort the VPC attachments 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 MultipleResp

type MultipleResp struct {
	// The list of the VPC attachment.
	Attachments []Attachment `json:"vpc_attachments"`
	// The request ID.
	RequestId string `json:"request_id"`
	// The page information.
	PageInfo PageInfo `json:"page_info"`
}

MultipleResp is the structure that represents the VPC attachment list, page detail and the request information.

type PageInfo

type PageInfo struct {
	// The next marker information.
	NextMarker string `json:"next_marker"`
	// The number of the VPC attahcment in current page.
	CurrentCount int `json:"current_count"`
}

PageInfo is the structure that represents the page information.

func ExtractPageInfo

func ExtractPageInfo(r pagination.Page) (*PageInfo, error)

ExtractPageInfo is a method which to extract the response of the page information.

type SingleResp

type SingleResp struct {
	// The response detail of the VPC attachment.
	Attachment Attachment `json:"vpc_attachment"`
	// The request ID.
	RequestId string `json:"request_id"`
}

SingleResp is the structure that represents the VPC attachment detail and the request information of the API request.

type UpdateOpts

type UpdateOpts struct {
	// The name of the VPC attachment.
	// 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 VPC attachment.
	// 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 VPC attachment configuration.

Jump to

Keyboard shortcuts

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