grid

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Operator actions for handling interventions on a grid

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCustomBackupPathRequest added in v1.8.0

type AddCustomBackupPathRequest struct {
	// ID of the grid
	// Required: true
	GID uint64 `url:"gridId" json:"gridId" validate:"required"`

	// Absolute path
	// Required: true
	Path string `url:"path" json:"path" validate:"required"`
}

AddCustomBackupPathRequest struct to add new path to the list of custom backup paths

type AddRequest

type AddRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Name of the location
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// Location code typicly used in dns names
	// Required: true
	LocationCode string `url:"locationcode" json:"locationcode" validate:"required"`
}

AddRequest struct for location code

type ChangeSettingsRequest

type ChangeSettingsRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"id" json:"id" validate:"required"`

	// Json data of the new settings will override old data
	// Required: true
	Settings string `url:"settings" json:"settings" validate:"required"`
}

ChangeSettingsRequest struct to change grid settings

type DiskUsage

type DiskUsage struct {
	// Disk size
	DiskSize float64 `json:"disksize"`

	// Disk size max
	DiskSizeMax float64 `json:"disksizemax"`
}

Disk usage

type DockerRegistry added in v1.9.0

type DockerRegistry struct {
	//Password
	Password string `json:"password"`

	//Server
	Server string `json:"server"`

	//Username
	Username string `json:"username"`
}

DockerRegistry in grid settings

type Emails added in v1.9.0

type Emails struct {
	//Address
	Address string `json:"address"`

	//Enabled
	Enabled bool `json:"enabled"`
}

type ExecuteMaintenanceScriptRequest

type ExecuteMaintenanceScriptRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Type of nodes you want to apply the action on
	// Required: true
	NodesType string `url:"nodestype" json:"nodestype" validate:"required"`

	// The script you want to run
	// Required: true
	Script string `url:"script" json:"script" validate:"required"`
}

ExecuteMaintenanceScriptRequest struct to execute script

type GetBackupRequest

type GetBackupRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`
}

GetBackupRequest struct to get backup

type GetDiagnosisRequest

type GetDiagnosisRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`
}

GetDiagnosisRequest struct to get platform snapshot with additional diagnosis

type GetRequest

type GetRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gridId" json:"gridId" validate:"required"`
}

GetRequest struct to get grid details

type GetResourceConsumptionRequest added in v1.5.0

type GetResourceConsumptionRequest struct {
	// ID of the grid
	// Required: true
	GridID uint64 `url:"gridId" json:"gridId" validate:"required"`
}

GetResourceConsumptionRequest struct to get resource consumption

type GetSettingsRequest added in v1.9.0

type GetSettingsRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"grid_id" json:"grid_id" validate:"required"`
}

GetSettingsRequest struct to get grid settings

type Grid

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

Structure for creating request to grid

func New

func New(client interfaces.Caller) *Grid

Builder for grid endpoints

func (Grid) Add

func (g Grid) Add(ctx context.Context, req AddRequest) (bool, error)

Add location code (e.g. DNS name of this grid)

func (Grid) AddCustomBackupPath added in v1.8.0

func (g Grid) AddCustomBackupPath(ctx context.Context, req AddCustomBackupPathRequest) (bool, error)

AddCustomBackupPath add new path to the list of custom backup paths

func (Grid) ChangeSettings

func (g Grid) ChangeSettings(ctx context.Context, req ChangeSettingsRequest) (bool, error)

ChangeSettings changes grid settings

func (Grid) ExecuteMaintenanceScript

func (g Grid) ExecuteMaintenanceScript(ctx context.Context, req ExecuteMaintenanceScriptRequest) (bool, error)

ExecuteMaintenanceScript executes maintenance script

func (Grid) Get

func (g Grid) Get(ctx context.Context, req GetRequest) (*RecordGrid, error)

Get gets information about grid by ID as a RecordGrid struct

func (Grid) GetBackup

func (g Grid) GetBackup(ctx context.Context, req GetBackupRequest) (string, error)

GetBackup gets platform backup

func (Grid) GetBackupGET

func (g Grid) GetBackupGET(ctx context.Context, req GetBackupRequest) (string, error)

GetBackupGET gets platform backup

func (Grid) GetDiagnosis

func (g Grid) GetDiagnosis(ctx context.Context, req GetDiagnosisRequest) (string, error)

GetDiagnosis gets platform snapshot with additional diagnosis info like a logs, etc

func (Grid) GetDiagnosisGET

func (g Grid) GetDiagnosisGET(ctx context.Context, req GetDiagnosisRequest) (string, error)

GetDiagnosisGET gets platform snapshot with additional diagnosis info like a logs, etc

func (Grid) GetRaw added in v1.6.6

func (g Grid) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)

GetRaw gets information about grid by ID as an array of bytes

func (Grid) GetResourceConsumption added in v1.5.0

func (g Grid) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*RecordResourcesConsumption, error)

GetResourceConsumption gets resource consumption

func (Grid) GetSettings added in v1.9.0

func (g Grid) GetSettings(ctx context.Context, req GetSettingsRequest) (*RecordSettingsGrid, error)

GetSettings gets settings grid by ID as a RecordSettingsGrid struct

func (Grid) GetSettingsRaw added in v1.9.0

func (g Grid) GetSettingsRaw(ctx context.Context, req GetSettingsRequest) ([]byte, error)

GetSettingsRaw gets settings grid by ID as an array of bytes

func (Grid) List

func (g Grid) List(ctx context.Context, req ListRequest) (*ListGrids, error)

List gets list of all locations as a ListGrids struct

func (Grid) ListEmails

func (g Grid) ListEmails(ctx context.Context, req ListEmailsRequest) (*ListEmails, error)

ListEmails returns list of email addresses of users

func (Grid) ListRaw added in v1.6.6

func (g Grid) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)

ListRaw gets list of all locations as an array of bytes

func (Grid) ListResourceConsumption added in v1.5.0

func (g Grid) ListResourceConsumption(ctx context.Context) (*ListResourceConsumption, error)

func (Grid) PurgeLogs

func (g Grid) PurgeLogs(ctx context.Context, req PurgeLogsRequest) (bool, error)

PurgeLogs clear Log and ECO records that are older than the specified age. By default, records older than one week are removed

func (Grid) RemoveCustomBackupPath added in v1.8.0

func (g Grid) RemoveCustomBackupPath(ctx context.Context, req RemoveCustomBackupPathRequest) (bool, error)

RemoveCustomBackupPath remove path from the list of custom backup paths

func (Grid) Rename

func (g Grid) Rename(ctx context.Context, req RenameRequest) (bool, error)

Rename renames a grid

func (Grid) ServicesRestart

func (g Grid) ServicesRestart(ctx context.Context, req ServicesRestartRequest) (bool, error)

ServicesRestart restarts decort services on the node

func (Grid) SetCPUAllocationParameter added in v1.4.0

func (g Grid) SetCPUAllocationParameter(ctx context.Context, req SetCPUAllocationParameterRequest) (bool, error)

SetCPUAllocationParameter sets CPU allocation parameter

func (Grid) SetCPUAllocationRatio

func (g Grid) SetCPUAllocationRatio(ctx context.Context, req SetCPUAllocationRatioRequest) (bool, error)

SetCPUAllocationRatio sets CPU allocation ratio

func (Grid) SetCPUAllocationRatioForVM added in v1.4.0

func (g Grid) SetCPUAllocationRatioForVM(ctx context.Context, req SetCPUAllocationRatioForVMRequest) (bool, error)

SetCPUAllocationRatioForVM sets CPU allocation ratio for computes

func (Grid) SetMemAllocationRatio

func (g Grid) SetMemAllocationRatio(ctx context.Context, req SetMemAllocationRatioRequest) (bool, error)

SetMemAllocationRatio sets memory allocation ratio

func (Grid) SetPasswordPolicy added in v1.8.0

func (g Grid) SetPasswordPolicy(ctx context.Context, req SetPasswordPolicyRequest) (bool, error)

RemoveCustomBackupPath set set password policy for a grid

func (Grid) Status

func (g Grid) Status(ctx context.Context) (bool, error)

Status check if current environment is active

func (Grid) StatusGET

func (g Grid) StatusGET(ctx context.Context) (bool, error)

StatusGET check if current environment is active

type HealthcheckNotifications added in v1.9.0

type HealthcheckNotifications struct {
	//Emails
	Emails []Emails `json:"emails"`
}

HealthcheckNotifications settings in grid

type ItemGridList added in v1.5.7

type ItemGridList struct {
	// Resource information
	Resources Resources `json:"Resources"`

	// AuthBroker
	AuthBroker []interface{} `json:"authBroker"`

	// Flag
	Flag string `json:"flag"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Location code
	LocationCode string `json:"locationCode"`

	// Name
	Name string `json:"name"`
}

Information about grid

type ListEmails added in v1.5.0

