Documentation
¶
Overview ¶
API Actors for managing resource groups. These actors are the final API for end users to manage resource groups
Index ¶
- type AccessGrantRequest
- type AccessRevokeRequest
- type AffinityGroupComputesRequest
- type AffinityGroupsGetRequest
- type AffinityGroupsListRequest
- type AuditsRequest
- type CreateRequest
- type DeleteRequest
- type DisableRequest
- type DiskUsage
- type EnableRequest
- type GetRequest
- type GetResourceConsumptionRequest
- type ItemACL
- type ItemAffinityGroup
- type ItemAffinityGroupComputes
- type ItemAudit
- type ItemBackend
- type ItemBinding
- type ItemCompute
- type ItemFrontend
- type ItemLoadBalancer
- type ItemPortForward
- type ItemResourceConsumption
- type ItemResourceGroup
- type ItemRule
- type ItemServer
- type ItemVINS
- type ListACL
- type ListAffinityGroup
- type ListAffinityGroups
- type ListAffinityGroupsComputes
- type ListAudits
- type ListBackends
- type ListBindings
- type ListComputes
- type ListComputesRequest
- type ListDeletedRequest
- type ListFrontends
- type ListLB
- type ListLBRequest
- type ListPFWRequest
- type ListPortForwards
- type ListRequest
- type ListResourceConsumption
- type ListResourceGroups
- func (lrg ListResourceGroups) FilterByCreatedBy(createdBy string) ListResourceGroups
- func (lrg ListResourceGroups) FilterByDefNetType(defNetType string) ListResourceGroups
- func (lrg ListResourceGroups) FilterByID(id uint64) ListResourceGroups
- func (lrg ListResourceGroups) FilterByLockStatus(lockStatus string) ListResourceGroups
- func (lrg ListResourceGroups) FilterByName(name string) ListResourceGroups
- func (lrg ListResourceGroups) FilterByStatus(status string) ListResourceGroups
- func (lrg ListResourceGroups) FilterFunc(predicate func(irg ItemResourceGroup) bool) ListResourceGroups
- func (lrg ListResourceGroups) FindOne() ItemResourceGroup
- func (lrg ListResourceGroups) IDs() []uint64
- func (lrg ListResourceGroups) Serialize(params ...string) (serialization.Serialized, error)
- func (lrg ListResourceGroups) SortByCreatedTime(inverse bool) ListResourceGroups
- func (lrg ListResourceGroups) SortByDeletedTime(inverse bool) ListResourceGroups
- func (lrg ListResourceGroups) SortByUpdatedTime(inverse bool) ListResourceGroups
- type ListRules
- type ListServers
- type ListVINS
- type ListVINSRequest
- type RG
- func (r RG) AccessGrant(ctx context.Context, req AccessGrantRequest) (bool, error)
- func (r RG) AccessRevoke(ctx context.Context, req AccessRevokeRequest) (bool, error)
- func (r RG) AffinityGroupComputes(ctx context.Context, req AffinityGroupComputesRequest) (ListAffinityGroupsComputes, error)
- func (r RG) AffinityGroupsGet(ctx context.Context, req AffinityGroupsGetRequest) ([]uint64, error)
- func (r RG) AffinityGroupsList(ctx context.Context, req AffinityGroupsListRequest) (*ListAffinityGroups, error)
- func (r RG) Audits(ctx context.Context, req AuditsRequest) (ListAudits, error)
- func (r RG) Create(ctx context.Context, req CreateRequest) (uint64, error)
- func (r RG) Delete(ctx context.Context, req DeleteRequest) (bool, error)
- func (r RG) Disable(ctx context.Context, req DisableRequest) (bool, error)
- func (r RG) Enable(ctx context.Context, req EnableRequest) (bool, error)
- func (r RG) Get(ctx context.Context, req GetRequest) (*RecordResourceGroup, error)
- func (r RG) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)
- func (r RG) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*ItemResourceConsumption, error)
- func (r RG) List(ctx context.Context, req ListRequest) (*ListResourceGroups, error)
- func (r RG) ListComputes(ctx context.Context, req ListComputesRequest) (*ListComputes, error)
- func (r RG) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListResourceGroups, error)
- func (r RG) ListLB(ctx context.Context, req ListLBRequest) (*ListLB, error)
- func (r RG) ListPFW(ctx context.Context, req ListPFWRequest) (*ListPortForwards, error)
- func (r RG) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)
- func (r RG) ListResourceConsumption(ctx context.Context) (*ListResourceConsumption, error)
- func (r RG) ListVINS(ctx context.Context, req ListVINSRequest) (*ListVINS, error)
- func (r RG) Restore(ctx context.Context, req RestoreRequest) (bool, error)
- func (r RG) SetDefNet(ctx context.Context, req SetDefNetRequest) (uint64, error)
- func (r RG) Update(ctx context.Context, req UpdateRequest) (bool, error)
- func (r RG) Usage(ctx context.Context, req UsageRequest) (*RecordResourceUsage, error)
- type RecordLoadBalancer
- type RecordNode
- type RecordResourceGroup
- type RecordResourceUsage
- type RecordServerSettings
- type Resource
- type ResourceLimits
- type Resources
- type RestoreRequest
- type SetDefNetRequest
- type UpdateRequest
- type UsageRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessGrantRequest ¶
type AccessGrantRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // User or group name to grant access // Required: true User string `url:"user" json:"user" validate:"required"` // Access rights to set, one of: // - "R" // - "RCX" // - "ARCXDU" // Required: true Right string `url:"right" json:"right" validate:"accessType"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
AccessGrantRequest struct to grant access to resource group
type AccessRevokeRequest ¶
type AccessRevokeRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // User or group name to revoke access // Required: true User string `url:"user" json:"user" validate:"required"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
AccessRevokeRequest struct to revoke access
type AffinityGroupComputesRequest ¶
type AffinityGroupComputesRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Affinity group label // Required: true AffinityGroup string `url:"affinityGroup" json:"affinityGroup" validate:"required"` }
AffinityGroupComputesRequest struct to get list of all computes with their relationships
type AffinityGroupsGetRequest ¶
type AffinityGroupsGetRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Label affinity group // Required: true AffinityGroup string `url:"affinityGroup" json:"affinityGroup" validate:"required"` }
AffinityGroupsGetRequest struct to get list computes from affinity group
type AffinityGroupsListRequest ¶
type AffinityGroupsListRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Page number // Required: false Page uint64 `url:"page,omitempty" json:"page,omitempty"` // Page size // Required: false Size uint64 `url:"size,omitempty" json:"size,omitempty"` }
AffinityGroupsListRequest struct to get list of affinity groups from resource group
type AuditsRequest ¶
type AuditsRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` }
AuditsRequest struct to get audit
type CreateRequest ¶
type CreateRequest struct { // Account, which will own this resource group // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` // Grid ID // Required: true GID uint64 `url:"gid" json:"gid" validate:"required"` // Name of this resource group. Must be unique within the account // Required: true Name string `url:"name" json:"name" validate:"required,min=2"` // Max size of memory in MB // Required: false MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"` // Max size of aggregated virtual disks in GB // Required: false MaxVDiskCapacity int64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"` // Max number of CPU cores // Required: false MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"` // Max sent/received network transfer peering // Required: false MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"` // Max number of assigned public IPs // Required: false MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"` // Username - owner of this resource group. // Leave blank to set current user as owner // Required: false Owner string `url:"owner,omitempty" json:"owner,omitempty"` // Type of the default network for this resource group. // virtual machines created in this resource group will be by default connected to this network. // Allowed values are: // - PRIVATE // - PUBLIC // - NONE // Required: false DefNet string `url:"def_net,omitempty" json:"def_net,omitempty" validate:"omitempty,rgDefNet"` // Private network IP CIDR if default network PRIVATE // Required: false IPCIDR string `url:"ipcidr,omitempty" json:"ipcidr,omitempty"` // Text description of this resource group // Required: false Description string `url:"desc,omitempty" json:"desc,omitempty"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` // External network ID // Required: false ExtNetID uint64 `url:"extNetId,omitempty" json:"extNetId,omitempty"` // External IP address // Required: false ExtIP string `url:"extIp,omitempty" json:"extIp,omitempty"` // Register computes in registration system // Required: false RegisterComputes bool `url:"registerComputes,omitempty" json:"registerComputes,omitempty"` }
CreateRequest struct to create resource group
type DeleteRequest ¶
type DeleteRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Set to True if you want force delete non-empty resource group // Required: false Force bool `url:"force,omitempty" json:"force,omitempty"` // Set to True if you want to destroy resource group and all linked resources, if any, immediately. // Otherwise, they will be placed into recycle bin and could be restored later within recycle bin's purge period // Required: false Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
DeleteRequest struct to delete resource group
type DisableRequest ¶
type DisableRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
DisableRequest struct to disable resource group
type DiskUsage ¶
type DiskUsage struct { // Disk size DiskSize float64 `json:"disksize"` // Disk size max DiskSizeMax float64 `json:"disksizemax"` }
Disk usage
type EnableRequest ¶
type EnableRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
EnableRequest struct to enable resource group
type GetRequest ¶
type GetRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
GetRequest struct to get detailed information about resource group
type GetResourceConsumptionRequest ¶ added in v1.5.0
type GetResourceConsumptionRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` }
GetResourceConsumptionRequest struct to get detailed information about resource consumption for ResGroup
type ItemACL ¶
type ItemACL struct { // Explicit Explicit bool `json:"explicit"` // GUID GUID string `json:"guid"` // Right Right string `json:"right"` // Status Status string `json:"status"` // Type Type string `json:"type"` // User group ID UserGroupID string `json:"userGroupId"` }
Main information about Access Control List
type ItemAffinityGroup ¶
Main information about
type ItemAffinityGroupComputes ¶ added in v1.5.0
type ItemAffinityGroupComputes struct { // Compute ID ComputeID uint64 `json:"computeId"` // Other node OtherNode []uint64 `json:"otherNode"` // Other node indirect OtherNodeIndirect []uint64 `json:"otherNodeIndirect"` // Other node indirect soft OtherNodeIndirectSoft []uint64 `json:"otherNodeIndirectSoft"` // Other node soft OtherNodeSoft []uint64 `json:"otherNodeSoft"` // Same node SameNode []uint64 `json:"sameNode"` // Same node soft SameNodeSoft []uint64 `json:"sameNodeSoft"` }
Main information about affinity group
type ItemAudit ¶
type ItemAudit struct { // Call Call string `json:"call"` // Response time ResponseTime float64 `json:"responsetime"` // Status code StatusCode uint64 `json:"statuscode"` // Timestamp Timestamp float64 `json:"timestamp"` // User User string `json:"user"` }
Main information about audit
type ItemBackend ¶
type ItemBackend struct { // Algorithm Algorithm string `json:"algorithm"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` // Server settings ServerDefaultSettings RecordServerSettings `json:"serverDefaultSettings"` // List of servers Servers ListServers `json:"servers"` }
Main information about backend
type ItemBinding ¶
type ItemBinding struct { // Address Address string `json:"address"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` // Port Port uint64 `json:"port"` }
Main information of binding
type ItemCompute ¶
type ItemCompute struct { // Account ID AccountID uint64 `json:"accountId"` // Account name AccountName string `json:"accountName"` // Affinity label AffinityLabel string `json:"affinityLabel"` // List of affinity rules AffinityRules ListRules `json:"affinityRules"` // Affinity weight AffinityWeight uint64 `json:"affinityWeight"` // List of anti affinity rules AntiAffinityRules ListRules `json:"antiAffinityRules"` // Number of CPU CPUs uint64 `json:"cpus"` // Created by CreatedBy string `json:"createdBy"` // Created time CreatedTime uint64 `json:"createdTime"` // Deleted by DeletedBy string `json:"deletedBy"` // Deleted time DeletedTime uint64 `json:"deletedTime"` // ID ID uint64 `json:"id"` // Name Name string `json:"name"` // Number of RAM RAM uint64 `json:"ram"` // Registered Registered bool `json:"registered"` // Resource group ID RGID uint64 `json:"rgId"` // Resource group name RGName string `json:"rgName"` // Status Status string `json:"status"` // Tech status TechStatus string `json:"techStatus"` // Total disks size TotalDisksSize uint64 `json:"totalDisksSize"` // Updated by UpdatedBy string `json:"updatedBy"` // Updated time UpdatedTime uint64 `json:"updatedTime"` // User managed UserManaged bool `json:"userManaged"` // Number of ViNS connected VINSConnected uint64 `json:"vinsConnected"` }
Main information about compute
type ItemFrontend ¶
type ItemFrontend struct { // Backend Backend string `json:"backend"` // List of bindings Bindings ListBindings `json:"bindings"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` }
Main information about frontend
type ItemLoadBalancer ¶
type ItemLoadBalancer struct { // DPAPI password DPAPIPassword string `json:"dpApiPassword"` // Main information about load balancer RecordLoadBalancer }
Detailed information about load balancer
type ItemPortForward ¶
type ItemPortForward struct { // Public port end PublicPortEnd uint64 `json:"Public Port End"` // Public port start PublicPortStart uint64 `json:"Public Port Start"` // Virtual machine ID VMID uint64 `json:"VM ID"` // Virtual machine IP VMIP string `json:"VM IP"` // Virtual machine name VMName string `json:"VM Name"` // Virtual machine port VMPort uint64 `json:"VM Port"` // VINS ID VINSID uint64 `json:"ViNS ID"` // VINS name VINSName string `json:"ViNS Name"` }
Main information about port forward
type ItemResourceConsumption ¶ added in v1.5.0
type ItemResourceConsumption struct { // Consumed information about resources Consumed Resource `json:"consumed"` // Reserved information about resources Reserved Resource `json:"reserved"` // Resource limits ResourceLimits ResourceLimits `json:"resourceLimits"` // Resource group ID RGID uint64 `json:"rgid"` }
Detailed information about resource consumption
type ItemResourceGroup ¶
type ItemResourceGroup struct { // AccountACL ItemACL `json:"accountAcl"` // Account ID AccountID uint64 `json:"accountId"` // Account name AccountName string `json:"accountName"` // Access Control List ACL ListACL `json:"acl"` // Compute Features ComputeFeatures []string `json:"computeFeatures"` // CPU allocation parameter CPUAllocationParameter string `json:"cpu_allocation_parameter"` // CPU allocation ratio CPUAllocationRatio float64 `json:"cpu_allocation_ratio"` // Created by CreatedBy string `json:"createdBy"` // Created time CreatedTime uint64 `json:"createdTime"` // DefNetID DefNetID int64 `json:"def_net_id"` // DefNetType DefNetType string `json:"def_net_type"` // Deleted by DeletedBy string `json:"deletedBy"` // Deleted time DeletedTime uint64 `json:"deletedTime"` // Description Description string `json:"desc"` // Dirty Dirty bool `json:"dirty"` // Grid ID GID uint64 `json:"gid"` // GUID GUID uint64 `json:"guid"` // ID ID uint64 `json:"id"` // Lock status LockStatus string `json:"lockStatus"` // Milestones Milestones uint64 `json:"milestones"` // Name Name string `json:"name"` // RegisterComputes RegisterComputes bool `json:"registerComputes"` // Resource limits ResourceLimits ResourceLimits `json:"resourceLimits"` // List of resource types ResTypes []string `json:"resourceTypes"` // Secret Secret string `json:"secret"` // Status Status string `json:"status"` // UniqPools UniqPools []string `json:"uniqPools"` // Updated by UpdatedBy string `json:"updatedBy"` // Updated time UpdatedTime uint64 `json:"updatedTime"` // List of VINS IDs VINS []uint64 `json:"vins"` // List of compute IDs Computes []uint64 `json:"vms"` }
Main information about resource group
func (ItemResourceGroup) Serialize ¶
func (irg ItemResourceGroup) 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 ItemRule ¶
type ItemRule struct { // GUID GUID string `json:"guid"` // Key Key string `json:"key"` // Mode Mode string `json:"mode"` // Policy Policy string `json:"policy"` // Topology Topology string `json:"topology"` // Value Value string `json:"value"` }
Main information about affinity rules
type ItemServer ¶
type ItemServer struct { // Address Address string `json:"address"` // Check Check string `json:"check"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` // Port Port uint64 `json:"port"` // Server settings ServerSettings RecordServerSettings `json:"serverSettings"` }
Main information about server
type ItemVINS ¶
type ItemVINS struct { // Account ID AccountID uint64 `json:"accountId"` // Account name AccountName string `json:"accountName"` // Computes Computes uint64 `json:"computes"` // Created by CreatedBy string `json:"createdBy"` // Created time CreatedTime uint64 `json:"createdTime"` // Deleted by DeletedBy string `json:"deletedBy"` // Deleted time DeletedTime uint64 `json:"deletedTime"` // External IP ExternalIP string `json:"externalIP"` // Extnet ID ExtnetId uint64 `json:"extnetId"` // Free IPs FreeIPs uint64 `json:"freeIPs"` // ID ID uint64 `json:"id"` // Name Name string `json:"name"` // Network Network string `json:"network"` // PriVNFDev ID PriVNFDevID uint64 `json:"priVnfDevId"` // Resource group ID RGID uint64 `json:"rgId"` // Resource group name RGName string `json:"rgName"` // Status Status string `json:"status"` // Updated by UpdatedBy string `json:"updatedBy"` // Updated time UpdatedTime uint64 `json:"updatedTime"` }
Main information about VINS
type ListAffinityGroup ¶ added in v1.6.9
type ListAffinityGroup []ItemAffinityGroup
List of affinity group
func (ListAffinityGroup) IDs ¶ added in v1.6.9
func (lag ListAffinityGroup) IDs() []uint64
IDs gets array of ResourceGroupIDs from ListAffinityGroup struct
type ListAffinityGroups ¶
type ListAffinityGroups struct { // Data Data []map[string]ListAffinityGroup `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List of affinity groups
type ListAffinityGroupsComputes ¶ added in v1.5.0
type ListAffinityGroupsComputes []ItemAffinityGroupComputes
List of affinity groups
func (ListAffinityGroupsComputes) IDs ¶ added in v1.6.8
func (lag ListAffinityGroupsComputes) IDs() []uint64
IDs gets array of ComputeIDs from ListAffinityGroupsComputes struct
type ListComputes ¶
type ListComputes struct { //Data Data []ItemCompute `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List of computes
func (ListComputes) IDs ¶ added in v1.6.8
func (lc ListComputes) IDs() []uint64
IDs gets array of ComputeIDs from ListComputes struct
type ListComputesRequest ¶
type ListComputesRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Find by compute id // Required: false ComputeID uint64 `url:"computeId,omitempty" json:"computeId,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // ID an account // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` // Find by tech status // Required: false TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"` // Find by status // Required: false Status string `url:"status,omitempty" json:"status,omitempty"` // Find by ip address // Required: false IPAddress string `url:"ipAddress,omitempty" json:"ipAddress,omitempty"` // Find by external network name // Required: false ExtNetName string `url:"extNetName,omitempty" json:"extNetName,omitempty"` // Find by external network id // Required: false ExtNetID uint64 `url:"extNetId,omitempty" json:"extNetId,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"` }
ListComputesRequest struct to get list of computes
type ListDeletedRequest ¶
type ListDeletedRequest struct { // Find by ID // Required: false ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // Find by account ID // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` // Find by name account // Required: false AccountName string `url:"accountName,omitempty" json:"accountName,omitempty"` // Find by created after time (unix timestamp) // Required: false CreatedAfter uint64 `url:"createdAfter,omitempty" json:"createdAfter,omitempty"` // Find by created before time (unix timestamp) // Required: false CreatedBefore uint64 `url:"createdBefore,omitempty" json:"createdBefore,omitempty"` // Find by status lock // Required: false LockStatus string `url:"lockStatus,omitempty" json:"lockStatus,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"` }
ListDeletedRequest struct to get list deleted resource groups
type ListLB ¶
type ListLB struct { // Data Data []ItemLoadBalancer `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List of load balancers
type ListLBRequest ¶
type ListLBRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Find by ID // Required: false ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // Find by account ID // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` // Find by tech status // Required: false TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"` // Find by status // Required: false Status string `url:"status,omitempty" json:"status,omitempty"` // Find by frontend Ip // Required: false FrontIP string `url:"frontIp,omitempty" json:"frontIp,omitempty"` // Find by backend Ip // Required: false BackIP string `url:"backIp,omitempty" json:"backIp,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"` }
ListLBRequest struct to get list of load balancers
type ListPFWRequest ¶
type ListPFWRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` }
ListPFWRequest struct to get list of port forward rules
type ListPortForwards ¶
type ListPortForwards struct { //Data Data []ItemPortForward `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List of port forwards
type ListRequest ¶
type ListRequest struct { // Find by ID // Required: false ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // Find by account ID // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` // Find by name account // Required: false AccountName string `url:"accountName,omitempty" json:"accountName,omitempty"` // Find by created after time (unix timestamp) // Required: false CreatedAfter uint64 `url:"createdAfter,omitempty" json:"createdAfter,omitempty"` // Find by created before time (unix timestamp) // Required: false CreatedBefore uint64 `url:"createdBefore,omitempty" json:"createdBefore,omitempty"` // Find by status // Required: false Status string `url:"status,omitempty" json:"status,omitempty"` // Find by status lock // Required: false LockStatus string `url:"lockStatus,omitempty" json:"lockStatus,omitempty"` // Included deleted resource groups // Required: false IncludeDeleted bool `url:"includedeleted,omitempty" json:"includedeleted,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 resource groups
type ListResourceConsumption ¶ added in v1.5.0
type ListResourceConsumption struct { Data []ItemResourceConsumption `json:"data"` EntryCount uint64 `json:"entryCount"` }
func (ListResourceConsumption) IDs ¶ added in v1.6.8
func (lrc ListResourceConsumption) IDs() []uint64
IDs gets array of ResourceGroupIDs from ListResourceConsumption struct
type ListResourceGroups ¶
type ListResourceGroups struct { Data []ItemResourceGroup `json:"data"` EntryCount uint64 `json:"entryCount"` }
List of resource groups
func (ListResourceGroups) FilterByCreatedBy ¶
func (lrg ListResourceGroups) FilterByCreatedBy(createdBy string) ListResourceGroups
FilterByCreatedBy return ListResourceGroups created by specified user.
func (ListResourceGroups) FilterByDefNetType ¶
func (lrg ListResourceGroups) FilterByDefNetType(defNetType string) ListResourceGroups
FilterByDefNetType returns ListResourceGroups with specified DefNetType.
func (ListResourceGroups) FilterByID ¶
func (lrg ListResourceGroups) FilterByID(id uint64) ListResourceGroups
FilterByID returns ListResourceGroups with specified ID.
func (ListResourceGroups) FilterByLockStatus ¶
func (lrg ListResourceGroups) FilterByLockStatus(lockStatus string) ListResourceGroups
FilterByLockStatus return ListResourceGroups with specified LockStatus.
func (ListResourceGroups) FilterByName ¶
func (lrg ListResourceGroups) FilterByName(name string) ListResourceGroups
FilterByName returns ListResourceGroups with specified Name.
func (ListResourceGroups) FilterByStatus ¶
func (lrg ListResourceGroups) FilterByStatus(status string) ListResourceGroups
FilterByStatus returns ListResourceGroups with specified Status.
func (ListResourceGroups) FilterFunc ¶
func (lrg ListResourceGroups) FilterFunc(predicate func(irg ItemResourceGroup) bool) ListResourceGroups
FilterFunc allows filtering ListResourceGroups based on a user-specified predicate.
func (ListResourceGroups) FindOne ¶
func (lrg ListResourceGroups) FindOne() ItemResourceGroup
FindOne returns first found ItemResourceGroup. If none was found, returns an empty struct.
func (ListResourceGroups) IDs ¶ added in v1.6.8
func (lrg ListResourceGroups) IDs() []uint64
IDs gets array of ResourceGroupIDs from ListResourceGroups struct
func (ListResourceGroups) Serialize ¶
func (lrg ListResourceGroups) 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
func (ListResourceGroups) SortByCreatedTime ¶
func (lrg ListResourceGroups) SortByCreatedTime(inverse bool) ListResourceGroups
SortByCreatedTime sorts ListResourceGroups by the CreatedTime field in ascending order.
If inverse param is set to true, the order is reversed.
func (ListResourceGroups) SortByDeletedTime ¶
func (lrg ListResourceGroups) SortByDeletedTime(inverse bool) ListResourceGroups
SortByDeletedTime sorts ListResourceGroups by the DeletedTime field in ascending order.
If inverse param is set to true, the order is reversed.
func (ListResourceGroups) SortByUpdatedTime ¶
func (lrg ListResourceGroups) SortByUpdatedTime(inverse bool) ListResourceGroups
SortByUpdatedTime sorts ListResourceGroups by the UpdatedTime field in ascending order.
If inverse param is set to true, the order is reversed.
type ListVINS ¶
type ListVINS struct { // Data Data []ItemVINS `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List of VINSes
type ListVINSRequest ¶
type ListVINSRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // ID an account // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` // Find by ip extnet address // Required: false ExtIP string `url:"extIp,omitempty" json:"extIp,omitempty"` // Find by vins id // Required: false VINSID uint64 `url:"vinsId,omitempty" json:"vinsId,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"` }
ListVINSRequest struct to get list of VINSes
type RG ¶
type RG struct {
// contains filtered or unexported fields
}
Structure for creating request to resource group
func (RG) AccessGrant ¶
AccessGrant grants user or group access to the resource group as specified
func (RG) AccessRevoke ¶
AccessRevoke revokes specified user or group access from the resource group
func (RG) AffinityGroupComputes ¶
func (r RG) AffinityGroupComputes(ctx context.Context, req AffinityGroupComputesRequest) (ListAffinityGroupsComputes, error)
AffinityGroupComputes gets list of all computes with their relationships to another computes
func (RG) AffinityGroupsGet ¶
AffinityGroupsGet gets list computes in the specified affinity group
func (RG) AffinityGroupsList ¶
func (r RG) AffinityGroupsList(ctx context.Context, req AffinityGroupsListRequest) (*ListAffinityGroups, error)
AffinityGroupsList gets all currently defined affinity groups in this resource group with compute IDs
func (RG) Audits ¶
func (r RG) Audits(ctx context.Context, req AuditsRequest) (ListAudits, error)
Audits gets audit records for the specified resource group object
func (RG) Get ¶
func (r RG) Get(ctx context.Context, req GetRequest) (*RecordResourceGroup, error)
Get gets current configuration of the resource group as a RecordResourceGroup struct
func (RG) GetRaw ¶ added in v1.6.6
GetRaw gets current configuration of the resource group as an array of bytes
func (RG) GetResourceConsumption ¶ added in v1.5.0
func (r RG) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*ItemResourceConsumption, error)
GetResourceConsumption gets resource consumption of the resource group
func (RG) List ¶
func (r RG) List(ctx context.Context, req ListRequest) (*ListResourceGroups, error)
List gets list of all resource groups the user has access to as a ListResourceGroups struct
func (RG) ListComputes ¶
func (r RG) ListComputes(ctx context.Context, req ListComputesRequest) (*ListComputes, error)
ListComputes gets list of all compute instances under specified resource group, accessible by the user
func (RG) ListDeleted ¶
func (r RG) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListResourceGroups, error)
ListDeleted gets list all deleted resource groups the user has access to
func (RG) ListLB ¶
ListLB gets list all load balancers in the specified resource group, accessible by the user
func (RG) ListPFW ¶
func (r RG) ListPFW(ctx context.Context, req ListPFWRequest) (*ListPortForwards, error)
ListPFW gets list port forward rules for the specified resource group
func (RG) ListRaw ¶ added in v1.6.6
ListRaw gets list of all resource groups the user has access to as an array of bytes
func (RG) ListResourceConsumption ¶ added in v1.5.0
func (r RG) ListResourceConsumption(ctx context.Context) (*ListResourceConsumption, error)
ListResourceConsumption gets resource consumptions of the resource groups
func (RG) ListVINS ¶
ListVINS gets list all ViNSes under specified resource group, accessible by the user
func (RG) Usage ¶
func (r RG) Usage(ctx context.Context, req UsageRequest) (*RecordResourceUsage, error)
Usage gets report resource usage on the resource group
type RecordLoadBalancer ¶
type RecordLoadBalancer struct { // HAMode HAMode bool `json:"HAmode"` // Access Control List ACL interface{} `json:"acl"` // BackendHAIP BackendHAIP string `json:"backendHAIP"` // List of Backends Backends ListBackends `json:"backends"` // Created by CreatedBy string `json:"createdBy"` // Created time CreatedTime uint64 `json:"createdTime"` // Deleted by DeletedBy string `json:"deletedBy"` // Deleted time DeletedTime uint64 `json:"deletedTime"` // Description Description string `json:"desc"` // DPAPIUser DPAPIUser string `json:"dpApiUser"` // External network ID ExtNetID uint64 `json:"extnetId"` // FrontendHAIP FrontendHAIP string `json:"frontendHAIP"` // List of frontends Frontends ListFrontends `json:"frontends"` // Grid ID GID uint64 `json:"gid"` // GUID GUID uint64 `json:"guid"` // ID ID uint64 `json:"id"` // Image ID ImageID uint64 `json:"imageId"` // Milestones Milestones uint64 `json:"milestones"` // Name Name string `json:"name"` // Primary node PrimaryNode RecordNode `json:"primaryNode"` // Resource group ID RGID uint64 `json:"rgId"` // Resource group name RGName string `json:"rgName"` // Secondary node SecondaryNode RecordNode `json:"secondaryNode"` // Status Status string `json:"status"` // Tech status TechStatus string `json:"techStatus"` // Updated by UpdatedBy string `json:"updatedBy"` // Updated time UpdatedTime uint64 `json:"updatedTime"` // VINS ID VINSID uint64 `json:"vinsId"` }
Main information about load balancer
type RecordNode ¶
type RecordNode struct { // Backend IP BackendIP string `json:"backendIp"` // Compute ID ComputeID uint64 `json:"computeId"` // Frontend IP FrontendIP string `json:"frontendIp"` // GUID GUID string `json:"guid"` // MGMT IP MGMTIP string `json:"mgmtIp"` // Network ID NetworkID uint64 `json:"networkId"` }
Main information about node
type RecordResourceGroup ¶
type RecordResourceGroup struct { // Account ID AccountID uint64 `json:"accountId"` // Account name AccountName string `json:"accountName"` // Access Control List ACL ListACL `json:"acl"` // Compute Features ComputeFeatures []string `json:"computeFeatures"` // CPU allocation parameter CPUAllocationParameter string `json:"cpu_allocation_parameter"` // CPU allocation ratio CPUAllocationRatio float64 `json:"cpu_allocation_ratio"` // Created by CreatedBy string `json:"createdBy"` // Created time CreatedTime uint64 `json:"createdTime"` // DefNetID DefNetID int64 `json:"def_net_id"` // DefNetType DefNetType string `json:"def_net_type"` // Deleted by DeletedBy string `json:"deletedBy"` // Deleted time DeletedTime uint64 `json:"deletedTime"` // Description Description string `json:"desc"` // Dirty Dirty bool `json:"dirty"` // Grid ID GID uint64 `json:"gid"` // GUID GUID uint64 `json:"guid"` // ID ID uint64 `json:"id"` // Lock status LockStatus string `json:"lockStatus"` // Milestones Milestones uint64 `json:"milestones"` // Name Name string `json:"name"` // RegisterComputes RegisterComputes bool `json:"registerComputes"` // Resource limits ResourceLimits ResourceLimits `json:"resourceLimits"` // List of resource types ResTypes []string `json:"resourceTypes"` // Secret Secret string `json:"secret"` // Status Status string `json:"status"` // UniqPools UniqPools []string `json:"uniqPools"` // Updated by UpdatedBy string `json:"updatedBy"` // Updated time UpdatedTime uint64 `json:"updatedTime"` // List of VINS IDs VINS []uint64 `json:"vins"` // List of compute IDs Computes []uint64 `json:"vms"` }
Detailed information about resource group
type RecordResourceUsage ¶
type RecordResourceUsage struct { // Number of CPU CPU uint64 `json:"cpu"` // Disk size DiskSize float64 `json:"disksize"` // Max disk size DiskSizeMax uint64 `json:"disksizemax"` // Number of external IPs ExtIPs uint64 `json:"extips"` // ExtraTraffic ExtraTraffic 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"` }
Main information about usage of resource
type RecordServerSettings ¶
type RecordServerSettings struct { // Inter Inter uint64 `json:"inter"` // GUID GUID string `json:"guid"` // Down inter DownInter uint64 `json:"downinter"` // Rise Rise uint64 `json:"rise"` // Fall Fall uint64 `json:"fall"` // Slow start SlowStart uint64 `json:"slowstart"` // Max connections MaxConn uint64 `json:"maxconn"` // Max queue MaxQueue uint64 `json:"maxqueue"` // Weight Weight uint64 `json:"weight"` }
Server settings
type Resource ¶
type Resource struct { // Number of cores CPU int64 `json:"cpu"` // Disk size DiskSize float64 `json:"disksize"` // Max disk size DiskSizeMax float64 `json:"disksizemax"` // Number of External IPs ExtIPs int64 `json:"extips"` // External traffic ExtTraffic int64 `json:"exttraffic"` // Number of grafic cores GPU int64 `json:"gpu"` // Number of RAM RAM int64 `json:"ram"` // SEPs SEPs map[string]map[string]DiskUsage `json:"seps"` }
Resources used
type ResourceLimits ¶
type ResourceLimits struct { // CUC CUC float64 `json:"CU_C"` // CUD CUD float64 `json:"CU_D"` // CUDM CUDM float64 `json:"CU_DM"` // CUI CUI float64 `json:"CU_I"` // CUM CUM float64 `json:"CU_M"` // CUNP CUNP float64 `json:"CU_NP"` // GPU units GPUUnits float64 `json:"gpu_units"` }
Resource limits
type Resources ¶
type Resources struct { // Current information about resources Current Resource `json:"Current"` // Reserved information about resources Reserved Resource `json:"Reserved"` }
Information about resources
type RestoreRequest ¶
type RestoreRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
RestoreRequest struct to restore resource group
type SetDefNetRequest ¶
type SetDefNetRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Network type // Should be one of: // - "PUBLIC" // - "PRIVATE" // Required: true NetType string `url:"netType" json:"netType" validate:"rgNetType"` // Network ID // Required: false NetID uint64 `url:"netId,omitempty" json:"netId,omitempty"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
SetDefNetRequest struct to set default network
type UpdateRequest ¶
type UpdateRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // New name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // New description // Required: false Description string `url:"desc,omitempty" json:"desc,omitempty"` // Max size of memory in MB // Required: false MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"` // Max size of aggregated virtual disks in GB // Required: false MaxVDiskCapacity int64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"` // Max number of CPU cores // Required: false MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"` // Max sent/received network transfer peering // Required: false MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"` // Max number of assigned public IPs // Required: false MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"` // Register computes in registration system // Required: false RegisterComputes bool `url:"registerComputes,omitempty" json:"registerComputes,omitempty"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
UpdateRequest struct to update resource group
type UsageRequest ¶
type UsageRequest struct { // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Reason for action // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` }
UsageRequest struct to get report of resource usage
Source Files
¶
- access_grant.go
- access_revoke.go
- affinity_group_computes.go
- affinity_groups_get.go
- affinity_groups_list.go
- audits.go
- create.go
- delete.go
- disable.go
- enable.go
- filter.go
- get.go
- get_resource_consumption.go
- ids.go
- list.go
- list_computes.go
- list_deleted.go
- list_lb.go
- list_pfw.go
- list_resource_consumption.go
- list_vins.go
- models.go
- restore.go
- rg.go
- serialize.go
- set_def_net.go
- sorting.go
- update.go
- usage.go