endpoint

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

endpoint.go - the endpoint APIs definition supported by the endpoint service

Index

Constants

View Source
const (
	URI_PREFIX = bce.URI_PREFIX + "v1"

	DEFAULT_ENDPOINT = "bcc." + bce.DEFAULT_REGION + ".baidubce.com"

	REQUEST_ENDPOINT_URL = "/endpoint"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Billing

type Billing struct {
	PaymentTiming PaymentTimingType `json:"paymentTiming,omitempty"`
	Reservation   *Reservation      `json:"reservation,omitempty"`
}

type Client

type Client struct {
	*bce.BceClient
}

Client of VPC service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) CreateEndpoint

func (c *Client) CreateEndpoint(args *CreateEndpointArgs) (*CreateEndpointResult, error)

CreateEndpoint - create an endpoint with the specific parameters

PARAMS:

  • args: the arguments to create an endpoint

RETURNS:

  • *CreateEndpointResult: the result of create endpoint
  • error: nil if success otherwise the specific error

func (*Client) DeleteEndpoint

func (c *Client) DeleteEndpoint(endpointId string, clientToken string) error

DeleteEndpoint - delete an endpoint

PARAMS:

  • endpointId: the specific endpointId
  • clientToken: optional parameter, an Idempotent Token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetEndpointDetail

func (c *Client) GetEndpointDetail(endpointId string) (*Endpoint, error)

GetEndpointDetail - get the endpoint detail

PARAMS:

  • endpointId: the specific endpointId

RETURNS:

  • *Endpoint: the endpoint
  • error: nil if success otherwise the specific error

func (*Client) GetServices

func (c *Client) GetServices() (*ListServiceResult, error)

GetServices - get the public services RETURNS:

  • *ListServiceResult: the result of public service
  • error: nil if success otherwise the specific error

func (*Client) ListEndpoints

func (c *Client) ListEndpoints(args *ListEndpointArgs) (*ListEndpointResult, error)

ListEndpoints - list all endpoint with the specific parameters

PARAMS:

  • args: the arguments to list all endpoint

RETURNS:

  • *ListEndpointResult: the result of list all endpoint
  • error: nil if success otherwise the specific error

func (*Client) UpdateEndpoint

func (c *Client) UpdateEndpoint(endpointId string, args *UpdateEndpointArgs) error

UpdateEndpoint - update an endpoint

PARAMS:

  • endpointId: the specific endpointId
  • UpdateEndpointArgs: the arguments to update an endpoint

RETURNS:

  • error: nil if success otherwise the specific error

type CreateEndpointArgs

type CreateEndpointArgs struct {
	ClientToken string   `json:"-"`
	VpcId       string   `json:"vpcId"`
	Name        string   `json:"name"`
	SubnetId    string   `json:"subnetId"`
	Service     string   `json:"service"`
	Description string   `json:"description,omitempty"`
	IpAddress   string   `json:"ipAddress,omitempty"`
	Billing     *Billing `json:"billing"`
}

type CreateEndpointResult

type CreateEndpointResult struct {
	Id        string `json:"id"`
	IpAddress string `json:"ipAddress"`
}

type Endpoint

type Endpoint struct {
	EndpointId  string `json:"endpointId"`
	Name        string `json:"name"`
	IpAddress   string `json:"ipAddress"`
	Status      string `json:"status"`
	Service     string `json:"service"`
	SubnetId    string `json:"subnetId"`
	Description string `json:"description"`
	CreateTime  string `json:"createTime"`
	VpcId       string `json:"vpcId"`
	ProductType string `json:"productType"`
}

type ListEndpointArgs

type ListEndpointArgs struct {
	VpcId     string
	Name      string
	IpAddress string
	Status    string
	SubnetId  string
	Service   string
	Marker    string
	MaxKeys   int
}

type ListEndpointResult

type ListEndpointResult struct {
	Endpoints   []Endpoint `json:"endpoints"`
	Marker      string     `json:"marker"`
	IsTruncated bool       `json:"isTruncated"`
	NextMarker  string     `json:"nextMarker"`
	MaxKeys     int        `json:"maxKeys"`
}

type ListServiceResult

type ListServiceResult struct {
	Services []string `json:"services"`
}

type PaymentTimingType

type PaymentTimingType string

type Reservation

type Reservation struct {
	ReservationLength   int    `json:"reservationLength"`
	ReservationTimeUnit string `json:"reservationTimeUnit"`
}

type UpdateEndpointArgs

type UpdateEndpointArgs struct {
	ClientToken string `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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