target

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: GPL-3.0 Imports: 28 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKey

func CreateKey(keyValues ...string) string

create a target key

Types

type Builder

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

func NewBuilder

func NewBuilder(
	pathKey string,
	cookbookRecipe,
	cloudProvider,
	cloudBackend config.Configurable,
	additonalInputs map[string]string,
	outputBuffer,
	errorBuffer io.Writer,
) (*Builder, error)

in: cookbookRecipe - the recipe to create a launcher for in: cloudProvider - the cloud provider for the cloud to launch the recipe in in: cloudBackend - the backend where launch state will be saved in: outputBuffer - buffer to redirect the stdout from CLI execution in: errorBuffer - buffer to redirect the stderr from CLI execution

func (*Builder) AutoInitialize

func (b *Builder) AutoInitialize() error

initialize if not initialized

func (*Builder) Delete

func (b *Builder) Delete() error

delete all resources created for the target

func (*Builder) GetLocalBuildState

func (b *Builder) GetLocalBuildState() (bool, bool)

this build's local state - is build's run state present - is build's resource state local

func (*Builder) Initialize

func (b *Builder) Initialize() error

initialize the target

func (*Builder) Launch

func (b *Builder) Launch() error

launch the target

func (*Builder) Migrate

func (b *Builder) Migrate() error

migrate a target

func (*Builder) Output

func (b *Builder) Output() *map[string]terraform.Output

outputs from last launch

func (*Builder) Resume

func (b *Builder) Resume() error

resume a suspended target

func (*Builder) SetRebuildInstanceData

func (b *Builder) SetRebuildInstanceData() error

taints deployed instance's attached data resources so they are rebuilt next time launch is called

func (*Builder) SetRebuildInstances

func (b *Builder) SetRebuildInstances() error

taints deployed instance resources so they are rebuilt next time launch is called

func (*Builder) ShowLaunchPlan

func (b *Builder) ShowLaunchPlan() error

show launch plan

func (*Builder) Suspend

func (b *Builder) Suspend() error

suspend the target

type InstanceStateChange

type InstanceStateChange func(name string, instance *ManagedInstance)

Instance state callback

type ManagedInstance

type ManagedInstance struct {
	Instance cloud.ComputeInstance
	Metadata map[string]interface{}
	// contains filtered or unexported fields
}

func (*ManagedInstance) CanConnect

func (i *ManagedInstance) CanConnect() (bool, error)

func (*ManagedInstance) Description

func (i *ManagedInstance) Description() string

func (*ManagedInstance) FQDN

func (i *ManagedInstance) FQDN() string

func (*ManagedInstance) GetEndpoint

func (i *ManagedInstance) GetEndpoint() (string, error)

func (*ManagedInstance) HttpsClient

func (i *ManagedInstance) HttpsClient() (*http.Client, string, error)

func (*ManagedInstance) Name

func (i *ManagedInstance) Name() string

func (*ManagedInstance) NonRootPassword

func (i *ManagedInstance) NonRootPassword() string

func (*ManagedInstance) NonRootUser

func (i *ManagedInstance) NonRootUser() string

func (*ManagedInstance) PublicIP

func (i *ManagedInstance) PublicIP() string

func (*ManagedInstance) RootPassword

func (i *ManagedInstance) RootPassword() string

func (*ManagedInstance) RootUser

func (i *ManagedInstance) RootUser() string

func (*ManagedInstance) SSHAddress

func (i *ManagedInstance) SSHAddress() string

func (*ManagedInstance) SSHKey

func (i *ManagedInstance) SSHKey() []byte

func (*ManagedInstance) SSHUser

func (i *ManagedInstance) SSHUser() string

func (*ManagedInstance) State

func (i *ManagedInstance) State() (cloud.InstanceState, error)

type Target

type Target struct {
	RecipeName string `json:"recipeName"`
	RecipeIaas string `json:"recipeIaas"`

	CookbookName    string `json:"cookbookName,omitempty"`
	CookbookVersion string `json:"cookbookVersion,omitempty"`
	RepoTimestamp   string `json:"repoTimestamp,omitempty"`

	DependentTargets []string `json:"dependentTargets"`

	Recipe   cookbook.Recipe        `json:"recipe,omitempty"`
	Provider provider.CloudProvider `json:"provider,omitempty"`
	Backend  backend.CloudBackend   `json:"backend,omitempty"`

	Output *map[string]terraform.Output `json:"output,omitempty"`

	RSAPrivateKey string `json:"rsaPrivateKey,omitempty"`
	RSAPublicKey  string `json:"rsaPublicKey,omitempty"`

	NodeKey string `json:"nodeKey,omitempty"`
	NodeID  string `json:"nodeID,omitempty"`
	// contains filtered or unexported fields
}

