Documentation
¶
Overview ¶
Operator actions for handling interventions on a grid
Index ¶
- type AddCustomBackupPathRequest
- type AddRequest
- type ChangeSettingsRequest
- type DiskUsage
- type DockerRegistry
- type Emails
- type ExecuteMaintenanceScriptRequest
- type GetBackupRequest
- type GetDiagnosisRequest
- type GetRequest
- type GetResourceConsumptionRequest
- type GetSettingsRequest
- type Grid
- func (g Grid) Add(ctx context.Context, req AddRequest) (bool, error)
- func (g Grid) AddCustomBackupPath(ctx context.Context, req AddCustomBackupPathRequest) (bool, error)
- func (g Grid) ChangeSettings(ctx context.Context, req ChangeSettingsRequest) (bool, error)
- func (g Grid) ExecuteMaintenanceScript(ctx context.Context, req ExecuteMaintenanceScriptRequest) (bool, error)
- func (g Grid) Get(ctx context.Context, req GetRequest) (*RecordGrid, error)
- func (g Grid) GetBackup(ctx context.Context, req GetBackupRequest) (string, error)
- func (g Grid) GetBackupGET(ctx context.Context, req GetBackupRequest) (string, error)
- func (g Grid) GetDiagnosis(ctx context.Context, req GetDiagnosisRequest) (string, error)
- func (g Grid) GetDiagnosisGET(ctx context.Context, req GetDiagnosisRequest) (string, error)
- func (g Grid) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)
- func (g Grid) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*RecordResourcesConsumption, error)
- func (g Grid) GetSettings(ctx context.Context, req GetSettingsRequest) (*RecordSettingsGrid, error)
- func (g Grid) GetSettingsRaw(ctx context.Context, req GetSettingsRequest) ([]byte, error)
- func (g Grid) List(ctx context.Context, req ListRequest) (*ListGrids, error)
- func (g Grid) ListEmails(ctx context.Context, req ListEmailsRequest) (*ListEmails, error)
- func (g Grid) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)
- func (g Grid) ListResourceConsumption(ctx context.Context) (*ListResourceConsumption, error)
- func (g Grid) PurgeLogs(ctx context.Context, req PurgeLogsRequest) (bool, error)
- func (g Grid) RemoveCustomBackupPath(ctx context.Context, req RemoveCustomBackupPathRequest) (bool, error)
- func (g Grid) Rename(ctx context.Context, req RenameRequest) (bool, error)
- func (g Grid) ServicesRestart(ctx context.Context, req ServicesRestartRequest) (bool, error)
- func (g Grid) SetCPUAllocationParameter(ctx context.Context, req SetCPUAllocationParameterRequest) (bool, error)
- func (g Grid) SetCPUAllocationRatio(ctx context.Context, req SetCPUAllocationRatioRequest) (bool, error)
- func (g Grid) SetCPUAllocationRatioForVM(ctx context.Context, req SetCPUAllocationRatioForVMRequest) (bool, error)
- func (g Grid) SetMemAllocationRatio(ctx context.Context, req SetMemAllocationRatioRequest) (bool, error)
- func (g Grid) SetPasswordPolicy(ctx context.Context, req SetPasswordPolicyRequest) (bool, error)
- func (g Grid) Status(ctx context.Context) (bool, error)
- func (g Grid) StatusGET(ctx context.Context) (bool, error)
- type HealthcheckNotifications
- type ItemGridList
- type ListEmails
- type ListEmailsRequest
- type ListGrids
- func (lg ListGrids) FilterByGID(gid uint64) ListGrids
- func (lg ListGrids) FilterByID(id uint64) ListGrids
- func (lg ListGrids) FilterByLocationCode(locationCode string) ListGrids
- func (lg ListGrids) FilterByName(name string) ListGrids
- func (lg ListGrids) FilterFunc(predicate func(ItemGridList) bool) ListGrids
- func (lg ListGrids) FindOne() ItemGridList
- func (lg ListGrids) IDs() []uint64
- func (lg ListGrids) Serialize(params ...string) (serialization.Serialized, error)
- type ListRequest
- type ListResourceConsumption
- type NetQOS
- type Prometheus
- type PurgeLogsRequest
- type RecordGrid
- type RecordResource
- type RecordResourcesConsumption
- type RecordSettingsGrid
- type RemoveCustomBackupPathRequest
- type RenameRequest
- type Resources
- type ServicesRestartRequest
- type SetCPUAllocationParameterRequest
- type SetCPUAllocationRatioForVMRequest
- type SetCPUAllocationRatioRequest
- type SetMemAllocationRatioRequest
- type SetPasswordPolicyRequest
- type SettingsNetQOS
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 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 (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 ¶
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) GetBackupGET ¶
GetBackupGET gets platform backup
func (Grid) GetDiagnosis ¶
GetDiagnosis gets platform snapshot with additional diagnosis info like a logs, etc
func (Grid) GetDiagnosisGET ¶
GetDiagnosisGET gets platform snapshot with additional diagnosis info like a logs, etc
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
GetSettingsRaw gets settings grid by ID as an array of bytes
func (Grid) ListEmails ¶
func (g Grid) ListEmails(ctx context.Context, req ListEmailsRequest) (*ListEmails, error)
ListEmails returns list of email addresses of users
func (Grid) ListResourceConsumption ¶ added in v1.5.0
func (g Grid) ListResourceConsumption(ctx context.Context) (*ListResourceConsumption, error)
func (Grid) PurgeLogs ¶
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) ServicesRestart ¶
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
RemoveCustomBackupPath set set password policy for a grid
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
FilterByGID returns ListGrids with specified GID.
func (ListGrids) FilterByID ¶
FilterByID returns ListGrids with specified ID.
func (ListGrids) FilterByLocationCode ¶
FilterByLocationCode returns ListGrids with specified LocationCode.
func (ListGrids) FilterByName ¶
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) 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
Source Files
¶
- add.go
- add_custom_backup_path.go
- change_settings.go
- execute_maintenance_script.go
- filter.go
- get.go
- get_backup.go
- get_diagnosis.go
- get_resource_consumption.go
- get_settings.go
- grid.go
- ids.go
- list.go
- list_emails.go
- list_resource_consumption.go
- models.go
- purge_logs.go
- remove_custom_backup_path.go
- rename.go
- serialize.go
- services_restart.go
- set_cpu_allocation_parameter.go
- set_cpu_allocation_ratio.go
- set_cpu_allocation_ratio_for_vm.go
- set_mem_allocation_ratio.go
- set_password_policy.go
- status.go