services

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnActionOpts

type ConnActionOpts struct {
	// Specifies whether to receive or reject a VPC endpoint for a VPC endpoint service.
	Action string `json:"action" required:"true"`
	// Lists the VPC endpoints.
	Endpoints []string `json:"endpoints" required:"true"`
}

ConnActionOpts used to receive or reject a VPC endpoint for a VPC endpoint service.

func (ConnActionOpts) ToServicePostMap

func (opts ConnActionOpts) ToServicePostMap() (map[string]interface{}, error)

ToServicePostMap assembles a request body based on the contents of a ConnActionOpts.

type Connection

type Connection struct {
	// the ID of the VPC endpoint
	EndpointID string `json:"id"`
	// the packet ID of the VPC endpoint
	MarkerID int `json:"marker_id"`
	// the ID of the user's domain
	DomainID string `json:"domain_id"`
	// the connection status of the VPC endpoint
	Status string `json:"status"`
	// the creation time of the VPC endpoint
	Created string `json:"created_at"`
	// the update time of the VPC endpoint
	Updated string `json:"updated_at"`
	// the error message when the status of the VPC endpoint service changes to failed
	Error []ErrorInfo `json:"error"`
	// the description of endpoint service connection
	Description string `json:"description"`
}

Connection contains the response of querying Connections of a VPC Endpoint Service

func ListConnections

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

ListConnections makes a request against the API to list connections of a VPC endpoint service.

type ConnectionResult

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

ConnectionResult represents the result of a list connections. Call its ExtractConnections method to interpret it as []Connection.

func ConnAction

func ConnAction(c *golangsdk.ServiceClient, serviceID string, opts PostOptsBuilder) (r ConnectionResult)

ConnAction accepts a ConnActionOpts struct and uses the values to receive or reject a VPC endpoint for a VPC endpoint service.

