This commit is contained in:
q committed 2026-09-04 17:50:58 +03:00
1 parent e7f605ec8c
commit dfe95e7ee4
12 files changed
+490 -79

No files matched your search

+13 -4
View File
@@ -716,6 +716,12 @@ type AddWorkersRequest struct {
//
// Required.
WorkerCount int64 `json:"workerCount" form:"workerCount"`
// Dynamix RG ID
DynamixRGID int64 `json:"dynamixRGId" form:"dynamixRGId"`
// Dynamix SEP ID
DynamixSEPID int64 `json:"dynamixSEPId" form:"dynamixSEPId"`
// Dynamix SEP pool
DynamixSEPPool string `json:"dynamixSEPPool" form:"dynamixSEPPool"`
// WorkerGroupId
WorkerGroupID int64 `json:"workerGroupId" form:"workerGroupId"`
// worker gpu ids (for denergy type)
@@ -866,6 +872,9 @@ func (a *DeClusterService) AddWorkers(ctx context.Context, req AddWorkersRequest
headerParams["Accept"] = accept
}
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixRGId", req.DynamixRGID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixSEPId", req.DynamixSEPID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixSEPPool", req.DynamixSEPPool, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupId", req.WorkerGroupID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "workerCount", req.WorkerCount, "", "")
@@ -1030,9 +1039,9 @@ type CreateRequest struct {
// iLoadBalancer's input data for cloud-init facility
ILoadBalancerCloudInit string `json:"iLoadBalancerCloudInit" form:"iLoadBalancerCloudInit"`
// Use custom external loadBalancer addresses (for denergy type)
UseCustomExternalLBAddreses bool `json:"useCustomExternalLBAddreses" form:"useCustomExternalLBAddreses"`
UseCustomExternalLBAddresses bool `json:"useCustomExternalLBAddresses" form:"useCustomExternalLBAddresses"`
// Use custom internal loadBalancer addresses (for denergy type)
UseCustomInternalLBAddreses bool `json:"useCustomInternalLBAddreses" form:"useCustomInternalLBAddreses"`
UseCustomInternalLBAddresses bool `json:"useCustomInternalLBAddresses" form:"useCustomInternalLBAddresses"`
// List of external loadBalancers IP addresses (for denergy types)
ExternalLBAddresses []string `json:"externalLBAddresses,omitempty" form:"externalLBAddresses,omitempty"`
// List of internal loadBalancers IP addresses (for denergy types)
@@ -1424,8 +1433,8 @@ func (a *DeClusterService) Create(ctx context.Context, req CreateRequest) (Clust
utils.ParameterAddToHeaderOrQuery(formParams, "iLoadBalancerGpuIds", req.ILoadBalancerGPUIDs, "", "multi")
}
utils.ParameterAddToHeaderOrQuery(formParams, "iLoadBalancerCloudInit", req.ILoadBalancerCloudInit, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "useCustomExternalLBAddreses", req.UseCustomExternalLBAddreses, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "useCustomInternalLBAddreses", req.UseCustomInternalLBAddreses, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "useCustomExternalLBAddresses", req.UseCustomExternalLBAddresses, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "useCustomInternalLBAddresses", req.UseCustomInternalLBAddresses, "", "")
if !utils.IsZeroValue(req.ExternalLBAddresses) {
utils.ParameterAddToHeaderOrQuery(formParams, "externalLBAddresses", req.ExternalLBAddresses, "", "multi")
}
+10 -9
View File
@@ -25,16 +25,17 @@ type Cluster struct {
DomainResolvers []string `json:"domainResolvers,omitempty"`
DynamixCIID int64 `json:"dynamixCIId,omitempty"`
DynamixCreateTaskID string `json:"dynamixCreateTaskId,omitempty"`
DynamixID int64 `json:"dynamixId,omitempty"`
DynamixK8CIID int64 `json:"dynamixK8CIId,omitempty"`
DynamixOwnerID int64 `json:"dynamixOwnerId,omitempty"`
DynamixRGID int64 `json:"dynamixRGId,omitempty"`
DynamixSEPID int64 `json:"dynamixSEPId,omitempty"`
DynamixSEPPool string `json:"dynamixSEPPool,omitempty"`
DynamixStatus string `json:"dynamixStatus,omitempty"`
DynamixTechStatus string `json:"dynamixTechStatus,omitempty"`
// Dynamyx data
DynamixID int64 `json:"dynamixId,omitempty"`
DynamixK8CIID int64 `json:"dynamixK8CIId,omitempty"`
DynamixOwnerID int64 `json:"dynamixOwnerId,omitempty"`
DynamixRGID int64 `json:"dynamixRGId,omitempty"`
DynamixSEPID int64 `json:"dynamixSEPId,omitempty"`
DynamixSEPPool string `json:"dynamixSEPPool,omitempty"`
DynamixStatus string `json:"dynamixStatus,omitempty"`
DynamixTechStatus string `json:"dynamixTechStatus,omitempty"`
DynamixVersion DynamixVersion `json:"dynamixVersion,omitempty"`
DynamixURL string `json:"dynamixURL,omitempty"`
DynamixVersion DynamixVersion `json:"dynamixVersion,omitempty"`
// Data encryption information
Encrypted bool `json:"encrypted,omitempty"`
ExtVirtualAddress string `json:"extVirtualAddress,omitempty"`
+4 -4
View File
@@ -110,8 +110,8 @@ type ClusterTemplate struct {
SaveComputesOnFailedK8SCreation bool `json:"saveComputesOnFailedK8SCreation,omitempty"`
Shared bool `json:"shared,omitempty"`
StoragePolicyID int64 `json:"storagePolicyID,omitempty"`
UseCustomExternalLBAddreses bool `json:"useCustomExternalLBAddreses,omitempty"`
UseCustomInternalLBAddreses bool `json:"useCustomInternalLBAddreses,omitempty"`
UseCustomExternalLBAddresses bool `json:"useCustomExternalLBAddresses,omitempty"`
UseCustomInternalLBAddresses bool `json:"useCustomInternalLBAddresses,omitempty"`
UseCustomMasterIPAddresses bool `json:"useCustomMasterIPAddresses,omitempty"`
UseCustomWorkerIPAddresses bool `json:"useCustomWorkerIPAddresses,omitempty"`
UseDynamixExtNet bool `json:"useDynamixExtnet,omitempty"`
@@ -261,8 +261,8 @@ type CreateClusterRequest struct {
SaveComputesOnFailedK8SCreation bool `json:"saveComputesOnFailedK8SCreation"`
SharedClusterTemplate bool `json:"sharedClusterTemplate"`
StoragePolicyID int64 `json:"storagePolicyId"`
UseCustomExternalLBAddreses bool `json:"useCustomExternalLBAddreses"`
UseCustomInternalLBAddreses bool `json:"useCustomInternalLBAddreses"`
UseCustomExternalLBAddresses bool `json:"useCustomExternalLBAddresses"`
UseCustomInternalLBAddresses bool `json:"useCustomInternalLBAddresses"`
UseCustomMasterIPAddresses bool `json:"useCustomMasterIPAddresses"`
UseCustomWorkerIPAddresses bool `json:"useCustomWorkerIPAddresses"`
UseDynamixExtNet bool `json:"useDynamixExtnet"`
@@ -0,0 +1,285 @@
// Code generated by OpenAPI Generator; DO NOT EDIT.
package de_seaweedfs_operator
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 DeSeaweedfsOperatorService service
type DescribeRequest struct {
// cluster ID
//
// Required.
ClusterID int64 `json:"clusterId" form:"clusterId"`
// check whether installed in cluster
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
// check operator pods liveness
CheckLiveness bool `json:"checkLiveness" form:"checkLiveness"`
}
// Get SeaweedFS operator status
func (a *DeSeaweedfsOperatorService) Describe(ctx context.Context, req DescribeRequest) (DescribeSeaweedfsOperatorResult, error) {
var (
method = http.MethodPost
requestBody any
formFiles []utils.FormFile
result DescribeSeaweedfsOperatorResult
)
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/seaweedfs-operator/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, "checkLiveness", req.CheckLiveness, "", "")
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 DescribeSeaweedfsOperatorResultWithError
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"`
// Hostname for integagent
IntegagentHostname string `json:"integagentHostname" form:"integagentHostname"`
// images apps repository ID
AppsRepositoryID int64 `json:"appsRepositoryId" form:"appsRepositoryId"`
// charts repository ID
ChartsRepositoryID int64 `json:"chartsRepositoryId" form:"chartsRepositoryId"`
// download chart anyway
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
}
// Install SeaweedFS operator in cluster
func (a *DeSeaweedfsOperatorService) 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 len(missingRequiredParams) > 0 {
return result, utils.MissingRequiredParamsError(missingRequiredParams)
}
basePath := a.client.BaseURL()
requestPath := basePath + "/digitalenergy/seaweedfs-operator/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, "integagentHostname", req.IntegagentHostname, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
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"`
// delete even if not registered
CleanAlways bool `json:"cleanAlways" form:"cleanAlways"`
// ignore dns server errors
IgnoreDNSError bool `json:"ignoreDnsError" form:"ignoreDnsError"`
}
// Uninstall SeaweedFS operator from cluster
func (a *DeSeaweedfsOperatorService) 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/seaweedfs-operator/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, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
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_seaweedfs_operator
import (
"repository.basistech.ru/BASIS/de-golang-sdk/core"
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
)
type APIClient struct {
common service
DeSeaweedfsOperator *DeSeaweedfsOperatorService
}
type service struct {
client *utils.Client
}
func NewAPIClient(cfg *core.Configuration) *APIClient {
c := &APIClient{}
c.common.client = utils.NewClient(cfg)
c.DeSeaweedfsOperator = (*DeSeaweedfsOperatorService)(&c.common)
return c
}
+28
View File
@@ -0,0 +1,28 @@
// Code generated by internal codegen utility; DO NOT EDIT.
package de_seaweedfs_operator
type DescribeSeaweedfsOperatorResult struct {
CheckListOk bool `json:"checkListOk,omitempty"`
Description ProductDescr `json:"description,omitempty"`
Installed bool `json:"installed,omitempty"`
Registered bool `json:"registered,omitempty"`
Registry SeaweedfsOperatorRecord `json:"registry,omitempty"`
}
type DescribeSeaweedfsOperatorResultWithError struct {
Error bool `json:"error,omitempty"`
ErrorCode int64 `json:"errorCode,omitempty"`
Message string `json:"message,omitempty"`
Result DescribeSeaweedfsOperatorResult `json:"result,omitempty"`
}
type SeaweedfsOperatorRecord struct {
ClusterID int64 `json:"clusterId,omitempty"`
ID int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
OwnerID int64 `json:"ownerId,omitempty"`
ProductName string `json:"productName,omitempty"`
ProductVersion string `json:"productVersion,omitempty"`
TaskIDs []int64 `json:"taskIds,omitempty"`
}
@@ -0,0 +1,11 @@
// Code generated by internal codegen utility; DO NOT EDIT.
package de_seaweedfs_operator
import (
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
)
type CreateTaskResult = shared.CreateTaskResult
type CreateTaskResultWithError = shared.CreateTaskResultWithError
type ProductDescr = shared.ProductDescr