Help us shape the future of Go! Take the 2026 Go Developer Survey

services

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 4 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 ListPublic

func ListPublic(client *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager

func WaitForServiceStatus

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

Types

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 ID of the virtual NIC to which the virtual IP address is bound.
	VIPPortID string `json:"vip_port_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.
	RouterID 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"`
}

func (CreateOpts) ToServiceCreateMap

func (opts CreateOpts) ToServiceCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToServiceCreateMap() (map[string]interface{}, error)
}

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (r CreateResult) Extract() (*Service, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

type ErrorParameters

type ErrorParameters struct {
	ErrorCode    string
	ErrorMessage string
}

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

func (GetResult) Extract

func (r GetResult) Extract() (*Service, error)

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"`

	SortKey string `q:"sort_key"`
	SortDir string `q:"sort_dir"`
}

func (ListOpts) ToServiceListQuery

func (opts ListOpts) ToServiceListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToServiceListQuery() (string, error)
}

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"`
}

type PublicService added in v0.5.3

type PublicService struct {
	ID          string      `json:"id"`
	Owner       string      `json:"owner"`
	ServiceName string      `json:"service_name"`
	ServiceType ServiceType `json:"service_type"`
	CreatedAt   string      `json:"created_at"`
	IsCharge    bool        `json:"is_charge"`
}

func ExtractPublicServices added in v0.5.3

func ExtractPublicServices(p pagination.Page) ([]PublicService, error)

type ServerType

type ServerType string

type Service

type Service struct {
	ID              string             `json:"id"`
	PortID          string             `json:"port_id"`
	VIPPortID       string             `json:"vip_port_id"`
	ServiceName     string             `json:"service_name"`
	ServiceType     string             `json:"service_type"`
	ServerType      ServerType         `json:"server_type"`
	RouterID        string             `json:"vpc_id"`
	PoolID          string             `json:"pool_id"`
	ApprovalEnabled bool               `json:"approval_enabled"`
	Status          Status             `json:"status"`
	CreatedAt       string             `json:"created_at"`
	UpdatedAt       string             `json:"updated_at"`
	ProjectID       string             `json:"project_id"`
	CIDRType        string             `json:"cidr_type"` // CIDRType returned only in Create
	Ports           []PortMapping      `json:"ports"`
	TCPProxy        string             `json:"tcp_proxy"`
	Tags            []tags.ResourceTag `json:"tags"`

	// 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"`
}

func ExtractServices

func ExtractServices(p pagination.Page) ([]Service, error)

type ServicePage

type ServicePage struct {
	pagination.OffsetPageBase
}

func (ServicePage) IsEmpty

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

type ServiceType

type ServiceType string

type Status

type Status string

type UpdateOpts

type UpdateOpts struct {
	ApprovalEnabled *bool         `json:"approval_enabled,omitempty"`
	ServiceName     string        `json:"service_name,omitempty"`
	Ports           []PortMapping `json:"ports,omitempty"`
	PortID          string        `json:"port_id,omitempty"`
	VIPPortID       string        `json:"vip_port_id,omitempty"`
}

func (UpdateOpts) ToServiceUpdateMap

func (opts UpdateOpts) ToServiceUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToServiceUpdateMap() (map[string]interface{}, error)
}

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Service, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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