robotclient

package
v1.0.0-beta.33 Latest Latest
Warning

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

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

Documentation

Overview

Package robotclient contains the interface to speak to Hetzner robot API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ValidateCredentials() error

	RebootBMServer(int, infrav1.RebootType) (*models.ResetPost, error)
	ListBMServers() ([]models.Server, error)
	SetBMServerName(int, string) (*models.Server, error)
	GetBMServer(int) (*models.Server, error)
	ListSSHKeys() ([]models.Key, error)
	SetSSHKey(name, publickey string) (*models.Key, error)
	SetBootRescue(id int, fingerprint string) (*models.Rescue, error)
	GetBootRescue(id int) (*models.Rescue, error)
	DeleteBootRescue(id int) (*models.Rescue, error)
	GetReboot(int) (*models.Reset, error)
}

Client collects all methods used by the controller in the robot API.

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials holds the information for authenticating with the Hetzner Robot API.

type Factory

type Factory interface {
	NewClient(Credentials) Client
}

Factory is the interface for creating new Client objects.

func NewFactory

func NewFactory() Factory

NewFactory creates a new factory for HCloud clients.

type LoggingTransport

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

LoggingTransport is a struct for creating new logger for robot API.

func (*LoggingTransport) RoundTrip

func (lt *LoggingTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip is used for logging api calls to robot API.

Jump to

Keyboard shortcuts

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