ibm

package
v0.0.0-...-6054725 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "ibm"

ProviderName of the cloud platform provider

Variables

This section is empty.

Functions

This section is empty.

Types

type IBM

type IBM struct {
	Storage *Objects
	// contains filtered or unexported fields
}

IBM Provider to interact with IBM infrastructure

func NewProvider

func NewProvider() *IBM

NewProvider IBM

func (*IBM) AttachVolume

func (v *IBM) AttachVolume(ctx *lepton.Context, image, name string, attachID int) error

AttachVolume is a stub to satisfy VolumeService interface

func (*IBM) BuildImage

func (v *IBM) BuildImage(ctx *lepton.Context) (string, error)

BuildImage to be upload on IBM

func (*IBM) BuildImageWithPackage

func (v *IBM) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on IBM.

func (*IBM) CreateImage

func (v *IBM) CreateImage(ctx *lepton.Context, imagePath string) error

CreateImage - Creates image on IBM using nanos images

func (*IBM) CreateInstance

func (v *IBM) CreateInstance(ctx *lepton.Context) error

CreateInstance - Creates instance on IBM Cloud Platform

func (*IBM) CreateVolume

func (v *IBM) CreateVolume(ctx *lepton.Context, name, data, provider string) (lepton.NanosVolume, error)

CreateVolume is a stub to satisfy VolumeService interface

func (*IBM) CustomizeImage

func (v *IBM) CustomizeImage(ctx *lepton.Context) (string, error)

CustomizeImage returns image path with adaptations needed by cloud provider

func (*IBM) DeleteImage

func (v *IBM) DeleteImage(ctx *lepton.Context, snapshotID string) error

DeleteImage deletes image from v

func (*IBM) DeleteInstance

func (v *IBM) DeleteInstance(ctx *lepton.Context, instanceID string) error

DeleteInstance deletes instance from IBM

func (*IBM) DeleteVolume

func (v *IBM) DeleteVolume(ctx *lepton.Context, name string) error

DeleteVolume is a stub to satisfy VolumeService interface

func (*IBM) DetachVolume

func (v *IBM) DetachVolume(ctx *lepton.Context, image, name string) error

DetachVolume is a stub to satisfy VolumeService interface

func (*IBM) GetAllVolumes

func (v *IBM) GetAllVolumes(ctx *lepton.Context) (*[]lepton.NanosVolume, error)

GetAllVolumes is a stub to satisfy VolumeService interface

func (*IBM) GetImages

func (v *IBM) GetImages(ctx *lepton.Context) ([]lepton.CloudImage, error)

GetImages return all images on IBM needs tags added

func (*IBM) GetInstanceByName

func (v *IBM) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)

GetInstanceByName returns instance with given name

func (*IBM) GetInstanceLogs

func (v *IBM) GetInstanceLogs(ctx *lepton.Context, instancename string) (string, error)

GetInstanceLogs gets instance related logs https://cloud.ibm.com/docs/vpc?topic=vpc-vsi_is_connecting_console&interface=api

func (*IBM) GetInstances

func (v *IBM) GetInstances(ctx *lepton.Context) ([]lepton.CloudInstance, error)

GetInstances return all instances on IBM

func (*IBM) GetStorage

func (v *IBM) GetStorage() lepton.Storage

GetStorage returns storage interface for cloud provider

func (*IBM) Initialize

func (v *IBM) Initialize(config *types.ProviderConfig) error

Initialize provider

func (*IBM) ListImages

func (v *IBM) ListImages(ctx *lepton.Context) error

ListImages lists images on IBM

func (*IBM) ListInstances

func (v *IBM) ListInstances(ctx *lepton.Context) error

ListInstances lists instances on v

func (*IBM) PrintInstanceLogs

func (v *IBM) PrintInstanceLogs(ctx *lepton.Context, instancename string, watch bool) error

PrintInstanceLogs writes instance logs to console

func (*IBM) RebootInstance

func (v *IBM) RebootInstance(ctx *lepton.Context, instanceName string) error

RebootInstance reboots the instance.

func (*IBM) ResizeImage

func (v *IBM) ResizeImage(ctx *lepton.Context, imagename string, hbytes string) error

ResizeImage is not supported on IBM.

func (*IBM) StartInstance

func (v *IBM) StartInstance(ctx *lepton.Context, instanceID string) error

StartInstance starts an instance in IBM

func (*IBM) StopInstance

func (v *IBM) StopInstance(ctx *lepton.Context, instanceID string) error

StopInstance halts instance from v

func (*IBM) SyncImage

func (v *IBM) SyncImage(config *types.Config, target lepton.Provider, image string) error

SyncImage syncs image from provider to another provider

type Image

type Image struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Status    string `json:"status"`
	CreatedAt string `json:"created_at"`
}

Image represents a given IBM image configuration.

type ImageListResponse

type ImageListResponse struct {
	Images []Image `json:"images"`
}

ImageListResponse is the set of instances available from IBM in an images list call.

type Instance

type Instance struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Status    string `json:"status"`
	CreatedAt string `json:"created_at"`
}

Instance represents a virtual server instance.

type InstancesListResponse

type InstancesListResponse struct {
	Instances []Instance `json:"instance"`
}

InstancesListResponse is the set of instances available from IBM in an images list call.

type Objects

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

Objects represent storage specific information for cloud object storage.

func (*Objects) CopyToBucket

func (s *Objects) CopyToBucket(config *types.Config, archPath string) error

CopyToBucket copies archive to bucket

func (*Objects) DeleteFromBucket

func (s *Objects) DeleteFromBucket(config *types.Config, key string) error

DeleteFromBucket deletes key from config's bucket

type ResourceGroup

type ResourceGroup struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ResourceGroup represents a single resource group.

type ResourceGroupResponse

type ResourceGroupResponse struct {
	ResourceGroups []ResourceGroup `json:"resources"`
}

ResourceGroupResponse is the response type for the resource group list endpoint.

type Subnet

type Subnet struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Subnet represents a single subnet.

type SubnetListResponse

type SubnetListResponse struct {
	Subnets []Subnet `json:"subnets"`
}

SubnetListResponse is the response type for the subnet list endpoint.

type SubnetResponse

type SubnetResponse struct {
	Subnets []Subnet `json:"subnets"`
}

SubnetResponse is the response type for the subnet list endpoint.

type Token

type Token struct {
	AccessToken string `json:"access_token"`
}

Token is the return type for a new IAM token.

type VPC

type VPC struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

VPC represents a single vpc.

type VPCListResponse

type VPCListResponse struct {
	VPCs []VPC `json:"vpcs"`
}

VPCListResponse is the response type for the vpc list endpoint.

Jump to

Keyboard shortcuts

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