services

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StatusCreating  Status = "creating"
	StatusAvailable Status = "available"
	StatusFailed    Status = "failed"
	StatusDeleting  Status = "deleting"
	StatusDeleted   Status = "" // this is a special status for missing LB

	ServerTypeVM  ServerType = "VM"
	ServerTypeVIP ServerType = "VIP"
	ServerTypeLB  ServerType = "LB"

	ServiceTypeInterface ServiceType = "interface"
	ServiceTypeGateway   ServiceType = "gateway"
)

Variables

This section is empty.

Functions

func Delete

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

func WaitForServiceStatus

func WaitForServiceStatus(client *golangsdk.ServiceClient, id string, status Status, timeout int) error

Types

type ActionOpts added in v0.9.4

type ActionOpts struct {
	// Specifies whether to accept or reject a VPC endpoint for a VPC endpoint service.
	// receive: means to accept the VPC endpoint.
	// reject: means to reject the VPC endpoint.
	Action string `json:"action" required:"true"`
	// Lists VPC endpoint IDs.
	// Each request accepts or rejects only one VPC endpoint
	Endpoints []string `json:"endpoints" required:"true"`
}

type BasicOpts added in v0.9.4

type BasicOpts struct {
	// Specifies the name of the VPC endpoint service.
	// Either this parameter or the id parameter must be selected.
	Name string `q:"endpoint_service_name"`
	// Specifies the unique ID of the VPC endpoint service.
	// Either this parameter or the name parameter must be selected.
	ID string `q:"id"`
}

type BasicService added in v0.9.4

type BasicService struct {
	// Specifies the unique ID of the VPC endpoint service.
	ID string `json:"id"`
	// Specifies the name of the VPC endpoint service.
	ServiceName string `json:"service_name"`
	// Specifies the type of the VPC endpoint service.
	ServiceType string `json:"service_type"`
	// Specifies the resource type.
	ServerType ServerType `json:"server_type"`
	// Specifies the creation time of the VPC endpoint service.
	// The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ.
	CreatedAt string `json:"created_at"`
	// Specifies whether the associated VPC endpoint carries a charge.
	IsCharge bool `json:"is_charge"`
}

func GetBasicInfo added in v0.9.4

func GetBasicInfo(client *golangsdk.ServiceClient, opts BasicOpts) (*BasicService, error)

type Connection added in v0.9.4

type Connection struct {
	// Specifies the unique ID of the VPC endpoint.
	ID string `json:"id"`
	// Specifies the packet ID of the VPC endpoint.
	MarkerId int `json:"marker_id"`
	// Specifies the creation time of the VPC endpoint.
	CreatedAt string `json:"created_at"`
	// Specifies the update time of the VPC endpoint.
	UpdatedAt string `json:"updated_at"`
	// Specifies the user's domain ID.
	DomainId string `json:"domain_id"`
	// Specifies the connection status of the VPC endpoint.
	// pendingAcceptance: The VPC endpoint is to be accepted.
	// creating: The VPC endpoint is being created.
	// accepted: The VPC endpoint has been accepted.
	// rejected: The VPC endpoint has been rejected.
	// failed: The VPC endpoint service failed to be created.
	// deleting: The VPC endpoint is being deleted.
	Status string `json:"status"`
	// Specifies the error message.
	Error []ErrorParameters `json:"error"`
}

func Action added in v0.9.4

func Action(client *golangsdk.ServiceClient, id string, opts ActionOpts) ([]Connection, error)

func ExtractConnections added in v0.9.4

func ExtractConnections(r pagination.NewPage) ([]Connection, error)

func ListConnections added in v0.9.4

func ListConnections(client *golangsdk.ServiceClient, ServiceID string, opts ListConnectionsOpts) ([]Connection, error)

type CreateOpts

