4 Commits
Author SHA1 Message Date
src eaf2672f6b v1.0.10 2026-11-26 10:52:35 +03:00
src 2ba8f61cb5 v1.0.9 2026-10-30 16:45:47 +03:00
src 3e25635f9b v1.0.8 2026-10-22 11:21:01 +03:00
src c885f22775 v1.0.7 2026-10-16 15:34:40 +03:00
25 changed files with 653 additions and 231 deletions

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
Makefile
.gitlab
.idea
/examples/05_file/downloaded_image.img
/examples/05_file/downloaded_image.img
/BACKEND_COMMIT
+6 -33
View File
@@ -1,36 +1,9 @@
## Version 1.0.6
### Добавлено
| Идентификатор задачи | Описание |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| COD-46 | Добавлен метод `DeCluster.LoadBalancersDescribe` (`POST /digitalenergy/cluster/loadBalancers/describe`) |
| COD-46 | Добавлен метод `DeCluster.LoadBalancersHaproxyEditConfig` (`POST /digitalenergy/cluster/loadBalancers/haproxy/editConfig`) |
| COD-46 | Добавлен метод `DeCluster.LoadBalancersHaproxyGetConfig` (`POST /digitalenergy/cluster/loadBalancers/haproxy/getConfig`) |
| COD-46 | Добавлен метод `DeCluster.LoadBalancersHaproxyResetToDefaults` (`POST /digitalenergy/cluster/loadBalancers/haproxy/resetToDefaults`) |
| COD-46 | Добавлен метод `DeComputes.DiskAttach` (`POST /digitalenergy/computes/diskAttach`) |
| COD-46 | Добавлен метод `DeComputes.DiskDetach` (`POST /digitalenergy/computes/diskDetach`) |
| COD-46 | Добавлен метод `DeComputes.Get` (`POST /digitalenergy/computes/get`) |
| COD-46 | Добавлен метод `DeComputes.List` (`POST /digitalenergy/computes/list`) |
| COD-46 | Добавлен метод `DeCsidynamix.Describe` (`POST /digitalenergy/csidynamix/describe`) |
| COD-46 | Добавлен метод `DeCsidynamix.Install` (`POST /digitalenergy/csidynamix/install`) |
| COD-46 | Добавлен метод `DeCsidynamix.Reinstall` (`POST /digitalenergy/csidynamix/reinstall`) |
| COD-46 | Добавлен метод `DeCsidynamix.Uninstall` (`POST /digitalenergy/csidynamix/uninstall`) |
| COD-46 | Добавлен метод `DeDisks.Create` (`POST /digitalenergy/disks/create`) |
| COD-46 | Добавлен метод `DeDisks.Delete` (`POST /digitalenergy/disks/delete`) |
| COD-46 | Добавлен метод `DeDisks.Get` (`POST /digitalenergy/disks/get`) |
| COD-46 | Добавлен метод `DeDisks.List` (`POST /digitalenergy/disks/list`) |
| COD-46 | Добавлен метод `DeDisks.Resize` (`POST /digitalenergy/disks/resize`) |
| COD-46 | Добавлен метод `DeFalco.Describe` (`POST /digitalenergy/falco/describe`) |
| COD-46 | Добавлен метод `DeFalco.Install` (`POST /digitalenergy/falco/install`) |
| COD-46 | Добавлен метод `DeFalco.Uninstall` (`POST /digitalenergy/falco/uninstall`) |
## Version 1.0.10
### Изменено
| Идентификатор задачи | Описание |
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| COD-46 | Изменён метод `DeCluster.Create` (`POST /digitalenergy/cluster/create`): добавлено новое необязательное поле запроса `InstallCsiDynamix` |
| COD-46 | Изменён метод `DeCluster.Get` (`POST /digitalenergy/cluster/get`): в ответе добавлено необязательное поле `InstalledCsiDynamix` |
| COD-46 | Изменён метод `DeCluster.List` (`POST /digitalenergy/cluster/list`): в ответе добавлено необязательное поле `InstalledCsiDynamix`; добавлено новое необязательное поле запроса `InstalledCsiDynamix` |
| COD-46 | Изменён метод `DeClusterTemplate.Get` (`POST /digitalenergy/clusterTemplate/get`): в ответе добавлено необязательное поле `InstallCsiDynamix`; в ответе удалено необязательное поле `InstallAutoscaler` |
| COD-46 | Изменён метод `DeClusterTemplate.Update` (`POST /digitalenergy/clusterTemplate/update`): добавлено новое необязательное поле запроса `ExtraCluster.InstallCsiDynamix`; удалено поле запроса `ExtraCluster.InstallAutoscaler` |
| Идентификатор задачи | Описание |
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| COD-78 | Изменён метод `DeCluster.Create` (`POST /digitalenergy/cluster/create`): добавлены новые необязательные поля запроса `Podkiller`, `RequeueInterval` и `SkipNamespaces` |
| COD-78 | Изменён метод `DeClusterTemplate.Update` (`POST /digitalenergy/clusterTemplate/update`): добавлены новые необязательные поля запроса `ExtraCluster.Podkiller`, `ExtraCluster.RequeueInterval`, `ExtraCluster.Severities` и `ExtraCluster.SkipNamespaces` |
| COD-78 | Изменён метод `DeTrivy.Install` (`POST /digitalenergy/trivy/install`): добавлены новые необязательные поля запроса `Podkiller`, `RequeueInterval` и `SkipNamespaces` |
+1
View File
@@ -114,6 +114,7 @@ import desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
| [`DeDependencyTrack`](tags/de_dependency_track) | Установка Dependency-Track (мониторинг уязвимостей зависимостей) |
| [`DeDeployment`](tags/de_deployment) | Получение информации о сборке demanager |
| [`DeDisks`](tags/de_disks) | Создание и удаление дисков, получение списка и информации о дисках, изменение их размера |
| [`DeEss`](tags/de_ess) | Установка и удаление ESS (Enterprise Security Stack), получение инцидентов |
| [`DeFalco`](tags/de_falco) | Установка, проверка состояния и удаление Falco в кластере |
| [`DeFiles`](tags/de_files) | Загрузка временных файлов на сервер DE |
| [`DeGitLab`](tags/de_gitlab) | Установка GitLab (Git-репозиторий и DevOps-платформа) |
+3
View File
@@ -25,6 +25,7 @@ import (
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_dependency_track"
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_deployment"
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_disks"
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_ess"
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_falco"
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_files"
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_gitlab"
@@ -119,6 +120,7 @@ type Client struct {
DeDependencyTrack *de_dependency_track.DeDependencyTrackService
DeDeployment *de_deployment.DeDeploymentService
DeDisks *de_disks.DeDisksService
DeEss *de_ess.DeEssService
DeFalco *de_falco.DeFalcoService
DeFiles *de_files.DeFilesService
DeGitLab *de_gitlab.DeGitLabService
@@ -243,6 +245,7 @@ func NewClientWithConfig(cfg *core.Configuration) *Client {
client.DeDependencyTrack = de_dependency_track.NewAPIClient(cfg).DeDependencyTrack
client.DeDeployment = de_deployment.NewAPIClient(cfg).DeDeployment
client.DeDisks = de_disks.NewAPIClient(cfg).DeDisks
client.DeEss = de_ess.NewAPIClient(cfg).DeEss
client.DeFalco = de_falco.NewAPIClient(cfg).DeFalco
client.DeFiles = de_files.NewAPIClient(cfg).DeFiles
client.DeGitLab = de_gitlab.NewAPIClient(cfg).DeGitLab
+3
View File
@@ -3,6 +3,9 @@ module repository.basistech.ru/BASIS/de-golang-sdk
go 1.26.0
retract (
v1.0.8 // Pre-release version for DE 1.8.0, doesn't contain some changes
v1.0.7 // Pre-release version for DE 1.8.0, doesn't contain some changes
v1.0.6 // Pre-release version for DE 1.8.0, doesn't contain some changes
v1.0.5 // Pre-release version for DE 1.8.0, doesn't contain some changes
v1.0.4 // Pre-release version for DE 1.8.0, doesn't contain some changes
v1.0.3 // Pre-release version for DE 1.8.0, doesn't contain some changes
+17
View File
@@ -1256,6 +1256,10 @@ type CreateRequest struct {
InstallMonitoring bool `json:"installMonitoring" form:"installMonitoring"`
// Install CsiDynamix
InstallCsiDynamix bool `json:"installCsiDynamix" form:"installCsiDynamix"`
// Install ESS (Enterprise Security Stack)
InstallEss bool `json:"installEss" form:"installEss"`
// Auth token for ESS mutation API (required if installEss)
EssAuthToken string `json:"essAuthToken" form:"essAuthToken"`
// CertificateValidityBefore is time end of life kubernetes'certs. Example 2025-08-05T12:00:00Z, time.RFC3339
CertificateValidityBefore string `json:"certificateValidityBefore" form:"certificateValidityBefore"`
// Storage policy id (for denergy)
@@ -1270,6 +1274,12 @@ type CreateRequest struct {
ClusterTemplateDescription string `json:"clusterTemplateDescription" form:"clusterTemplateDescription"`
// Share cluster template for any users
SharedClusterTemplate bool `json:"sharedClusterTemplate" form:"sharedClusterTemplate"`
// on podkiller
Podkiller bool `json:"podkiller" form:"podkiller"`
// time to check report
RequeueInterval int64 `json:"requeueInterval" form:"requeueInterval"`
// set skip Namespaces
SkipNamespaces []string `json:"skipNamespaces,omitempty" form:"skipNamespaces,omitempty"`
}
// Create cluster
@@ -1629,6 +1639,8 @@ func (a *DeClusterService) Create(ctx context.Context, req CreateRequest) (Clust
utils.ParameterAddToHeaderOrQuery(formParams, "installCriobox", req.InstallCriobox, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "installMonitoring", req.InstallMonitoring, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "installCsiDynamix", req.InstallCsiDynamix, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "installEss", req.InstallEss, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "essAuthToken", req.EssAuthToken, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "certificateValidityBefore", req.CertificateValidityBefore, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "storagePolicyId", req.StoragePolicyID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "certificateIssuerId", req.CertificateIssuerID, "", "")
@@ -1636,6 +1648,11 @@ func (a *DeClusterService) Create(ctx context.Context, req CreateRequest) (Clust
utils.ParameterAddToHeaderOrQuery(formParams, "clusterTemplateName", req.ClusterTemplateName, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "clusterTemplateDescription", req.ClusterTemplateDescription, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "sharedClusterTemplate", req.SharedClusterTemplate, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "podkiller", req.Podkiller, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "requeueInterval", req.RequeueInterval, "", "")
if !utils.IsZeroValue(req.SkipNamespaces) {
utils.ParameterAddToHeaderOrQuery(formParams, "skipNamespaces", req.SkipNamespaces, "", "multi")
}
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
if err != nil {
+2
View File
@@ -91,6 +91,7 @@ type Cluster struct {
DynamixVersion DynamixVersion `json:"dynamixVersion,omitempty"`
// Data encryption information
Encrypted bool `json:"encrypted,omitempty"`
EssAuthToken string `json:"essAuthToken,omitempty"`
ExtVirtualAddress string `json:"extVirtualAddress,omitempty"`
// Virtual addresses
ExtVirtualAddressID int64 `json:"extVirtualAddressId,omitempty"`
@@ -112,6 +113,7 @@ type Cluster struct {
InstalledAutoscaler bool `json:"installedAutoscaler,omitempty"`
InstalledCriobox bool `json:"installedCriobox,omitempty"`
InstalledCsiDynamix bool `json:"installedCsiDynamix,omitempty"`
InstalledEss bool `json:"installedEss,omitempty"`
InstalledIntegagent bool `json:"installedIntegagent,omitempty"`
InstalledKyverno bool `json:"installedKyverno,omitempty"`
InstalledMetricServer bool `json:"installedMetricServer,omitempty"`
+9 -1
View File
@@ -44,7 +44,8 @@ type ClusterTemplate struct {
EnableCustomMasterHostnames bool `json:"enableCustomMasterHostnames,omitempty"`
EnableCustomWorkerHostnames bool `json:"enableCustomWorkerHostnames,omitempty"`
// Data encryption information
Encrypted bool `json:"encrypted,omitempty"`
Encrypted bool `json:"encrypted,omitempty"`
EssAuthToken string `json:"essAuthToken,omitempty"`
// VirtualAddresses Section
ExtVirtualAddress string `json:"extVirtualAddress,omitempty"`
ExternalLBAddresses []string `json:"externalLBAddresses,omitempty"`
@@ -59,6 +60,7 @@ type ClusterTemplate struct {
InitialSecureShellPort int64 `json:"initialSecureShellPort,omitempty"`
InstallCriobox bool `json:"installCriobox,omitempty"`
InstallCsiDynamix bool `json:"installCsiDynamix,omitempty"`
InstallEss bool `json:"installEss,omitempty"`
InstallKyverno bool `json:"installKyverno,omitempty"`
InstallMetrics bool `json:"installMetrics,omitempty"`
InstallMonitoring bool `json:"installMonitoring,omitempty"`
@@ -199,6 +201,7 @@ type CreateClusterRequest struct {
EnableCustomLoadBalancerHostnames bool `json:"enableCustomLoadBalancerHostnames"`
EnableCustomMasterHostnames bool `json:"enableCustomMasterHostnames"`
EnableCustomWorkerHostnames bool `json:"enableCustomWorkerHostnames"`
EssAuthToken string `json:"essAuthToken"`
// VirtualAddresses Section
ExtVirtualAddress string `json:"extVirtualAddress"`
ExternalLBAddresses []string `json:"externalLBAddresses,omitempty"`
@@ -212,6 +215,7 @@ type CreateClusterRequest struct {
InitialSecureShellPort int64 `json:"initialSecureShellPort"`
InstallCriobox bool `json:"installCriobox"`
InstallCsiDynamix bool `json:"installCsiDynamix"`
InstallEss bool `json:"installEss"`
InstallKyverno bool `json:"installKyverno"`
InstallMetrics bool `json:"installMetrics"`
InstallMonitoring bool `json:"installMonitoring"`
@@ -257,9 +261,13 @@ type CreateClusterRequest struct {
MastersDynamixSEPID int64 `json:"mastersDynamixSEPId"`
MastersDynamixSEPPool string `json:"mastersDynamixSEPPool"`
PackageRepository int64 `json:"packageRepository"`
Podkiller bool `json:"podkiller"`
ProvideDNS bool `json:"provideDNS"`
RequeueInterval int64 `json:"requeueInterval"`
SaveComputesOnFailedK8SCreation bool `json:"saveComputesOnFailedK8SCreation"`
Severities []string `json:"severities,omitempty"`
SharedClusterTemplate bool `json:"sharedClusterTemplate"`
SkipNamespaces []string `json:"skipNamespaces,omitempty"`
StoragePolicyID int64 `json:"storagePolicyId"`
UseCustomExternalLBAddresses bool `json:"useCustomExternalLBAddresses"`
UseCustomInternalLBAddresses bool `json:"useCustomInternalLBAddresses"`
-6
View File
@@ -112,8 +112,6 @@ type InstallRequest struct {
ChartsRepositoryID int64 `json:"chartsRepositoryId" form:"chartsRepositoryId"`
// namespace
Namespace string `json:"namespace" form:"namespace"`
// custom csi-driver name
CsiDriverName string `json:"csiDriverName" form:"csiDriverName"`
// SEP pool ID for the cluster (for dynamix type)
DynamixSEPID int64 `json:"dynamixSepId" form:"dynamixSepId"`
// SEP pool name for the cluster (for dynamix type)
@@ -181,7 +179,6 @@ func (a *DeCsidynamixService) Install(ctx context.Context, req InstallRequest) (
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "csiDriverName", req.CsiDriverName, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixSepId", req.DynamixSEPID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPool", req.DynamixPool, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixStoragePolicyId", req.DynamixStoragePolicyID, "", "")
@@ -247,8 +244,6 @@ type ReinstallRequest struct {
ChartsRepositoryID int64 `json:"chartsRepositoryId" form:"chartsRepositoryId"`
// namespace
Namespace string `json:"namespace" form:"namespace"`
// custom csi-driver name
CsiDriverName string `json:"csiDriverName" form:"csiDriverName"`
// SEP pool ID for the cluster (for dynamix type)
DynamixSEPID int64 `json:"dynamixSepId" form:"dynamixSepId"`
// SEP pool name for the cluster (for dynamix type)
@@ -316,7 +311,6 @@ func (a *DeCsidynamixService) Reinstall(ctx context.Context, req ReinstallReques
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "csiDriverName", req.CsiDriverName, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixSepId", req.DynamixSEPID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPool", req.DynamixPool, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixStoragePolicyId", req.DynamixStoragePolicyID, "", "")
-5
View File
@@ -125,8 +125,6 @@ type InstallRequest struct {
// Required.
ReleaseNamespace string `json:"releaseNamespace" form:"releaseNamespace"`
// Hostname for custom app
//
// Required.
Hostname string `json:"hostname" form:"hostname"`
// Install timeout in minutes. Max is 60 minutes, min is 5 minutes. If not specified, default timeout of 10 minutes will be used
InstallTimeout int64 `json:"installTimeout" form:"installTimeout"`
@@ -159,9 +157,6 @@ func (a *DeCustomAppService) Install(ctx context.Context, req InstallRequest) (C
if utils.IsRequiredParamMissing(req.ReleaseNamespace) {
missingRequiredParams = append(missingRequiredParams, "releaseNamespace")
}
if utils.IsRequiredParamMissing(req.Hostname) {
missingRequiredParams = append(missingRequiredParams, "hostname")
}
if len(missingRequiredParams) > 0 {
return result, utils.MissingRequiredParamsError(missingRequiredParams)
}
+421
View File
@@ -0,0 +1,421 @@
// Code generated by OpenAPI Generator; DO NOT EDIT.
package de_ess
import (
"context"
"fmt"
"net/http"
"net/url"
"repository.basistech.ru/BASIS/de-golang-sdk/core"
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
)
type DeEssService service
type DescribeRequest struct {
// cluster ID
//
// Required.
ClusterID int64 `json:"clusterId" form:"clusterId"`
// check whether installed in cluster
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
// return rules actually loaded on each node
CheckRules bool `json:"checkRules" form:"checkRules"`
}
// Get ess info in cluster: version, daemonset state, agents status per node, events losses. With checkRules additionally - loaded rules per node
func (a *DeEssService) Describe(ctx context.Context, req DescribeRequest) (DescribeEssResult, error) {
var (
method = http.MethodPost
requestBody any
formFiles []utils.FormFile
result DescribeEssResult
)
headerParams := make(map[string]string)
queryParams := url.Values{}
formParams := url.Values{}
missingRequiredParams := make([]string, 0)
if utils.IsRequiredParamMissing(req.ClusterID) {
missingRequiredParams = append(missingRequiredParams, "clusterId")
}
if len(missingRequiredParams) > 0 {
return result, utils.MissingRequiredParamsError(missingRequiredParams)
}
basePath := a.client.BaseURL()
requestPath := basePath + "/digitalenergy/ess/describe"
contentTypes := []string{"application/x-www-form-urlencoded"}
contentType := utils.SelectHeaderContentType(contentTypes)
if contentType != "" {
headerParams["Content-Type"] = contentType
}
accepts := []string{"application/json"}
accept := utils.SelectHeaderAccept(accepts)
if accept != "" {
headerParams["Accept"] = accept
}
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "checkRules", req.CheckRules, "", "")
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
if err != nil {
return result, fmt.Errorf("prepare request: %w", err)
}
resp, err := a.client.CallAPI(httpReq, false)
if err != nil {
return result, err
}
respBody, err := utils.ReadResponseBody(resp)
if err != nil {
return result, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
httpErr := &core.HTTPError{
StatusCode: resp.StatusCode,
Header: resp.Header.Clone(),
Body: respBody,
}
return result, httpErr
}
var wrappedResp DescribeEssResultWithError
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
if err != nil {
return result, fmt.Errorf("decode response body: %w", err)
}
if wrappedResp.Error {
return result, &core.BackendError{
Code: wrappedResp.ErrorCode,
Message: wrappedResp.Message,
}
}
result = wrappedResp.Result
return result, nil
}
type IncidentsRequest struct {
// cluster ID
ClusterID int64 `json:"clusterId" form:"clusterId"`
// Incident severity
//
// Allowed values:
// - "Critical"
// - "High"
// - "Medium"
// - "Low"
Severity string `json:"severity" form:"severity"`
// rule name
RuleID string `json:"ruleId" form:"ruleId"`
// agent node name
AgentNode string `json:"agentNode" form:"agentNode"`
// substring of AuditRecord message
Message string `json:"message" form:"message"`
// limit of items in response
Limit int64 `json:"limit" form:"limit"`
// offset of items in response
Offset int64 `json:"offset" form:"offset"`
}
// List ess incidents collected by background collector
func (a *DeEssService) Incidents(ctx context.Context, req IncidentsRequest) (ListEssIncidentsResult, error) {
var (
method = http.MethodPost
requestBody any
formFiles []utils.FormFile
result ListEssIncidentsResult
)
headerParams := make(map[string]string)
queryParams := url.Values{}
formParams := url.Values{}
if !utils.IsZeroValue(req.Severity) {
severityValue := req.Severity
severityAllowedValues := []string{
"Critical",
"High",
"Medium",
"Low",
}
severityValid := false
for _, allowed := range severityAllowedValues {
if severityValue == allowed {
severityValid = true
break
}
}
if !severityValid {
return result, fmt.Errorf("severity must be one of %v", severityAllowedValues)
}
}
basePath := a.client.BaseURL()
requestPath := basePath + "/digitalenergy/ess/incidents"
contentTypes := []string{"application/x-www-form-urlencoded"}
contentType := utils.SelectHeaderContentType(contentTypes)
if contentType != "" {
headerParams["Content-Type"] = contentType
}
accepts := []string{"application/json"}
accept := utils.SelectHeaderAccept(accepts)
if accept != "" {
headerParams["Accept"] = accept
}
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "severity", req.Severity, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "ruleId", req.RuleID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "agentNode", req.AgentNode, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "message", req.Message, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "limit", req.Limit, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "offset", req.Offset, "", "")
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
if err != nil {
return result, fmt.Errorf("prepare request: %w", err)
}
resp, err := a.client.CallAPI(httpReq, false)
if err != nil {
return result, err
}
respBody, err := utils.ReadResponseBody(resp)
if err != nil {
return result, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
httpErr := &core.HTTPError{
StatusCode: resp.StatusCode,
Header: resp.Header.Clone(),
Body: respBody,
}
return result, httpErr
}
var wrappedResp ListEssIncidentsResultWithError
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
if err != nil {
return result, fmt.Errorf("decode response body: %w", err)
}
if wrappedResp.Error {
return result, &core.BackendError{
Code: wrappedResp.ErrorCode,
Message: wrappedResp.Message,
}
}
result = wrappedResp.Result
return result, nil
}
type InstallRequest struct {
// cluster ID
//
// Required.
ClusterID int64 `json:"clusterId" form:"clusterId"`
// auth token for ess mutation API
//
// Required.
AuthToken string `json:"authToken" form:"authToken"`
// images apps repository ID. If the ID is zero or the value is empty, the default images apps repository will be used.
AppsRepositoryID int64 `json:"appsRepositoryId" form:"appsRepositoryId"`
// charts repository ID. If the ID is zero or the value is empty, the default charts repository will be used.
ChartsRepositoryID int64 `json:"chartsRepositoryId" form:"chartsRepositoryId"`
// download chart anyway
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
}
// Install ess in cluster
func (a *DeEssService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
var (
method = http.MethodPost
requestBody any
formFiles []utils.FormFile
result CreateTaskResult
)
headerParams := make(map[string]string)
queryParams := url.Values{}
formParams := url.Values{}
missingRequiredParams := make([]string, 0)
if utils.IsRequiredParamMissing(req.ClusterID) {
missingRequiredParams = append(missingRequiredParams, "clusterId")
}
if utils.IsRequiredParamMissing(req.AuthToken) {
missingRequiredParams = append(missingRequiredParams, "authToken")
}
if len(missingRequiredParams) > 0 {
return result, utils.MissingRequiredParamsError(missingRequiredParams)
}
basePath := a.client.BaseURL()
requestPath := basePath + "/digitalenergy/ess/install"
contentTypes := []string{"application/x-www-form-urlencoded"}
contentType := utils.SelectHeaderContentType(contentTypes)
if contentType != "" {
headerParams["Content-Type"] = contentType
}
accepts := []string{"application/json"}
accept := utils.SelectHeaderAccept(accepts)
if accept != "" {
headerParams["Accept"] = accept
}
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "authToken", req.AuthToken, "", "")
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
if err != nil {
return result, fmt.Errorf("prepare request: %w", err)
}
resp, err := a.client.CallAPI(httpReq, false)
if err != nil {
return result, err
}
respBody, err := utils.ReadResponseBody(resp)
if err != nil {
return result, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
httpErr := &core.HTTPError{
StatusCode: resp.StatusCode,
Header: resp.Header.Clone(),
Body: respBody,
}
return result, httpErr
}
var wrappedResp CreateTaskResultWithError
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
if err != nil {
return result, fmt.Errorf("decode response body: %w", err)
}
if wrappedResp.Error {
return result, &core.BackendError{
Code: wrappedResp.ErrorCode,
Message: wrappedResp.Message,
}
}
result = wrappedResp.Result
return result, nil
}
type UninstallRequest struct {
// cluster ID
//
// Required.
ClusterID int64 `json:"clusterId" form:"clusterId"`
}
// Uninstall ess from cluster: daemonset, configmaps, api auth secret, serviceaccount, clusterrole and clusterrolebinding, service, namespace
func (a *DeEssService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
var (
method = http.MethodPost
requestBody any
formFiles []utils.FormFile
result CreateTaskResult
)
headerParams := make(map[string]string)
queryParams := url.Values{}
formParams := url.Values{}
missingRequiredParams := make([]string, 0)
if utils.IsRequiredParamMissing(req.ClusterID) {
missingRequiredParams = append(missingRequiredParams, "clusterId")
}
if len(missingRequiredParams) > 0 {
return result, utils.MissingRequiredParamsError(missingRequiredParams)
}
basePath := a.client.BaseURL()
requestPath := basePath + "/digitalenergy/ess/uninstall"
contentTypes := []string{"application/x-www-form-urlencoded"}
contentType := utils.SelectHeaderContentType(contentTypes)
if contentType != "" {
headerParams["Content-Type"] = contentType
}
accepts := []string{"application/json"}
accept := utils.SelectHeaderAccept(accepts)
if accept != "" {
headerParams["Accept"] = accept
}
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
if err != nil {
return result, fmt.Errorf("prepare request: %w", err)
}
resp, err := a.client.CallAPI(httpReq, false)
if err != nil {
return result, err
}
respBody, err := utils.ReadResponseBody(resp)
if err != nil {
return result, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
httpErr := &core.HTTPError{
StatusCode: resp.StatusCode,
Header: resp.Header.Clone(),
Body: respBody,
}
return result, httpErr
}
var wrappedResp CreateTaskResultWithError
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
if err != nil {
return result, fmt.Errorf("decode response body: %w", err)
}
if wrappedResp.Error {
return result, &core.BackendError{
Code: wrappedResp.ErrorCode,
Message: wrappedResp.Message,
}
}
result = wrappedResp.Result
return result, nil
}
+27
View File
@@ -0,0 +1,27 @@
// Code generated by OpenAPI Generator; DO NOT EDIT.
package de_ess
import (
"repository.basistech.ru/BASIS/de-golang-sdk/core"
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
)
type APIClient struct {
common service
DeEss *DeEssService
}
type service struct {
client *utils.Client
}
func NewAPIClient(cfg *core.Configuration) *APIClient {
c := &APIClient{}
c.common.client = utils.NewClient(cfg)
c.DeEss = (*DeEssService)(&c.common)
return c
}
+87
View File
@@ -0,0 +1,87 @@
// Code generated by internal codegen utility; DO NOT EDIT.
package de_ess
type AgentStatus struct {
AttachedPrograms int64 `json:"attachedPrograms,omitempty"`
Error string `json:"error,omitempty"`
EventsDropped int64 `json:"eventsDropped,omitempty"`
Healthy bool `json:"healthy,omitempty"`
Mode string `json:"mode,omitempty"`
NodeName string `json:"nodeName,omitempty"`
PodName string `json:"podName,omitempty"`
ProgramLoaded bool `json:"programLoaded,omitempty"`
RingbufReaderAlive bool `json:"ringbufReaderAlive,omitempty"`
RulesLoaded int64 `json:"rulesLoaded,omitempty"`
}
type DaemonSetStatus struct {
DesiredNumberScheduled int64 `json:"desiredNumberScheduled,omitempty"`
Name string `json:"name,omitempty"`
NumberAvailable int64 `json:"numberAvailable,omitempty"`
NumberReady int64 `json:"numberReady,omitempty"`
}
type DescribeEssResult struct {
Agents []AgentStatus `json:"agents,omitempty"`
AuthToken string `json:"authToken,omitempty"`
DaemonSet DaemonSetStatus `json:"daemonSet,omitempty"`
Installed bool `json:"installed,omitempty"`
NodesCount int64 `json:"nodesCount,omitempty"`
Registered bool `json:"registered,omitempty"`
Rules []NodeRules `json:"rules,omitempty"`
Version string `json:"version,omitempty"`
}
type DescribeEssResultWithError struct {
Error bool `json:"error,omitempty"`
ErrorCode int64 `json:"errorCode,omitempty"`
Message string `json:"message,omitempty"`
Result DescribeEssResult `json:"result,omitempty"`
}
type EssIncident struct {
Action string `json:"action,omitempty"`
AgentNode string `json:"agentNode,omitempty"`
AgentPod string `json:"agentPod,omitempty"`
ClusterID int64 `json:"clusterId,omitempty"`
CollectedAt string `json:"collectedAt,omitempty"`
ContainerID string `json:"containerId,omitempty"`
EssRecordID string `json:"essRecordId,omitempty"`
Message string `json:"message,omitempty"`
OccurredAt string `json:"occurredAt,omitempty"`
OwnerID int64 `json:"ownerId,omitempty"`
Rule string `json:"rule,omitempty"`
Severity string `json:"severity,omitempty"`
Source string `json:"source,omitempty"`
Status string `json:"status,omitempty"`
}
type ListEssIncidentsResult struct {
Items []EssIncident `json:"items,omitempty"`
Limit int64 `json:"limit,omitempty"`
Offset int64 `json:"offset,omitempty"`
Total int64 `json:"total,omitempty"`
}
type ListEssIncidentsResultWithError struct {
Error bool `json:"error,omitempty"`
ErrorCode int64 `json:"errorCode,omitempty"`
Message string `json:"message,omitempty"`
Result ListEssIncidentsResult `json:"result,omitempty"`
}
type NodeRules struct {
Error string `json:"error,omitempty"`
NodeName string `json:"nodeName,omitempty"`
PodName string `json:"podName,omitempty"`
Rules []RuleSummary `json:"rules,omitempty"`
RulesEnabled int64 `json:"rulesEnabled,omitempty"`
RulesTotal int64 `json:"rulesTotal,omitempty"`
}
type RuleSummary struct {
Name string `json:"name,omitempty"`
Priority string `json:"priority,omitempty"`
Tags []string `json:"tags,omitempty"`
}
+10
View File
@@ -0,0 +1,10 @@
// Code generated by internal codegen utility; DO NOT EDIT.
package de_ess
import (
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
)
type CreateTaskResult = shared.CreateTaskResult
type CreateTaskResultWithError = shared.CreateTaskResultWithError
-3
View File
@@ -112,8 +112,6 @@ type InstallRequest struct {
//
// Required.
ClusterID int64 `json:"clusterId" form:"clusterId"`
// hostname for integagent
IntegagentHostname string `json:"integagentHostname" form:"integagentHostname"`
// images apps repository ID. If the ID is zero or the value is empty, the default images apps repository will be used.
AppsRepositoryID int64 `json:"appsRepositoryId" form:"appsRepositoryId"`
// charts repository ID. If the ID is zero or the value is empty, the default charts repository will be used.
@@ -160,7 +158,6 @@ func (a *DeFalcoService) Install(ctx context.Context, req InstallRequest) (Creat
}
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
-3
View File
@@ -116,8 +116,6 @@ type InstallRequest struct {
//
// Required.
Hostname string `json:"hostname" form:"hostname"`
// Hostname for integagent
IntegagentHostname string `json:"integagentHostname" form:"integagentHostname"`
// images apps repository ID. If the ID is zero or the value is empty, the default images apps repository will be used.
AppsRepositoryID int64 `json:"appsRepositoryId" form:"appsRepositoryId"`
// charts repository ID. If the ID is zero or the value is empty, the default charts repository will be used.
@@ -170,7 +168,6 @@ func (a *DeIstioService) Install(ctx context.Context, req InstallRequest) (Creat
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
-3
View File
@@ -112,8 +112,6 @@ type InstallRequest struct {
//
// Required.
ClusterID int64 `json:"clusterId" form:"clusterId"`
// Hostname for integagent
IntegagentHostname string `json:"integagentHostname" form:"integagentHostname"`
// images apps repository ID. If the ID is zero or the value is empty, the default images apps repository will be used.
AppsRepositoryID int64 `json:"appsRepositoryId" form:"appsRepositoryId"`
// charts repository ID. If the ID is zero or the value is empty, the default charts repository will be used.
@@ -162,7 +160,6 @@ func (a *DeOpenELBService) Install(ctx context.Context, req InstallRequest) (Cre
}
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
+12 -1
View File
@@ -105,7 +105,7 @@ func (a *DeTrivyService) Describe(ctx context.Context, req DescribeRequest) (Des
}
type InstallRequest struct {
// Cluster ID
// cluster ID
//
// Required.
ClusterID int64 `json:"clusterId" form:"clusterId"`
@@ -115,6 +115,12 @@ type InstallRequest struct {
ChartsRepositoryID int64 `json:"chartsRepositoryId" form:"chartsRepositoryId"`
// download chart anyway
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
// on podkiller
Podkiller bool `json:"podkiller" form:"podkiller"`
// time to check report
RequeueInterval int64 `json:"requeueInterval" form:"requeueInterval"`
// set skip Namespaces
SkipNamespaces []string `json:"skipNamespaces,omitempty" form:"skipNamespaces,omitempty"`
}
// Install Trivy
@@ -158,6 +164,11 @@ func (a *DeTrivyService) Install(ctx context.Context, req InstallRequest) (Insta
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "podkiller", req.Podkiller, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "requeueInterval", req.RequeueInterval, "", "")
if !utils.IsZeroValue(req.SkipNamespaces) {
utils.ParameterAddToHeaderOrQuery(formParams, "skipNamespaces", req.SkipNamespaces, "", "multi")
}
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
if err != nil {
+4
View File
@@ -135,6 +135,8 @@ type CloudAPIComputeItemCompute struct {
Disks []CloudAPIComputeInfoDisk `json:"disks,omitempty"`
// Driver
Driver string `json:"driver,omitempty"`
// Folder ID
FolderID int64 `json:"folder_id,omitempty"`
// Grid ID
GID int64 `json:"gid,omitempty"`
// GUID
@@ -562,6 +564,8 @@ type CloudAPIComputeRecordCompute struct {
Disks []CloudAPIComputeItemComputeDisk `json:"disks,omitempty"`
// Driver
Driver string `json:"driver,omitempty"`
// Folder ID
FolderID int64 `json:"folder_id,omitempty"`
// Grid ID
GID int64 `json:"gid,omitempty"`
// GUID
+11 -1
View File
@@ -3,7 +3,7 @@
package dx_disks
type ListDiskTypesResult struct {
Records []any `json:"records,omitempty"`
Records []SEPData `json:"records,omitempty"`
}
type ListDiskTypesResultWithError struct {
@@ -12,3 +12,13 @@ type ListDiskTypesResultWithError struct {
Message string `json:"message,omitempty"`
Result ListDiskTypesResult `json:"result,omitempty"`
}
type SEPData struct {
Pools []SEPPool `json:"pools,omitempty"`
SEPID int64 `json:"sepId,omitempty"`
SEPName string `json:"sepName,omitempty"`
}
type SEPPool struct {
Name string `json:"name,omitempty"`
}
+8 -14
View File
@@ -19,19 +19,6 @@ type CloudAPIExtNetExcluded struct {
VMID int64 `json:"vmId,omitempty"`
}
type CloudAPIExtNetItemExtNet struct {
// Free IPs
FreeIPs int64 `json:"freeIps,omitempty"`
// ID
ID int64 `json:"id,omitempty"`
// IPCIDR
IPCIDR string `json:"ipcidr,omitempty"`
// Name
Name string `json:"name,omitempty"`
// Status
Status string `json:"status,omitempty"`
}
type CloudAPIExtNetItemReservation struct {
// Account ID
AccountID int64 `json:"account_id,omitempty"`
@@ -148,6 +135,13 @@ type CloudAPIExtNetVNFs struct {
DHCP int64 `json:"dhcp,omitempty"`
}
type ExtNet struct {
ID int64 `json:"id,omitempty"`
IPCIDR string `json:"ipcidr,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
}
type GetExtNetResult struct {
Record CloudAPIExtNetRecordExtNet `json:"record,omitempty"`
}
@@ -160,7 +154,7 @@ type GetExtNetResultWithError struct {
}
type ListExtNetResult struct {
Records []CloudAPIExtNetItemExtNet `json:"records,omitempty"`
Records []ExtNet `json:"records,omitempty"`
}
type ListExtNetResultWithError struct {
+6 -20
View File
@@ -2,25 +2,6 @@
package dx_k8ci
type CloudAPIK8CIItemK8CI struct {
// Created time
CreatedTime int64 `json:"createdTime,omitempty"`
// Description
Desc string `json:"desc,omitempty"`
// ID
ID int64 `json:"id,omitempty"`
// LB image ID
LBImageID int64 `json:"lbImageId,omitempty"`
// Name
Name string `json:"name,omitempty"`
// Network plugins
NetworkPlugins []string `json:"networkPlugins,omitempty"`
// Status
Status string `json:"status,omitempty"`
// Version
Version string `json:"version,omitempty"`
}
type CloudAPIK8CIRecordK8CI struct {
// Description
Desc string `json:"desc,omitempty"`
@@ -45,8 +26,13 @@ type GetK8CIResultWithError struct {
Result GetK8CIResult `json:"result,omitempty"`
}
type K8CI struct {
ID int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
type ListK8CIResult struct {
Records []CloudAPIK8CIItemK8CI `json:"records,omitempty"`
Records []K8CI `json:"records,omitempty"`
}
type ListK8CIResultWithError struct {
+7 -67
View File
@@ -19,72 +19,6 @@ type CloudAPIRGItemACL struct {
UserGroupID string `json:"userGroupId,omitempty"`
}
type CloudAPIRGItemResourceGroup struct {
AccountACL CloudAPIRGItemACL `json:"accountAcl,omitempty"`
// Account ID
AccountID int64 `json:"accountId,omitempty"`
// Account name
AccountName string `json:"accountName,omitempty"`
// Access Control List
ACL []CloudAPIRGItemACL `json:"acl,omitempty"`
// Compute Features
ComputeFeatures []string `json:"computeFeatures,omitempty"`
// CPU allocation parameter
CPUAllocationParameter string `json:"cpu_allocation_parameter,omitempty"`
// CPU allocation ratio
CPUAllocationRatio int64 `json:"cpu_allocation_ratio,omitempty"`
// Created by
CreatedBy string `json:"createdBy,omitempty"`
// Created time
CreatedTime int64 `json:"createdTime,omitempty"`
// DefNetID
DefNetID int64 `json:"def_net_id,omitempty"`
// DefNetType
DefNetType string `json:"def_net_type,omitempty"`
// Deleted by
DeletedBy string `json:"deletedBy,omitempty"`
// Deleted time
DeletedTime int64 `json:"deletedTime,omitempty"`
// Description
Desc string `json:"desc,omitempty"`
// Dirty
Dirty bool `json:"dirty,omitempty"`
// Grid ID
GID int64 `json:"gid,omitempty"`
// GUID
GUID int64 `json:"guid,omitempty"`
// ID
ID int64 `json:"id,omitempty"`
// Lock status
LockStatus string `json:"lockStatus,omitempty"`
// Milestones
Milestones int64 `json:"milestones,omitempty"`
// Name
Name string `json:"name,omitempty"`
// Resource limits
ResourceLimits CloudAPIRGResourceLimits `json:"resourceLimits,omitempty"`
// List of resource types
ResourceTypes []string `json:"resourceTypes,omitempty"`
// SDN access group id
SDNAccessGroupID string `json:"sdn_access_group_id,omitempty"`
// Secret
Secret string `json:"secret,omitempty"`
// Status
Status string `json:"status,omitempty"`
// Storage policy ids
StoragePolicyIDs []int64 `json:"storage_policy_ids,omitempty"`
// UniqPools
UniqPools []string `json:"uniqPools,omitempty"`
// Updated by
UpdatedBy string `json:"updatedBy,omitempty"`
// Updated time
UpdatedTime int64 `json:"updatedTime,omitempty"`
// List of VINS IDs
ViNS []int64 `json:"vins,omitempty"`
// List of compute IDs
VMs []int64 `json:"vms,omitempty"`
}
type CloudAPIRGRecordResourceGroup struct {
// Account ID
AccountID int64 `json:"accountId,omitempty"`
@@ -184,7 +118,7 @@ type GetRGResultWithError struct {
}
type ListRGResult struct {
Records []CloudAPIRGItemResourceGroup `json:"records,omitempty"`
Records []ResourceGroup `json:"records,omitempty"`
}
type ListRGResultWithError struct {
@@ -193,3 +127,9 @@ type ListRGResultWithError struct {
Message string `json:"message,omitempty"`
Result ListRGResult `json:"result,omitempty"`
}
type ResourceGroup struct {
AccountID int64 `json:"accountId,omitempty"`
ID int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
+8 -33
View File
@@ -3,38 +3,14 @@
package dx_sp
type AccessSEPPool struct {
// Pool names
PoolNames []string `json:"pool_names,omitempty"`
// SEP ID
SEPID int64 `json:"sep_id,omitempty"`
// SEP name
SEPName string `json:"sep_name,omitempty"`
}
type ItemStoragePolicy struct {
// List of pools in SEP for storage policy
AccessSEPsPools []AccessSEPPool `json:"access_seps_pools,omitempty"`
// Description of the storage policy
Description string `json:"description,omitempty"`
// GUID
GUID int64 `json:"guid,omitempty"`
// ID of the storage policy
ID int64 `json:"id,omitempty"`
// Max IOPS for the sotrage policy
LimitIOPS int64 `json:"limit_iops,omitempty"`
// Name of the storage policy
Name string `json:"name,omitempty"`
// Status of the storage policy
Status string `json:"status,omitempty"`
// Storage policy ID
StoragePolicyID int64 `json:"storage_policy_id,omitempty"`
// Which accounts and resource groups use the storage policy
Usage Usage `json:"usage,omitempty"`
SEPID int64 `json:"sep_id,omitempty"`
SEPName string `json:"sep_name,omitempty"`
}
type ListSecurityPoliciesResult struct {
DxVersion Version `json:"dxVersion,omitempty"`
Records []ItemStoragePolicy `json:"records,omitempty"`
DxVersion Version `json:"dxVersion,omitempty"`
Records []StoragePolicy `json:"records,omitempty"`
}
type ListSecurityPoliciesResultWithError struct {
@@ -44,9 +20,8 @@ type ListSecurityPoliciesResultWithError struct {
Result ListSecurityPoliciesResult `json:"result,omitempty"`
}
type Usage struct {
// List of accounts
Accounts []int64 `json:"accounts,omitempty"`
// List of resource groups
Resgroups []int64 `json:"resgroups,omitempty"`
type StoragePolicy struct {
AccessSEPsPools []AccessSEPPool `json:"access_seps_pools,omitempty"`
ID int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
+9 -40
View File
@@ -49,45 +49,6 @@ type CloudAPIViNSItemRoutes struct {
NetMask string `json:"netmask,omitempty"`
}
type CloudAPIViNSItemViNS struct {
// Account ID
AccountID int64 `json:"accountId,omitempty"`
// Account name
AccountName string `json:"accountName,omitempty"`
// Created by
CreatedBy string `json:"createdBy,omitempty"`
// Created time
CreatedTime int64 `json:"createdTime,omitempty"`
// Deleted by
DeletedBy string `json:"deletedBy,omitempty"`
// Deleted time
DeletedTime int64 `json:"deletedTime,omitempty"`
// External IP
ExternalIP string `json:"externalIP,omitempty"`
// Extnet ID
ExtNetID int64 `json:"extnetId,omitempty"`
// Free IPs
FreeIPs int64 `json:"freeIPs,omitempty"`
// ID
ID int64 `json:"id,omitempty"`
// Name
Name string `json:"name,omitempty"`
// Network
Network string `json:"network,omitempty"`
// Resource group ID
RGID int64 `json:"rgId,omitempty"`
// Resource group name
RGName string `json:"rgName,omitempty"`
// Status
Status string `json:"status,omitempty"`
// Updated by
UpdatedBy string `json:"updatedBy,omitempty"`
// Updated time
UpdatedTime int64 `json:"updatedTime,omitempty"`
// VXLAN ID
VXLANID int64 `json:"vxlanId,omitempty"`
}
type CloudAPIViNSItemViNSCompute struct {
// ID
ID int64 `json:"id,omitempty"`
@@ -516,7 +477,7 @@ type GetViNSResultWithError struct {
}
type ListViNSResult struct {
Records []CloudAPIViNSItemViNS `json:"records,omitempty"`
Records []ViNS `json:"records,omitempty"`
}
type ListViNSResultWithError struct {
@@ -525,3 +486,11 @@ type ListViNSResultWithError struct {
Message string `json:"message,omitempty"`
Result ListViNSResult `json:"result,omitempty"`
}
type ViNS struct {
ExtNetID int64 `json:"extnetId,omitempty"`
ID int64 `json:"id,omitempty"`
Network string `json:"network,omitempty"`
RGID int64 `json:"rgId,omitempty"`
Status string `json:"status,omitempty"`
}