a target is a recipe configured to be launched in a public cloud region

func (*Target) CanUpdate

func (t *Target) CanUpdate() bool

func (*Target) CanUseAsEgressNode

func (t *Target) CanUseAsEgressNode() bool

func (*Target) Copy

func (t *Target) Copy() (*Target, error)

returns a copy of this target

func (*Target) CreateDeviceConnectKeyPair

func (t *Target) CreateDeviceConnectKeyPair() (string, string, error)

func (*Target) DeleteBackend

func (t *Target) DeleteBackend() error

deletes the target backend

func (*Target) Dependencies

func (t *Target) Dependencies() []*Target

func (*Target) DeploymentName

func (t *Target) DeploymentName() string

func (*Target) Description

func (t *Target) Description() string

func (*Target) Error

func (t *Target) Error() error

func (*Target) GetApiCARoot

func (t *Target) GetApiCARoot() string

func (*Target) GetEndpoint

func (t *Target) GetEndpoint() (string, error)

func (*Target) GetIaaS

func (t *Target) GetIaaS() string

func (*Target) GetLastSeen

func (t *Target) GetLastSeen() uint64

func (*Target) GetPublicKey

func (t *Target) GetPublicKey() string

func (*Target) GetRecipe

func (t *Target) GetRecipe() string

func (*Target) GetRegion

func (t *Target) GetRegion() string

func (*Target) GetSpaceID

func (t *Target) GetSpaceID() string

func (*Target) GetSpaceName

func (t *Target) GetSpaceName() string

func (*Target) GetStatus

func (t *Target) GetStatus() string

func (*Target) GetVersion

func (t *Target) GetVersion() string

func (*Target) HasAdminAccess

func (t *Target) HasAdminAccess() bool

func (*Target) HasDependents

func (t *Target) HasDependents() bool

func (*Target) IsRunning

func (t *Target) IsRunning() bool

func (*Target) IsSpaceOwned

func (t *Target) IsSpaceOwned() bool

func (*Target) Key

func (t *Target) Key() string

func (*Target) ManagedInstance

func (t *Target) ManagedInstance(name string) *ManagedInstance

func (*Target) ManagedInstances

func (t *Target) ManagedInstances() []*ManagedInstance

func (*Target) Name

func (t *Target) Name() string

func (*Target) NewBuilder

func (t *Target) NewBuilder(
	buildVars map[string]string,
	outputBuffer,
	errorBuffer io.Writer,
) (*Builder, error)

returns a launcher for this target

func (*Target) PrepareBackend

func (t *Target) PrepareBackend() error

prepares the target backend

func (*Target) Refresh

func (t *Target) Refresh()

func (*Target) RestApiClient

func (t *Target) RestApiClient(ctx pcontext.Context) (*rest.RestApiClient, error)

func (*Target) Resume

func (t *Target) Resume(cb InstanceStateChange) error

func (*Target) SetOutput

func (t *Target) SetOutput(output *map[string]terraform.Output)

func (*Target) Status

func (t *Target) Status() TargetState

func (*Target) Suspend

func (t *Target) Suspend(cb InstanceStateChange) error

func (*Target) UpdateKeys

func (t *Target) UpdateKeys() (*Target, error)

func (*Target) Version

func (t *Target) Version() string

type TargetSet

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

func NewTargetSet

func NewTargetSet(ctx context) *TargetSet

func (*TargetSet) DeleteTarget

func (ts *TargetSet) DeleteTarget(key string)

func (*TargetSet) GetDisabledTargetRecipes

func (ts *TargetSet) GetDisabledTargetRecipes() []cookbook.CookbookRecipeInfo

func (*TargetSet) GetTarget

func (ts *TargetSet) GetTarget(name string) *Target

func (*TargetSet) GetTargets

func (ts *TargetSet) GetTargets() []*Target

func (*TargetSet) Lookup

func (ts *TargetSet) Lookup(keyValues ...string) []*Target

func (*TargetSet) MarshalJSON

func (ts *TargetSet) MarshalJSON() ([]byte, error)

func (*TargetSet) SaveTarget

func (ts *TargetSet) SaveTarget(key string, target *Target) error

func (*TargetSet) UnmarshalJSON

func (ts *TargetSet) UnmarshalJSON(b []byte) error

type TargetState

type TargetState int

Input types

const (
	Undeployed TargetState = iota
	Running
	Shutdown
	Pending
	Unknown
)

Jump to

Keyboard shortcuts

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