type CreateOpts struct {
	// Specifies the ID for identifying the backend resource of the VPC endpoint service.
	// The ID is in the form of the UUID.
	PortID string `json:"port_id" required:"true"`
	// Specifies the ID of the cluster associated with the target VPCEP resource.
	PoolID string `json:"pool_id,omitempty"`
	// Specifies the name of the VPC endpoint service.
	// The value contains a maximum of 16 characters, including letters, digits, underscores (_), and hyphens (-).
	//  If you do not specify this parameter, the VPC endpoint service name is in the format: `regionName.serviceId`.
	//  If you specify this parameter, the VPC endpoint service name is in the format: `regionName.serviceName.serviceId`.
	ServiceName string `json:"service_name,omitempty"`
	// Specifies the ID of the VPC (router) to which the backend resource of the VPC endpoint service belongs.
	VpcId string `json:"vpc_id" required:"true"`
	// Specifies whether connection approval is required.
	// The default value is `true`.
	ApprovalEnabled *bool `json:"approval_enabled,omitempty"`
	// Specifies the type of the VPC endpoint service.
	// Only your private services can be configured into interface VPC endpoint services.
	ServiceType ServiceType `json:"service_type,omitempty"`
	// Specifies the backend resource type.
	//  - `VM`: Resource is an ECS. Backend resources of this type serve as servers.
	//  - `VIP`: Resource is a virtual IP address that functions as a physical server hosting virtual resources.
	//  - `LB`: Resource is an enhanced load balancer.
	ServerType ServerType `json:"server_type" required:"true"`
	// Lists the port mappings opened to the VPC endpoint service.
	Ports []PortMapping `json:"ports" required:"true"`
	// Specifies whether the client IP address and port number or `marker_id` information is transmitted to the server.
	// The values are as follows:
	//    close: indicates that the TOA and Proxy Protocol methods are neither used.
	//    toa_open: indicates that the TOA method is used.
	//    proxy_open: indicates that the Proxy Protocol method is used.
	//    open: indicates that the TOA and Proxy Protocol methods are both used.
	// The default value is close.
	TCPProxy string `json:"tcp_proxy,omitempty"`
	// Lists the resource tags.
	Tags []tags.ResourceTag `json:"tags,omitempty"`
	// Supplementary information about the VPC endpoint service.
	Description string `json:"description,omitempty"`
	// Specifies the ID of the virtual NIC to which the virtual IP address is bound.
	VIPPortID string `json:"vip_port_id,omitempty"`
}

type ErrorParameters

type ErrorParameters struct {
	// Specifies the error code.
	ErrorCode string
	// Specifies the error message.
	ErrorMessage string
}

type ListConnectionsOpts added in v0.9.4

type ListConnectionsOpts struct {
	// Specifies the unique ID of the VPC endpoint.
	ID string `q:"id"`
	// Specifies the packet ID of the VPC endpoint.
	MarkerId string `q:"marker_id"`
	// Specifies the connection status of the VPC endpoint.
	// pendingAcceptance: The VPC endpoint is to be accepted.
	// accepted: The VPC endpoint has been accepted.
	// rejected: The VPC endpoint has been rejected.
	// failed: The VPC endpoint service failed to be created.
	Status Status `q:"status"`
	// Specifies the sorting field of the VPC endpoint list. The field can be:
	// created_at: VPC endpoints are sorted by creation time.
	// updated_at: VPC endpoints are sorted by update time.
	SortKey string `q:"sort_key"`
	// Specifies the sorting method of the VPC endpoint list. The method can be:
	// desc: VPC endpoints are sorted in descending order.
	// asc: VPC endpoints are sorted in ascending order.
	SortDir string `q:"sort_dir"`
	// Specifies the maximum number of VPC endpoint services displayed on each page.
	Limit *int `q:"limit"`
	// Specifies the offset.
	Offset *int `q:"offset"`
}

type ListOpts

type ListOpts struct {
	// Specifies the name of the VPC endpoint service. The value is not case-sensitive and supports fuzzy match.
	Name string `q:"endpoint_service_name"`
	// Specifies the unique ID of the VPC endpoint service.
	ID string `q:"id"`
	// Specifies the status of the VPC endpoint service.
	//    creating: indicates the VPC endpoint service is being created.
	//    available: indicates the VPC endpoint service is connectable.
	//    failed: indicates the creation of the VPC endpoint service failed.
	//    deleting: indicates the VPC endpoint service is being deleted.
	Status Status `q:"status"`
	// Specifies the sorting field of the VPC endpoint service list.
	SortKey string `q:"sort_key"`
	// Specifies the sorting method of the VPC endpoint service list.
	SortDir string `q:"sort_dir"`
	// Specifies the maximum number of VPC endpoint services displayed on each page.
	Limit *int `q:"limit"`
	// Specifies the offset.
	Offset *int `q:"offset"`
}

type ListPublicOpts added in v0.9.4

type ListPublicOpts struct {
	// Specifies the name of the public VPC endpoint service.
	// The value is not case-sensitive and supports fuzzy match.
	Name string `q:"endpoint_service_name"`
	// Specifies the unique ID of the public VPC endpoint service.
	ID string `q:"id"`
	// Specifies the sorting field of the VPC endpoint service list.
	SortKey string `q:"sort_key"`
	// Specifies the sorting method of the VPC endpoint service list.
	SortDir string `q:"sort_dir"`
	// Specifies the maximum number of VPC endpoint services displayed on each page.
	Limit *int `q:"limit"`
	// Specifies the offset.
	Offset *int `q:"offset"`
}

type PortMapping

type PortMapping struct {
	// Specifies the port for accessing the VPC endpoint.
	ClientPort int `json:"client_port"`
	// Specifies the port for accessing the VPC endpoint service.
	ServerPort int `json:"server_port"`
	// Specifies the protocol used in port mappings. The value can be TCP or UDP. The default value is TCP.
	Protocol string `json:"protocol,omitempty"`
}

