robotclient

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 4 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.

func (Credentials) Validate

func (creds Credentials) Validate() error

Validate returns an error if the credentials are invalid.

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.

Jump to

Keyboard shortcuts

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