client

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package client contains a client wrapper for Tinkerbell.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("resource not found")

ErrNotFound is returned if a requested resource is not found.

Functions

func HardwareToJSON

func HardwareToJSON(h *hardware.Hardware) (string, error)

HardwareToJSON converts Hardware to a string suitable for use in a Workflow Request for the raw Tinkerbell client.

Types

type Hardware

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

Hardware client for Tinkerbell.

func NewHardwareClient

func NewHardwareClient(client hardware.HardwareServiceClient) *Hardware

NewHardwareClient returns a Hardware client.

func (*Hardware) Create

func (t *Hardware) Create(ctx context.Context, h *hardware.Hardware) error

Create Tinkerbell Hardware.

func (*Hardware) Delete

func (t *Hardware) Delete(ctx context.Context, id string) error

Delete a Tinkerbell Hardware.

func (*Hardware) Get

func (t *Hardware) Get(ctx context.Context, id, ip, mac string) (*hardware.Hardware, error)

Get returns a Tinkerbell Hardware.

func (*Hardware) Update

func (t *Hardware) Update(ctx context.Context, h *hardware.Hardware) error

Update Tinkerbell Hardware.

type HardwareClient added in v1.29.0

type HardwareClient interface {
	Get(context.Context, string, string, string) (*hardware.Hardware, error)
	Delete(context.Context, string) error
	Create(context.Context, *hardware.Hardware) error
}

type Template

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

Template client for Tinkerbell.

func NewTemplateClient

func NewTemplateClient(client template.TemplateServiceClient) *Template

NewTemplateClient returns a Template client.

func (*Template) Create

func (t *Template) Create(ctx context.Context, template *template.WorkflowTemplate) error

Create a Tinkerbell Template.

func (*Template) Delete

func (t *Template) Delete(ctx context.Context, id string) error

Delete a Tinkerbell Template.

func (*Template) Get

func (t *Template) Get(ctx context.Context, id, name string) (*template.WorkflowTemplate, error)

Get returns a Tinkerbell Template.

func (*Template) Update

func (t *Template) Update(ctx context.Context, template *template.WorkflowTemplate) error

Update a Tinkerbell Template.

type TemplateClient added in v1.29.0

type TemplateClient interface {
	Get(context.Context, string, string) (*template.WorkflowTemplate, error)
	Create(context.Context, *template.WorkflowTemplate) error
}

type Workflow

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

Workflow client for Tinkerbell.

func NewWorkflowClient

func NewWorkflowClient(client workflow.WorkflowServiceClient, hClient *Hardware) *Workflow

NewWorkflowClient returns a Workflow client.

func (*Workflow) Create

func (t *Workflow) Create(ctx context.Context, templateID, hardwareID string) (string, error)

Create a Tinkerbell Workflow.

func (*Workflow) Delete

func (t *Workflow) Delete(ctx context.Context, id string) error

Delete a Tinkerbell Workflow.

func (*Workflow) Get

func (t *Workflow) Get(ctx context.Context, id string) (*workflow.Workflow, error)

Get returns a Tinkerbell Workflow.

func (*Workflow) GetActions

func (t *Workflow) GetActions(ctx context.Context, id string) ([]*workflow.WorkflowAction, error)

GetActions returns the actions for a given Tinkerbell Workflow.

func (*Workflow) GetEvents

func (t *Workflow) GetEvents(ctx context.Context, id string) ([]*workflow.WorkflowActionStatus, error)

GetEvents returns the events for a given Tinkerbell Workflow.

func (*Workflow) GetMetadata

func (t *Workflow) GetMetadata(ctx context.Context, id string) ([]byte, error)

GetMetadata returns the metadata for a given Tinkerbell Workflow.

func (*Workflow) GetState

func (t *Workflow) GetState(ctx context.Context, id string) (workflow.State, error)

GetState returns the state for a given Tinkerbell Workflow.

type WorkflowClient added in v1.29.0

type WorkflowClient interface {
	Create(context.Context, string, string) (string, error)
}

Jump to

Keyboard shortcuts

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