func (ConnectionResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

func (ConnectionResult) ExtractConnections

func (r ConnectionResult) ExtractConnections() ([]Connection, error)

ExtractConnections is a function that accepts a result and extracts the given []Connection

type CreateOpts

type CreateOpts struct {
	// Specifies the ID of the VPC to which the backend resource of the VPC endpoint service belongs.
	VpcID string `json:"vpc_id" required:"true"`
	// Specifies the ID for identifying the backend resource of the VPC endpoint service.
	PortID string `json:"port_id" required:"true"`
	// Specifies the resource type.
	ServerType string `json:"server_type" required:"true"`
	// Lists the port mappings opened to the VPC endpoint service.
	Ports []PortOpts `json:"ports" required:"true"`

	// Specifies the name of the VPC endpoint service.
	// The value contains a maximum of 16 characters, including letters, digits, underscores (_), and hyphens (-).
	ServiceName string `json:"service_name,omitempty"`
	// Specifies the type of the VPC endpoint service, only interface is valid.
	ServiceType string `json:"service_type,omitempty"`
	// Specifies whether connection approval is required.
	Approval *bool `json:"approval_enabled,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"`
}

CreateOpts contains the options for create a VPC endpoint service. This object is passed to Create().

func (CreateOpts) ToServicePostMap

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

ToServicePostMap assembles a request body based on the contents of a CreateOpts.

type CreateResult

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

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Service.

func Create

Create accepts a CreateOpts struct and uses the values to create a new VPC endpoint service.

func (CreateResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(c *golangsdk.ServiceClient, serviceID string) (r DeleteResult)

Delete will permanently delete a particular node based on its unique ID and cluster ID.

type ErrorInfo

type ErrorInfo struct {
	Code    string `json:"error_code"`
	Message string `json:"error_message"`
}

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Service.

func Get

func Get(c *golangsdk.ServiceClient, serviceID string) (r GetResult)

Get retrieves a particular nodes based on its unique ID and cluster ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

type ListConnOpts

type ListConnOpts struct {
	// Specifies the unique ID of the VPC endpoint
	EndpointID string `q:"id"`
	// Specifies the packet ID of the VPC endpoint
	MarkerID string `q:"marker_id"`
}

ListConnOpts used to query connections of a VPC endpoint service.

func (ListConnOpts) ToListQuery

func (opts ListConnOpts) ToListQuery() (string, error)

ToListQuery formats a ListConnOpts into a query string.

type ListOpts

type ListOpts struct {
	ServiceName string `q:"endpoint_service_name"`
	ID          string `q:"id"`
	// Status is not supported for ListPublic
	Status string `q:"status"`
}

ListOpts allows the filtering of list data using given parameters.

func (ListOpts) ToListQuery

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

ToListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add parameters to the List request.

type ListPermResult

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

ListPermResult represents the result of a list permissions. Call its ExtractPermissions method to interpret it as []Permission.

func (ListPermResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

func (ListPermResult) ExtractPermissions

func (r ListPermResult) ExtractPermissions() ([]Permission, error)

ExtractPermissions is a function that accepts a result and extracts the given []Permission

type ListPublicResult

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

ListPublicResult represents the result of a list public operation. Call its ExtractServices method to interpret it as PublicServices.

func (ListPublicResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

func (ListPublicResult) ExtractServices

func (r ListPublicResult) ExtractServices() ([]PublicService, error)

ExtractServices is a function that accepts a result and extracts the given PublicService

type ListResult

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

ListResult represents the result of a list operation. Call its ExtractServices method to interpret it as Services.

func (ListResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

func (ListResult) ExtractServices

func (r ListResult) ExtractServices() ([]Service, error)

ExtractServices is a function that accepts a result and extracts the given Services

type PermActionOpts

type PermActionOpts struct {
	// Specifies the operation to be performed: dd or remove.
	Action string `json:"action" required:"true"`
	// Lists the whitelist records. The record is in the iam:domain::domain_id format.
	Permissions []string `json:"permissions" required:"true"`
}

PermActionOpts used to add to or delete whitelist records from a VPC endpoint service.

func (PermActionOpts) ToServicePostMap

func (opts PermActionOpts) ToServicePostMap() (map[string]interface{}, error)

ToServicePostMap assembles a request body based on the contents of a PermActionOpts.

type PermActionResult

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

func PermAction

func PermAction(c *golangsdk.ServiceClient, serviceID string, opts PostOptsBuilder) (r PermActionResult)

PermAction accepts a PermActionOpts struct and uses the values toadd to or delete whitelist records from a VPC endpoint service.

func (PermActionResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

type Permission

type Permission struct {
	// the unique ID of the permission.
	ID string `json:"id"`
	// the whitelist records.
	Permission string `json:"permission"`
	// the time of adding the whitelist record
	Created string `json:"created_at"`
}

Permission contains the response of querying Permissions of a VPC Endpoint Service

func ListPermissions

func ListPermissions(client *golangsdk.ServiceClient, serviceID string) ([]Permission, error)

ListPermissions makes a request against the API to query the whitelist records of a VPC endpoint service.

type PortMapping

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

PortMapping contains the port mappings opened to the VPC endpoint service

type PortOpts

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

PortOpts contains the port mappings opened to the VPC endpoint service.

type PostOptsBuilder

type PostOptsBuilder interface {
	ToServicePostMap() (map[string]interface{}, error)
}

PostOptsBuilder allows extensions to add parameters to the Post request.

type PublicService

type PublicService struct {
	// the ID of the public VPC endpoint service
	ID string `json:"id"`
	// the owner of the VPC endpoint service
	Owner string `json:"owner"`
	// the name of the VPC endpoint service
	ServiceName string `json:"service_name"`
	// the type of the VPC endpoint service: gateway or interface
	ServiceType string `json:"service_type"`
	// whether the associated VPC endpoint carries a charge: true or false
	IsChange bool `json:"is_charge"`
	// the creation time of the VPC endpoint service
	Created string `json:"created_at"`
}

PublicService contains the response of the public VPC endpoint service

func ListPublic

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

ListPublic makes a request against the API to list public VPC endpoint services.

type Service

type Service struct {
	// the ID of the VPC endpoint service
	ID string `json:"id"`
	// the status of the VPC endpoint service
	Status string `json:"status"`
	// the ID for identifying the backend resource of the VPC endpoint service
	PortID string `json:"port_id"`
	// the ID of the VPC to which the backend resource of the VPC endpoint service belongs
	VpcID string `json:"vpc_id"`
	// the name of the VPC endpoint service
	ServiceName string `json:"service_name"`
	// the type of the VPC endpoint service
	ServiceType string `json:"service_type"`
	// the resource type
	ServerType string `json:"server_type"`
	// whether connection approval is required
	Approval bool `json:"approval_enabled"`
	// the project ID
	ProjectID string `json:"project_id"`
	// the network segment type. The value can be public or internal
	CidrType string `json:"cidr_type"`
	// Lists the port mappings opened to the VPC endpoint service
	Ports []PortMapping `json:"ports"`
	// whether the client IP address and port number or marker_id information is transmitted to the server
	TCPProxy string `json:"tcp_proxy"`
	// the error message when the status of the VPC endpoint service changes to failed
	Error []ErrorInfo `json:"error"`
	// the description of the VPC endpoint service
	Created string `json:"created_at"`
	// the update time of the VPC endpoint service
	Updated string `json:"updated_at"`
}

Service contains the response of the VPC endpoint service

func List

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

List makes a request against the API to list VPC endpoint services.

type UpdateOpts

type UpdateOpts struct {
	// Specifies the name of the VPC endpoint service.
	ServiceName string `json:"service_name,omitempty"`
	// Specifies whether connection approval is required.
	Approval *bool `json:"approval_enabled,omitempty"`
	// Specifies the ID for identifying the backend resource of the VPC endpoint service.
	PortID string `json:"port_id,omitempty"`
	// Lists the port mappings opened to the VPC endpoint service.
	Ports []PortOpts `json:"ports,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 description
	Description *string `json:"description,omitempty"`
}

UpdateOpts contains all the values needed to update a VPC endpoint service

func (UpdateOpts) ToServiceUpdateMap

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

ToServiceUpdateMap builds an update body based on UpdateOpts.

type UpdateOptsBuilder

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

UpdateOptsBuilder allows extensions to add parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Service.

func Update

func Update(c *golangsdk.ServiceClient, serviceID string, opts UpdateOptsBuilder) (r UpdateResult)

Update allows a VPC endpoint service to be updated.

func (UpdateResult) Extract

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

Extract is a function that accepts a result and extracts a Service.

Jump to

Keyboard shortcuts

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