govultr

package
v0.0.0-...-30e57c9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client that is used for HTTP requests

func NewClient

func NewClient(client *http.Client) *Client

NewClient returns a client struct

func (*Client) DeleteNodePoolInstance

func (c *Client) DeleteNodePoolInstance(ctx context.Context, vkeID, nodePoolID, nodeID string) error

DeleteNodePoolInstance will delete a specific instance from a nodepool

func (*Client) ListNodePools

func (c *Client) ListNodePools(ctx context.Context, vkeID string, options *ListOptions) ([]NodePool, *Meta, error)

ListNodePools returns all nodepools on a given VKE cluster

func (*Client) SetBaseUrl

func (c *Client) SetBaseUrl(baseURL string) (*Client, error)

SetBaseUrl sets the base URL

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(userAgent string) *Client

SetUserAgent sets the user-agent for HTTP requests

func (*Client) UpdateNodePool

func (c *Client) UpdateNodePool(ctx context.Context, vkeID, nodePoolID string, updateReq *NodePoolReqUpdate) (*NodePool, error)

UpdateNodePool updates a given nodepool

type Links struct {
	Next string `json:"next"`
	Prev string `json:"prev"`
}

Links represent the next/previous cursor in your pagination calls

type ListOptions

type ListOptions struct {
	PerPage int    `url:"per_page,omitempty"`
	Cursor  string `url:"cursor,omitempty"`
}

ListOptions are the available fields that can be used with pagination

type Meta

type Meta struct {
	Total int `json:"total"`
	Links *Links
}

Meta represents the available pagination information

type Node

type Node struct {
	ID          string `json:"id"`
	DateCreated string `json:"date_created"`
	Label       string `json:"label"`
	Status      string `json:"status"`
}

Node represents a node that will live within a nodepool

type NodePool

type NodePool struct {
	ID           string `json:"id"`
	DateCreated  string `json:"date_created"`
	DateUpdated  string `json:"date_updated"`
	Label        string `json:"label"`
	Plan         string `json:"plan"`
	Status       string `json:"status"`
	NodeQuantity int    `json:"node_quantity"`
	Tag          string `json:"tag"`
	Nodes        []Node `json:"nodes"`
	AutoScaler   bool   `json:"auto_scaler"`
	MinNodes     int    `json:"min_nodes"`
	MaxNodes     int    `json:"max_nodes"`
}

NodePool represents a pool of nodes that are grouped by their label and plan type

type NodePoolReqUpdate

type NodePoolReqUpdate struct {
	NodeQuantity int    `json:"node_quantity,omitempty"`
	Tag          string `json:"tag,omitempty"`
}

NodePoolReqUpdate struct used to update a node pool

type Nodepools

type Nodepools interface {
	ListNodePools(ctx context.Context, vkeID string, options *ListOptions) ([]NodePool, *Meta, error)
	UpdateNodePool(ctx context.Context, vkeID, nodePoolID string, updateReq *NodePoolReqUpdate) (*NodePool, error)
	DeleteNodePoolInstance(ctx context.Context, vkeID, nodePoolID, nodeID string) error
}

Nodepools interface

Jump to

Keyboard shortcuts

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