type ListEmails struct {
	//Data
	Data []string `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List emails

type ListEmailsRequest added in v1.5.0

type ListEmailsRequest struct {
	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListEmailsRequest struct for getting list of email addresses of users

type ListGrids

type ListGrids struct {
	//Data
	Data []ItemGridList `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List Grids

func (ListGrids) FilterByGID added in v1.6.5

func (lg ListGrids) FilterByGID(gid uint64) ListGrids

FilterByGID returns ListGrids with specified GID.

func (ListGrids) FilterByID

func (lg ListGrids) FilterByID(id uint64) ListGrids

FilterByID returns ListGrids with specified ID.

func (ListGrids) FilterByLocationCode

func (lg ListGrids) FilterByLocationCode(locationCode string) ListGrids

FilterByLocationCode returns ListGrids with specified LocationCode.

func (ListGrids) FilterByName

func (lg ListGrids) FilterByName(name string) ListGrids

FilterByName returns ListGrids with specified Name.

func (ListGrids) FilterFunc

func (lg ListGrids) FilterFunc(predicate func(ItemGridList) bool) ListGrids

FilterFunc allows filtering ListGrids based on a user-specified predicate.

func (ListGrids) FindOne

func (lg ListGrids) FindOne() ItemGridList

FindOne returns first found RecordGrid. If none was found, returns an empty struct.

func (ListGrids) IDs added in v1.6.8

func (lg ListGrids) IDs() []uint64

IDs gets array of GRIDID from ListGrids struct

func (ListGrids) Serialize

func (lg ListGrids) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListRequest

type ListRequest struct {
	// Find by id grid
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by name grid
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Sort by one of supported fields, format +|-(field)
	// Required: false
	SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListRequest struct to get list of locations

type ListResourceConsumption added in v1.5.0

type ListResourceConsumption struct {
	// Data
	Data []RecordResourcesConsumption `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

func (ListResourceConsumption) IDs added in v1.6.8

func (lg ListResourceConsumption) IDs() []uint64

IDs gets array of GRIDID from ListResourceConsumption struct

type NetQOS added in v1.9.0

type NetQOS struct {
	// ExtNet Net QOS settings
	ExtNet SettingsNetQOS `json:"ext_net"`

	// VINS Net QOS settings
	VINS SettingsNetQOS `json:"vins"`
}

NetQOS in grid settings

type Prometheus added in v1.9.0

type Prometheus struct {
	//ScrapeInterval
	ScrapeInterval int `json:"scrapeInterval"`
}

Prometheus setting in grid

type PurgeLogsRequest

type PurgeLogsRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Age of the records to remove, e.g. -1h for records older than 1 hour, -1w - one week, etc
	// Required: true
	Age string `url:"age" json:"age" validate:"required"`
}

PurgeLogsRequest struct to purge logs

type RecordGrid

type RecordGrid struct {
	// CKey
	CKey string `json:"_ckey"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// AuthBroker
	AuthBroker []interface{} `json:"authBroker"`

	// Flag
	Flag string `json:"flag"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Location code
	LocationCode string `json:"locationCode"`

	// Name
	Name string `json:"name"`
}

Detailed information about grid

func (RecordGrid) Serialize

func (rg RecordGrid) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type RecordResource

type RecordResource struct {
	// Number of CPU
	CPU uint64 `json:"cpu"`

	// Disk size
	DiskSize float64 `json:"disksize"`

	// Disk size max
	DiskSizeMax int64 `json:"disksizemax"`

	// External IPs
	ExtIPs uint64 `json:"extips"`

	// External traffic
	ExtTraffic uint64 `json:"exttraffic"`

	// Number of GPU
	GPU uint64 `json:"gpu"`

	// Number of RAM
	RAM uint64 `json:"ram"`

	// SEPs
	SEPs map[string]map[string]DiskUsage `json:"seps"`
}

Resource details

type RecordResourcesConsumption added in v1.5.0

type RecordResourcesConsumption struct {
	// Current resources
	Consumed RecordResource `json:"Consumed"`

	// Reserved resources
	Reserved RecordResource `json:"Reserved"`

	// GID
	GID uint64 `json:"id"`
}

Resource consumption information

type RecordSettingsGrid added in v1.9.0

type RecordSettingsGrid struct {
	//Allowed ports
	Allowedports []int `json:"allowedports"`

	//Cleanup retention period
	CleanupRetentionPeriod uint64 `json:"cleanupRetentionPeriod"`

	//Docker registry
	DockerRegistry DockerRegistry `json:"docker_registry"`

	//Enable uptime monitor
	EnableUptimeMonitor bool `json:"enableUptimeMonitor"`

	//Extnet max prereservation num
	ExtnetMaxPreReservationsNum int `json:"extnetMaxPreReservationsNum"`

	//Healthcheck notifications
	HealthcheckNotifications HealthcheckNotifications `json:"healthcheck_notifications"`

	//k8s cleanup enabled
	K8sCleanupEnabled bool `json:"k8s_cleanup_enabled"`

	//Limits
	Limits interface{} `json:"limits"`

	//Location url
	LocationURL string `json:"location_url"`

	//Net QOS
	NetQOS NetQOS `json:"net_qos"`

	//Networks
	Networks string `json:"networks"`

	//Prometheus
	Prometheus Prometheus `json:"prometheus"`

	//Vins max prereservation num
	VinsMaxPreReservationsNum int `json:"vinsMaxPreReservationsNum"`

	//Vnfdev mgmt net range
	VnfdevMgmtNetRange string `json:"vnfdev_mgmt_net_range"`
}

Detailed information about grid settings

type RemoveCustomBackupPathRequest added in v1.8.0

type RemoveCustomBackupPathRequest struct {
	// ID of the grid
	// Required: true
	GID uint64 `url:"gridId" json:"gridId" validate:"required"`

	// Absolute path
	// Required: true
	Path string `url:"path" json:"path" validate:"required"`
}

RemoveCustomBackupPathRequest struct to remove path from the list of custom backup paths

type RenameRequest

type RenameRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// New name
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`
}

RenameRequest struct to rename grid

type Resources

type Resources struct {
	// Current resources
	Current RecordResource `json:"Current"`

	// Reserved resources
	Reserved RecordResource `json:"Reserved"`
}

Resource information

type ServicesRestartRequest

type ServicesRestartRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`
}

ServicesRestartRequest struct to restart services

type SetCPUAllocationParameterRequest added in v1.4.0

type SetCPUAllocationParameterRequest struct {
	// Grid ID
	// Required: true
	GridID uint64 `url:"gridId" json:"gridId" validate:"required"`

	// CPU allocation parameter.
	// If "strict" VM can't be run if not enough CPU resources.
	// "loose" allow running VM if not enough resources.
	// Required: true
	StrictLoose string `url:"strict_loose" json:"strict_loose" validate:"required,strict_loose"`
}

SetCPUAllocationParameterRequest for setting CPU allocation parameter

type SetCPUAllocationRatioForVMRequest added in v1.4.0

type SetCPUAllocationRatioForVMRequest struct {
	// Grid ID
	// Required: true
	GridID uint64 `url:"gridId" json:"gridId" validate:"required"`

	// Default CPU allocation ratio for computes
	// Required: true
	Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
}

SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes

type SetCPUAllocationRatioRequest

type SetCPUAllocationRatioRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gridId" json:"gridId" validate:"required"`

	// Allocation ratio
	// Required: true
	Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
}

SetCPUAllocationRatioRequest struct to set allocation

type SetMemAllocationRatioRequest

type SetMemAllocationRatioRequest struct {
	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gridId" json:"gridId" validate:"required"`

	// Allocation ratio
	// Required: true
	Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
}

SetMemAllocationRatioRequest struct to set memory allocation

type SetPasswordPolicyRequest added in v1.8.0

type SetPasswordPolicyRequest struct {
	// ID of the grid
	// Required: true
	GID uint64 `url:"gridId" json:"gridId" validate:"required"`

	// Available numbers in the password
	// Default value : true
	// Required: true
	Digits interface{} `url:"digits" json:"digits" validate:"isBool"`

	// Available special characters in the password
	// Default value : false
	// Required: true
	SpecialSymbols bool `url:"specialSymbols" json:"specialSymbols"`

	// Number of characters in the password
	// Default value : 9
	// Required: true
	PasswordLength uint64 `url:"passwordLength" json:"passwordLength"`

	// Capital letters in the password are available
	// Default value : true
	// Required: true
	Uppercase interface{} `url:"uppercase" json:"uppercase" validate:"isBool"`
}

SetPasswordPolicyRequest struct to set password policy for a grid

type SettingsNetQOS added in v1.9.0

type SettingsNetQOS struct {
	//ERate
	ERate uint64 `json:"eRate"`

	//InBurst
	InBurst uint64 `json:"inBurst"`

	//InRate
	InRate uint64 `json:"inRate"`
}

SettingsNetQOS in grid settings

Jump to

Keyboard shortcuts

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