Documentation
¶
Overview ¶
API for Kubernetes clusters management
Index ¶
- type CreateRequest
- type DeleteMasterFromGroupRequest
- type DeleteRequest
- type DeleteWorkerFromGroupRequest
- type DisableEnableRequest
- type FindGroupByLabelRequest
- type GetConfigRequest
- type GetNodeAnnotationsRequest
- type GetNodeLabelsRequest
- type GetNodeTaintsRequest
- type GetRequest
- type GetWorkerNodesMetaDataRequest
- type ItemACL
- type ItemDetailedInfo
- type ItemK8SCluster
- type ItemK8SGroup
- type K8S
- func (k8s K8S) Create(ctx context.Context, req CreateRequest) (string, error)
- func (k8s K8S) Delete(ctx context.Context, req DeleteRequest) (bool, error)
- func (k8s K8S) DeleteMasterFromGroup(ctx context.Context, req DeleteMasterFromGroupRequest) (bool, error)
- func (k8s K8S) DeleteWorkerFromGroup(ctx context.Context, req DeleteWorkerFromGroupRequest) (bool, error)
- func (k8s K8S) Disable(ctx context.Context, req DisableEnableRequest) (bool, error)
- func (k8s K8S) Enable(ctx context.Context, req DisableEnableRequest) (bool, error)
- func (k8s K8S) FindGroupByLabel(ctx context.Context, req FindGroupByLabelRequest) (ListK8SGroups, error)
- func (k8s K8S) Get(ctx context.Context, req GetRequest) (*RecordK8S, error)
- func (k8s K8S) GetConfig(ctx context.Context, req GetConfigRequest) (string, error)
- func (k8s K8S) GetNodeAnnotations(ctx context.Context, req GetNodeAnnotationsRequest) (string, error)
- func (k8s K8S) GetNodeLabels(ctx context.Context, req GetNodeLabelsRequest) (string, error)
- func (k8s K8S) GetNodeTaints(ctx context.Context, req GetNodeTaintsRequest) (string, error)
- func (k8s K8S) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)
- func (k K8S) GetWorkerNodesMetaData(ctx context.Context, req GetWorkerNodesMetaDataRequest) (string, error)
- func (k8s K8S) List(ctx context.Context, req ListRequest) (*ListK8SClusters, error)
- func (k8s K8S) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListK8SClusters, error)
- func (k8s K8S) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)
- func (k8s K8S) Restore(ctx context.Context, req RestoreRequest) (bool, error)
- func (k8s K8S) Start(ctx context.Context, req StartRequest) (bool, error)
- func (k8s K8S) Stop(ctx context.Context, req StopRequest) (bool, error)
- func (k8s K8S) Update(ctx context.Context, req UpdateRequest) (bool, error)
- func (k K8S) UpdateWorkerNodesMetaData(ctx context.Context, req UpdateWorkerNodesMetaDataRequest) (bool, error)
- func (k8s K8S) WorkerAdd(ctx context.Context, req WorkerAddRequest) ([]uint64, error)
- func (k8s K8S) WorkerReset(ctx context.Context, req WorkerResetRequest) (bool, error)
- func (k8s K8S) WorkerRestart(ctx context.Context, req WorkerRestartRequest) (bool, error)
- func (k8s K8S) WorkersGroupAdd(ctx context.Context, req WorkersGroupAddRequest) (uint64, error)
- func (k8s K8S) WorkersGroupDelete(ctx context.Context, req WorkersGroupDeleteRequest) (bool, error)
- func (k8s K8S) WorkersGroupGetByName(ctx context.Context, req WorkersGroupGetByNameRequest) (*ItemK8SGroup, error)
- type ListACL
- type ListDeletedRequest
- type ListDetailedInfo
- type ListK8SClusters
- func (lkc ListK8SClusters) FilterByAccountID(accountID uint64) ListK8SClusters
- func (lkc ListK8SClusters) FilterByCreatedBy(createdBy string) ListK8SClusters
- func (lkc ListK8SClusters) FilterByDeletedBy(deletedBy string) ListK8SClusters
- func (lkc ListK8SClusters) FilterByID(id uint64) ListK8SClusters
- func (lkc ListK8SClusters) FilterByName(name string) ListK8SClusters
- func (lkc ListK8SClusters) FilterByRGID(rgID uint64) ListK8SClusters
- func (lkc ListK8SClusters) FilterByStatus(status string) ListK8SClusters
- func (lkc ListK8SClusters) FilterByTechStatus(techStatus string) ListK8SClusters
- func (lkc ListK8SClusters) FilterFunc(predicate func(ItemK8SCluster) bool) ListK8SClusters
- func (lkc ListK8SClusters) FindOne() ItemK8SCluster
- func (lk ListK8SClusters) IDs() []uint64
- func (lkc ListK8SClusters) Serialize(params ...string) (serialization.Serialized, error)
- func (lkc ListK8SClusters) SortByCreatedTime(inverse bool) ListK8SClusters
- func (lkc ListK8SClusters) SortByDeletedTime(inverse bool) ListK8SClusters
- func (lkc ListK8SClusters) SortByUpdatedTime(inverse bool) ListK8SClusters
- type ListK8SGroups
- type ListRequest
- type MasterGroup
- type RecordACL
- type RecordK8S
- type RecordK8SGroups
- type RecordServiceAccount
- type RestoreRequest
- type StartRequest
- type StopRequest
- type UpdateRequest
- type UpdateWorkerNodesMetaDataRequest
- type WorkerAddRequest
- type WorkerResetRequest
- type WorkerRestartRequest
- type WorkersGroupAddRequest
- type WorkersGroupDeleteRequest
- type WorkersGroupGetByNameRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type CreateRequest struct { // Name of Kubernetes cluster // Required: true Name string `url:"name" json:"name" validate:"required"` // Resource Group ID for cluster placement // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // ID of Kubernetes catalog item (k8sci) for cluster // Required: true K8SCIID uint64 `url:"k8ciId" json:"k8ciId" validate:"required"` // Name for first worker group created with cluster // Required: true WorkerGroupName string `url:"workerGroupName" json:"workerGroupName" validate:"required,workerGroupName"` // Network plugin // Must be one of these values: flannel, weawenet, calico // Required: true NetworkPlugin string `url:"networkPlugin" json:"networkPlugin" validate:"required,networkPlugin"` // ID of SEP to create boot disks for master nodes. Uses images SEP ID if not set // Required: false MasterSEPID uint64 `url:"masterSepId,omitempty" json:"masterSepId,omitempty"` // Pool to use if master SEP ID is set, can be also empty if needed to be chosen by system // Required: false MasterSEPPool string `url:"masterSepPool,omitempty" json:"masterSepPool,omitempty"` // ID of SEP to create boot disks for default worker nodes group. Uses images SEP ID if not set // Required: false WorkerSEPID uint64 `url:"workerSepId,omitempty" json:"workerSepId,omitempty"` // Pool to use if worker SEP ID is set, can be also empty if needed to be chosen by system // Required: false WorkerSEPPool string `url:"workerSepPool,omitempty" json:"workerSepPool,omitempty"` // List of strings with labels for default worker group // i.e: ["label1=value1", "label2=value2"] // Required: false Labels []string `url:"labels,omitempty" json:"labels,omitempty"` // List of strings with taints for default worker group // i.e: ["key1=value1:NoSchedule", "key2=value2:NoExecute"] // Required: false Taints []string `url:"taints,omitempty" json:"taints,omitempty"` // List of strings with annotations for worker group // i.e: ["key1=value1", "key2=value2"] // Required: false Annotations []string `url:"annotations,omitempty" json:"annotations,omitempty"` // Number of master nodes to create // Required: false MasterNum uint `url:"masterNum,omitempty" json:"masterNum,omitempty"` // Master node CPU count // Required: false MasterCPU uint `url:"masterCpu,omitempty" json:"masterCpu,omitempty"` // Master node RAM volume in MB // Required: false MasterRAM uint `url:"masterRam,omitempty" json:"masterRam,omitempty"` // Master node boot disk size in GB If 0 is specified, size is defined by the OS image size // Required: false MasterDisk uint `url:"masterDisk,omitempty" json:"masterDisk,omitempty"` // Number of worker nodes to create in default worker group // Required: false WorkerNum uint `url:"workerNum,omitempty" json:"workerNum,omitempty"` // Worker node CPU count // Required: false WorkerCPU uint `url:"workerCpu,omitempty" json:"workerCpu,omitempty"` // Worker node RAM volume in MB // Required: false WorkerRAM uint `url:"workerRam,omitempty" json:"workerRam,omitempty"` // Worker node boot disk size in GB. If 0 is specified, size is defined by the OS image size // Required: false WorkerDisk uint `url:"workerDisk,omitempty" json:"workerDisk,omitempty"` // ID of the external network to connect load balancer and cluster ViNS. If 0 is specified, external network selects automatically to // Required: false ExtNetID uint64 `url:"extnetId,omitempty" json:"extnetId,omitempty"` // ID of the ViNS to connect k8s cluster. If nothing is specified, ViNS will be created automatically // Required: false VinsId uint64 `url:"vinsId,omitempty" json:"vinsId,omitempty"` // Create Kubernetes cluster with masters nodes behind load balancer if true. // Otherwise give all cluster nodes direct external addresses from selected ExtNet // Required: false WithLB bool `url:"withLB" json:"withLB"` // Custom sysctl values for Load Balancer instance. Applied on boot // Required: false LbSysctlParams string `url:"lbSysctlParams,omitempty" json:"lbSysctlParams,omitempty"` // Use Highly Available schema for LB deploy // Required: false HighlyAvailable bool `url:"highlyAvailableLB,omitempty" json:"highlyAvailableLB,omitempty"` // Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names // Required: false AdditionalSANs []string `url:"additionalSANs,omitempty" json:"additionalSANs,omitempty"` // Is used to define settings and actions that should be performed before any other component in the cluster starts. // It allows you to configure things like node registration, network setup, and other initialization tasks. insert a valid JSON string with all levels of nesting // Required: false InitConfiguration string `url:"initConfiguration,omitempty" json:"initConfiguration,omitempty"` // Is used to define global settings and configurations for the entire cluster. // It includes parameters such as cluster name, DNS settings, authentication methods, and other cluster-wide configurations. // Insert a valid JSON string with all levels of nesting // Required: false ClusterConfiguration string `url:"clusterConfiguration,omitempty" json:"clusterConfiguration,omitempty"` // Is used to configure the behavior and settings of the Kubelet, which is the primary node agent that runs on each node in the cluster. // It includes parameters such as node IP address, resource allocation, pod eviction policies, and other Kubelet-specific configurations. // Insert a valid JSON string with all levels of nesting // Required: false KubeletConfiguration string `url:"kubeletConfiguration,omitempty" json:"kubeletConfiguration,omitempty"` // Is used to configure the behavior and settings of the Kube-proxy, which is responsible for network proxying and load balancing within the cluster. // It includes parameters such as proxy mode, cluster IP ranges, and other Kube-proxy specific configurations. // Insert a valid JSON string with all levels of nesting // Required: false KubeProxyConfiguration string `url:"kubeProxyConfiguration,omitempty" json:"kubeProxyConfiguration,omitempty"` // Is used to configure the behavior and settings for joining a node to a cluster. // It includes parameters such as the cluster's control plane endpoint, token, and certificate key. insert a valid JSON string with all levels of nesting // Required: false JoinConfiguration string `url:"joinConfiguration,omitempty" json:"joinConfiguration,omitempty"` // Text description of this Kubernetes cluster // Required: false Description string `url:"desc,omitempty" json:"desc,omitempty"` // Meta data for working group computes, format YAML "user_data": 1111 // Required: false UserData string `url:"userData,omitempty" json:"userData,omitempty"` // Use only selected ExtNet for infrastructure connections // Required: false ExtNetOnly bool `url:"extnetOnly,omitempty" json:"extnetOnly,omitempty"` // Insert ssl certificate in x509 pem format // Required: false OidcCertificate string `url:"oidcCertificate,omitempty" json:"oidcCertificate,omitempty"` }
CreateRequest struct to create kubernetes cluster
type DeleteMasterFromGroupRequest ¶
type DeleteMasterFromGroupRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // ID of the masters compute group // Required: true MasterGroupID uint64 `url:"masterGroupId" json:"masterGroupId" validate:"required"` // List of Compute IDs of master nodes to delete // Required: true MasterIDs []string `url:"masterIds" json:"masterIds" validate:"min=1"` }
DeleteMasterFromGroupRequest struct to delete master from group
type DeleteRequest ¶
type DeleteRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // True if cluster is destroyed permanently. // Otherwise it can be restored from Recycle Bin // Required: true Permanently bool `url:"permanently" json:"permanently" validate:"required"` }
DeleteRequest struct to delete kubernetes cluster
type DeleteWorkerFromGroupRequest ¶
type DeleteWorkerFromGroupRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // ID of the workers compute group // Required: true WorkersGroupID uint64 `url:"workersGroupId" json:"workersGroupId" validate:"required"` // Compute ID of worker node to delete // Required: true WorkerID uint64 `url:"workerId" json:"workerId" validate:"required"` }
DeleteWorkerFromGroupRequest struct to delete worker from group
type DisableEnableRequest ¶ added in v1.4.2
type DisableEnableRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` }
DisableEnableRequest struct to disable/enable kubernetes cluster
type FindGroupByLabelRequest ¶
type FindGroupByLabelRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // List of labels to search // Required: true Labels []string `url:"labels" json:"labels" validate:"min=1"` // If true and more than one label provided, select only groups that have all provided labels. // If false - groups that have at least one label // Required: false Strict bool `url:"strict,omitempty" json:"strict,omitempty"` }
FindGroupByLabelRequest struct to get information about group of kubernetes cluster
type GetConfigRequest ¶
type GetConfigRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` }
GetConfigRequest struct to get configuration of kubernetes cluster
type GetNodeAnnotationsRequest ¶
type GetNodeAnnotationsRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // Node ID // Required: true NodeID uint64 `url:"nodeId" json:"nodeId" validate:"required"` }
GetNodeAnnotationsRequest struct to get node annotations
type GetNodeLabelsRequest ¶
type GetNodeLabelsRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // Node ID // Required: true NodeID uint64 `url:"nodeId" json:"nodeId" validate:"required"` }
GetNodeLabelsRequest struct to get node labels
type GetNodeTaintsRequest ¶
type GetNodeTaintsRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // Node ID // Required: true NodeID uint64 `url:"nodeId" json:"nodeId" validate:"required"` }
GetNodeTaintsRequest struct to get node taints
type GetRequest ¶
type GetRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` }
GetRequest struct to get detailed information about kubernetes cluster
type GetWorkerNodesMetaDataRequest ¶ added in v1.6.0
type GetWorkerNodesMetaDataRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // ID of the workers compute group // Required: true WorkersGroupID uint64 `url:"workersGroupId" json:"workersGroupId" validate:"required"` }
GetWorkerNodesMetaDataRequest struct to get worker group metadata by ID
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 of Access Control List
type ItemDetailedInfo ¶
type ItemDetailedInfo struct { // Externalip Externalip string `json:"externalip"` // ID ID uint64 `json:"id"` // Name Name string `json:"name"` // Status Status string `json:"status"` // Tech status TechStatus string `json:"techStatus"` }
Detailed information
type ItemK8SCluster ¶
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"` // Network plugin NetworkPlugin string `json:"networkPlugin"` // 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"` }
Main information about kubernetes cluster
func (ItemK8SCluster) Serialize ¶
func (ikc ItemK8SCluster) 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 ItemK8SGroup ¶
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"` }
Main information about kubernetes cluster
type K8S ¶
type K8S struct {
// contains filtered or unexported fields
}
Structure for creating request to K8S
func (K8S) DeleteMasterFromGroup ¶
func (k8s K8S) DeleteMasterFromGroup(ctx context.Context, req DeleteMasterFromGroupRequest) (bool, error)
DeleteMasterFromGroup deletes compute from masters group in selected Kubernetes cluster
func (K8S) DeleteWorkerFromGroup ¶
func (k8s K8S) DeleteWorkerFromGroup(ctx context.Context, req DeleteWorkerFromGroupRequest) (bool, error)
DeleteWorkerFromGroup deletes worker compute from workers group in selected Kubernetes cluster
func (K8S) FindGroupByLabel ¶
func (k8s K8S) FindGroupByLabel(ctx context.Context, req FindGroupByLabelRequest) (ListK8SGroups, error)
FindGroupByLabel find worker group information by one on more labels
func (K8S) GetNodeAnnotations ¶
func (k8s K8S) GetNodeAnnotations(ctx context.Context, req GetNodeAnnotationsRequest) (string, error)
GetNodeAnnotations gets kubernetes cluster worker node annotations
func (K8S) GetNodeLabels ¶
GetNodeLabels gets kubernetes cluster worker node labels
func (K8S) GetNodeTaints ¶
GetNodeTaints gets kubernetes cluster worker node taints
func (K8S) GetRaw ¶ added in v1.6.6
GetRaw gets information about Kubernetes cluster as an array of bytes
func (K8S) GetWorkerNodesMetaData ¶ added in v1.6.0
func (k K8S) GetWorkerNodesMetaData(ctx context.Context, req GetWorkerNodesMetaDataRequest) (string, error)
GetWorkerNodesMetaData gets worker group metadata by ID
func (K8S) List ¶
func (k8s K8S) List(ctx context.Context, req ListRequest) (*ListK8SClusters, error)
List gets list of all kubernetes clusters the user has access to as a ListK8SClusters
func (K8S) ListDeleted ¶
func (k8s K8S) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListK8SClusters, error)
ListDeleted gets all deleted kubernetes clusters the user has access to
func (K8S) ListRaw ¶ added in v1.6.6
ListRaw gets list of all kubernetes clusters the user has access to as an array of bytes
func (K8S) UpdateWorkerNodesMetaData ¶ added in v1.6.0
func (k K8S) UpdateWorkerNodesMetaData(ctx context.Context, req UpdateWorkerNodesMetaDataRequest) (bool, error)
UpdateWorkerNodesMetaData adds worker nodes to a kubernetes cluster
func (K8S) WorkerReset ¶
WorkerReset hard reset (compute start + stop) worker node of the Kubernetes cluster
func (K8S) WorkerRestart ¶
WorkerRestart soft restart (reboot OS) worker node of the Kubernetes cluster
func (K8S) WorkersGroupAdd ¶
WorkersGroupAdd adds workers group to Kubernetes cluster
func (K8S) WorkersGroupDelete ¶
WorkersGroupDelete deletes workers group from Kubernetes cluster
func (K8S) WorkersGroupGetByName ¶
func (k8s K8S) WorkersGroupGetByName(ctx context.Context, req WorkersGroupGetByNameRequest) (*ItemK8SGroup, error)
WorkersGroupGetByName gets worker group metadata by name
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 IP address // Required: false IPAddress string `url:"ipAddress,omitempty" json:"ipAddress,omitempty"` // Find by resource group ID // Required: false RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"` // Find by lbId // Required: false LBID uint64 `url:"lbId,omitempty" json:"lbId,omitempty"` // Find by basicServiceId // Required: false BasicServiceID uint64 `url:"basicServiceId,omitempty" json:"basicServiceId,omitempty"` // Find by techStatus // Required: false TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"` // 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 of deleted kubernetes cluster
type ListDetailedInfo ¶
type ListDetailedInfo []ItemDetailedInfo
List detailed information
func (ListDetailedInfo) IDs ¶ added in v1.6.8
func (ldi ListDetailedInfo) IDs() []uint64
IDs gets array of Worker or Master ComputesIDs from ListDetailedInfo struct
type ListK8SClusters ¶
type ListK8SClusters struct { // Data Data []ItemK8SCluster `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List of kubernetes clusters
func (ListK8SClusters) FilterByAccountID ¶
func (lkc ListK8SClusters) FilterByAccountID(accountID uint64) ListK8SClusters
FilterByAccountID returns ListK8SClusters with specified AccountID.
func (ListK8SClusters) FilterByCreatedBy ¶
func (lkc ListK8SClusters) FilterByCreatedBy(createdBy string) ListK8SClusters
FilterByCreatedBy returns ListK8SClusters created by specified user.
func (ListK8SClusters) FilterByDeletedBy ¶
func (lkc ListK8SClusters) FilterByDeletedBy(deletedBy string) ListK8SClusters
FilterByDeletedBy returns ListK8SClusters deleted by specified user.
func (ListK8SClusters) FilterByID ¶
func (lkc ListK8SClusters) FilterByID(id uint64) ListK8SClusters
FilterByID returns ListK8SClusters with specified ID.
func (ListK8SClusters) FilterByName ¶
func (lkc ListK8SClusters) FilterByName(name string) ListK8SClusters
FilterByName returns ListK8SClusters with specified Name.
func (ListK8SClusters) FilterByRGID ¶
func (lkc ListK8SClusters) FilterByRGID(rgID uint64) ListK8SClusters
FilterByRGID returns ListK8SClusters with specified RGID.
func (ListK8SClusters) FilterByStatus ¶
func (lkc ListK8SClusters) FilterByStatus(status string) ListK8SClusters
FilterByStatus returns ListK8SClusters with specified Status.
func (ListK8SClusters) FilterByTechStatus ¶
func (lkc ListK8SClusters) FilterByTechStatus(techStatus string) ListK8SClusters
FilterByTechStatus returns ListK8SClusters with specified TechStatus.
func (ListK8SClusters) FilterFunc ¶
func (lkc ListK8SClusters) FilterFunc(predicate func(ItemK8SCluster) bool) ListK8SClusters
FilterFunc allows filtering ListK8SClusters based on a user-specified predicate.
func (ListK8SClusters) FindOne ¶
func (lkc ListK8SClusters) FindOne() ItemK8SCluster
FindOne returns first found ItemK8SCluster If none was found, returns an empty struct.
func (ListK8SClusters) IDs ¶ added in v1.6.8
func (lk ListK8SClusters) IDs() []uint64
IDs gets array of K8SIDs from ListK8SClusters struct
func (ListK8SClusters) Serialize ¶
func (lkc ListK8SClusters) 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 (ListK8SClusters) SortByCreatedTime ¶
func (lkc ListK8SClusters) SortByCreatedTime(inverse bool) ListK8SClusters
SortByCreatedTime sorts ListK8SClusters by the CreatedTime field in ascending order.
If inverse param is set to true, the order is reversed.
func (ListK8SClusters) SortByDeletedTime ¶
func (lkc ListK8SClusters) SortByDeletedTime(inverse bool) ListK8SClusters
SortByDeletedTime sorts ListK8SClusters by the DeletedTime field in ascending order.
If inverse param is set to true, the order is reversed.
func (ListK8SClusters) SortByUpdatedTime ¶
func (lkc ListK8SClusters) SortByUpdatedTime(inverse bool) ListK8SClusters
SortByUpdatedTime sorts ListK8SClusters by the UpdatedTime field in ascending order.
If inverse param is set to true, the order is reversed.
type ListK8SGroups ¶
type ListK8SGroups []ItemK8SGroup
List kubernetes cluster groups
func (ListK8SGroups) IDs ¶ added in v1.6.8
func (lwg ListK8SGroups) IDs() []uint64
IDs gets array of K8SWorkerGroupIDs from ListK8SGroups struct
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 IP address // Required: false IPAddress string `url:"ipAddress,omitempty" json:"ipAddress,omitempty"` // Find by resource group ID // Required: false RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"` // Find by lbId // Required: false LBID uint64 `url:"lbId,omitempty" json:"lbId,omitempty"` // Find by basicServiceId // Required: false BasicServiceID uint64 `url:"basicServiceId,omitempty" json:"basicServiceId,omitempty"` // Find by status // Required: false Status string `url:"status,omitempty" json:"status,omitempty"` // Find by techStatus // Required: false TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"` // Include deleted clusters in result // Required: false IncludeDeleted bool `url:"includedeleted,omitempty" json:"includedeleted,omitempty"` // 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 information K8S
type MasterGroup ¶
type MasterGroup struct { // 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"` }
Master group information
type RecordACL ¶
type RecordACL struct { // Account ACL AccountACL ListACL `json:"accountAcl"` // K8S ACL K8SACL ListACL `json:"k8sAcl"` // RG ACL RGACL ListACL `json:"rgAcl"` }
Access Control List
type RecordK8S ¶
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"` // 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"` // Network plugin NetworkPlugin string `json:"networkPlugin"` // 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"` }
Deteal information about kubernetes cluster
type RecordK8SGroups ¶
type RecordK8SGroups struct { // Master information Masters MasterGroup `json:"masters"` // Worker information Workers ListK8SGroups `json:"workers"` }
Detailed information about kubernetes cluster groups
type RecordServiceAccount ¶
type RecordServiceAccount struct { // GUID GUID string `json:"guid"` // Password Password string `json:"password"` // Username Username string `json:"username"` }
Information about service account
type RestoreRequest ¶
type RestoreRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` }
RestoreRequest struct to restore kubernetes cluster
type StartRequest ¶
type StartRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` }
StartRequest struct to start kubernetes cluster
type StopRequest ¶
type StopRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` }
StopRequest struct to stop kubernetes cluster
type UpdateRequest ¶
type UpdateRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // New name to set. // If empty string is passed, name is not updated // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // New description to set. // If empty string is passed, description is not updated // Required: false Description string `url:"desc,omitempty" json:"desc,omitempty"` }
UpdateRequest struct to update kubernetes cluster
type UpdateWorkerNodesMetaDataRequest ¶ added in v1.6.0
type UpdateWorkerNodesMetaDataRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // ID of the workers compute group // Required: true WorkersGroupID uint64 `url:"workersGroupId" json:"workersGroupId" validate:"required"` // Meta data for working group computes, format YAML "user_data": 1111 // Required: true UserData string `url:"userData" json:"userData" validate:"required"` }
UpdateWorkerNodesMetaDataRequest struct to add worker to a kubernetes cluster
type WorkerAddRequest ¶
type WorkerAddRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // ID of the workers compute group // Required: true WorkersGroupID uint64 `url:"workersGroupId" json:"workersGroupId" validate:"required"` // How many worker nodes to add // Required: false Num uint64 `url:"num,omitempty" json:"num,omitempty"` }
WorkerAddRequest struct to add worker to a kubernetes cluster
type WorkerResetRequest ¶
type WorkerResetRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // ID of the workers compute group // Required: true WorkersGroupID uint64 `url:"workersGroupId" json:"workersGroupId" validate:"required"` // Compute ID of worker node to reset // Required: true WorkerID uint64 `url:"workerId" json:"workerId" validate:"required"` }
WorkerResetRequest struct for hard reset kubernetes cluster
type WorkerRestartRequest ¶
type WorkerRestartRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // ID of the workers compute group // Required: true WorkersGroupID uint64 `url:"workersGroupId" json:"workersGroupId" validate:"required"` // Compute ID of worker node to restart // Required: true WorkerID uint64 `url:"workerId" json:"workerId" validate:"required"` }
WorkerRestartRequest struct to restart worker node
type WorkersGroupAddRequest ¶
type WorkersGroupAddRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // Worker group name // Required: true Name string `url:"name" json:"name" validate:"required"` // ID of SEP to create boot disks for default worker nodes group. Uses images SEP ID if not set // Required: false WorkerSEPID uint64 `url:"workerSepId,omitempty" json:"workerSepId,omitempty"` // Pool to use if worker SEP ID is set, can be also empty if needed to be chosen by system // Required: false WorkerSEPPool string `url:"workerSepPool,omitempty" json:"workerSepPool,omitempty"` // List of strings with labels for worker group // i.e: ["label1=value1", "label2=value2"] // Required: false Labels []string `url:"labels,omitempty" json:"labels,omitempty"` // List of strings with taints for worker group // i.e: ["key1=value1:NoSchedule", "key2=value2:NoExecute"] // Required: false Taints []string `url:"taints,omitempty" json:"taints,omitempty"` // List of strings with annotations for worker group // i.e: ["key1=value1", "key2=value2"] // Required: false Annotations []string `url:"annotations,omitempty" json:"annotations,omitempty"` // Number of worker nodes to create // Required: false WorkerNum uint64 `url:"workerNum,omitempty" json:"workerNum,omitempty"` // Worker node CPU count // Required: false WorkerCPU uint64 `url:"workerCpu,omitempty" json:"workerCpu,omitempty"` // Worker node RAM volume in MB // Required: false WorkerRAM uint64 `url:"workerRam,omitempty" json:"workerRam,omitempty"` // Worker node boot disk size in GB If 0 is specified, size is defined by the OS image size // Required: false WorkerDisk uint64 `url:"workerDisk,omitempty" json:"workerDisk,omitempty"` // Meta data for working group computes, format YAML "user_data": 1111 // Required: false UserData string `url:"userData,omitempty" json:"userData,omitempty"` }
WorkersGroupAddRequest struct to add workers group
type WorkersGroupDeleteRequest ¶
type WorkersGroupDeleteRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // Worker group ID // Required: true WorkersGroupID uint64 `url:"workersGroupId" json:"workersGroupId" validate:"required"` }
WorkersGroupDeleteRequest struct to delete workers group
type WorkersGroupGetByNameRequest ¶
type WorkersGroupGetByNameRequest struct { // Kubernetes cluster ID // Required: true K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"` // Worker group name // Required: true GroupName string `url:"groupName" json:"groupName" validate:"required"` }
WorkersGroupGetByNameRequest struct to get information about worker group
Source Files
¶
- create.go
- delete.go
- delete_master_from_group.go
- delete_worker_from_group.go
- disable_enable.go
- filter.go
- find_group_by_label.go
- get.go
- get_config.go
- get_node_annotations.go
- get_node_labels.go
- get_node_taints.go
- get_worker_nodes_meta_data.go
- ids.go
- k8s.go
- list.go
- list_deleted.go
- models.go
- restore.go
- serialize.go
- sorting.go
- start.go
- stop.go
- update.go
- update_worker_nodes_meta_data.go
- worker_add.go
- worker_reset.go
- worker_restart.go
- workers_group_add.go
- workers_group_delete.go
- workers_group_get_by_name.go