mcs

package
v1.375.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterCost

type ClusterCost struct {
	Namespaces         []*Namespace  `json:"namespaces,omitempty"`
	Deployments        []*Deployment `json:"deployments,omitempty"`
	TotalCost          *float64      `json:"totalCost,omitempty"`
	TotalComputeCost   *float64      `json:"totalComputeCost,omitempty"`
	TotalEBSCost       *float64      `json:"totalEbsCost,omitempty"`
	TotalStorageCost   *float64      `json:"totalStorageCost,omitempty"`
	UnusedStorageCost  *float64      `json:"unusedStorageCost,omitempty"`
	StandAlonePodsCost *float64      `json:"standAlonePodsCost,omitempty"`
	HeadroomCost       *float64      `json:"headroomCost,omitempty"`
	IdleCost           *float64      `json:"idleCost,omitempty"`
}

type ClusterCostInput

type ClusterCostInput struct {
	ClusterID *string `json:"clusterId,omitempty"`
	ToDate    *string `json:"toDate,omitempty"`
	FromDate  *string `json:"fromDate,omitempty"`
}

type ClusterCostOutput

type ClusterCostOutput struct {
	ClusterCosts []*ClusterCost `json:"clusterCosts,omitempty"`
}

type Deployment deprecated

type Deployment struct {
	DeploymentName *string           `json:"name,omitempty"`
	Namespace      *string           `json:"namespace,omitempty"`
	Cost           *float64          `json:"cost,omitempty"`
	ComputeCost    *float64          `json:"computeCost,omitempty"`
	StorageCost    *float64          `json:"storageCost,omitempty"`
	Labels         map[string]string `json:"labels,omitempty"`
	Annotations    map[string]string `json:"annotations,omitempty"`
}

Deprecated: Use Resource instead. Kept for backward compatibility.

type Namespace

type Namespace struct {
	Namespace          *string           `json:"namespace,omitempty"`
	Cost               *float64          `json:"cost,omitempty"`
	ComputeCost        *float64          `json:"computeCost,omitempty"`
	EBSCost            *float64          `json:"ebsCost,omitempty"`
	StorageCost        *float64          `json:"storageCost,omitempty"`
	Deployments        []*Resource       `json:"deployments,omitempty"`
	StatefulSets       []*Resource       `json:"statefulSets,omitempty"`
	DaemonSets         []*Resource       `json:"daemonSets,omitempty"`
	Jobs               []*Resource       `json:"jobs,omitempty"`
	StandAlonePodsCost *Resource         `json:"standAlonePodsCost,omitempty"`
	Labels             map[string]string `json:"labels,omitempty"`
	Annotations        map[string]string `json:"annotations,omitempty"`
}

type Resource added in v1.52.2

type Resource struct {
	Name        *string           `json:"name,omitempty"`
	Namespace   *string           `json:"namespace,omitempty"`
	Cost        *float64          `json:"cost,omitempty"`
	ComputeCost *float64          `json:"computeCost,omitempty"`
	EBSCost     *float64          `json:"ebsCost,omitempty"`
	StorageCost *float64          `json:"storageCost,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type Service

type Service interface {
	GetClusterCosts(context.Context, *ClusterCostInput) (*ClusterCostOutput, error)
}

Service provides the API operation methods for making requests to endpoints of the Spotinst API. See this package's package overview docs for details on the service.

type ServiceOp

type ServiceOp struct {
	Client *client.Client
}

func New

func New(sess *session.Session, cfgs ...*spotinst.Config) *ServiceOp

func (*ServiceOp) GetClusterCosts

func (s *ServiceOp) GetClusterCosts(ctx context.Context, input *ClusterCostInput) (*ClusterCostOutput, error)

GetClusterCosts accepts Kubernetes `clusterId`, `fromDate`, and `toDate` and returns a list of cost objects. Dates can be in the format of `yyyy-mm-dd` or Unix timestamp (1494751821472).

Jump to

Keyboard shortcuts

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