type PublicService added in v0.5.3

type PublicService struct {
	// Specifies the unique ID of the public VPC endpoint service.
	ID string `json:"id"`
	// Specifies the owner of the VPC endpoint service.
	Owner string `json:"owner"`
	// Specifies the name of the public VPC endpoint service.
	ServiceName string `json:"service_name"`
	// Specifies the type of the VPC endpoint service.
	ServiceType ServiceType `json:"service_type"`
	// Specifies the creation time of the VPC endpoint service.
	// The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ.
	CreatedAt string `json:"created_at"`
	// Specifies whether the associated VPC endpoint carries a charge.
	IsCharge bool `json:"is_charge"`
}

func ExtractPublicServices added in v0.5.3

func ExtractPublicServices(r pagination.NewPage) ([]PublicService, error)

func ListPublic

func ListPublic(client *golangsdk.ServiceClient, opts ListPublicOpts) ([]PublicService, error)

type PublicServicePage added in v0.9.4

type PublicServicePage struct {
	pagination.NewSinglePageBase
}

type ServerType

type ServerType string

type Service

type Service struct {
	// Specifies the unique ID of the VPC endpoint service.
	ID string `json:"id"`
	// Specifies the ID for identifying the backend resource of the VPC endpoint service.
	PortID string `json:"port_id"`
	// Specifies the name of the VPC endpoint service.
	ServiceName string `json:"service_name"`
	// Specifies the type of the VPC endpoint service.
	ServiceType string `json:"service_type"`
	// Specifies the resource type.
	ServerType ServerType `json:"server_type"`
	// Specifies the ID of the VPC to which the backend resource of the VPC endpoint service belongs.
	VpcID string `json:"vpc_id"`
	// Specifies the ID of the cluster associated with the target VPCEP resource.
	PoolID string `json:"pool_id"`
	// Specifies whether connection approval is required.
	ApprovalEnabled bool `json:"approval_enabled"`
	// Specifies the status of the VPC endpoint service.
	Status Status `json:"status"`
	// Specifies the creation time of the VPC endpoint service.
	// The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ.
	CreatedAt string `json:"created_at"`
	// Specifies the update time of the VPC endpoint service.
	// The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ.
	UpdatedAt string `json:"updated_at"`
	// Specifies the project ID.
	ProjectID string `json:"project_id"`
	// Lists the port mappings opened to the VPC endpoint service.
	Ports []PortMapping `json:"ports"`
	// Specifies whether the client IP address and port number or marker_id information is transmitted to the server.
	TCPProxy string `json:"tcp_proxy"`
	// Lists the resource tags.
	Tags []tags.ResourceTag `json:"tags"`
	// Supplementary information about the VPC endpoint service.
	Description string `json:"description,omitempty"`

	CIDRType string `json:"cidr_type"` // CIDRType returned only in Create
	// ConnectionCount is set in `Get` and `List` only
	ConnectionCount int `json:"connection_count"`
	// Error is set in `Get` and `List` only
	Error     []ErrorParameters `json:"error"`
	VIPPortID string            `json:"vip_port_id"`
}

func Create

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

func ExtractServices

func ExtractServices(r pagination.NewPage) ([]Service, error)

func Get

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

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Service, error)

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOpts) (*Service, error)

type ServiceConnectionsPage added in v0.9.4

type ServiceConnectionsPage struct {
	pagination.NewSinglePageBase
}

type ServicePage

type ServicePage struct {
	pagination.NewSinglePageBase
}

func (ServicePage) IsEmpty

func (p ServicePage) IsEmpty() (bool, error)

type ServiceType

type ServiceType string

type Status

type Status string

type UpdateOpts

type UpdateOpts struct {
	// Specifies whether connection approval is required.
	ApprovalEnabled *bool `json:"approval_enabled,omitempty"`
	// Specifies the name of the VPC endpoint service.
	// The name can contain a maximum of 16 characters, including letters, digits, underscores (_), and hyphens (-).
	ServiceName string `json:"service_name,omitempty"`
	// Lists the port mappings opened to the VPC endpoint service.
	Ports []PortMapping `json:"ports,omitempty"`
	// Specifies the ID for identifying the backend resource of the VPC endpoint service.
	// The ID is in UUID format. The values are as follows:
	PortID string `json:"port_id,omitempty"`
	// Specifies whether the client IP address and port number or marker_id
	// information is transmitted to the server.
	TcpProxy string `json:"tcp_proxy,omitempty"`
	// Supplementary information about the VPC endpoint service.
	// The description can contain a maximum of 128 characters and cannot contain left angle brackets (<) or right angle brackets (>).
	Description string `json:"description,omitempty"`
	VIPPortID   string `json:"vip_port_id,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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