node

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package node provides the ability to retrieve and manage Kubernetes nodes of a cluster nodegroup through the MKS V1 API.

Example of getting a single node of a cluster nodegroup by its id

singleNode, _, err := node.Get(ctx, mksClient, clusterID, nodegroupID, nodeID)
if err != nil {
  log.Fatal(err)
}
fmt.Printf("%+v\n", singleNode)

Example of reinstalling a single node of a cluster nodegroup by its id

_, err := node.Reinstall(ctx, mksClient, clusterID, nodegroupID, nodeID)
if err != nil {
  log.Fatal(err)
}

Example of deleting a single node of a cluster nodegroup by its id

_, err := node.Delete(ctx, mksClient, clusterID, nodegroupID, nodeID)
if err != nil {
  log.Fatal(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete added in v0.6.0

func Delete(ctx context.Context, client *v1.ServiceClient, clusterID, nodegroupID, nodeID string) (*v1.ResponseResult, error)

Delete deletes a node of a cluster nodegroup by its id.

func Reinstall

func Reinstall(ctx context.Context, client *v1.ServiceClient, clusterID, nodegroupID, nodeID string) (*v1.ResponseResult, error)

Reinstall requests to make reinstall of a single node of a cluster nodegroup by its id.

Types

type View

type View struct {
	// ID is the identifier of the node.
	ID string `json:"id"`

	// CreatedAt is the timestamp in UTC timezone of when the node has been created.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt is the timestamp in UTC timezone of when the node has been updated.
	UpdatedAt *time.Time `json:"updated_at"`

	// Hostname represents a hostname of the node.
	Hostname string `json:"hostname"`

	// IP represents IP address of the node.
	IP string `json:"ip"`

	// NodegroupID contains nodegroup identifier.
	NodegroupID string `json:"nodegroup_id"`

	// OSServerID contains OpenStack server identifier.
	OSServerID string `json:"os_server_id"`
}

View represents an unmarshalled node body from an API response.

func Get

func Get(ctx context.Context, client *v1.ServiceClient, clusterID, nodegroupID, nodeID string) (*View, *v1.ResponseResult, error)

Get returns a node of a cluster nodegroup by its id.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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