tfplugin

package
v0.0.0-...-924030b Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

package tfplugin for threefold plugin client interface and implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TFPluginClient

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

tfPluginClient wraps grid-client tfPluginClient

func NewTFPluginClient

func NewTFPluginClient(mnemonics, network string) (TFPluginClient, error)

NewTFPluginClient returns new tfPluginClient given mnemonics and grid network

func (*TFPluginClient) CancelByProjectName

func (t *TFPluginClient) CancelByProjectName(projectName string) error

CancelByProjectName cancels a contract on Threefold grid

func (*TFPluginClient) DeployDeployment

func (t *TFPluginClient) DeployDeployment(ctx context.Context, dl *workloads.Deployment) error

DeployDeployment deploys a deployment to Threefold grid

func (*TFPluginClient) DeployGatewayName

func (t *TFPluginClient) DeployGatewayName(ctx context.Context, gw *workloads.GatewayNameProxy) error

DeployNameGateway deploys a GatewayName deployment to Threefold grid

func (*TFPluginClient) DeployNetwork

func (t *TFPluginClient) DeployNetwork(ctx context.Context, znet *workloads.ZNet) error

DeployNetwork deploys a network deployment to Threefold grid

func (*TFPluginClient) GetAvailableNode

func (t *TFPluginClient) GetAvailableNode(ctx context.Context, options types.NodeFilter, rootfs uint64) (uint32, error)

GetAvailableNode returns nodes that match the given filter with rootfs specified in GBs

func (*TFPluginClient) GetGridNetwork

func (t *TFPluginClient) GetGridNetwork() string

GetGridNetwork returns the current grid network

func (*TFPluginClient) ListContractsOfProjectName

func (t *TFPluginClient) ListContractsOfProjectName(projectName string) (graphql.Contracts, error)

ListContractsOfProjectName returns contracts for a project name from Threefold grid

func (*TFPluginClient) LoadGatewayNameFromGrid

func (t *TFPluginClient) LoadGatewayNameFromGrid(ctx context.Context, nodeID uint32, name string, deploymentName string) (workloads.GatewayNameProxy, error)

LoadGatewayNameFromGrid loads a GatewayName from Threefold grid

func (*TFPluginClient) LoadVMFromGrid

func (t *TFPluginClient) LoadVMFromGrid(ctx context.Context, nodeID uint32, name string, deploymentName string) (workloads.VM, error)

LoadVMFromGrid loads a VM from Threefold grid

func (*TFPluginClient) SetState

func (t *TFPluginClient) SetState(nodeID uint32, contractIDs []uint64)

SetState set the state of tf plugin client

type TFPluginClientInterface

type TFPluginClientInterface interface {
	DeployNetwork(ctx context.Context, znet *workloads.ZNet) error
	DeployDeployment(ctx context.Context, dl *workloads.Deployment) error
	DeployGatewayName(ctx context.Context, gw *workloads.GatewayNameProxy) error
	LoadVMFromGrid(ctx context.Context, nodeID uint32, name string, deploymentName string) (workloads.VM, error)
	LoadGatewayNameFromGrid(ctx context.Context, nodeID uint32, name string, deploymentName string) (workloads.GatewayNameProxy, error)
	ListContractsOfProjectName(projectName string) (graphql.Contracts, error)
	CancelByProjectName(projectName string) error
	GetAvailableNode(ctx context.Context, options types.NodeFilter, rootfs uint64) (uint32, error)
	GetGridNetwork() string
	SetState(nodeID uint32, contractIDs []uint64)
}

TFPluginClientInterface interface for tfPluginClient

Jump to

Keyboard shortcuts

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