leftovers: github.com/genevievelesperance/leftovers/openstack Index | Files | Directories

package openstack

import "github.com/genevievelesperance/leftovers/openstack"

Index

Package Files

compute_api.go compute_instance.go compute_instance_client.go compute_instances.go image.go image_api.go images.go images_client.go leftovers.go volume.go volume_api.go volumes.go volumes_block_storage_client.go

type AuthArgs Uses

type AuthArgs struct {
    AuthURL    string
    Username   string
    Password   string
    Domain     string
    Region     string
    TenantName string
}

type ComputeAPI Uses

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

func (ComputeAPI) Delete Uses

func (api ComputeAPI) Delete(instanceID string) error

func (ComputeAPI) GetComputeInstancePager Uses

func (api ComputeAPI) GetComputeInstancePager() pagination.Pager

func (ComputeAPI) PageToServers Uses

func (api ComputeAPI) PageToServers(page pagination.Page) ([]servers.Server, error)

func (ComputeAPI) PagerToPage Uses

func (api ComputeAPI) PagerToPage(pager pagination.Pager) (pagination.Page, error)

type ComputeClient Uses

type ComputeClient interface {
    List() ([]servers.Server, error)
    Delete(instanceID string) error
}

go:generate faux --interface ComputeClient --output fakes/compute_client.go

type ComputeInstance Uses

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

func NewComputeInstance Uses

func NewComputeInstance(name string, id string, client ComputeClient) ComputeInstance

func (ComputeInstance) Delete Uses

func (ci ComputeInstance) Delete() error

func (ComputeInstance) Name Uses

func (ci ComputeInstance) Name() string

func (ComputeInstance) Type Uses

func (ComputeInstance) Type() string

type ComputeInstanceAPI Uses

type ComputeInstanceAPI interface {
    GetComputeInstancePager() pagination.Pager
    PagerToPage(pagination.Pager) (pagination.Page, error)
    PageToServers(pagination.Page) ([]servers.Server, error)
    Delete(instanceID string) error
}

go:generate faux --interface ComputeInstanceAPI --output fakes/compute_instance_api.go

type ComputeInstanceClient Uses

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

func NewComputeInstanceClient Uses

func NewComputeInstanceClient(api ComputeInstanceAPI) ComputeInstanceClient

func (ComputeInstanceClient) Delete Uses

func (client ComputeInstanceClient) Delete(instanceID string) error

func (ComputeInstanceClient) List Uses

func (client ComputeInstanceClient) List() ([]servers.Server, error)

type ComputeInstances Uses

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

func NewComputeInstances Uses

func NewComputeInstances(computeClient ComputeClient, logger logger) ComputeInstances

func (ComputeInstances) List Uses

func (ci ComputeInstances) List() ([]common.Deletable, error)

func (ComputeInstances) Type Uses

func (ci ComputeInstances) Type() string

type Image Uses

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

func NewImage Uses

func NewImage(name string, id string, client imageServiceClient) Image

func (Image) Delete Uses

func (i Image) Delete() error

func (Image) Name Uses

func (i Image) Name() string

func (Image) Type Uses

func (Image) Type() string

type ImageAPI Uses

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

func (ImageAPI) Delete Uses

func (api ImageAPI) Delete(imageID string) error

func (ImageAPI) GetImagesPager Uses

func (api ImageAPI) GetImagesPager() pagination.Pager

func (ImageAPI) PageToImages Uses

func (api ImageAPI) PageToImages(page pagination.Page) ([]images.Image, error)

func (ImageAPI) PagerToPage Uses

func (api ImageAPI) PagerToPage(pager pagination.Pager) (pagination.Page, error)

type Images Uses

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

func NewImages Uses

func NewImages(client imageServiceClient, logger logger) Images

func (Images) List Uses

func (i Images) List() ([]common.Deletable, error)

func (Images) Type Uses

func (i Images) Type() string

type ImagesClient Uses

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

func NewImagesClient Uses

func NewImagesClient(imageAPI imageAPI) ImagesClient

func (ImagesClient) Delete Uses

func (ic ImagesClient) Delete(imageID string) error

func (ImagesClient) List Uses

func (ic ImagesClient) List() ([]images.Image, error)

type Leftovers Uses

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

func NewLeftovers Uses

func NewLeftovers(logger logger, authArgs AuthArgs) (Leftovers, error)

NewLeftovers returns a new Leftovers for OpenStack that can be used to list resources, list types, or delete resources for the provided account. It returns an error if the credentials provided are invalid or if a client fails to be created.

func (Leftovers) Delete Uses

func (l Leftovers) Delete(filter string) error

Delete will collect all resources that contain the provided filter in the resource's identifier, prompt you to confirm deletion (if enabled), and delete thoseu that are selected.

func (Leftovers) DeleteByType Uses

func (l Leftovers) DeleteByType(filter, rType string) error

DeleteByType will collect all resources of the provied type that contain the provided filter in the resource's identifier, prompt you to confirm deletion (if enabled), and delete those that are selected.

func (Leftovers) List Uses

func (l Leftovers) List(filter string)

List will print all of the resources that match the provided filter.

func (Leftovers) ListByType Uses

func (l Leftovers) ListByType(filter, rType string)

ListByType defaults to List.

func (Leftovers) Types Uses

func (l Leftovers) Types()

Types will print all the resource types that can be deleted on this IaaS.

type Volume Uses

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

func NewVolume Uses

func NewVolume(name string, id string, client volumesClient) Volume

func (Volume) Delete Uses

func (v Volume) Delete() error

func (Volume) Name Uses

func (v Volume) Name() string

func (Volume) Type Uses

func (Volume) Type() string

type Volumes Uses

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

func NewVolumes Uses

func NewVolumes(client volumesClient, logger logger) Volumes

func (Volumes) List Uses

func (v Volumes) List() ([]common.Deletable, error)

func (Volumes) Type Uses

func (Volumes) Type() string

type VolumesAPI Uses

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

func (VolumesAPI) DeleteVolume Uses

func (api VolumesAPI) DeleteVolume(id string) error

func (VolumesAPI) GetVolumesPager Uses

func (api VolumesAPI) GetVolumesPager() pagination.Pager

func (VolumesAPI) PageToVolumes Uses

func (api VolumesAPI) PageToVolumes(page pagination.Page) ([]volumes.Volume, error)

func (VolumesAPI) PagerToPage Uses

func (api VolumesAPI) PagerToPage(pager pagination.Pager) (pagination.Page, error)

type VolumesBlockStorageClient Uses

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

func NewVolumesBlockStorageClient Uses

func NewVolumesBlockStorageClient(api volumesAPI) VolumesBlockStorageClient

func (VolumesBlockStorageClient) Delete Uses

func (v VolumesBlockStorageClient) Delete(volumeID string) error

func (VolumesBlockStorageClient) List Uses

func (v VolumesBlockStorageClient) List() ([]volumes.Volume, error)

Directories

PathSynopsis
fakes

Package openstack imports 12 packages (graph). Updated 2019-11-15. Refresh now. Tools for package owners.