edp

package
v0.0.0-...-e2054a2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HttpClient *http.Client
	Config     *Config
	Logger     *zap.SugaredLogger
}

func NewClient

func NewClient(config *Config, logger *zap.SugaredLogger) *Client

func (Client) NewRequest

func (eClient Client) NewRequest(dataTenant string) (*http.Request, error)

func (Client) Send

func (eClient Client) Send(req *http.Request, payload []byte) (*http.Response, error)

type Compute

type Compute struct {
	VMTypes            []VMType           `json:"vm_types" validate:"required"`
	ProvisionedCpus    int                `json:"provisioned_cpus" validate:"numeric"`
	ProvisionedRAMGb   float64            `json:"provisioned_ram_gb" validate:"numeric"`
	ProvisionedVolumes ProvisionedVolumes `json:"provisioned_volumes" validate:"required"`
}

type Config

type Config struct {
	URL               string        `envconfig:"EDP_URL" default:"https://input.yevents.io" required:"true"`
	Namespace         string        `envconfig:"EDP_NAMESPACE" default:"kyma-dev" required:"true"`
	DataStreamName    string        `envconfig:"EDP_DATASTREAM_NAME" default:"consumption-metrics" required:"true"`
	DataStreamVersion string        `envconfig:"EDP_DATASTREAM_VERSION" default:"1" required:"true"`
	DataStreamEnv     string        `envconfig:"EDP_DATASTREAM_ENV" default:"dev" required:"true"`
	Timeout           time.Duration `envconfig:"EDP_TIMEOUT" default:"30s"`
	EventRetry        int           `envconfig:"EDP_RETRY" default:"3"`
	Token             string
}

type ConsumptionMetrics

type ConsumptionMetrics struct {
	RuntimeId    string      `json:"runtime_id" validate:"required"`
	SubAccountId string      `json:"sub_account_id" validate:"required"`
	ShootName    string      `json:"shoot_name" validate:"required"`
	Timestamp    string      `json:"timestamp" validate:"required"`
	Compute      Compute     `json:"compute" validate:"required"`
	Networking   *Networking `json:"networking,omitempty"`
}

type Networking

type Networking struct {
	ProvisionedVnets int `json:"provisioned_vnets" validate:"numeric"`
	ProvisionedIPs   int `json:"provisioned_ips" validate:"numeric"`
}

type ProvisionedVolumes

type ProvisionedVolumes struct {
	SizeGbTotal   int64 `json:"size_gb_total" validate:"numeric"`
	Count         int   `json:"count" validate:"numeric"`
	SizeGbRounded int64 `json:"size_gb_rounded" validate:"numeric"`
}

type VMType

type VMType struct {
	Name  string `json:"name" validate:"required"`
	Count int    `json:"count" validate:"numeric"`
}

Jump to

Keyboard shortcuts

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