Files
decort-golang-sdk/pkg/cloudapi/account/models.go

734 lines
13 KiB
Go
Raw Normal View History

2022-10-03 16:56:47 +03:00
package account
2025-08-01 15:36:29 +03:00
// Access Control List
type ListRecordACL struct {
// Whether access is explicitly specified
IsExplicit bool `json:"explicit"`
// GUID
GUID string `json:"guid"`
// Access rights
Rights string `json:"right"`
// Status
Status string `json:"status"`
// Account Type
Type string `json:"type"`
// Account owner ID
UgroupID string `json:"userGroupId"`
// Is it possible to remove
CanBeDeleted bool `json:"canBeDeleted"`
}
2022-12-22 17:56:47 +03:00
// Access Control List
type RecordACL struct {
2025-08-01 15:36:29 +03:00
// Emails
Emails []string `json:"emails"`
2022-12-22 17:56:47 +03:00
// Whether access is explicitly specified
IsExplicit bool `json:"explicit"`
// GUID
GUID string `json:"guid"`
// Access rights
Rights string `json:"right"`
// Status
Status string `json:"status"`
// Account Type
Type string `json:"type"`
// Account owner ID
UgroupID string `json:"userGroupId"`
// Is it possible to remove
CanBeDeleted bool `json:"canBeDeleted"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Resource limits
2022-10-03 16:56:47 +03:00
type ResourceLimits struct {
2022-12-22 17:56:47 +03:00
// Number of cores
CUC float64 `json:"CU_C"`
// Disk size, GB
CUD float64 `json:"CU_D"`
2023-06-30 11:21:47 +03:00
// Max disk size, GB
2023-07-21 15:14:10 +03:00
CUDM float64 `json:"CU_DM"`
2023-06-30 11:21:47 +03:00
2022-12-22 17:56:47 +03:00
// Number of public IP addresses
CUI float64 `json:"CU_I"`
// RAM size, MB
CUM float64 `json:"CU_M"`
// Number of graphics cores
2022-10-03 16:56:47 +03:00
GPUUnits float64 `json:"gpu_units"`
2025-08-29 12:51:25 +03:00
// Storage policy
StoragePolicy []StoragePolicyItem `json:"storage_policy"`
}
type StoragePolicyItem struct {
ID uint64 `json:"id"`
Limit int `json:"limit"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Main information in one of if the list of accounts
type ItemAccount struct {
// Access Control List
2025-08-01 15:36:29 +03:00
ACL []ListRecordACL `json:"acl"`
2022-12-22 17:56:47 +03:00
2024-04-16 14:26:06 +03:00
// Compute Features
ComputeFeatures []string `json:"computeFeatures"`
2022-12-22 17:56:47 +03:00
// Created time
CreatedTime uint64 `json:"createdTime"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
2022-10-03 16:56:47 +03:00
2025-04-09 11:21:07 +03:00
// Description
Description string `json:"desc"`
2022-12-22 17:56:47 +03:00
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
// Status
Status string `json:"status"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
2025-08-29 12:51:25 +03:00
// Zones
ZoneIDs []uint64 `json:"zoneIds"`
2022-12-22 17:56:47 +03:00
}
// List of accounts
2023-06-30 11:21:47 +03:00
type ListAccounts struct {
Data []ItemAccount `json:"data"`
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
2025-09-11 15:56:44 +03:00
// Policy
type Policy struct {
// Size of the disk
DiskSize float64 `json:"disksize"`
// Max size of the disk
DiskSizeMax float64 `json:"disksizemax"`
// SEPs used
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
2022-12-22 17:56:47 +03:00
// Resources used
2022-10-03 16:56:47 +03:00
type Resource struct {
2022-12-22 17:56:47 +03:00
// Number of cores
CPU int64 `json:"cpu"`
// Disk size
2023-03-01 11:44:08 +03:00
DiskSize float64 `json:"disksize"`
2022-12-22 17:56:47 +03:00
2023-01-23 15:39:41 +03:00
// Max disk size
2023-10-03 16:44:32 +03:00
DiskSizeMax float64 `json:"disksizemax"`
2023-01-23 15:39:41 +03:00
2022-12-22 17:56:47 +03:00
// Number of External IPs
ExtIPs int64 `json:"extips"`
// Number of grafic cores
GPU int64 `json:"gpu"`
2025-09-11 15:56:44 +03:00
// Policies
Policies map[string]Policy `json:"policies"`
2022-12-22 17:56:47 +03:00
// Number of RAM
RAM int64 `json:"ram"`
2023-01-23 15:39:41 +03:00
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
// Disk usage
type DiskUsage struct {
// Disk size
DiskSize float64 `json:"disksize"`
// Disk size max
2023-07-07 12:40:03 +03:00
DiskSizeMax float64 `json:"disksizemax"`
2022-10-03 16:56:47 +03:00
}
2023-07-21 15:14:10 +03:00
// Information about resource consumption
type RecordResourceConsumption struct {
ItemResourceConsumption
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
}
2022-12-22 17:56:47 +03:00
// Information about resources
2023-06-30 11:21:47 +03:00
type ItemResourceConsumption struct {
2022-12-22 17:56:47 +03:00
// Current information about resources
2023-10-03 16:44:32 +03:00
Consumed Resource `json:"consumed"`
2022-12-22 17:56:47 +03:00
// Reserved information about resources
2023-10-03 16:44:32 +03:00
Reserved Resource `json:"reserved"`
2023-06-30 11:21:47 +03:00
// Account ID
AccountID uint64 `json:"id"`
}
type ListResourceConsumption struct {
Data []ItemResourceConsumption `json:"data"`
EntryCount uint64 `json:"entryCount"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Information about computes
2022-10-03 16:56:47 +03:00
type Computes struct {
2022-12-22 17:56:47 +03:00
// Number of started computes
2022-10-03 16:56:47 +03:00
Started uint64 `json:"started"`
2022-12-22 17:56:47 +03:00
// Number of stopped computes
2022-10-03 16:56:47 +03:00
Stopped uint64 `json:"stopped"`
}
2022-12-22 17:56:47 +03:00
// Information about machines
2022-10-03 16:56:47 +03:00
type Machines struct {
2022-12-22 17:56:47 +03:00
// Number of running machines
2022-10-03 16:56:47 +03:00
Running uint64 `json:"running"`
2022-12-22 17:56:47 +03:00
// Number of halted machines
Halted uint64 `json:"halted"`
2022-10-03 16:56:47 +03:00
}
2025-07-15 17:39:18 +03:00
// Detailed information about the account zone
type ZoneID struct {
// ID of zone
ID int64 `json:"id"`
// Name of zone
Name string `json:"name"`
}
2023-01-23 15:39:41 +03:00
// Main information about account
2022-12-22 17:56:47 +03:00
type RecordAccount struct {
2023-01-23 15:39:41 +03:00
// DCLocation
DCLocation string `json:"DCLocation"`
2022-12-22 17:56:47 +03:00
2023-01-23 15:39:41 +03:00
// Access control list
ACL []RecordACL `json:"acl"`
// Company
Company string `json:"company"`
// Company URL
CompanyURL string `json:"companyurl"`
2024-04-16 14:26:06 +03:00
// Compute Features
ComputeFeatures []string `json:"computeFeatures"`
2022-12-22 17:56:47 +03:00
// Computes
Computes Computes `json:"computes"`
2023-04-28 11:46:58 +03:00
// CPU allocation parameter
CPUAllocationParameter string `json:"cpu_allocation_parameter"`
// CPU allocation ratio
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
2023-01-23 15:39:41 +03:00
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
2025-04-09 11:21:07 +03:00
// Description
Description string `json:"desc"`
2023-01-23 15:39:41 +03:00
// Deactivation time
2023-04-20 11:17:35 +03:00
DeactivationTime float64 `json:"deactivationTime"`
2023-01-23 15:39:41 +03:00
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
// Display name
DisplayName string `json:"displayname"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
2022-12-22 17:56:47 +03:00
// Machines
Machines Machines `json:"machines"`
2023-01-23 15:39:41 +03:00
// Name
Name string `json:"name"`
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
// Resource types
2023-04-28 11:46:58 +03:00
ResTypes []string `json:"resourceTypes"`
2023-01-23 15:39:41 +03:00
// Send access emails
SendAccessEmails bool `json:"sendAccessEmails"`
// Status
Status string `json:"status"`
2025-08-29 12:51:25 +03:00
// Storage policy ids
StoragePolicyIDs []uint64 `json:"storage_policy_ids"`
2023-01-23 15:39:41 +03:00
// UniqPools
UniqPools []interface{} `json:"uniqPools"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// Version
Version uint64 `json:"version"`
// VINS
VINS []uint64 `json:"vins"`
// VINSes
2022-12-22 17:56:47 +03:00
VINSes uint64 `json:"vinses"`
2025-07-15 17:39:18 +03:00
// Zone
2025-08-29 12:51:25 +03:00
ZoneIDs []ZoneID `json:"zoneIds"`
2025-07-15 17:39:18 +03:00
// Zones
DefaultZoneID uint64 `json:"defaultZoneId"`
2022-12-22 17:56:47 +03:00
}
// Main information about compute
type ItemCompute struct {
// ID an account
AccountID uint64 `json:"accountId"`
// Account name
AccountName string `json:"accountName"`
// 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 compute
ComputeID uint64 `json:"id"`
// Compute name
ComputeName string `json:"name"`
// Number of RAM
RAM uint64 `json:"ram"`
// Registered or not
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
2022-10-03 16:56:47 +03:00
TotalDisksSize uint64 `json:"totalDisksSize"`
2022-12-22 17:56:47 +03:00
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// User controlled or not
UserManaged bool `json:"userManaged"`
// Number of connected VINS
VINSConnected uint64 `json:"vinsConnected"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// List of computes
2023-07-07 12:40:03 +03:00
type ListComputes struct {
// Data
Data []ItemCompute `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Main information about disk
type ItemDisk struct {
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
2022-10-03 16:56:47 +03:00
2022-12-22 17:56:47 +03:00
// Pool
Pool string `json:"pool"`
// ID SEP
SEPID uint64 `json:"sepId"`
2023-01-23 15:39:41 +03:00
// Shareable
Shareable bool `json:"shareable"`
2022-12-22 17:56:47 +03:00
// Max size
2022-10-03 16:56:47 +03:00
SizeMax uint64 `json:"sizeMax"`
2022-12-22 17:56:47 +03:00
// Disk type
Type string `json:"type"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// List of disks
2023-07-07 12:40:03 +03:00
type ListDisks struct {
// Data
Data []ItemDisk `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-10-03 16:56:47 +03:00
2022-12-22 17:56:47 +03:00
// Main information about VINS
type ItemVINS struct {
// Account ID
AccountID uint64 `json:"accountId"`
// Name of account
2022-10-03 16:56:47 +03:00
AccountName string `json:"accountName"`
2022-12-22 17:56:47 +03:00
// Number of computes
Computes uint64 `json:"computes"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
2022-10-03 16:56:47 +03:00
CreatedTime uint64 `json:"createdTime"`
2022-12-22 17:56:47 +03:00
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
2022-10-03 16:56:47 +03:00
DeletedTime uint64 `json:"deletedTime"`
2022-12-22 17:56:47 +03:00
// External IP
ExternalIP string `json:"externalIP"`
2024-04-16 14:26:06 +03:00
// Extnet ID
ExtnetId uint64 `json:"extnetId"`
// Free IPs
2024-08-26 17:51:34 +03:00
FreeIPs int64 `json:"freeIPs"`
2024-04-16 14:26:06 +03:00
2022-12-22 17:56:47 +03:00
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
// Network
Network string `json:"network"`
// NNFDev 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
2022-10-03 16:56:47 +03:00
UpdatedTime uint64 `json:"updatedTime"`
}
2022-12-22 17:56:47 +03:00
// List of VINS
2023-07-07 12:40:03 +03:00
type ListVINS struct {
// Data
Data []ItemVINS `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Main info about audit
type ItemAudit struct {
// Call
Call string `json:"call"`
2022-10-03 16:56:47 +03:00
2022-12-22 17:56:47 +03:00
// Response time
2022-10-03 16:56:47 +03:00
ResponseTime float64 `json:"responsetime"`
2022-12-22 17:56:47 +03:00
// Status code
StatusCode uint64 `json:"statuscode"`
// Timestamp
Timestamp float64 `json:"timestamp"`
// User
User string `json:"user"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// List of audits
type ListAudits []ItemAudit
// Information compute in resource group
type RGComputes struct {
// Number of started computes
2023-01-23 15:39:41 +03:00
Started uint64 `json:"Started"`
2022-10-03 16:56:47 +03:00
2022-12-22 17:56:47 +03:00
// Number of stopped computes
2023-01-23 15:39:41 +03:00
Stopped uint64 `json:"Stopped"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Resources of Resource group
type RGResources struct {
// Consumed
2022-10-03 16:56:47 +03:00
Consumed Resource `json:"Consumed"`
2022-12-22 17:56:47 +03:00
// Limits
2023-01-23 15:39:41 +03:00
Limits LimitsRG `json:"Limits"`
2022-12-22 17:56:47 +03:00
// Reserved
2022-10-03 16:56:47 +03:00
Reserved Resource `json:"Reserved"`
}
2023-01-23 15:39:41 +03:00
// Resources used
type LimitsRG struct {
// Number of cores
CPU int64 `json:"cpu"`
// Disk size
DiskSize int64 `json:"disksize"`
// Max disk size
DiskSizeMax int64 `json:"disksizemax"`
// Number of External IPs
ExtIPs int64 `json:"extips"`
// Number of grafic cores
GPU int64 `json:"gpu"`
// Number of RAM
RAM int64 `json:"ram"`
// SEPs
SEPs uint64 `json:"seps"`
2025-12-16 14:22:57 +03:00
// Policies
Policies map[string]Policy `json:"policies"`
2023-01-23 15:39:41 +03:00
}
2022-12-22 17:56:47 +03:00
// Main information about resource group
type ItemRG struct {
// Computes
Computes RGComputes `json:"Computes"`
// Resources
Resources RGResources `json:"Resources"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
2025-04-09 11:21:07 +03:00
// Description
Description string `json:"desc"`
2022-12-22 17:56:47 +03:00
// Resource group ID
RGID uint64 `json:"id"`
// Milestones
Milestones uint64 `json:"milestones"`
// Resource group name
RGName string `json:"name"`
// Status
Status string `json:"status"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// Number of VINS
VINSes uint64 `json:"vinses"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// List of Resource groups
2023-07-07 12:40:03 +03:00
type ListRG struct {
// Data
Data []ItemRG `json:"data"`
// Enrtry count
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Main information about template
type ItemTemplate struct {
// UNCPath
UNCPath string `json:"UNCPath"`
// Account ID
AccountID uint64 `json:"accountId"`
2022-10-03 16:56:47 +03:00
2022-12-22 17:56:47 +03:00
// Description
2022-10-03 16:56:47 +03:00
Description string `json:"desc"`
2022-12-22 17:56:47 +03:00
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
// Public or not
Public bool `json:"public"`
// Size
Size uint64 `json:"size"`
// Status
Status string `json:"status"`
// Type
Type string `json:"type"`
// Username
Username string `json:"username"`
}
// List of templates
2023-07-21 15:14:10 +03:00
type ListTemplates struct {
// Data
Data []ItemTemplate `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Main information about FLIPGroup
type ItemFLIPGroup struct {
// Account ID
AccountID uint64 `json:"accountId"`
// Client type
ClientType string `json:"clientType"`
// Connection type
ConnType string `json:"connType"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
2022-10-03 16:56:47 +03:00
CreatedTime uint64 `json:"createdTime"`
2022-12-22 17:56:47 +03:00
// Default GW
DefaultGW string `json:"defaultGW"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
2022-10-03 16:56:47 +03:00
DeletedTime uint64 `json:"deletedTime"`
2022-12-22 17:56:47 +03:00
// Description
2022-10-03 16:56:47 +03:00
Description string `json:"desc"`
2022-12-22 17:56:47 +03:00
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// IP
IP string `json:"ip"`
// Milestones
Milestones uint64 `json:"milestones"`
// Name
Name string `json:"name"`
// Network ID
NetID uint64 `json:"netId"`
// Network type
NetType string `json:"netType"`
// Network mask
NetMask uint64 `json:"netmask"`
// Status
Status string `json:"status"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
2022-10-03 16:56:47 +03:00
UpdatedTime uint64 `json:"updatedTime"`
}
2022-12-22 17:56:47 +03:00
// List of FLIPGroups
2023-07-07 12:40:03 +03:00
type ListFLIPGroups struct {
// Data
Data []ItemFLIPGroup `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}