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

336 lines
5.8 KiB
Go
Raw Normal View History

2022-10-03 16:56:47 +03:00
package k8s
2022-12-22 17:56:47 +03:00
// Main information about kubernetes cluster
type ItemK8SGroup struct {
// List of Annotations
Annotations []string `json:"annotations"`
// Number of CPU
CPU uint64 `json:"cpu"`
// List detailed information
DetailedInfo ListDetailedInfo `json:"detailedInfo"`
// Disk ID
Disk uint64 `json:"disk"`
// GUID
GUID string `json:"guid"`
// ID
ID uint64 `json:"id"`
// List of Labels
Labels []string `json:"labels"`
// Name
Name string `json:"name"`
// Num
Num uint64 `json:"num"`
// Number of RAM
RAM uint64 `json:"ram"`
// List of taints
Taints []string `json:"taints"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// List kubernetes cluster groups
type ListK8SGroups []ItemK8SGroup
2022-10-03 16:56:47 +03:00
2022-12-22 17:56:47 +03:00
// Detailed information
type ItemDetailedInfo struct {
2023-09-24 12:11:31 +03:00
// Externalip
Externalip string `json:"externalip"`
2022-12-22 17:56:47 +03:00
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
// Status
Status string `json:"status"`
// Tech status
2022-10-03 16:56:47 +03:00
TechStatus string `json:"techStatus"`
}
2022-12-22 17:56:47 +03:00
// List detailed information
type ListDetailedInfo []ItemDetailedInfo
// Deteal information about kubernetes cluster
type RecordK8S struct {
// Access Control List
ACL RecordACL `json:"ACL"`
// Account ID
AccountID uint64 `json:"accountId"`
// Account name
AccountName string `json:"accountName"`
// Basic Service ID
BServiceID uint64 `json:"bserviceId"`
// CIID
CIID uint64 `json:"ciId"`
// 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"`
2024-11-12 12:51:21 +03:00
// Only external network
ExtnetOnly bool `json:"extnetOnly"`
// Highly available LB
HighlyAvailableLB bool `json:"highlyAvailableLB"`
// Address Virtual Internet Protocol
AddressVIP K8SAddressVIP `json:"addressVip"`
2022-12-22 17:56:47 +03:00
// ID
ID uint64 `json:"id"`
// K8CI name
K8CIName string `json:"k8ciName"`
// Kubernetes cluster groups information
K8SGroups RecordK8SGroups `json:"k8sGroups"`
// Load balancer ID
LBID uint64 `json:"lbId"`
// Name
Name string `json:"name"`
2023-04-28 11:46:58 +03:00
// Network plugin
NetworkPlugin string `json:"networkPlugin"`
2022-12-22 17:56:47 +03:00
// 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"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
2024-11-12 12:51:21 +03:00
// With LB
WithLB bool `json:"withLB"`
2025-07-15 17:39:18 +03:00
// Zone ID
ZoneID uint64 `json:"zoneId"`
2024-11-12 12:51:21 +03:00
}
// Detailed information about address of the Virtual Internet Protocol
type K8SAddressVIP struct {
// Backend IP
BackendIP string `json:"backendIp"`
// Frontend IP
FrontendIP string `json:"frontendIp"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Detailed information about kubernetes cluster groups
type RecordK8SGroups struct {
// Master information
Masters MasterGroup `json:"masters"`
// Worker information
Workers ListK8SGroups `json:"workers"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Master group information
2022-10-03 16:56:47 +03:00
type MasterGroup struct {
2022-12-22 17:56:47 +03:00
// Number of CPU
CPU uint64 `json:"cpu"`
// Detailed information
DetailedInfo ListDetailedInfo `json:"detailedInfo"`
// Disk ID
Disk uint64 `json:"disk"`
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
// Num
Num uint64 `json:"num"`
// Number of RAM
RAM uint64 `json:"ram"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Access Control List
type RecordACL struct {
// Account ACL
AccountACL ListACL `json:"accountAcl"`
// K8S ACL
K8SACL ListACL `json:"k8sAcl"`
// RG ACL
RGACL ListACL `json:"rgAcl"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Main information of Access Control List
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
2022-10-03 16:56:47 +03:00
UserGroupID string `json:"userGroupId"`
}
2022-12-22 17:56:47 +03:00
// List of ACL
type ListACL []ItemACL
// Main information about kubernetes cluster
type ItemK8SCluster struct {
// Account ID
AccountID uint64 `json:"accountId"`
// Account name
AccountName string `json:"accountName"`
// Access Control List
ACL []interface{} `json:"acl"`
// Basic Service ID
BServiceID uint64 `json:"bserviceId"`
// CIID
CIID uint64 `json:"ciId"`
// Config
Config interface{} `json:"config"`
// Create 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"`
// External network ID
ExtNetID uint64 `json:"extnetId"`
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// Load balancer ID
LBID uint64 `json:"lbId"`
// Milestones
Milestones uint64 `json:"milestones"`
// Name
Name string `json:"name"`
2023-04-28 11:46:58 +03:00
// Network plugin
NetworkPlugin string `json:"networkPlugin"`
2022-12-22 17:56:47 +03:00
// Resource group ID
RGID uint64 `json:"rgId"`
// Resource group name
RGName string `json:"rgName"`
// Information about service account
ServiceAccount RecordServiceAccount `json:"serviceAccount"`
// 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"`
// List workers group
WorkersGroup ListK8SGroups `json:"workersGroups"`
2025-07-15 17:39:18 +03:00
// Zone ID
ZoneID uint64 `json:"zoneId"`
2022-10-03 16:56:47 +03:00
}
2022-12-22 17:56:47 +03:00
// Information about service account
type RecordServiceAccount struct {
// GUID
GUID string `json:"guid"`
// Password
2022-10-03 16:56:47 +03:00
Password string `json:"password"`
2022-12-22 17:56:47 +03:00
// Username
2022-10-03 16:56:47 +03:00
Username string `json:"username"`
}
2022-12-22 17:56:47 +03:00
// List of kubernetes clusters
2023-07-07 12:40:03 +03:00
type ListK8SClusters struct {
// Data
Data []ItemK8SCluster `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}