Documentation ¶
Overview ¶
Package unsued provides the basic interfaces to obtain information and in some cases, manipulate, unused resources in different Cloud Service Providers (CSPs).
Currently only unused disks are supported.
The following providers are already implemented:
- Google Cloud Platform (GCP)
- Amazon Web Services (AWS)
- Azure
Index ¶
- func ByCreatedAt(p, q Disk) bool
- func ByName(p, q Disk) bool
- func ByProvider(p, q Disk) bool
- type ByFunc
- type Disk
- type DiskType
- type Disks
- type Meta
- func (m Meta) CreatedBy() string
- func (m Meta) CreatedForNamespace() string
- func (m Meta) CreatedForPV() string
- func (m Meta) CreatedForPVC() string
- func (m Meta) Equals(b Meta) bool
- func (m Meta) Keys() []string
- func (m Meta) Matches(key, val string) bool
- func (m Meta) String() string
- func (m Meta) Zone() string
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByCreatedAt ¶
ByCreatedAt sorts a Disks collection by disk creation time.
func ByProvider ¶
ByProvider sorts a Disks collection by provider name.
Types ¶
type Disk ¶
type Disk interface { // ID should return a unique ID for a disk within each cloud // provider. ID() string // Provider returns a string indicating the provider this disk // belongs to. Provider() Provider // Name returns the disk name. Name() string // SizeGB returns the disk size in GB. SizeGB() int // CreatedAt returns the time when the disk was created. CreatedAt() time.Time // LastUsedAt returns the date when the disk was last used. LastUsedAt() time.Time // Meta returns the disk metadata. Meta() Meta // DiskType returns the normalized type of disk. DiskType() DiskType }
Disk represents an unused disk on a given cloud provider.
type Meta ¶
Meta is a map of key/value pairs.
func (Meta) CreatedForNamespace ¶ added in v0.0.3
func (Meta) CreatedForPV ¶ added in v0.0.3
func (Meta) CreatedForPVC ¶ added in v0.0.3
func (Meta) Matches ¶
Matches returns true when the given key exists in the map with the given value.
type Provider ¶
type Provider interface { // Name returns the provider name. Name() string // ListUnusedDisks returns a list of unused disks for the given // provider. ListUnusedDisks(ctx context.Context) (Disks, error) // Meta returns the provider metadata. Meta() Meta // Delete deletes a disk from the provider. Delete(ctx context.Context, disk Disk) error }
Provider represents a cloud provider.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
unused
unused is a CLI tool to query the given providers for unused disks.
|
unused is a CLI tool to query the given providers for unused disks. |
unused-exporter
unused-exporter is a Prometheus exporter with a web interface to expose unused disks as metrics.
|
unused-exporter is a Prometheus exporter with a web interface to expose unused disks as metrics. |
Click to show internal directories.
Click to hide internal directories.