Compare commits
7
Commits
d340d1b2ad
..
v2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76efee844d | ||
|
|
eaf2672f6b | ||
|
|
2ba8f61cb5 | ||
|
|
3e25635f9b | ||
|
|
c885f22775 | ||
|
|
f96ab6054d | ||
|
|
7ccd84cd96 |
No files matched your search
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
Makefile
|
Makefile
|
||||||
.gitlab
|
.gitlab
|
||||||
.idea
|
.idea
|
||||||
/examples/05_file/downloaded_image.img
|
/examples/05_file/downloaded_image.img
|
||||||
|
/BACKEND_COMMIT
|
||||||
+223
-11
@@ -1,17 +1,229 @@
|
|||||||
## Version 1.0.4
|
## Version 2.0.0-rc.9
|
||||||
|
|
||||||
|
Этот CHANGELOG.md сравнивает v1.0.10 и v2.0.0-rc.9
|
||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
|----------------------|----------------------------------------------------------------------------------------------------------------------------|
|
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| COD-42 | Группа `DeSeaweedfs` с методами `Describe`, `Install` и `Uninstall` для проверки состояния, установки и удаления SeaweedFS |
|
| COD-78 | Добавлен метод `DeArgocd.Describe` (`POST /digitalenergy/argocd/describe`) |
|
||||||
| COD-42 | Группа `Valkey` с методами `Describe`, `Install` и `Uninstall` для проверки состояния, установки и удаления Valkey |
|
| COD-78 | Добавлен метод `DeArgocd.Install` (`POST /digitalenergy/argocd/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeArgocd.Uninstall` (`POST /digitalenergy/argocd/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeCdxgen.Describe` (`POST /digitalenergy/cdxgen/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeCdxgen.Install` (`POST /digitalenergy/cdxgen/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeCdxgen.Uninstall` (`POST /digitalenergy/cdxgen/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeCluster.LoadBalancersHaproxyEditForwardingServer` (`POST /digitalenergy/cluster/loadBalancers/haproxy/editForwardingServer`) |
|
||||||
|
| COD-78 | Добавлен метод `DeCluster.LoadBalancersHaproxyGetForwarding` (`POST /digitalenergy/cluster/loadBalancers/haproxy/getForwarding`) |
|
||||||
|
| COD-78 | Добавлен метод `DeCluster.LoadBalancersHaproxyListForwardings` (`POST /digitalenergy/cluster/loadBalancers/haproxy/listForwardings`) |
|
||||||
|
| COD-78 | Добавлен метод `DeDefectdojo.Describe` (`POST /digitalenergy/defectdojo/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeDefectdojo.Install` (`POST /digitalenergy/defectdojo/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeDefectdojo.Uninstall` (`POST /digitalenergy/defectdojo/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeFilebeat.Describe` (`POST /digitalenergy/filebeat/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeFilebeat.Install` (`POST /digitalenergy/filebeat/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeFilebeat.Uninstall` (`POST /digitalenergy/filebeat/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeFluentbit.Describe` (`POST /digitalenergy/fluentbit/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeFluentbit.Install` (`POST /digitalenergy/fluentbit/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeFluentbit.Uninstall` (`POST /digitalenergy/fluentbit/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeGitea.Describe` (`POST /digitalenergy/gitea/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeGitea.Install` (`POST /digitalenergy/gitea/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeGitea.Uninstall` (`POST /digitalenergy/gitea/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeIstore.ChartsValidate` (`POST /digitalenergy/istore/charts/validate`) |
|
||||||
|
| COD-78 | Добавлен метод `DeOpenbao.Describe` (`POST /digitalenergy/openbao/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeOpenbao.Install` (`POST /digitalenergy/openbao/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeOpenbao.Uninstall` (`POST /digitalenergy/openbao/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeProducts.InstallApp` (`POST /digitalenergy/products/installApp`) |
|
||||||
|
| COD-78 | Добавлен метод `DeRbpo.Describe` (`POST /digitalenergy/rbpo/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeRbpo.Install` (`POST /digitalenergy/rbpo/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeSherlock.Describe` (`POST /digitalenergy/sherlock/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeSherlock.Install` (`POST /digitalenergy/sherlock/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeSherlock.Uninstall` (`POST /digitalenergy/sherlock/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.Describe` (`POST /digitalenergy/tekton/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.Install` (`POST /digitalenergy/tekton/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelineCreate` (`POST /digitalenergy/tekton/pipeline/create`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelineDelete` (`POST /digitalenergy/tekton/pipeline/delete`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelineGet` (`POST /digitalenergy/tekton/pipeline/get`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelineList` (`POST /digitalenergy/tekton/pipeline/list`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelineRun` (`POST /digitalenergy/tekton/pipeline/run`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelinerunCancel` (`POST /digitalenergy/tekton/pipelinerun/cancel`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelinerunDelete` (`POST /digitalenergy/tekton/pipelinerun/delete`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelinerunDeleteAll` (`POST /digitalenergy/tekton/pipelinerun/deleteAll`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelinerunGet` (`POST /digitalenergy/tekton/pipelinerun/get`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.PipelinerunList` (`POST /digitalenergy/tekton/pipelinerun/list`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.TaskCreate` (`POST /digitalenergy/tekton/task/create`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.TaskDelete` (`POST /digitalenergy/tekton/task/delete`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.TaskGet` (`POST /digitalenergy/tekton/task/get`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.TaskList` (`POST /digitalenergy/tekton/task/list`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.TaskrunLogs` (`POST /digitalenergy/tekton/taskrun/logs`) |
|
||||||
|
| COD-78 | Добавлен метод `DeTekton.Uninstall` (`POST /digitalenergy/tekton/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeValkeyCluster.Describe` (`POST /digitalenergy/valkey-cluster/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeValkeyCluster.Install` (`POST /digitalenergy/valkey-cluster/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeValkeyCluster.Uninstall` (`POST /digitalenergy/valkey-cluster/uninstall`) |
|
||||||
|
| COD-78 | Добавлен метод `DeZabbix.Describe` (`POST /digitalenergy/zabbix/describe`) |
|
||||||
|
| COD-78 | Добавлен метод `DeZabbix.Install` (`POST /digitalenergy/zabbix/install`) |
|
||||||
|
| COD-78 | Добавлен метод `DeZabbix.Uninstall` (`POST /digitalenergy/zabbix/uninstall`) |
|
||||||
|
|
||||||
### Изменено
|
### Изменено
|
||||||
|
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
|----------------------|-----------------------------------------------------------------------------------------------------------------|
|
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| COD-42 | В `go.mod` версия `v1.0.3` помечена как retracted, поскольку в ней отсутствует часть изменений для DE 1.8.0 |
|
| COD-78 | Изменён метод `DeAPISIX.Describe` (`POST /digitalenergy/apisix/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
| COD-42 | `/openid/authenticate` теперь имеет путь `/openid/{providername}/authenticate` |
|
| COD-78 | Изменён метод `DeAPISIX.Install` (`POST /digitalenergy/apisix/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
| COD-42 | `/openid/status` теперь вместо `enabled:true/false` возвращает `[]OpenIDStatus{name: ..., enabled: true/false}` |
|
| COD-78 | Изменён метод `DeAPISIX.Uninstall` (`POST /digitalenergy/apisix/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
| COD-42 | `/digitalenergy/property/get` теперь также возвращает статусы OpenID и лимиты Node |
|
| COD-78 | Изменён метод `DeCertmanager.Describe` (`POST /digitalenergy/certmanager/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeCertmanager.Install` (`POST /digitalenergy/certmanager/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeCertmanager.Uninstall` (`POST /digitalenergy/certmanager/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.AddLoadBalancers` (`POST /digitalenergy/cluster/addLoadBalancers`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixSSOURL` и `DynamixURL` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.AddMasters` (`POST /digitalenergy/cluster/addMasters`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixSSOURL` и `DynamixURL` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.AddPoolVMs` (`POST /digitalenergy/cluster/addPoolVMs`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.AddWorkers` (`POST /digitalenergy/cluster/addWorkers`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.Create` (`POST /digitalenergy/cluster/create`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeWorkerGroup.ClusterCreateWorkerGroup` (`POST /digitalenergy/cluster/createWorkerGroup`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.Delete` (`POST /digitalenergy/cluster/delete`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.DeleteLoadBalancers` (`POST /digitalenergy/cluster/deleteLoadBalancers`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.DeleteMasters` (`POST /digitalenergy/cluster/deleteMasters`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.DeletePoolVMs` (`POST /digitalenergy/cluster/deletePoolVMs`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeWorkerGroup.ClusterDeleteWorkerGroup` (`POST /digitalenergy/cluster/deleteWorkerGroup`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.DeleteWorkers` (`POST /digitalenergy/cluster/deleteWorkers`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.Get` (`POST /digitalenergy/cluster/get`): в ответе добавлены необязательные поля `DynamixPlatform`, `InstalledTekton` и `IsRBPO`; в ответе удалено необязательное поле `DynamixURL` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.GetKubectlResources` (`POST /digitalenergy/cluster/getKubectlResources`): в ответе добавлены необязательные поля `ConfigMap`, `CronJob`, `DaemonSet`, `Deployment`, `EndpointSlice`, `Event`, `HorizontalPodAutoscaler`, `Ingress`, `IngressClass`, `Job`, `LimitRange`, `Namespace`, `NetworkPolicy`, `PersistentVolume`, `PersistentVolumeClaim`, `Pod`, `ReplicaSet`, `ReplicationController`, `ResourceQuota`, `Secret`, `Service`, `StatefulSet` и `StorageClass`; в ответе удалено необязательное поле `Any` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.JoinPoolVMs` (`POST /digitalenergy/cluster/joinPoolVMs`): удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.List` (`POST /digitalenergy/cluster/list`): в ответе добавлены необязательные поля `InstalledTekton` и `IsRPBO`; добавлено новое необязательное поле запроса `InstalledTekton` |
|
||||||
|
| COD-78 | Изменён метод `DeCluster.ListKubectlResources` (`POST /digitalenergy/cluster/listKubectlResources`): в ответе добавлены необязательные поля `ConfigMaps`, `CronJobs`, `DaemonSets`, `Deployments`, `EndpointSlices`, `Events`, `HorizontalPodAutoscalers`, `IngressClasses`, `Ingresses`, `Jobs`, `LimitRanges`, `Namespaces`, `NetworkPolicies`, `PersistentVolumeClaims`, `PersistentVolumes`, `Pods`, `ReplicaSets`, `ReplicationControllers`, `ResourceQuotas`, `Secrets`, `Services`, `StatefulSets` и `StorageClasses`; в ответе удалено необязательное поле `Any`; добавлено новое необязательное поле запроса `Name` |
|
||||||
|
| COD-78 | Изменён метод `DeWorkerGroup.ClusterResizeWorkerGroup` (`POST /digitalenergy/cluster/resizeWorkerGroup`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeWorkerGroup.ClusterUpdateWorkerGroup` (`POST /digitalenergy/cluster/updateWorkerGroup`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DeClusterTemplate.Get` (`POST /digitalenergy/clusterTemplate/get`): в ответе добавлены необязательные поля `DynamixPlatformID` и `InstallTekton`; в ответе удалены необязательные поля `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeClusterTemplate.Update` (`POST /digitalenergy/clusterTemplate/update`): добавлены новые необязательные поля запроса `ExtraCluster.DynamixPlatformID`, `ExtraCluster.IsRBPO`, `ExtraCluster.LoadBalancerMachineOSBuilds`, `ExtraCluster.LoadBalancerMachineOSTypes` и `ExtraCluster.RbpoApps`; поле запроса `extraCluster/allOf[#/components/schemas/helmet_tld_de_demanager_internal_delogic_comtype_iotype.CreateClusterRequest]/clusterType` стало обязательным; удалены поля запроса `ExtraCluster.DynamixAppID`, `ExtraCluster.DynamixAppSecret`, `ExtraCluster.DynamixAuthDomain`, `ExtraCluster.DynamixAuthType`, `ExtraCluster.DynamixPassword`, `ExtraCluster.DynamixSSOURL`, `ExtraCluster.DynamixURL`, `ExtraCluster.DynamixUsername`, `ExtraCluster.LoadBalancerMachineOSBuild` и `ExtraCluster.LoadBalancerMachineOSType` |
|
||||||
|
| COD-78 | Изменён метод `DeCodeScoring.Describe` (`POST /digitalenergy/codescoring/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeCodeScoring.Install` (`POST /digitalenergy/codescoring/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeCodeScoring.Uninstall` (`POST /digitalenergy/codescoring/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeComputes.DiskAttach` (`POST /digitalenergy/computes/diskAttach`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeComputes.DiskDetach` (`POST /digitalenergy/computes/diskDetach`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeComputes.Get` (`POST /digitalenergy/computes/get`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeComputes.List` (`POST /digitalenergy/computes/list`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCriobox.Install` (`POST /digitalenergy/criobox/install`): тип результата изменён с `InstallCrioboxResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeCriobox.Uninstall` (`POST /digitalenergy/criobox/uninstall`): тип результата изменён с `UninstallCrioboxResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeCsidynamix.Install` (`POST /digitalenergy/csidynamix/install`): добавлено новое необязательное поле запроса `DynamixPlatformID`; тип результата изменён с `InstallCsiDynamixResult` на `CreateTaskResult`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCsidynamix.Reinstall` (`POST /digitalenergy/csidynamix/reinstall`): добавлено новое необязательное поле запроса `DynamixPlatformID`; тип результата изменён с `ReinstallCsiDynamixResult` на `CreateTaskResult`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeCsidynamix.Uninstall` (`POST /digitalenergy/csidynamix/uninstall`): тип результата изменён с `UninstallCsiDynamixResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeCustomApp.Install` (`POST /digitalenergy/customapp/install`): добавлено новое необязательное поле запроса `CheckType` |
|
||||||
|
| COD-78 | Изменён метод `DeDependencyTrack.Describe` (`POST /digitalenergy/dependency-track/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeDependencyTrack.Install` (`POST /digitalenergy/dependency-track/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeDependencyTrack.Uninstall` (`POST /digitalenergy/dependency-track/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeDeployment.Get` (`POST /digitalenergy/deployment/get`): в ответе тип поля `CheckIstoreEntityResult` изменён с `string` на `[]string` |
|
||||||
|
| COD-78 | Изменён метод `DeDisks.Create` (`POST /digitalenergy/disks/create`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeDisks.Delete` (`POST /digitalenergy/disks/delete`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeDisks.Get` (`POST /digitalenergy/disks/get`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeDisks.List` (`POST /digitalenergy/disks/list`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeDisks.Resize` (`POST /digitalenergy/disks/resize`): добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeFalco.Describe` (`POST /digitalenergy/falco/describe`): в ответе удалено необязательное поле `Rules`; добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeFalco.Install` (`POST /digitalenergy/falco/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeFalco.Uninstall` (`POST /digitalenergy/falco/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeGitLab.Describe` (`POST /digitalenergy/gitlab/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeGitLab.Install` (`POST /digitalenergy/gitlab/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeGitLab.Uninstall` (`POST /digitalenergy/gitlab/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeGrafana.Describe` (`POST /digitalenergy/grafana/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeGrafana.Install` (`POST /digitalenergy/grafana/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeGrafana.Uninstall` (`POST /digitalenergy/grafana/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeHarbor.Describe` (`POST /digitalenergy/harbor/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeHarbor.Install` (`POST /digitalenergy/harbor/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeHarbor.Uninstall` (`POST /digitalenergy/harbor/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeIngressNginx.Describe` (`POST /digitalenergy/ingress-nginx/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeIngressNginx.Install` (`POST /digitalenergy/ingress-nginx/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeIngressNginx.Uninstall` (`POST /digitalenergy/ingress-nginx/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeIntegagent.Install` (`POST /digitalenergy/integagent/install`): тип результата изменён с `InstallIntegagentResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeIntegagent.Uninstall` (`POST /digitalenergy/integagent/uninstall`): тип результата изменён с `UninstallIntegagentResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeIstio.Describe` (`POST /digitalenergy/istio/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeIstio.Install` (`POST /digitalenergy/istio/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeIstio.Uninstall` (`POST /digitalenergy/istio/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeJenkins.Describe` (`POST /digitalenergy/jenkins/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeJenkins.Install` (`POST /digitalenergy/jenkins/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeJenkins.Uninstall` (`POST /digitalenergy/jenkins/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeKyverno.Install` (`POST /digitalenergy/kyverno/install`): тип результата изменён с `InstallKyvernoResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeKyverno.Uninstall` (`POST /digitalenergy/kyverno/uninstall`): тип результата изменён с `UninstallKyvernoResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeLonghorn.Describe` (`POST /digitalenergy/longhorn/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeLonghorn.Install` (`POST /digitalenergy/longhorn/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeLonghorn.Uninstall` (`POST /digitalenergy/longhorn/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeNexus.Describe` (`POST /digitalenergy/nexus/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeNexus.Install` (`POST /digitalenergy/nexus/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeNexus.Uninstall` (`POST /digitalenergy/nexus/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeOpenELB.Describe` (`POST /digitalenergy/openelb/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeOpenELB.Install` (`POST /digitalenergy/openelb/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeOpenELB.Uninstall` (`POST /digitalenergy/openelb/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DePodLogger.Install` (`POST /digitalenergy/podlogger/install`): тип результата изменён с `InstallPodLoggerResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DePodLogger.Uninstall` (`POST /digitalenergy/podlogger/uninstall`): тип результата изменён с `UninstallPodLoggerResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DePostgreSQLHA.Describe` (`POST /digitalenergy/postgresql-ha/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DePostgreSQLHA.Install` (`POST /digitalenergy/postgresql-ha/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DePostgreSQLHA.Uninstall` (`POST /digitalenergy/postgresql-ha/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeProducts.DescribeAll` (`POST /digitalenergy/products/describeAll`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeProducts.DescribeAllShort` (`POST /digitalenergy/products/describeAllShort`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DePrometheus.Describe` (`POST /digitalenergy/prometheus/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DePrometheus.Install` (`POST /digitalenergy/prometheus/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DePrometheus.Uninstall` (`POST /digitalenergy/prometheus/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeProperty.Get` (`POST /digitalenergy/property/get`): в ответе удалено необязательное поле `FullMarketplace`; добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DeRBACManager.Install` (`POST /digitalenergy/rbacmanager/install`): тип результата изменён с `InstallRBACManagerResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeRBACManager.Uninstall` (`POST /digitalenergy/rbacmanager/uninstall`): тип результата изменён с `UninstallRBACManagerResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeRedisCluster.Describe` (`POST /digitalenergy/redis-cluster/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeRedisCluster.Install` (`POST /digitalenergy/redis-cluster/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeRedisCluster.Uninstall` (`POST /digitalenergy/redis-cluster/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeRedmine.Describe` (`POST /digitalenergy/redmine/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeRedmine.Install` (`POST /digitalenergy/redmine/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeRedmine.Uninstall` (`POST /digitalenergy/redmine/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSeaweedfsOperator.Describe` (`POST /digitalenergy/seaweedfs-operator/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSeaweedfsOperator.Install` (`POST /digitalenergy/seaweedfs-operator/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSeaweedfsOperator.Uninstall` (`POST /digitalenergy/seaweedfs-operator/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSeaweedfs.Describe` (`POST /digitalenergy/seaweedfs/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSeaweedfs.Install` (`POST /digitalenergy/seaweedfs/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSeaweedfs.Uninstall` (`POST /digitalenergy/seaweedfs/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeServchecker.Describe` (`POST /digitalenergy/servchecker/describe`): в ответе добавлено необязательное поле `Namespace` |
|
||||||
|
| COD-78 | Изменён метод `DeServchecker.Install` (`POST /digitalenergy/servchecker/install`): тип результата изменён с `InstallServcheckerResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeServchecker.Reinstall` (`POST /digitalenergy/servchecker/reinstall`): тип результата изменён с `ReinstallServcheckerResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeServchecker.Uninstall` (`POST /digitalenergy/servchecker/uninstall`): тип результата изменён с `UninstallServcheckerResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeSonarQube.Describe` (`POST /digitalenergy/sonarqube/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSonarQube.Install` (`POST /digitalenergy/sonarqube/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSonarQube.Uninstall` (`POST /digitalenergy/sonarqube/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSvacer.Describe` (`POST /digitalenergy/svacer/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSvacer.Install` (`POST /digitalenergy/svacer/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeSvacer.Uninstall` (`POST /digitalenergy/svacer/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeTrivy.Install` (`POST /digitalenergy/trivy/install`): тип результата изменён с `InstallTrivyResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeTrivy.Uninstall` (`POST /digitalenergy/trivy/uninstall`): тип результата изменён с `UninstallTrivyResult` на `CreateTaskResult` |
|
||||||
|
| COD-78 | Изменён метод `DeUser.Create` (`POST /digitalenergy/user/create`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeUser.Get` (`POST /digitalenergy/user/get`): в ответе добавлены необязательные поля `DynamixPlatforms`, `IstorePassword` и `LimitSessionsCount`; в ответе удалены необязательные поля `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername` |
|
||||||
|
| COD-78 | Изменён метод `DeUser.List` (`POST /digitalenergy/user/list`): в ответе добавлено необязательное поле `DynamixPlatforms`; в ответе удалены необязательные поля `DynamixAuthDomain`, `DynamixAuthType`, `DynamixSSOURL` и `DynamixURL` |
|
||||||
|
| COD-78 | Изменён метод `DeUser.Update` (`POST /digitalenergy/user/update`): в ответе добавлены необязательные поля `DynamixPlatforms`, `IstorePassword` и `LimitSessionsCount`; в ответе удалены необязательные поля `DynamixAppID`, `DynamixAppSecret`, `DynamixAuthDomain`, `DynamixAuthType`, `DynamixPassword`, `DynamixSSOURL`, `DynamixURL` и `DynamixUsername`; добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeValkey.Describe` (`POST /digitalenergy/valkey/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeValkey.Install` (`POST /digitalenergy/valkey/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeValkey.Uninstall` (`POST /digitalenergy/valkey/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeVault.Describe` (`POST /digitalenergy/vault/describe`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeVault.Install` (`POST /digitalenergy/vault/install`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DeVault.Uninstall` (`POST /digitalenergy/vault/uninstall`): добавлен тип медиа для тела запроса `application/json`; тело запроса стало обязательным; удален тип медиа для тела запроса `application/x-www-form-urlencoded` |
|
||||||
|
| COD-78 | Изменён метод `DxAccount.Get` (`POST /dynamix/account/get`): в ответе добавлены необязательные поля `BACKUP_RUNNING`, `BACKUP_STOPPED`, `CLONING`, `DOWN`, `MERGE`, `MIGRATING`, `MIGRATING_IN`, `MIGRATING_OUT`, `PAUSED`, `PAUSING`, `ROLLBACK`, `SCHEDULED`, `SNAPCREATE`, `STARTED`, `STARTING`, `STOPPED` и `STOPPING`; в ответе удалены необязательные поля `Started` и `Stopped`; добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxAccount.List` (`POST /dynamix/account/list`): в ответе удалено необязательное поле `CanBeDeleted`; добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxCompute.AttachVGPU` (`POST /dynamix/compute/attachVGpu`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxCompute.DeattachVGPU` (`POST /dynamix/compute/deattachVGpu`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxCompute.Delete` (`POST /dynamix/compute/delete`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxCompute.Get` (`POST /dynamix/compute/get`): в ответе добавлены необязательные поля `MemoryBalloonMode`, `Record.Disks[].CrtTracking`, `Record.Interfaces[].QoSPolicies`, `Record.SnapSets[].Compute.Disks[].CrtTracking`, `Record.SnapSets[].Compute.Interfaces[].QoSPolicies`, `Record.SnapSets[].Compute.VGPUs[].AccountIDs`, `Record.SnapSets[].Compute.VGPUs[].ComputeID`, `Record.SnapSets[].Compute.VGPUs[].DeviceReference`, `Record.SnapSets[].Compute.VGPUs[].MdevUUID`, `Record.SnapSets[].Compute.VGPUs[].ParentPCIAddress`, `Record.SnapSets[].Compute.VGPUs[].PgpuID`, `Record.SnapSets[].Compute.VGPUs[].ProfileName`, `Record.SnapSets[].Compute.VGPUs[].ProfileReference`, `Record.SnapSets[].Compute.VGPUs[].SplitMode`, `Record.VGPUs[].AccountIDs`, `Record.VGPUs[].ComputeID`, `Record.VGPUs[].DeviceReference`, `Record.VGPUs[].MdevUUID`, `Record.VGPUs[].ParentPCIAddress`, `Record.VGPUs[].PgpuID`, `Record.VGPUs[].ProfileName`, `Record.VGPUs[].ProfileReference`, `Record.VGPUs[].SplitMode` и `WatchdogAction`; в ответе удалены необязательные поля `Record.SnapSets[].Compute.VGPUs[].AccountID`, `Record.SnapSets[].Compute.VGPUs[].LastClaimedBy`, `Record.SnapSets[].Compute.VGPUs[].Mode`, `Record.SnapSets[].Compute.VGPUs[].PGPUID`, `Record.SnapSets[].Compute.VGPUs[].ProfileID`, `Record.SnapSets[].Compute.VGPUs[].RAM`, `Record.SnapSets[].Compute.VGPUs[].RGID`, `Record.SnapSets[].Compute.VGPUs[].ReferenceID`, `Record.SnapSets[].Compute.VGPUs[].Type`, `Record.SnapSets[].Compute.VGPUs[].VMID`, `Record.VGPUs[].AccountID`, `Record.VGPUs[].LastClaimedBy`, `Record.VGPUs[].Mode`, `Record.VGPUs[].PGPUID`, `Record.VGPUs[].ProfileID`, `Record.VGPUs[].RAM`, `Record.VGPUs[].RGID`, `Record.VGPUs[].ReferenceID`, `Record.VGPUs[].Type` и `Record.VGPUs[].VMID`; добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxCompute.List` (`POST /dynamix/compute/list`): в ответе добавлены необязательные поля `AccountIDs`, `ComputeID`, `CrtTracking`, `DeviceReference`, `ImageID`, `MdevUUID`, `MemoryBalloonMode`, `ParentPCIAddress`, `PgpuID`, `ProfileName`, `ProfileReference`, `Records[].Interfaces[].QoSPolicies`, `Records[].SnapSets[].Compute.Interfaces[].QoSPolicies`, `SplitMode` и `WatchdogAction`; в ответе удалены необязательные поля `AccountID`, `LastClaimedBy`, `Mode`, `PGPUID`, `ProfileID`, `RAM`, `RGID`, `ReferenceID`, `Type` и `VMID`; добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxDisks.ListTypes` (`POST /dynamix/disk/listTypes`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxExtNet.Get` (`POST /dynamix/extnet/get`): в ответе добавлены необязательные поля `AccountID`, `Record.Excluded[].AutoAssignable`, `Record.PreReservations[].AutoAssignable` и `Record.Reservations[].AutoAssignable`; добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxExtNet.List` (`POST /dynamix/extnet/list`): добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxVersion.GetVersion` (`POST /dynamix/getVersion`): добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxImage.Get` (`POST /dynamix/image/get`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxImage.List` (`POST /dynamix/image/list`): добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxK8CI.Get` (`POST /dynamix/k8ci/get`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxK8CI.List` (`POST /dynamix/k8ci/list`): добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxRG.Get` (`POST /dynamix/rg/get`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxRG.List` (`POST /dynamix/rg/list`): добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxSP.List` (`POST /dynamix/sp/list`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxTasks.Get` (`POST /dynamix/task/get`): в ответе добавлено необязательное поле `CreatedTime`; добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxTasks.List` (`POST /dynamix/task/list`): в ответе добавлено необязательное поле `CreatedTime`; добавлено необязательное тело запроса |
|
||||||
|
| COD-78 | Изменён метод `DxVGPU.List` (`POST /dynamix/vgpu/list`): в ответе добавлены необязательные поля `AccountIDs`, `ComputeID`, `DeviceReference`, `MdevUUID`, `Name`, `NodeID`, `ParentPCIAddress`, `PgpuID`, `ProfileName`, `ProfileReference` и `SplitMode`; в ответе удалены необязательные поля `AccountID`, `LastClaimedBy`, `Mode`, `PGPUID`, `ProfileID`, `RAM`, `RGID`, `ReferenceID`, `Type` и `VMID`; добавлено новое необязательное поле запроса `DynamixPlatformID`; удалены поля запроса `Mode`, `RGID` и `Type` |
|
||||||
|
| COD-78 | Изменён метод `DxViNS.Get` (`POST /dynamix/vins/get`): в ответе добавлены необязательные поля `QoSPolicies`, `Record.VNFDev.Interfaces[].EnableDefaultGateway` и `Record.VNFs.DHCP.Config.EnableDefaultGateway`; добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
| COD-78 | Изменён метод `DxViNS.List` (`POST /dynamix/vins/list`): добавлено новое необязательное поле запроса `DynamixPlatformID` |
|
||||||
|
|
||||||
|
### Удалено
|
||||||
|
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
|----------------------|--------------------------------------------------------------------------|
|
||||||
|
| COD-78 | Удалён метод `DeMinIO.Describe` (`POST /digitalenergy/minio/describe`) |
|
||||||
|
| COD-78 | Удалён метод `DeMinIO.Install` (`POST /digitalenergy/minio/install`) |
|
||||||
|
| COD-78 | Удалён метод `DeMinIO.Uninstall` (`POST /digitalenergy/minio/uninstall`) |
|
||||||
@@ -13,18 +13,25 @@ Go SDK для работы с Базис.Digital Energy.
|
|||||||
4. [examples/04_cluster_create](examples/04_cluster_create/main.go) - создание кластера и ожидание фоновой задачи.
|
4. [examples/04_cluster_create](examples/04_cluster_create/main.go) - создание кластера и ожидание фоновой задачи.
|
||||||
5. [examples/05_file](examples/05_file/main.go) - потоковая загрузка OCI-образа в istore и его скачивание.
|
5. [examples/05_file](examples/05_file/main.go) - потоковая загрузка OCI-образа в istore и его скачивание.
|
||||||
|
|
||||||
|
## Совместимость версий
|
||||||
|
|
||||||
|
| Версия SDK | Поддерживаемая версия DE | Путь Go-модуля |
|
||||||
|
|------------|--------------------------|--------------------------------------------------|
|
||||||
|
| `v1.x.x` | `1.8.x` | `repository.basistech.ru/BASIS/de-golang-sdk` |
|
||||||
|
| `v2.x.x` | `1.9.x` | `repository.basistech.ru/BASIS/de-golang-sdk/v2` |
|
||||||
|
|
||||||
## Установка
|
## Установка
|
||||||
|
|
||||||
Выполните команду в терминале:
|
Выполните команду в терминале:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
go get repository.basistech.ru/BASIS/de-golang-sdk
|
go get repository.basistech.ru/BASIS/de-golang-sdk/v2
|
||||||
```
|
```
|
||||||
|
|
||||||
Для установки конкретной версии замените `VERSION` тегом нужного опубликованного релиза:
|
Для установки конкретной версии замените `VERSION` тегом нужного опубликованного релиза `v2.x.x`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
go get repository.basistech.ru/BASIS/de-golang-sdk@VERSION
|
go get repository.basistech.ru/BASIS/de-golang-sdk/v2@VERSION
|
||||||
```
|
```
|
||||||
|
|
||||||
## Аутентификация
|
## Аутентификация
|
||||||
@@ -36,18 +43,6 @@ go get repository.basistech.ru/BASIS/de-golang-sdk@VERSION
|
|||||||
- `cfg.SkipCompatibilityCheck = true` отключает автоматическую проверку в методах аутентификации. Явный
|
- `cfg.SkipCompatibilityCheck = true` отключает автоматическую проверку в методах аутентификации. Явный
|
||||||
`client.CheckCompatibility()` выполняется вне зависимости от этой настройки.
|
`client.CheckCompatibility()` выполняется вне зависимости от этой настройки.
|
||||||
|
|
||||||
## Совместимость версий
|
|
||||||
|
|
||||||
| Версия SDK | Поддерживаемая версия DE |
|
|
||||||
|------------|--------------------------|
|
|
||||||
| `1.x.x` | `1.8.x` |
|
|
||||||
|
|
||||||
С выходом DE 1.9.0 будет выпущена новая major-версия SDK `v2`. Путь Go-модуля и импорт будут содержать суффикс `/v2`:
|
|
||||||
|
|
||||||
```go
|
|
||||||
import desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Детали
|
## Детали
|
||||||
|
|
||||||
1. Почти для всех функций применима логика "Эндпоинт E из группы эндпоинтов G имеет структуру запроса G.ERequest".
|
1. Почти для всех функций применима логика "Эндпоинт E из группы эндпоинтов G имеет структуру запроса G.ERequest".
|
||||||
@@ -99,19 +94,30 @@ import desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
|||||||
| Клиент | Назначение |
|
| Клиент | Назначение |
|
||||||
|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
|
|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| [`DeAPISIX`](tags/de_apisix) | Установка APISIX (API-шлюз, предназначенный для управления, обеспечения безопасности и маршрутизации трафика в кластере Kubernetes) |
|
| [`DeAPISIX`](tags/de_apisix) | Установка APISIX (API-шлюз, предназначенный для управления, обеспечения безопасности и маршрутизации трафика в кластере Kubernetes) |
|
||||||
|
| [`DeArgocd`](tags/de_argocd) | Установка, проверка состояния и удаление Argo CD (GitOps-инструмент непрерывной доставки в Kubernetes) |
|
||||||
| [`DeAudits`](tags/de_audits) | Подготовка ссылок на скачивание журналов аудита Kubernetes |
|
| [`DeAudits`](tags/de_audits) | Подготовка ссылок на скачивание журналов аудита Kubernetes |
|
||||||
| [`DeAutoscaler`](tags/de_autoscaler) | Управление автомасштабированием Deployment в Kubernetes (HPA) |
|
| [`DeAutoscaler`](tags/de_autoscaler) | Управление автомасштабированием Deployment в Kubernetes (HPA) |
|
||||||
|
| [`DeCdxgen`](tags/de_cdxgen) | Установка, проверка состояния и удаление cdxgen (формирование SBOM в формате CycloneDX) |
|
||||||
| [`DeCertificates`](tags/de_certificates) | Проверка и обновление сертификатов kubeadm |
|
| [`DeCertificates`](tags/de_certificates) | Проверка и обновление сертификатов kubeadm |
|
||||||
| [`DeCertmanager`](tags/de_certmanager) | Установка Certmanager (утилита для удалённого управления сертификатами) |
|
| [`DeCertmanager`](tags/de_certmanager) | Установка Certmanager (утилита для удалённого управления сертификатами) |
|
||||||
| [`DeCluster`](tags/de_cluster) | Управление Kubernetes-кластерами |
|
| [`DeCluster`](tags/de_cluster) | Управление Kubernetes-кластерами |
|
||||||
| [`DeClusterTemplate`](tags/de_cluster_template) | Управление шаблонами Kubernetes-кластеров |
|
| [`DeClusterTemplate`](tags/de_cluster_template) | Управление шаблонами Kubernetes-кластеров |
|
||||||
| [`DeCodeScoring`](tags/de_codescoring) | Установка CodeScoring (композиционный анализ программных проектов) |
|
| [`DeCodeScoring`](tags/de_codescoring) | Установка CodeScoring (композиционный анализ программных проектов) |
|
||||||
|
| [`DeComputes`](tags/de_computes) | Получение списка и информации о виртуальных машинах, подключение и отключение дисков |
|
||||||
| [`DeCriobox`](tags/de_criobox) | Установка Criobox (утилита для взаимодействия с CRI-O) |
|
| [`DeCriobox`](tags/de_criobox) | Установка Criobox (утилита для взаимодействия с CRI-O) |
|
||||||
|
| [`DeCsidynamix`](tags/de_csidynamix) | Установка, переустановка, проверка состояния и удаление CSI-драйвера Базис.Dynamix |
|
||||||
| [`DeCustomApp`](tags/de_customapp) | Установка пользовательских приложений |
|
| [`DeCustomApp`](tags/de_customapp) | Установка пользовательских приложений |
|
||||||
| [`DeDatabase`](tags/de_database) | Создание и удаление баз данных и пользователей PostgreSQL (требуется установленный PostgreSQL HA) |
|
| [`DeDatabase`](tags/de_database) | Создание и удаление баз данных и пользователей PostgreSQL (требуется установленный PostgreSQL HA) |
|
||||||
|
| [`DeDefectdojo`](tags/de_defectdojo) | Установка, проверка состояния и удаление DefectDojo (управление уязвимостями) |
|
||||||
| [`DeDependencyTrack`](tags/de_dependency_track) | Установка Dependency-Track (мониторинг уязвимостей зависимостей) |
|
| [`DeDependencyTrack`](tags/de_dependency_track) | Установка Dependency-Track (мониторинг уязвимостей зависимостей) |
|
||||||
| [`DeDeployment`](tags/de_deployment) | Получение информации о сборке demanager |
|
| [`DeDeployment`](tags/de_deployment) | Получение информации о сборке demanager |
|
||||||
|
| [`DeDisks`](tags/de_disks) | Создание, удаление, изменение размера дисков, получение списка и информации о дисках |
|
||||||
|
| [`DeEss`](tags/de_ess) | Установка и удаление ESS (Enterprise Security Stack), получение инцидентов |
|
||||||
|
| [`DeFalco`](tags/de_falco) | Установка, проверка состояния и удаление Falco (мониторинг безопасности во время выполнения) |
|
||||||
|
| [`DeFilebeat`](tags/de_filebeat) | Установка, проверка состояния и удаление Filebeat (сбор и отправка журналов) |
|
||||||
| [`DeFiles`](tags/de_files) | Загрузка временных файлов на сервер DE |
|
| [`DeFiles`](tags/de_files) | Загрузка временных файлов на сервер DE |
|
||||||
|
| [`DeFluentbit`](tags/de_fluentbit) | Установка, проверка состояния и удаление Fluent Bit (сбор и отправка журналов) |
|
||||||
|
| [`DeGitea`](tags/de_gitea) | Установка, проверка состояния и удаление Gitea (платформа для размещения Git-репозиториев) |
|
||||||
| [`DeGitLab`](tags/de_gitlab) | Установка GitLab (Git-репозиторий и DevOps-платформа) |
|
| [`DeGitLab`](tags/de_gitlab) | Установка GitLab (Git-репозиторий и DevOps-платформа) |
|
||||||
| [`DeGrafana`](tags/de_grafana) | Установка Grafana (визуализация метрик и мониторинг) |
|
| [`DeGrafana`](tags/de_grafana) | Установка Grafana (визуализация метрик и мониторинг) |
|
||||||
| [`DeGroup`](tags/de_group) | Управление группами пользователей DE |
|
| [`DeGroup`](tags/de_group) | Управление группами пользователей DE |
|
||||||
@@ -131,6 +137,7 @@ import desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
|||||||
| [`DeMinIO`](tags/de_minio) | Установка MinIO (S3-совместимое объектное хранилище) |
|
| [`DeMinIO`](tags/de_minio) | Установка MinIO (S3-совместимое объектное хранилище) |
|
||||||
| [`DeNexus`](tags/de_nexus) | Установка Nexus Repository (репозиторий артефактов) |
|
| [`DeNexus`](tags/de_nexus) | Установка Nexus Repository (репозиторий артефактов) |
|
||||||
| [`DeNotification`](tags/de_notification) | Управление уведомлениями |
|
| [`DeNotification`](tags/de_notification) | Управление уведомлениями |
|
||||||
|
| [`DeOpenbao`](tags/de_openbao) | Установка, проверка состояния и удаление OpenBao (хранилище секретов) |
|
||||||
| [`DeOpenELB`](tags/de_openelb) | Установка OpenELB (балансировщик нагрузки для Kubernetes) |
|
| [`DeOpenELB`](tags/de_openelb) | Установка OpenELB (балансировщик нагрузки для Kubernetes) |
|
||||||
| [`DeOperation`](tags/de_operation) | Управление журналом операций (действий) пользователей |
|
| [`DeOperation`](tags/de_operation) | Управление журналом операций (действий) пользователей |
|
||||||
| [`DePodLogger`](tags/de_podlogger) | Установка и настройка PodLogger (сборка логов подов в кластере) |
|
| [`DePodLogger`](tags/de_podlogger) | Установка и настройка PodLogger (сборка логов подов в кластере) |
|
||||||
@@ -138,6 +145,7 @@ import desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
|||||||
| [`DeProducts`](tags/de_products) | Получение информации о продуктах и их состоянии в кластере |
|
| [`DeProducts`](tags/de_products) | Получение информации о продуктах и их состоянии в кластере |
|
||||||
| [`DePrometheus`](tags/de_prometheus) | Установка Prometheus (сбор и хранение метрик) |
|
| [`DePrometheus`](tags/de_prometheus) | Установка Prometheus (сбор и хранение метрик) |
|
||||||
| [`DeProperty`](tags/de_property) | Получение информации о конфигурации demanager |
|
| [`DeProperty`](tags/de_property) | Получение информации о конфигурации demanager |
|
||||||
|
| [`DeRbpo`](tags/de_rbpo) | Установка и проверка состояния пакета инструментов конвейера РБПО |
|
||||||
| [`DeRBACManager`](tags/de_rbacmanager) | Установка RBAC Manager (управление ролями Kubernetes) |
|
| [`DeRBACManager`](tags/de_rbacmanager) | Установка RBAC Manager (управление ролями Kubernetes) |
|
||||||
| [`DeRedisCluster`](tags/de_redis_cluster) | Установка Redis Cluster (кластер in-memory СУБД Redis) |
|
| [`DeRedisCluster`](tags/de_redis_cluster) | Установка Redis Cluster (кластер in-memory СУБД Redis) |
|
||||||
| [`DeRedmine`](tags/de_redmine) | Установка Redmine (система управления проектами) |
|
| [`DeRedmine`](tags/de_redmine) | Установка Redmine (система управления проектами) |
|
||||||
@@ -149,15 +157,19 @@ import desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
|||||||
| [`DeSeaweedfsOperator`](tags/de_seaweedfs_operator) | Установка, проверка состояния и удаление оператора SeaweedFS в кластере |
|
| [`DeSeaweedfsOperator`](tags/de_seaweedfs_operator) | Установка, проверка состояния и удаление оператора SeaweedFS в кластере |
|
||||||
| [`DeSeaweedfs`](tags/de_seaweedfs) | Установка, проверка состояния и удаление SeaweedFS |
|
| [`DeSeaweedfs`](tags/de_seaweedfs) | Установка, проверка состояния и удаление SeaweedFS |
|
||||||
| [`DeValKey`](tags/de_valkey) | Установка, проверка состояния и удаление Valkey |
|
| [`DeValKey`](tags/de_valkey) | Установка, проверка состояния и удаление Valkey |
|
||||||
|
| [`DeValkeyCluster`](tags/de_valkey_cluster) | Установка, проверка состояния и удаление кластера Valkey |
|
||||||
| [`DeServchecker`](tags/de_servchecker) | Установка Servchecker (мониторинг процесса установки приложений в кластере) |
|
| [`DeServchecker`](tags/de_servchecker) | Установка Servchecker (мониторинг процесса установки приложений в кластере) |
|
||||||
|
| [`DeSherlock`](tags/de_sherlock) | Установка, проверка состояния и удаление Sherlock |
|
||||||
| [`DeSonarQube`](tags/de_sonarqube) | Установка SonarQube (анализ качества кода) |
|
| [`DeSonarQube`](tags/de_sonarqube) | Установка SonarQube (анализ качества кода) |
|
||||||
| [`DeSvacer`](tags/de_svacer) | Установка Svacer (хранение и обработка результатов статического анализа) |
|
| [`DeSvacer`](tags/de_svacer) | Установка Svacer (хранение и обработка результатов статического анализа) |
|
||||||
| [`DeTask`](tags/de_task) | Отслеживание фоновых задач DE (например, задачи создания кластера) |
|
| [`DeTask`](tags/de_task) | Отслеживание фоновых задач DE (например, задачи создания кластера) |
|
||||||
|
| [`DeTekton`](tags/de_tekton) | Установка, проверка состояния и удаление Tekton Pipelines (CI/CD-конвейеры в Kubernetes) |
|
||||||
| [`DeTrivy`](tags/de_trivy) | Установка Trivy (сканер уязвимостей) |
|
| [`DeTrivy`](tags/de_trivy) | Установка Trivy (сканер уязвимостей) |
|
||||||
| [`DeUser`](tags/de_user) | Управление пользователями Базис.Digital Energy |
|
| [`DeUser`](tags/de_user) | Управление пользователями Базис.Digital Energy |
|
||||||
| [`DeVault`](tags/de_vault) | Установка Vault (хранилище секретов) |
|
| [`DeVault`](tags/de_vault) | Установка Vault (хранилище секретов) |
|
||||||
| [`DeWorkerGroup`](tags/de_worker_group) | Управление группами рабочих узлов Kubernetes |
|
| [`DeWorkerGroup`](tags/de_worker_group) | Управление группами рабочих узлов Kubernetes |
|
||||||
| [`DeX509`](tags/de_x509) | Генерация CA-сертификатов |
|
| [`DeX509`](tags/de_x509) | Генерация CA-сертификатов |
|
||||||
|
| [`DeZabbix`](tags/de_zabbix) | Установка, проверка состояния и удаление Zabbix (мониторинг) |
|
||||||
|
|
||||||
### Базис.Dynamix
|
### Базис.Dynamix
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package desdk
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/session"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (c *Client) IssueToken(ctx context.Context, username, password string) (string, error) {
|
||||||
|
response, err := c.Session.Create(ctx, session.CreateRequest{Username: username, Password: password})
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("create session: %w", err)
|
||||||
|
}
|
||||||
|
if response.Token == "" {
|
||||||
|
return "", fmt.Errorf("create session: response contains no token")
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.Token, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetToken configures the bearer token without validating it or checking compatibility.
|
||||||
|
func (c *Client) SetToken(token string) {
|
||||||
|
c.cfg.AddDefaultHeader("Authorization", "Bearer "+token)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AuthenticateWithToken verifies the token and server compatibility before
|
||||||
|
// configuring the token for subsequent requests.
|
||||||
|
//
|
||||||
|
// The verification is skipped when SkipCompatibilityCheck is enabled.
|
||||||
|
func (c *Client) AuthenticateWithToken(ctx context.Context, token string) error {
|
||||||
|
if ctx == nil {
|
||||||
|
return fmt.Errorf("nil context")
|
||||||
|
}
|
||||||
|
if c == nil {
|
||||||
|
return fmt.Errorf("nil client")
|
||||||
|
}
|
||||||
|
if c.cfg == nil {
|
||||||
|
return fmt.Errorf("nil client configuration")
|
||||||
|
}
|
||||||
|
if strings.TrimSpace(token) == "" {
|
||||||
|
return fmt.Errorf("empty token")
|
||||||
|
}
|
||||||
|
|
||||||
|
if !c.cfg.SkipCompatibilityCheck {
|
||||||
|
probeClient := NewClientWithConfig(c.cfg.Clone())
|
||||||
|
probeClient.SetToken(token)
|
||||||
|
if err := probeClient.CheckCompatibility(ctx); err != nil {
|
||||||
|
return fmt.Errorf("check compatibility: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
c.SetToken(token)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) Authenticate(ctx context.Context, username, password string) (string, error) {
|
||||||
|
token, err := c.IssueToken(ctx, username, password)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := c.AuthenticateWithToken(ctx, token); err != nil {
|
||||||
|
return "", fmt.Errorf("authenticate with issued token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return token, nil
|
||||||
|
}
|
||||||
@@ -8,88 +8,104 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_apisix"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_apisix"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_audits"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_argocd"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_autoscaler"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_audits"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_certificates"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_autoscaler"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_certmanager"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_cdxgen"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_cluster"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_certificates"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_cluster_template"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_certmanager"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_codescoring"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_cluster"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_criobox"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_cluster_template"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_customapp"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_codescoring"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_database"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_computes"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_dependency_track"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_criobox"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_deployment"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_csidynamix"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_files"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_customapp"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_gitlab"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_database"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_grafana"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_defectdojo"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_group"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_dependency_track"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_harbor"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_deployment"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_ingress_nginx"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_disks"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_integagent"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_ess"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_istio"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_falco"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_istore"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_filebeat"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_jenkins"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_files"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_kubernetes_user"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_fluentbit"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_kyverno"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_gitea"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_kyverno_policy"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_gitlab"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_logwatcher"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_grafana"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_longhorn"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_group"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_lrecords"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_harbor"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_metrics"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_ingress_nginx"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_minio"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_integagent"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_nexus"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_istio"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_notification"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_istore"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_openelb"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_jenkins"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_operation"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_kubernetes_user"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_podlogger"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_kyverno"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_postgresql_ha"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_kyverno_policy"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_products"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_logwatcher"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_prometheus"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_longhorn"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_property"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_lrecords"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_rbacmanager"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_metrics"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_redis_cluster"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_nexus"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_redmine"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_notification"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_report_cluster"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_openbao"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_repository_apps"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_openelb"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_repository_charts"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_operation"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_repository_files"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_podlogger"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_repository_kube"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_postgresql_ha"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_seaweedfs"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_products"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_seaweedfs_operator"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_prometheus"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_servchecker"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_property"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_sonarqube"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_rbacmanager"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_svacer"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_rbpo"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_task"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_redis_cluster"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_trivy"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_redmine"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_user"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_report_cluster"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_valkey"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_repository_apps"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_vault"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_repository_charts"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_worker_group"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_repository_files"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_x509"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_repository_kube"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_account"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_seaweedfs"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_compute"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_seaweedfs_operator"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_disks"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_servchecker"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_extnet"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_sherlock"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_image"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_sonarqube"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_k8ci"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_svacer"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_rg"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_task"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_sp"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_tekton"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_tasks"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_trivy"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_version"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_user"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_vgpu"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_valkey"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/dx_vins"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_valkey_cluster"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/openid"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_vault"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/prod_dependency_track"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_worker_group"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/prod_gitlab"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_x509"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/prod_harbor"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_zabbix"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/prod_jenkins"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_account"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/prod_nexus"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_compute"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/prod_redmine"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_disks"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/prod_sonarqube"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_extnet"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/session"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_image"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_k8ci"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_rg"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_sp"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_tasks"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_version"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_vgpu"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_vins"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/openid"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/prod_dependency_track"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/prod_gitlab"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/prod_harbor"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/prod_jenkins"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/prod_nexus"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/prod_redmine"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/prod_sonarqube"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewConfiguration() *core.Configuration {
|
func NewConfiguration() *core.Configuration {
|
||||||
@@ -100,19 +116,30 @@ type Client struct {
|
|||||||
cfg *core.Configuration
|
cfg *core.Configuration
|
||||||
|
|
||||||
DeAPISIX *de_apisix.DeAPISIXService
|
DeAPISIX *de_apisix.DeAPISIXService
|
||||||
|
DeArgocd *de_argocd.DeArgocdService
|
||||||
DeAudits *de_audits.DeAuditsService
|
DeAudits *de_audits.DeAuditsService
|
||||||
DeAutoscaler *de_autoscaler.DeAutoscalerService
|
DeAutoscaler *de_autoscaler.DeAutoscalerService
|
||||||
|
DeCdxgen *de_cdxgen.DeCdxgenService
|
||||||
DeCertificates *de_certificates.DeCertificatesService
|
DeCertificates *de_certificates.DeCertificatesService
|
||||||
DeCertmanager *de_certmanager.DeCertmanagerService
|
DeCertmanager *de_certmanager.DeCertmanagerService
|
||||||
DeCluster *de_cluster.DeClusterService
|
DeCluster *de_cluster.DeClusterService
|
||||||
DeClusterTemplate *de_cluster_template.DeClusterTemplateService
|
DeClusterTemplate *de_cluster_template.DeClusterTemplateService
|
||||||
DeCodeScoring *de_codescoring.DeCodeScoringService
|
DeCodeScoring *de_codescoring.DeCodeScoringService
|
||||||
|
DeComputes *de_computes.DeComputesService
|
||||||
DeCriobox *de_criobox.DeCrioboxService
|
DeCriobox *de_criobox.DeCrioboxService
|
||||||
|
DeCsidynamix *de_csidynamix.DeCsidynamixService
|
||||||
DeCustomApp *de_customapp.DeCustomAppService
|
DeCustomApp *de_customapp.DeCustomAppService
|
||||||
DeDatabase *de_database.DeDatabaseService
|
DeDatabase *de_database.DeDatabaseService
|
||||||
|
DeDefectdojo *de_defectdojo.DeDefectdojoService
|
||||||
DeDependencyTrack *de_dependency_track.DeDependencyTrackService
|
DeDependencyTrack *de_dependency_track.DeDependencyTrackService
|
||||||
DeDeployment *de_deployment.DeDeploymentService
|
DeDeployment *de_deployment.DeDeploymentService
|
||||||
|
DeDisks *de_disks.DeDisksService
|
||||||
|
DeEss *de_ess.DeEssService
|
||||||
|
DeFalco *de_falco.DeFalcoService
|
||||||
|
DeFilebeat *de_filebeat.DeFilebeatService
|
||||||
DeFiles *de_files.DeFilesService
|
DeFiles *de_files.DeFilesService
|
||||||
|
DeFluentbit *de_fluentbit.DeFluentbitService
|
||||||
|
DeGitea *de_gitea.DeGiteaService
|
||||||
DeGitLab *de_gitlab.DeGitLabService
|
DeGitLab *de_gitlab.DeGitLabService
|
||||||
DeGrafana *de_grafana.DeGrafanaService
|
DeGrafana *de_grafana.DeGrafanaService
|
||||||
DeGroup *de_group.DeGroupService
|
DeGroup *de_group.DeGroupService
|
||||||
@@ -129,9 +156,9 @@ type Client struct {
|
|||||||
DeLonghorn *de_longhorn.DeLonghornService
|
DeLonghorn *de_longhorn.DeLonghornService
|
||||||
DeLrecords *de_lrecords.DeLrecordsService
|
DeLrecords *de_lrecords.DeLrecordsService
|
||||||
DeMetrics *de_metrics.DeMetricsService
|
DeMetrics *de_metrics.DeMetricsService
|
||||||
DeMinIO *de_minio.DeMinIOService
|
|
||||||
DeNexus *de_nexus.DeNexusService
|
DeNexus *de_nexus.DeNexusService
|
||||||
DeNotification *de_notification.DeNotificationService
|
DeNotification *de_notification.DeNotificationService
|
||||||
|
DeOpenbao *de_openbao.DeOpenbaoService
|
||||||
DeOpenELB *de_openelb.DeOpenELBService
|
DeOpenELB *de_openelb.DeOpenELBService
|
||||||
DeOperation *de_operation.DeOperationService
|
DeOperation *de_operation.DeOperationService
|
||||||
DePodLogger *de_podlogger.DePodLoggerService
|
DePodLogger *de_podlogger.DePodLoggerService
|
||||||
@@ -140,6 +167,7 @@ type Client struct {
|
|||||||
DePrometheus *de_prometheus.DePrometheusService
|
DePrometheus *de_prometheus.DePrometheusService
|
||||||
DeProperty *de_property.DePropertyService
|
DeProperty *de_property.DePropertyService
|
||||||
DeRBACManager *de_rbacmanager.DeRBACManagerService
|
DeRBACManager *de_rbacmanager.DeRBACManagerService
|
||||||
|
DeRbpo *de_rbpo.DeRbpoService
|
||||||
DeRedisCluster *de_redis_cluster.DeRedisClusterService
|
DeRedisCluster *de_redis_cluster.DeRedisClusterService
|
||||||
DeRedmine *de_redmine.DeRedmineService
|
DeRedmine *de_redmine.DeRedmineService
|
||||||
DeReportCluster *de_report_cluster.DeReportClusterService
|
DeReportCluster *de_report_cluster.DeReportClusterService
|
||||||
@@ -150,15 +178,19 @@ type Client struct {
|
|||||||
DeSeaweedfs *de_seaweedfs.DeSeaweedfsService
|
DeSeaweedfs *de_seaweedfs.DeSeaweedfsService
|
||||||
DeSeaweedfsOperator *de_seaweedfs_operator.DeSeaweedfsOperatorService
|
DeSeaweedfsOperator *de_seaweedfs_operator.DeSeaweedfsOperatorService
|
||||||
DeServchecker *de_servchecker.DeServcheckerService
|
DeServchecker *de_servchecker.DeServcheckerService
|
||||||
|
DeSherlock *de_sherlock.DeSherlockService
|
||||||
DeSonarQube *de_sonarqube.DeSonarQubeService
|
DeSonarQube *de_sonarqube.DeSonarQubeService
|
||||||
DeSvacer *de_svacer.DeSvacerService
|
DeSvacer *de_svacer.DeSvacerService
|
||||||
DeTask *de_task.DeTaskService
|
DeTask *de_task.DeTaskService
|
||||||
|
DeTekton *de_tekton.DeTektonService
|
||||||
DeTrivy *de_trivy.DeTrivyService
|
DeTrivy *de_trivy.DeTrivyService
|
||||||
DeUser *de_user.DeUserService
|
DeUser *de_user.DeUserService
|
||||||
DeValkey *de_valkey.DeValkeyService
|
DeValkey *de_valkey.DeValkeyService
|
||||||
|
DeValkeyCluster *de_valkey_cluster.DeValkeyClusterService
|
||||||
DeVault *de_vault.DeVaultService
|
DeVault *de_vault.DeVaultService
|
||||||
DeWorkerGroup *de_worker_group.DeWorkerGroupService
|
DeWorkerGroup *de_worker_group.DeWorkerGroupService
|
||||||
DeX509 *de_x509.DeX509Service
|
DeX509 *de_x509.DeX509Service
|
||||||
|
DeZabbix *de_zabbix.DeZabbixService
|
||||||
DxAccount *dx_account.DxAccountService
|
DxAccount *dx_account.DxAccountService
|
||||||
DxCompute *dx_compute.DxComputeService
|
DxCompute *dx_compute.DxComputeService
|
||||||
DxDisks *dx_disks.DxDisksService
|
DxDisks *dx_disks.DxDisksService
|
||||||
@@ -191,6 +223,7 @@ func NewClient(serverURL string, skipCertificateChecks bool) (*Client, error) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("clone http.DefaultTransport: got %T, want *http.Transport", http.DefaultTransport)
|
return nil, fmt.Errorf("clone http.DefaultTransport: got %T, want *http.Transport", http.DefaultTransport)
|
||||||
}
|
}
|
||||||
|
|
||||||
transport := defaultTransport.Clone()
|
transport := defaultTransport.Clone()
|
||||||
tlsConfig := &tls.Config{}
|
tlsConfig := &tls.Config{}
|
||||||
if transport.TLSClientConfig != nil {
|
if transport.TLSClientConfig != nil {
|
||||||
@@ -208,6 +241,7 @@ func NewClientWithConfig(cfg *core.Configuration) *Client {
|
|||||||
if cfg == nil {
|
if cfg == nil {
|
||||||
cfg = NewConfiguration()
|
cfg = NewConfiguration()
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.ServerURL = strings.TrimSuffix(cfg.ServerURL, "/")
|
cfg.ServerURL = strings.TrimSuffix(cfg.ServerURL, "/")
|
||||||
if !strings.HasSuffix(cfg.ServerURL, "/api/v1") {
|
if !strings.HasSuffix(cfg.ServerURL, "/api/v1") {
|
||||||
cfg.ServerURL += "/api/v1"
|
cfg.ServerURL += "/api/v1"
|
||||||
@@ -215,21 +249,33 @@ func NewClientWithConfig(cfg *core.Configuration) *Client {
|
|||||||
if cfg.HTTPClient == nil {
|
if cfg.HTTPClient == nil {
|
||||||
cfg.HTTPClient = http.DefaultClient
|
cfg.HTTPClient = http.DefaultClient
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &Client{cfg: cfg}
|
client := &Client{cfg: cfg}
|
||||||
client.DeAPISIX = de_apisix.NewAPIClient(cfg).DeAPISIX
|
client.DeAPISIX = de_apisix.NewAPIClient(cfg).DeAPISIX
|
||||||
|
client.DeArgocd = de_argocd.NewAPIClient(cfg).DeArgocd
|
||||||
client.DeAudits = de_audits.NewAPIClient(cfg).DeAudits
|
client.DeAudits = de_audits.NewAPIClient(cfg).DeAudits
|
||||||
client.DeAutoscaler = de_autoscaler.NewAPIClient(cfg).DeAutoscaler
|
client.DeAutoscaler = de_autoscaler.NewAPIClient(cfg).DeAutoscaler
|
||||||
|
client.DeCdxgen = de_cdxgen.NewAPIClient(cfg).DeCdxgen
|
||||||
client.DeCertificates = de_certificates.NewAPIClient(cfg).DeCertificates
|
client.DeCertificates = de_certificates.NewAPIClient(cfg).DeCertificates
|
||||||
client.DeCertmanager = de_certmanager.NewAPIClient(cfg).DeCertmanager
|
client.DeCertmanager = de_certmanager.NewAPIClient(cfg).DeCertmanager
|
||||||
client.DeCluster = de_cluster.NewAPIClient(cfg).DeCluster
|
client.DeCluster = de_cluster.NewAPIClient(cfg).DeCluster
|
||||||
client.DeClusterTemplate = de_cluster_template.NewAPIClient(cfg).DeClusterTemplate
|
client.DeClusterTemplate = de_cluster_template.NewAPIClient(cfg).DeClusterTemplate
|
||||||
client.DeCodeScoring = de_codescoring.NewAPIClient(cfg).DeCodeScoring
|
client.DeCodeScoring = de_codescoring.NewAPIClient(cfg).DeCodeScoring
|
||||||
|
client.DeComputes = de_computes.NewAPIClient(cfg).DeComputes
|
||||||
client.DeCriobox = de_criobox.NewAPIClient(cfg).DeCriobox
|
client.DeCriobox = de_criobox.NewAPIClient(cfg).DeCriobox
|
||||||
|
client.DeCsidynamix = de_csidynamix.NewAPIClient(cfg).DeCsidynamix
|
||||||
client.DeCustomApp = de_customapp.NewAPIClient(cfg).DeCustomApp
|
client.DeCustomApp = de_customapp.NewAPIClient(cfg).DeCustomApp
|
||||||
client.DeDatabase = de_database.NewAPIClient(cfg).DeDatabase
|
client.DeDatabase = de_database.NewAPIClient(cfg).DeDatabase
|
||||||
|
client.DeDefectdojo = de_defectdojo.NewAPIClient(cfg).DeDefectdojo
|
||||||
client.DeDependencyTrack = de_dependency_track.NewAPIClient(cfg).DeDependencyTrack
|
client.DeDependencyTrack = de_dependency_track.NewAPIClient(cfg).DeDependencyTrack
|
||||||
client.DeDeployment = de_deployment.NewAPIClient(cfg).DeDeployment
|
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.DeFilebeat = de_filebeat.NewAPIClient(cfg).DeFilebeat
|
||||||
client.DeFiles = de_files.NewAPIClient(cfg).DeFiles
|
client.DeFiles = de_files.NewAPIClient(cfg).DeFiles
|
||||||
|
client.DeFluentbit = de_fluentbit.NewAPIClient(cfg).DeFluentbit
|
||||||
|
client.DeGitea = de_gitea.NewAPIClient(cfg).DeGitea
|
||||||
client.DeGitLab = de_gitlab.NewAPIClient(cfg).DeGitLab
|
client.DeGitLab = de_gitlab.NewAPIClient(cfg).DeGitLab
|
||||||
client.DeGrafana = de_grafana.NewAPIClient(cfg).DeGrafana
|
client.DeGrafana = de_grafana.NewAPIClient(cfg).DeGrafana
|
||||||
client.DeGroup = de_group.NewAPIClient(cfg).DeGroup
|
client.DeGroup = de_group.NewAPIClient(cfg).DeGroup
|
||||||
@@ -246,9 +292,9 @@ func NewClientWithConfig(cfg *core.Configuration) *Client {
|
|||||||
client.DeLonghorn = de_longhorn.NewAPIClient(cfg).DeLonghorn
|
client.DeLonghorn = de_longhorn.NewAPIClient(cfg).DeLonghorn
|
||||||
client.DeLrecords = de_lrecords.NewAPIClient(cfg).DeLrecords
|
client.DeLrecords = de_lrecords.NewAPIClient(cfg).DeLrecords
|
||||||
client.DeMetrics = de_metrics.NewAPIClient(cfg).DeMetrics
|
client.DeMetrics = de_metrics.NewAPIClient(cfg).DeMetrics
|
||||||
client.DeMinIO = de_minio.NewAPIClient(cfg).DeMinIO
|
|
||||||
client.DeNexus = de_nexus.NewAPIClient(cfg).DeNexus
|
client.DeNexus = de_nexus.NewAPIClient(cfg).DeNexus
|
||||||
client.DeNotification = de_notification.NewAPIClient(cfg).DeNotification
|
client.DeNotification = de_notification.NewAPIClient(cfg).DeNotification
|
||||||
|
client.DeOpenbao = de_openbao.NewAPIClient(cfg).DeOpenbao
|
||||||
client.DeOpenELB = de_openelb.NewAPIClient(cfg).DeOpenELB
|
client.DeOpenELB = de_openelb.NewAPIClient(cfg).DeOpenELB
|
||||||
client.DeOperation = de_operation.NewAPIClient(cfg).DeOperation
|
client.DeOperation = de_operation.NewAPIClient(cfg).DeOperation
|
||||||
client.DePodLogger = de_podlogger.NewAPIClient(cfg).DePodLogger
|
client.DePodLogger = de_podlogger.NewAPIClient(cfg).DePodLogger
|
||||||
@@ -257,6 +303,7 @@ func NewClientWithConfig(cfg *core.Configuration) *Client {
|
|||||||
client.DePrometheus = de_prometheus.NewAPIClient(cfg).DePrometheus
|
client.DePrometheus = de_prometheus.NewAPIClient(cfg).DePrometheus
|
||||||
client.DeProperty = de_property.NewAPIClient(cfg).DeProperty
|
client.DeProperty = de_property.NewAPIClient(cfg).DeProperty
|
||||||
client.DeRBACManager = de_rbacmanager.NewAPIClient(cfg).DeRBACManager
|
client.DeRBACManager = de_rbacmanager.NewAPIClient(cfg).DeRBACManager
|
||||||
|
client.DeRbpo = de_rbpo.NewAPIClient(cfg).DeRbpo
|
||||||
client.DeRedisCluster = de_redis_cluster.NewAPIClient(cfg).DeRedisCluster
|
client.DeRedisCluster = de_redis_cluster.NewAPIClient(cfg).DeRedisCluster
|
||||||
client.DeRedmine = de_redmine.NewAPIClient(cfg).DeRedmine
|
client.DeRedmine = de_redmine.NewAPIClient(cfg).DeRedmine
|
||||||
client.DeReportCluster = de_report_cluster.NewAPIClient(cfg).DeReportCluster
|
client.DeReportCluster = de_report_cluster.NewAPIClient(cfg).DeReportCluster
|
||||||
@@ -267,15 +314,19 @@ func NewClientWithConfig(cfg *core.Configuration) *Client {
|
|||||||
client.DeSeaweedfs = de_seaweedfs.NewAPIClient(cfg).DeSeaweedfs
|
client.DeSeaweedfs = de_seaweedfs.NewAPIClient(cfg).DeSeaweedfs
|
||||||
client.DeSeaweedfsOperator = de_seaweedfs_operator.NewAPIClient(cfg).DeSeaweedfsOperator
|
client.DeSeaweedfsOperator = de_seaweedfs_operator.NewAPIClient(cfg).DeSeaweedfsOperator
|
||||||
client.DeServchecker = de_servchecker.NewAPIClient(cfg).DeServchecker
|
client.DeServchecker = de_servchecker.NewAPIClient(cfg).DeServchecker
|
||||||
|
client.DeSherlock = de_sherlock.NewAPIClient(cfg).DeSherlock
|
||||||
client.DeSonarQube = de_sonarqube.NewAPIClient(cfg).DeSonarQube
|
client.DeSonarQube = de_sonarqube.NewAPIClient(cfg).DeSonarQube
|
||||||
client.DeSvacer = de_svacer.NewAPIClient(cfg).DeSvacer
|
client.DeSvacer = de_svacer.NewAPIClient(cfg).DeSvacer
|
||||||
client.DeTask = de_task.NewAPIClient(cfg).DeTask
|
client.DeTask = de_task.NewAPIClient(cfg).DeTask
|
||||||
|
client.DeTekton = de_tekton.NewAPIClient(cfg).DeTekton
|
||||||
client.DeTrivy = de_trivy.NewAPIClient(cfg).DeTrivy
|
client.DeTrivy = de_trivy.NewAPIClient(cfg).DeTrivy
|
||||||
client.DeUser = de_user.NewAPIClient(cfg).DeUser
|
client.DeUser = de_user.NewAPIClient(cfg).DeUser
|
||||||
client.DeValkey = de_valkey.NewAPIClient(cfg).DeValkey
|
client.DeValkey = de_valkey.NewAPIClient(cfg).DeValkey
|
||||||
|
client.DeValkeyCluster = de_valkey_cluster.NewAPIClient(cfg).DeValkeyCluster
|
||||||
client.DeVault = de_vault.NewAPIClient(cfg).DeVault
|
client.DeVault = de_vault.NewAPIClient(cfg).DeVault
|
||||||
client.DeWorkerGroup = de_worker_group.NewAPIClient(cfg).DeWorkerGroup
|
client.DeWorkerGroup = de_worker_group.NewAPIClient(cfg).DeWorkerGroup
|
||||||
client.DeX509 = de_x509.NewAPIClient(cfg).DeX509
|
client.DeX509 = de_x509.NewAPIClient(cfg).DeX509
|
||||||
|
client.DeZabbix = de_zabbix.NewAPIClient(cfg).DeZabbix
|
||||||
client.DxAccount = dx_account.NewAPIClient(cfg).DxAccount
|
client.DxAccount = dx_account.NewAPIClient(cfg).DxAccount
|
||||||
client.DxCompute = dx_compute.NewAPIClient(cfg).DxCompute
|
client.DxCompute = dx_compute.NewAPIClient(cfg).DxCompute
|
||||||
client.DxDisks = dx_disks.NewAPIClient(cfg).DxDisks
|
client.DxDisks = dx_disks.NewAPIClient(cfg).DxDisks
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package desdk
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Supported DE version is selected during SDK generation.
|
||||||
|
const (
|
||||||
|
supportedDEMajor = 1
|
||||||
|
supportedDEMinor = 9
|
||||||
|
)
|
||||||
|
|
||||||
|
// CheckCompatibility verifies access to DE with the configured token and
|
||||||
|
// checks that this SDK version supports the connected DE version.
|
||||||
|
//
|
||||||
|
// An explicit check is performed even when SkipCompatibilityCheck is enabled.
|
||||||
|
func (c *Client) CheckCompatibility(ctx context.Context) error {
|
||||||
|
if ctx == nil {
|
||||||
|
return fmt.Errorf("nil context")
|
||||||
|
}
|
||||||
|
if c == nil {
|
||||||
|
return fmt.Errorf("nil client")
|
||||||
|
}
|
||||||
|
if c.cfg == nil {
|
||||||
|
return fmt.Errorf("nil client configuration")
|
||||||
|
}
|
||||||
|
if c.DeDeployment == nil {
|
||||||
|
return fmt.Errorf("de_deployment service is nil; call NewClient or NewClientWithConfig")
|
||||||
|
}
|
||||||
|
|
||||||
|
authorization := strings.TrimSpace(c.cfg.DefaultHeaders()["Authorization"])
|
||||||
|
if !strings.HasPrefix(authorization, "Bearer ") || strings.TrimSpace(strings.TrimPrefix(authorization, "Bearer ")) == "" {
|
||||||
|
return fmt.Errorf("token is not set")
|
||||||
|
}
|
||||||
|
|
||||||
|
deployment, err := c.DeDeployment.Get(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("get DE version: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
deMajor, deMinor, ok := versionMajorMinor(deployment.ReleaseVersion)
|
||||||
|
if !ok || deMajor != supportedDEMajor || deMinor != supportedDEMinor {
|
||||||
|
return fmt.Errorf("incompatible DE version %q: expected %d.%d.x", deployment.ReleaseVersion, supportedDEMajor, supportedDEMinor)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func versionMajorMinor(version string) (int, int, bool) {
|
||||||
|
version = strings.TrimPrefix(version, "v")
|
||||||
|
if suffix := strings.IndexAny(version, "-+"); suffix >= 0 {
|
||||||
|
version = version[:suffix]
|
||||||
|
}
|
||||||
|
|
||||||
|
parts := strings.Split(version, ".")
|
||||||
|
if len(parts) != 3 {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
major, err := strconv.Atoi(parts[0])
|
||||||
|
if err != nil || major < 0 {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
minor, err := strconv.Atoi(parts[1])
|
||||||
|
if err != nil || minor < 0 {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
patch, err := strconv.Atoi(parts[2])
|
||||||
|
if err != nil || patch < 0 {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
return major, minor, true
|
||||||
|
}
|
||||||
@@ -10,12 +10,13 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
const sdkModulePath = "repository.basistech.ru/BASIS/de-golang-sdk"
|
const sdkModulePath = "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
||||||
|
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
ServerURL string `json:"serverURL,omitempty"`
|
ServerURL string `json:"serverURL,omitempty"`
|
||||||
UserAgent string `json:"userAgent,omitempty"`
|
UserAgent string `json:"userAgent,omitempty"`
|
||||||
HTTPClient *http.Client
|
HTTPClient *http.Client
|
||||||
|
|
||||||
// SkipCompatibilityCheck disables the automatic compatibility checks performed during authentication.
|
// SkipCompatibilityCheck disables the automatic compatibility checks performed during authentication.
|
||||||
//
|
//
|
||||||
// It does not affect explicit CheckCompatibility calls.
|
// It does not affect explicit CheckCompatibility calls.
|
||||||
|
|||||||
@@ -19,9 +19,11 @@ func (e *HTTPError) Error() string {
|
|||||||
if statusText := http.StatusText(e.StatusCode); statusText != "" {
|
if statusText := http.StatusText(e.StatusCode); statusText != "" {
|
||||||
status += " " + statusText
|
status += " " + statusText
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(e.Body) == 0 {
|
if len(e.Body) == 0 {
|
||||||
return status
|
return status
|
||||||
}
|
}
|
||||||
|
|
||||||
return status + ": " + string(e.Body)
|
return status + ": " + string(e.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/dx_version"
|
||||||
|
|
||||||
|
desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -45,7 +47,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
fmt.Printf("DE version: %s\n", deVersion.ReleaseVersion)
|
fmt.Printf("DE version: %s\n", deVersion.ReleaseVersion)
|
||||||
|
|
||||||
dxVersion, err := client.DxVersion.GetVersion(ctx)
|
dxVersion, err := client.DxVersion.GetVersion(ctx, dx_version.GetVersionRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("get DX version: %v", err)
|
log.Fatalf("get DX version: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_cluster"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_cluster"
|
|
||||||
|
desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_user"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_user"
|
|
||||||
|
desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_cluster"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_cluster"
|
|
||||||
|
desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -37,7 +38,7 @@ func main() {
|
|||||||
defer cancelCreate()
|
defer cancelCreate()
|
||||||
|
|
||||||
clusterName := fmt.Sprintf("sdk-example-%d", time.Now().Unix())
|
clusterName := fmt.Sprintf("sdk-example-%d", time.Now().Unix())
|
||||||
createRes, err := client.DeCluster.Create(ctxCreate, de_cluster.CreateRequest{
|
createRes, err := client.DeCluster.Create(ctxCreate, de_cluster.CreateClusterRequest{
|
||||||
ClusterType: "denergy",
|
ClusterType: "denergy",
|
||||||
ClusterName: clusterName,
|
ClusterName: clusterName,
|
||||||
// ...
|
// ...
|
||||||
|
|||||||
@@ -9,9 +9,10 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/tags/de_istore"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/tags/de_istore"
|
|
||||||
|
desdk "repository.basistech.ru/BASIS/de-golang-sdk/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -1,10 +1,29 @@
|
|||||||
module repository.basistech.ru/BASIS/de-golang-sdk
|
module repository.basistech.ru/BASIS/de-golang-sdk/v2
|
||||||
|
|
||||||
go 1.26.0
|
go 1.26.0
|
||||||
|
|
||||||
retract (
|
require (
|
||||||
v1.0.0 // Has wrong path in go.mod
|
k8s.io/api v0.36.1
|
||||||
v1.0.1 // Still uses wrong path across files
|
k8s.io/apimachinery v0.36.1
|
||||||
v1.0.2 // 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
|
|
||||||
|
require (
|
||||||
|
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||||
|
github.com/go-logr/logr v1.4.3 // indirect
|
||||||
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
|
github.com/kr/text v0.2.0 // indirect
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
|
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||||
|
github.com/spf13/pflag v1.0.10 // indirect
|
||||||
|
github.com/x448/float16 v0.8.4 // indirect
|
||||||
|
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||||
|
golang.org/x/net v0.57.0 // indirect
|
||||||
|
golang.org/x/text v0.40.0 // indirect
|
||||||
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
|
k8s.io/klog/v2 v2.140.0 // indirect
|
||||||
|
k8s.io/kube-openapi v0.0.0-20260319004828-5883c5ee87b9 // indirect
|
||||||
|
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 // indirect
|
||||||
|
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
||||||
|
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||||
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
|
||||||
|
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||||
|
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||||
|
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
|
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||||
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
|
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
|
||||||
|
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||||
|
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||||
|
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
|
||||||
|
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||||
|
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||||
|
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||||
|
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||||
|
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
||||||
|
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
||||||
|
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
|
||||||
|
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
|
||||||
|
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
|
||||||
|
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
|
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||||
|
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
k8s.io/api v0.36.1 h1:XbL/EMj8K2aJpJtePmqUyQMsM0D4QI2pvl7YKJ20FTY=
|
||||||
|
k8s.io/api v0.36.1/go.mod h1:KOWo4ey3TINlXjeHVuwB3i+tXXnu+UcwFBHlI/9dvEo=
|
||||||
|
k8s.io/apimachinery v0.36.1 h1:G63Gjx2W+q0YD+72Vo8oY0nDnePVwnuzTmmy5ENrVSA=
|
||||||
|
k8s.io/apimachinery v0.36.1/go.mod h1:ibYOR00vW/I1kzvi5SF0dRuJ52BvKtfvRdOn35GPQ+8=
|
||||||
|
k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=
|
||||||
|
k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0=
|
||||||
|
k8s.io/kube-openapi v0.0.0-20260319004828-5883c5ee87b9 h1:Sztf7ESG9tAXRW/ACJZjrj5jhdOUqS2KFRQT+CTvu78=
|
||||||
|
k8s.io/kube-openapi v0.0.0-20260319004828-5883c5ee87b9/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0=
|
||||||
|
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbeZuxoSGOX/J+aYM=
|
||||||
|
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
|
||||||
|
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
|
||||||
|
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||||
|
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||||
|
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||||
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8=
|
||||||
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
|
||||||
|
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
|
||||||
|
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
|
||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -114,6 +114,7 @@ func (c *Client) PrepareRequest(
|
|||||||
if body != nil {
|
if body != nil {
|
||||||
return nil, errors.New("cannot specify requestBody and multipart form at the same time.")
|
return nil, errors.New("cannot specify requestBody and multipart form at the same time.")
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeReader, pipeWriter := io.Pipe()
|
pipeReader, pipeWriter := io.Pipe()
|
||||||
writer := multipart.NewWriter(pipeWriter)
|
writer := multipart.NewWriter(pipeWriter)
|
||||||
headerParams["Content-Type"] = writer.FormDataContentType()
|
headerParams["Content-Type"] = writer.FormDataContentType()
|
||||||
@@ -133,6 +134,7 @@ func (c *Client) PrepareRequest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, formFile := range formFiles {
|
for _, formFile := range formFiles {
|
||||||
var part io.Writer
|
var part io.Writer
|
||||||
part, err = writer.CreateFormFile(formFile.FieldName, filepath.Base(formFile.Filename))
|
part, err = writer.CreateFormFile(formFile.FieldName, filepath.Base(formFile.Filename))
|
||||||
@@ -143,8 +145,10 @@ func (c *Client) PrepareRequest(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = writer.Close()
|
err = writer.Close()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
closeMultipart = func(err error) {
|
closeMultipart = func(err error) {
|
||||||
pipeReader.CloseWithError(err)
|
pipeReader.CloseWithError(err)
|
||||||
pipeWriter.CloseWithError(err)
|
pipeWriter.CloseWithError(err)
|
||||||
@@ -155,6 +159,7 @@ func (c *Client) PrepareRequest(
|
|||||||
if body != nil {
|
if body != nil {
|
||||||
return nil, errors.New("cannot specify requestBody and x-www-form-urlencoded form at the same time.")
|
return nil, errors.New("cannot specify requestBody and x-www-form-urlencoded form at the same time.")
|
||||||
}
|
}
|
||||||
|
|
||||||
formBody := &bytes.Buffer{}
|
formBody := &bytes.Buffer{}
|
||||||
if _, err := formBody.WriteString(formParams.Encode()); err != nil {
|
if _, err := formBody.WriteString(formParams.Encode()); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -223,27 +228,26 @@ func setBody(body any, contentType string) (bodyBuffer *bytes.Buffer, err error)
|
|||||||
_, err = bodyBuffer.ReadFrom(reader)
|
_, err = bodyBuffer.ReadFrom(reader)
|
||||||
} else if bytesValue, ok := body.([]byte); ok {
|
} else if bytesValue, ok := body.([]byte); ok {
|
||||||
_, err = bodyBuffer.Write(bytesValue)
|
_, err = bodyBuffer.Write(bytesValue)
|
||||||
|
} else if jsonCheck.MatchString(contentType) {
|
||||||
|
err = json.NewEncoder(bodyBuffer).Encode(body)
|
||||||
} else if stringValue, ok := body.(string); ok {
|
} else if stringValue, ok := body.(string); ok {
|
||||||
_, err = bodyBuffer.WriteString(stringValue)
|
_, err = bodyBuffer.WriteString(stringValue)
|
||||||
} else if stringValue, ok := body.(*string); ok {
|
} else if stringValue, ok := body.(*string); ok {
|
||||||
_, err = bodyBuffer.WriteString(*stringValue)
|
_, err = bodyBuffer.WriteString(*stringValue)
|
||||||
} else if jsonCheck.MatchString(contentType) {
|
|
||||||
err = json.NewEncoder(bodyBuffer).Encode(body)
|
|
||||||
} else if xmlCheck.MatchString(contentType) {
|
} else if xmlCheck.MatchString(contentType) {
|
||||||
var encoded []byte
|
var encoded []byte
|
||||||
encoded, err = xml.Marshal(body)
|
encoded, err = xml.Marshal(body)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
bodyBuffer.Write(encoded)
|
bodyBuffer.Write(encoded)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return nil, fmt.Errorf("invalid body type %s\n", contentType)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if bodyBuffer.Len() == 0 {
|
|
||||||
return nil, fmt.Errorf("invalid body type %s\n", contentType)
|
|
||||||
}
|
|
||||||
return bodyBuffer, nil
|
return bodyBuffer, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+115
-39
@@ -16,9 +16,11 @@ func SelectHeaderContentType(contentTypes []string) string {
|
|||||||
if len(contentTypes) == 0 {
|
if len(contentTypes) == 0 {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if contains(contentTypes, "application/json") {
|
if contains(contentTypes, "application/json") {
|
||||||
return "application/json"
|
return "application/json"
|
||||||
}
|
}
|
||||||
|
|
||||||
return contentTypes[0]
|
return contentTypes[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +42,7 @@ func contains(haystack []string, needle string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +60,7 @@ func ParameterValueToString(obj any) string {
|
|||||||
if value.IsNil() {
|
if value.IsNil() {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
value = value.Elem()
|
value = value.Elem()
|
||||||
current := value.Interface()
|
current := value.Interface()
|
||||||
|
|
||||||
@@ -65,81 +69,152 @@ func ParameterValueToString(obj any) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if t, ok := value.Interface().(time.Time); ok {
|
||||||
|
return t.Format(time.RFC3339Nano)
|
||||||
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("%v", value.Interface())
|
return fmt.Sprintf("%v", value.Interface())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ParameterArrayToString(obj any, collectionType string) string {
|
||||||
|
value := reflect.ValueOf(obj)
|
||||||
|
for value.Kind() == reflect.Interface || value.Kind() == reflect.Ptr {
|
||||||
|
if value.IsNil() {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
value = value.Elem()
|
||||||
|
}
|
||||||
|
if !value.IsValid() {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.Join(parameterArrayValues(value), collectionDelimiter(collectionType))
|
||||||
|
}
|
||||||
|
|
||||||
func ParameterAddToHeaderOrQuery(headerOrQueryParams any, keyPrefix string, obj any, style string, collectionType string) {
|
func ParameterAddToHeaderOrQuery(headerOrQueryParams any, keyPrefix string, obj any, style string, collectionType string) {
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, "null", collectionType)
|
addParameterValue(headerOrQueryParams, keyPrefix, "null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
value := reflect.ValueOf(obj)
|
value := reflect.ValueOf(obj)
|
||||||
if !value.IsValid() {
|
if !value.IsValid() {
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, "invalid", collectionType)
|
addParameterValue(headerOrQueryParams, keyPrefix, "invalid")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for value.Kind() == reflect.Interface || value.Kind() == reflect.Ptr {
|
for value.Kind() == reflect.Interface || value.Kind() == reflect.Ptr {
|
||||||
if value.IsNil() {
|
if value.IsNil() {
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, "null", collectionType)
|
addParameterValue(headerOrQueryParams, keyPrefix, "null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
value = value.Elem()
|
value = value.Elem()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch value.Kind() {
|
||||||
|
case reflect.Slice, reflect.Array:
|
||||||
|
if value.Len() == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if style == "deepObject" {
|
||||||
|
for i := 0; i < value.Len(); i++ {
|
||||||
|
itemKeyPrefix := keyPrefix + "[" + strconv.Itoa(i) + "]"
|
||||||
|
ParameterAddToHeaderOrQuery(headerOrQueryParams, itemKeyPrefix, value.Index(i).Interface(), style, collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
items := parameterArrayValues(value)
|
||||||
|
if collectionType == "multi" {
|
||||||
|
if values, ok := headerOrQueryParams.(url.Values); ok {
|
||||||
|
for _, item := range items {
|
||||||
|
values.Add(keyPrefix, item)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addParameterValue(headerOrQueryParams, keyPrefix, strings.Join(items, collectionDelimiter(collectionType)))
|
||||||
|
|
||||||
|
case reflect.Map:
|
||||||
|
if value.IsNil() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
iter := value.MapRange()
|
||||||
|
for iter.Next() {
|
||||||
|
mapKey := fmt.Sprintf("%v", iter.Key().Interface())
|
||||||
|
ParameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, mapKey), iter.Value().Interface(), style, collectionType)
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
addParameterValue(headerOrQueryParams, keyPrefix, parameterScalarValue(value.Interface()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func parameterArrayValues(value reflect.Value) []string {
|
||||||
|
items := make([]string, value.Len())
|
||||||
|
for i := range items {
|
||||||
|
items[i] = parameterScalarValue(value.Index(i).Interface())
|
||||||
|
}
|
||||||
|
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
|
||||||
|
func parameterScalarValue(obj any) string {
|
||||||
|
if obj == nil {
|
||||||
|
return "null"
|
||||||
|
}
|
||||||
|
|
||||||
|
value := reflect.ValueOf(obj)
|
||||||
|
for value.Kind() == reflect.Interface || value.Kind() == reflect.Ptr {
|
||||||
|
if value.IsNil() {
|
||||||
|
return "null"
|
||||||
|
}
|
||||||
|
value = value.Elem()
|
||||||
|
}
|
||||||
|
|
||||||
switch value.Kind() {
|
switch value.Kind() {
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
if t, ok := value.Interface().(time.Time); ok {
|
if t, ok := value.Interface().(time.Time); ok {
|
||||||
ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType)
|
return t.Format(time.RFC3339Nano)
|
||||||
return
|
|
||||||
}
|
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, value.Type().String()+" value", collectionType)
|
|
||||||
case reflect.Slice, reflect.Array:
|
|
||||||
if value.Kind() == reflect.Slice && value.IsNil() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for i := 0; i < value.Len(); i++ {
|
|
||||||
itemKeyPrefix := keyPrefix
|
|
||||||
if style == "deepObject" {
|
|
||||||
itemKeyPrefix = keyPrefix + "[" + strconv.Itoa(i) + "]"
|
|
||||||
}
|
|
||||||
ParameterAddToHeaderOrQuery(headerOrQueryParams, itemKeyPrefix, value.Index(i).Interface(), style, collectionType)
|
|
||||||
}
|
|
||||||
case reflect.Map:
|
|
||||||
if value.IsNil() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
iter := value.MapRange()
|
|
||||||
for iter.Next() {
|
|
||||||
mapKey := fmt.Sprintf("%v", iter.Key().Interface())
|
|
||||||
ParameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, mapKey), iter.Value().Interface(), style, collectionType)
|
|
||||||
}
|
}
|
||||||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, strconv.FormatInt(value.Int(), 10), collectionType)
|
return strconv.FormatInt(value.Int(), 10)
|
||||||
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, strconv.FormatUint(value.Uint(), 10), collectionType)
|
return strconv.FormatUint(value.Uint(), 10)
|
||||||
case reflect.Float32:
|
case reflect.Float32:
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, strconv.FormatFloat(value.Float(), 'g', -1, 32), collectionType)
|
return strconv.FormatFloat(value.Float(), 'g', -1, 32)
|
||||||
case reflect.Float64:
|
case reflect.Float64:
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, strconv.FormatFloat(value.Float(), 'g', -1, 64), collectionType)
|
return strconv.FormatFloat(value.Float(), 'g', -1, 64)
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, strconv.FormatBool(value.Bool()), collectionType)
|
return strconv.FormatBool(value.Bool())
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, value.String(), collectionType)
|
return value.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
return value.Type().String() + " value"
|
||||||
|
}
|
||||||
|
|
||||||
|
func collectionDelimiter(collectionType string) string {
|
||||||
|
switch collectionType {
|
||||||
|
case "ssv":
|
||||||
|
return " "
|
||||||
|
case "tsv":
|
||||||
|
return "\t"
|
||||||
|
case "pipes":
|
||||||
|
return "|"
|
||||||
default:
|
default:
|
||||||
addParameterValue(headerOrQueryParams, keyPrefix, value.Type().String()+" value", collectionType)
|
// Swagger 2 defaults to CSV.
|
||||||
|
return ","
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func addParameterValue(headerOrQueryParams any, keyPrefix, value, collectionType string) {
|
func addParameterValue(headerOrQueryParams any, keyPrefix, value string) {
|
||||||
switch values := headerOrQueryParams.(type) {
|
switch values := headerOrQueryParams.(type) {
|
||||||
case url.Values:
|
case url.Values:
|
||||||
if collectionType == "csv" && values.Get(keyPrefix) != "" {
|
values.Add(keyPrefix, value)
|
||||||
values.Set(keyPrefix, values.Get(keyPrefix)+","+value)
|
|
||||||
} else {
|
|
||||||
values.Add(keyPrefix, value)
|
|
||||||
}
|
|
||||||
case map[string]string:
|
case map[string]string:
|
||||||
values[keyPrefix] = value
|
values[keyPrefix] = value
|
||||||
}
|
}
|
||||||
@@ -150,5 +225,6 @@ func ParameterToJSON(obj any) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(jsonBuf), err
|
return string(jsonBuf), err
|
||||||
}
|
}
|
||||||
+25
-14
@@ -13,23 +13,10 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Client) Decode(v any, body []byte, contentType string) (err error) {
|
func (c *Client) Decode(v any, body []byte, contentType string) (err error) {
|
||||||
if len(body) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if stringValue, ok := v.(*string); ok {
|
|
||||||
*stringValue = string(body)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if xmlCheck.MatchString(contentType) {
|
|
||||||
if err = xml.Unmarshal(body, v); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if jsonCheck.MatchString(contentType) {
|
if jsonCheck.MatchString(contentType) {
|
||||||
if actualObj, ok := v.(interface{ GetActualInstance() any }); ok {
|
if actualObj, ok := v.(interface{ GetActualInstance() any }); ok {
|
||||||
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok {
|
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok {
|
||||||
@@ -42,11 +29,26 @@ func (c *Client) Decode(v any, body []byte, contentType string) (err error) {
|
|||||||
} else if err = json.Unmarshal(body, v); err != nil {
|
} else if err = json.Unmarshal(body, v); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = populateEmbeddedAnyMap(v, body); err != nil {
|
if err = populateEmbeddedAnyMap(v, body); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if stringValue, ok := v.(*string); ok {
|
||||||
|
*stringValue = string(body)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if xmlCheck.MatchString(contentType) {
|
||||||
|
if err = xml.Unmarshal(body, v); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("undefined response type: %v", contentType)
|
return fmt.Errorf("undefined response type: %v", contentType)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +61,7 @@ func decodeFileResponseError(body []byte) error {
|
|||||||
if err := json.Unmarshal(body, &responseError); err != nil || !responseError.Error {
|
if err := json.Unmarshal(body, &responseError); err != nil || !responseError.Error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return &core.BackendError{
|
return &core.BackendError{
|
||||||
Code: responseError.ErrorCode,
|
Code: responseError.ErrorCode,
|
||||||
Message: responseError.Message,
|
Message: responseError.Message,
|
||||||
@@ -86,6 +89,7 @@ func (c *Client) FileResponse(resp *http.Response) (io.ReadCloser, error) {
|
|||||||
if err := decodeFileResponseError(body); err != nil {
|
if err := decodeFileResponseError(body); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return io.NopCloser(bytes.NewReader(body)), nil
|
return io.NopCloser(bytes.NewReader(body)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +101,7 @@ func populateEmbeddedAnyMapValue(value reflect.Value, data []byte) error {
|
|||||||
if !value.IsValid() {
|
if !value.IsValid() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for value.Kind() == reflect.Ptr || value.Kind() == reflect.Interface {
|
for value.Kind() == reflect.Ptr || value.Kind() == reflect.Interface {
|
||||||
if value.IsNil() {
|
if value.IsNil() {
|
||||||
return nil
|
return nil
|
||||||
@@ -115,14 +120,17 @@ func populateEmbeddedAnyMapValue(value reflect.Value, data []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return populateEmbeddedAnyMapStruct(value, trimmed)
|
return populateEmbeddedAnyMapStruct(value, trimmed)
|
||||||
|
|
||||||
case reflect.Slice, reflect.Array:
|
case reflect.Slice, reflect.Array:
|
||||||
if trimmed[0] != '[' {
|
if trimmed[0] != '[' {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var rawItems []json.RawMessage
|
var rawItems []json.RawMessage
|
||||||
if err := json.Unmarshal(trimmed, &rawItems); err != nil {
|
if err := json.Unmarshal(trimmed, &rawItems); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < value.Len() && i < len(rawItems); i++ {
|
for i := 0; i < value.Len() && i < len(rawItems); i++ {
|
||||||
if err := populateEmbeddedAnyMapValue(value.Index(i), rawItems[i]); err != nil {
|
if err := populateEmbeddedAnyMapValue(value.Index(i), rawItems[i]); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -158,10 +166,12 @@ func populateEmbeddedAnyMapStruct(value reflect.Value, data []byte) error {
|
|||||||
if fieldType.PkgPath != "" {
|
if fieldType.PkgPath != "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
rawField, ok := rawJSONField(rawObject, fieldType)
|
rawField, ok := rawJSONField(rawObject, fieldType)
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := populateEmbeddedAnyMapValue(value.Field(i), rawField); err != nil {
|
if err := populateEmbeddedAnyMapValue(value.Field(i), rawField); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -236,5 +246,6 @@ func hasJSONKeyFold(rawObject map[string]json.RawMessage, name string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -51,6 +51,20 @@ func IsRequiredParamMissing(v any) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsRequiredBodyMissing(v any) bool {
|
||||||
|
if v == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
rv := reflect.ValueOf(v)
|
||||||
|
switch rv.Kind() {
|
||||||
|
case reflect.Interface, reflect.Pointer, reflect.Map, reflect.Slice:
|
||||||
|
return rv.IsNil()
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func MissingRequiredParamsError(params []string) error {
|
func MissingRequiredParamsError(params []string) error {
|
||||||
return fmt.Errorf("required params are missing: %s", strings.Join(params, ", "))
|
return fmt.Errorf("required params are missing: %s", strings.Join(params, ", "))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,288 @@
|
|||||||
|
|
||||||
package shared
|
package shared
|
||||||
|
|
||||||
|
type AlertmanagerParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Enabled bool `json:"enabled"`
|
||||||
|
HostnamePrefix string `json:"hostnamePrefix"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
Retention string `json:"retention"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateClusterRequest struct {
|
||||||
|
// App repository
|
||||||
|
AppContainerRepository int64 `json:"appContainerRepository"`
|
||||||
|
// Audit log enable
|
||||||
|
AuditEnable bool `json:"auditEnable"`
|
||||||
|
// Audit log max age
|
||||||
|
AuditLogMaxAge int64 `json:"auditLogMaxAge"`
|
||||||
|
// Max backup of audit log
|
||||||
|
AuditLogMaxBackup int64 `json:"auditLogMaxBackup"`
|
||||||
|
// Audit log max size
|
||||||
|
AuditLogMaxSize int64 `json:"auditLogMaxSize"`
|
||||||
|
// Base64 encoded audit policy manifest
|
||||||
|
AuditPolicy string `json:"auditPolicy"`
|
||||||
|
// SEP pool ID for the balancers (for denergy type)
|
||||||
|
BalancersDynamixSEPID int64 `json:"balancersDynamixSEPId"`
|
||||||
|
// SEP pool name for the balancers (for denergy type)
|
||||||
|
BalancersDynamixSEPPool string `json:"balancersDynamixSEPPool"`
|
||||||
|
// Issuer id of certificate for external cluster
|
||||||
|
CertificateIssuerID int64 `json:"certificateIssuerId"`
|
||||||
|
// Denergy root certificate encripting key in hex form
|
||||||
|
CertificateKey string `json:"certificateKey"`
|
||||||
|
// CertificateValidityBefore is time end of life kubernetes'certs. Example 2025-08-05T12:00:00Z, time.RFC3339
|
||||||
|
CertificateValidityBefore string `json:"certificateValidityBefore"`
|
||||||
|
// Denergy private chart repository
|
||||||
|
ChartRepository int64 `json:"chartRepository"`
|
||||||
|
// Customer cluster hostname
|
||||||
|
ClusterHostname string `json:"clusterHostname"`
|
||||||
|
// Cluster machine OS build (for baremetal type)
|
||||||
|
ClusterMachineOSBuild string `json:"clusterMachineOSBuild"`
|
||||||
|
// Cluster machine OS type (for baremetal type)
|
||||||
|
ClusterMachineOSType string `json:"clusterMachineOSType"`
|
||||||
|
// Customer cluster name
|
||||||
|
ClusterName string `json:"clusterName"`
|
||||||
|
// Cluster template description for any cluster
|
||||||
|
ClusterTemplateDescription string `json:"clusterTemplateDescription"`
|
||||||
|
// Cluster template name for any cluster
|
||||||
|
ClusterTemplateName string `json:"clusterTemplateName"`
|
||||||
|
// Cluster type. Possible values: dynamix, generic, denergy, baremetal
|
||||||
|
ClusterType string `json:"clusterType"`
|
||||||
|
// Container Network Type. Possible values: flannel, calico
|
||||||
|
ContainerNetworkType string `json:"containerNetworkType"`
|
||||||
|
// Create cluster template for any cluster
|
||||||
|
CreateClusterTemplate bool `json:"createClusterTemplate"`
|
||||||
|
// Set custom maximum transmission unit
|
||||||
|
CustomMTU int64 `json:"customMTU"`
|
||||||
|
// Runtime type (for denergy type). Possible values: crio, containerd
|
||||||
|
DenergyRuntimeType string `json:"denergyRuntimeType"`
|
||||||
|
// Customer cluster description
|
||||||
|
Description string `json:"description"`
|
||||||
|
// List of strings with DNS resolvers
|
||||||
|
DomainResolvers []string `json:"domainResolvers,omitempty"`
|
||||||
|
// CI ID for the cluster (for dynamix type)
|
||||||
|
DynamixK8CIID int64 `json:"dynamixK8CIId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId"`
|
||||||
|
// Resourse group ID for the cluster (for dynamix and denergy type)
|
||||||
|
DynamixRGID int64 `json:"dynamixRGId"`
|
||||||
|
// SEP pool ID for the cluster (for dynamix type)
|
||||||
|
DynamixSEPID int64 `json:"dynamixSEPId"`
|
||||||
|
// SEP pool name for the cluster (for dynamix type)
|
||||||
|
DynamixSEPPool string `json:"dynamixSEPPool"`
|
||||||
|
// Use custom load balancer node names (hostnames) (for baremetal type)
|
||||||
|
EnableCustomLoadBalancerHostnames bool `json:"enableCustomLoadBalancerHostnames"`
|
||||||
|
// Use custom master node names (hostnames) (for baremetal type)
|
||||||
|
EnableCustomMasterHostnames bool `json:"enableCustomMasterHostnames"`
|
||||||
|
// Use custom worker node names (hostnames) (for baremetal type)
|
||||||
|
EnableCustomWorkerHostnames bool `json:"enableCustomWorkerHostnames"`
|
||||||
|
// Auth token for ESS mutation API (required if installEss)
|
||||||
|
EssAuthToken string `json:"essAuthToken"`
|
||||||
|
// VirtualAddresses Section External virtual IP address (for baremetal type)
|
||||||
|
ExtVirtualAddress string `json:"extVirtualAddress"`
|
||||||
|
// List of external loadBalancers IP addresses (for denergy types)
|
||||||
|
ExternalLBAddresses []string `json:"externalLBAddresses,omitempty"`
|
||||||
|
// Global network ID (for dynamix and denergy type)
|
||||||
|
GlobalNetworkID int64 `json:"globalNetworkId"`
|
||||||
|
// Number of iLoadBalancer CPUs (for denergy type)
|
||||||
|
ILoadBalancerCPUCount int64 `json:"iLoadBalancerCPUCount"`
|
||||||
|
// iLoadBalancer's input data for cloud-init facility
|
||||||
|
ILoadBalancerCloudInit string `json:"iLoadBalancerCloudInit"`
|
||||||
|
// Number of iLoadBalancers (for denergy type)
|
||||||
|
ILoadBalancerCount int64 `json:"iLoadBalancerCount"`
|
||||||
|
// iLoadBalancer's disk size, GB (for denergy type)
|
||||||
|
ILoadBalancerDiskSize int64 `json:"iLoadBalancerDiskSize"`
|
||||||
|
// iLoadBalancer gpu ids (for denergy type)
|
||||||
|
ILoadBalancerGPUIDs []int64 `json:"iLoadBalancerGpuIds,omitempty"`
|
||||||
|
// iLoadBalancer's ram, MB (for denergy type)
|
||||||
|
ILoadBalancerMemorySize int64 `json:"iLoadBalancerMemorySize"`
|
||||||
|
// secure shell port (denergy type) default(22) minimum(0) maximum(65535)
|
||||||
|
InitialSecureShellPort int64 `json:"initialSecureShellPort"`
|
||||||
|
// Install Criobox
|
||||||
|
InstallCriobox bool `json:"installCriobox"`
|
||||||
|
// Install CsiDynamix
|
||||||
|
InstallCsiDynamix bool `json:"installCsiDynamix"`
|
||||||
|
// Install ESS (Enterprise Security Stack)
|
||||||
|
InstallEss bool `json:"installEss"`
|
||||||
|
// Install Kyverno
|
||||||
|
InstallKyverno bool `json:"installKyverno"`
|
||||||
|
// Install metrics-server (for denergy type)
|
||||||
|
InstallMetrics bool `json:"installMetrics"`
|
||||||
|
// Install Monitoring
|
||||||
|
InstallMonitoring bool `json:"installMonitoring"`
|
||||||
|
// Install PodLogger
|
||||||
|
InstallPodLogger bool `json:"installPodLogger"`
|
||||||
|
// Install RbacManager
|
||||||
|
InstallRBACManager bool `json:"installRbacManager"`
|
||||||
|
// Install Trivy
|
||||||
|
InstallTrivy bool `json:"installTrivy"`
|
||||||
|
// Internal virtual IP address (for baremetal type)
|
||||||
|
IntVirtualAddress string `json:"intVirtualAddress"`
|
||||||
|
// List of internal loadBalancers IP addresses (for denergy types)
|
||||||
|
InternalLBAddresses []string `json:"internalLBAddresses,omitempty"`
|
||||||
|
// Install RBPO pipeline applications stack after cluster creation
|
||||||
|
IsRBPO bool `json:"isRBPO"`
|
||||||
|
// Cluster config (for generic type)
|
||||||
|
KubeConfig string `json:"kubeConfig"`
|
||||||
|
// Kubernetes repository
|
||||||
|
KubeContainerRepository int64 `json:"kubeContainerRepository"`
|
||||||
|
// Kubernetes version (for denergy type)
|
||||||
|
KubeVersion string `json:"kubeVersion"`
|
||||||
|
// list of loadbalancers ext ip addresses (for baremetal type)
|
||||||
|
LoadBalancerExternalIPAddresses []string `json:"loadBalancerExternalIPAddresses,omitempty"`
|
||||||
|
// List of load balancer names (hostnames) (for baremetal type)
|
||||||
|
LoadBalancerHostnames []string `json:"loadBalancerHostnames,omitempty"`
|
||||||
|
// list of loadbalancers int ip addresses (for baremetal type)
|
||||||
|
LoadBalancerInternalIPAddresses []string `json:"loadBalancerInternalIPAddresses,omitempty"`
|
||||||
|
// list of load balancer nodes machine OS builds(for baremetal type)
|
||||||
|
LoadBalancerMachineOSBuilds []string `json:"loadBalancerMachineOSBuilds,omitempty"`
|
||||||
|
// list of load balancer nodes machine OS types (for baremetal type)
|
||||||
|
LoadBalancerMachineOSTypes []string `json:"loadBalancerMachineOSTypes,omitempty"`
|
||||||
|
// list of system root password for loadbalancer (for baremetal type)
|
||||||
|
LoadBalancerRootPasswords []string `json:"loadBalancerRootPasswords,omitempty"`
|
||||||
|
// list of system root username for loadbalancer (for baremetal type)
|
||||||
|
LoadBalancerRootUsernames []string `json:"loadBalancerRootUsernames,omitempty"`
|
||||||
|
// list of loadbalancers secure shell ports (for baremetal type)
|
||||||
|
LoadBalancerSecureShellPorts []int64 `json:"loadBalancerSecureShellPorts,omitempty"`
|
||||||
|
// list of system user password for loadbalancer (for baremetal type)
|
||||||
|
LoadBalancerUserPasswords []string `json:"loadBalancerUserPasswords,omitempty"`
|
||||||
|
// list of system user username for loadbalancer (for baremetal type)
|
||||||
|
LoadBalancerUserUsernames []string `json:"loadBalancerUserUsernames,omitempty"`
|
||||||
|
// Local network ID (for dynamix type)
|
||||||
|
LocalNetworkID int64 `json:"localNetworkId"`
|
||||||
|
// Machine OS build (for denergy && baremetal type)
|
||||||
|
MachineOSBuild string `json:"machineOSBuild"`
|
||||||
|
// Machine provider OS ID (for denergy type)
|
||||||
|
MachineOSImageID int64 `json:"machineOSImageId"`
|
||||||
|
// Machine OS type (for denergy && baremetal type)
|
||||||
|
MachineOSType string `json:"machineOSType"`
|
||||||
|
// Machine provider (for denergy type)
|
||||||
|
MachineProvider string `json:"machineProvider"`
|
||||||
|
// List of masters IP addresses (for denergy types)
|
||||||
|
MasterAddresses []string `json:"masterAddresses,omitempty"`
|
||||||
|
// Number of master CPUs (for dynamix, denergy types)
|
||||||
|
MasterCPUCount int64 `json:"masterCPUCount"`
|
||||||
|
// Master's input data for cloud-init facility
|
||||||
|
MasterCloudInit string `json:"masterCloudInit"`
|
||||||
|
// Mumber of masters (for dynamix, denergy types)
|
||||||
|
MasterCount int64 `json:"masterCount"`
|
||||||
|
// Master's disk size, GB (for dynamix, denergy types)
|
||||||
|
MasterDiskSize int64 `json:"masterDiskSize"`
|
||||||
|
// Master gpu ids (for denergy type)
|
||||||
|
MasterGPUIDs []int64 `json:"masterGpuIds,omitempty"`
|
||||||
|
// List of master names (hostnames) (for baremetal type)
|
||||||
|
MasterHostnames []string `json:"masterHostnames,omitempty"`
|
||||||
|
// Master's ram, MB (for dynamix, denergy types)
|
||||||
|
MasterMemorySize int64 `json:"masterMemorySize"`
|
||||||
|
// list of master nodes ext ip addresses (for baremetal type)
|
||||||
|
MasterNodesExternalIPAdresses []string `json:"masterNodesExternalIPAdresses,omitempty"`
|
||||||
|
// list of master nodes machine OS builds(for baremetal type)
|
||||||
|
MasterNodesMachineOSBuilds []string `json:"masterNodesMachineOSBuilds,omitempty"`
|
||||||
|
// list of master nodes machine OS types (for baremetal type)
|
||||||
|
MasterNodesMachineOSTypes []string `json:"masterNodesMachineOSTypes,omitempty"`
|
||||||
|
// list of system root password for master nodes (for baremetal type)
|
||||||
|
MasterNodesRootPasswords []string `json:"masterNodesRootPasswords,omitempty"`
|
||||||
|
// list of system root username for master nodes (for baremetal type)
|
||||||
|
MasterNodesRootUsernames []string `json:"masterNodesRootUsernames,omitempty"`
|
||||||
|
// list of master nodes secure shell ports (for baremetal type)
|
||||||
|
MasterNodesSecureShellPorts []int64 `json:"masterNodesSecureShellPorts,omitempty"`
|
||||||
|
// list of system user password for master nodes (for baremetal type)
|
||||||
|
MasterNodesUserPasswords []string `json:"masterNodesUserPasswords,omitempty"`
|
||||||
|
// list of system user username for master nodes (for baremetal type)
|
||||||
|
MasterNodesUserUsernames []string `json:"masterNodesUserUsernames,omitempty"`
|
||||||
|
// SEP pool ID for the masters (for denergy type)
|
||||||
|
MastersDynamixSEPID int64 `json:"mastersDynamixSEPId"`
|
||||||
|
// SEP pool name for the masters (for denergy type)
|
||||||
|
MastersDynamixSEPPool string `json:"mastersDynamixSEPPool"`
|
||||||
|
// Operation system package repository
|
||||||
|
PackageRepository int64 `json:"packageRepository"`
|
||||||
|
// Enable pod killer
|
||||||
|
Podkiller bool `json:"podkiller"`
|
||||||
|
// True for use Denergy DNS for services
|
||||||
|
ProvideDNS bool `json:"provideDNS"`
|
||||||
|
// Per-application install parameters of the RBPO pipeline stack (required if isRBPO)
|
||||||
|
RbpoApps []InstallAppItem `json:"rbpoApps,omitempty"`
|
||||||
|
// Time to check report
|
||||||
|
RequeueInterval int64 `json:"requeueInterval"`
|
||||||
|
// Save computes in case of cluster creation error
|
||||||
|
SaveComputesOnFailedK8SCreation bool `json:"saveComputesOnFailedK8SCreation"`
|
||||||
|
// Set severity levels
|
||||||
|
Severities []string `json:"severities,omitempty"`
|
||||||
|
// Share cluster template for any users
|
||||||
|
SharedClusterTemplate bool `json:"sharedClusterTemplate"`
|
||||||
|
// Set skip Namespaces
|
||||||
|
SkipNamespaces []string `json:"skipNamespaces,omitempty"`
|
||||||
|
// Storage policy id (for denergy)
|
||||||
|
StoragePolicyID int64 `json:"storagePolicyId"`
|
||||||
|
// Use custom external loadBalancer addresses (for denergy type)
|
||||||
|
UseCustomExternalLBAddresses bool `json:"useCustomExternalLBAddresses"`
|
||||||
|
// Use custom internal loadBalancer addresses (for denergy type)
|
||||||
|
UseCustomInternalLBAddresses bool `json:"useCustomInternalLBAddresses"`
|
||||||
|
// Use custom external master addresses (for denergy type)
|
||||||
|
UseCustomMasterIPAddresses bool `json:"useCustomMasterIPAddresses"`
|
||||||
|
// Use custom external worker addresses (for denergy type)
|
||||||
|
UseCustomWorkerIPAddresses bool `json:"useCustomWorkerIPAddresses"`
|
||||||
|
// Use dynamix external network (for denergy type)
|
||||||
|
UseDynamixExtNet bool `json:"useDynamixExtnet"`
|
||||||
|
// Vins global network ID (for dynamix type)
|
||||||
|
ViNSGlobalNetworkID int64 `json:"vinsGlobalNetworkId"`
|
||||||
|
// List of workers IP addresses (for denergy types)
|
||||||
|
WorkerAddresses []string `json:"workerAddresses,omitempty"`
|
||||||
|
// List of strings with annotations for worker group. example: 'key1=value1,key2=value2'
|
||||||
|
WorkerAnnotations []string `json:"workerAnnotations,omitempty"`
|
||||||
|
// Number of worker CPUs (for dynamix, denergy types)
|
||||||
|
WorkerCPUCount int64 `json:"workerCPUCount"`
|
||||||
|
// Worker's input data for cloud-init facility
|
||||||
|
WorkerCloudInit string `json:"workerCloudInit"`
|
||||||
|
// Number of workers (for dynamix, denergy types)
|
||||||
|
WorkerCount int64 `json:"workerCount"`
|
||||||
|
// Worker's disk size, GB (for dynamix, denergy types)
|
||||||
|
WorkerDiskSize int64 `json:"workerDiskSize"`
|
||||||
|
// Worker gpu ids (for denergy type)
|
||||||
|
WorkerGPUIDs []int64 `json:"workerGpuIds,omitempty"`
|
||||||
|
// Name for initial worker group of the cluster
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
// List of worker names (hostnames) (for baremetal type)
|
||||||
|
WorkerHostnames []string `json:"workerHostnames,omitempty"`
|
||||||
|
// List of strings with labels for worker group. example: 'key1=value1,key2=value2'
|
||||||
|
WorkerLabels []string `json:"workerLabels,omitempty"`
|
||||||
|
// Worker's ram, MB (for dynamix, denergy types)
|
||||||
|
WorkerMemorySize int64 `json:"workerMemorySize"`
|
||||||
|
// list of worker nodes ext ip addresses (for baremetal type)
|
||||||
|
WorkerNodesExternalIPAdresses []string `json:"workerNodesExternalIPAdresses,omitempty"`
|
||||||
|
// list of worker nodes machine OS builds(for baremetal type)
|
||||||
|
WorkerNodesMachineOSBuilds []string `json:"workerNodesMachineOSBuilds,omitempty"`
|
||||||
|
// list of worker nodes machine OS types (for baremetal type)
|
||||||
|
WorkerNodesMachineOSTypes []string `json:"workerNodesMachineOSTypes,omitempty"`
|
||||||
|
// list of system root password for worker nodes (for baremetal type)
|
||||||
|
WorkerNodesRootPasswords []string `json:"workerNodesRootPasswords,omitempty"`
|
||||||
|
// list of system root username for worker nodes (for baremetal type)
|
||||||
|
WorkerNodesRootUsernames []string `json:"workerNodesRootUsernames,omitempty"`
|
||||||
|
// list of worker nodes secure shell ports (for baremetal type)
|
||||||
|
WorkerNodesSecureShellPorts []int64 `json:"workerNodesSecureShellPorts,omitempty"`
|
||||||
|
// list of system user password for worker nodes (for baremetal type)
|
||||||
|
WorkerNodesUserPasswords []string `json:"workerNodesUserPasswords,omitempty"`
|
||||||
|
// list of system user username for worker nodes (for baremetal type)
|
||||||
|
WorkerNodesUserUsernames []string `json:"workerNodesUserUsernames,omitempty"`
|
||||||
|
// List of strings with taints for worker group. example: 'key1=value1:NoSchedule,key2=value2:NoExecute, key3=value3:PreferNoSchedule'
|
||||||
|
WorkerTaints []string `json:"workerTaints,omitempty"`
|
||||||
|
// SEP pool ID for the workers (for denergy type)
|
||||||
|
WorkersDynamixSEPID int64 `json:"workersDynamixSEPId"`
|
||||||
|
// SEP pool name for the workers (for denergy type)
|
||||||
|
WorkersDynamixSEPPool string `json:"workersDynamixSEPPool"`
|
||||||
|
}
|
||||||
|
|
||||||
type CreateTaskResult struct {
|
type CreateTaskResult struct {
|
||||||
TaskID int64 `json:"taskId,omitempty"`
|
TaskID int64 `json:"taskId,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -18,11 +300,80 @@ type DependencyAny struct {
|
|||||||
Key string `json:"key,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DynamixPlatform struct {
|
||||||
|
AppID string `json:"appID"`
|
||||||
|
AppSecret string `json:"appSecret"`
|
||||||
|
AuthDomain string `json:"authDomain"`
|
||||||
|
AuthType string `json:"authType"`
|
||||||
|
ID int64 `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
SsoURL string `json:"ssoURL"`
|
||||||
|
URL string `json:"url"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilebeatParams struct {
|
||||||
|
FilebeatYMLConfig string `json:"filebeatYMLConfig"`
|
||||||
|
SecretParams map[string]string `json:"secretParams,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FluentBitParams struct {
|
||||||
|
LogOutputHost string `json:"logOutputHost"`
|
||||||
|
LogOutputPassword string `json:"logOutputPassword"`
|
||||||
|
LogOutputPort string `json:"logOutputPort"`
|
||||||
|
LogOutputUser string `json:"logOutputUser"`
|
||||||
|
}
|
||||||
|
|
||||||
type ImageDescr struct {
|
type ImageDescr struct {
|
||||||
Image string `json:"image,omitempty"`
|
Image string `json:"image,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type InstallAppItem struct {
|
||||||
|
AppName string `json:"appName"`
|
||||||
|
Params InstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type InstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
ClassReplicaCount int64 `json:"classReplicaCount"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Filebeat FilebeatParams `json:"filebeat"`
|
||||||
|
Fluentbit FluentBitParams `json:"fluentbit"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
HTTPPort int64 `json:"httpPort"`
|
||||||
|
HTTPSPort int64 `json:"httpsPort"`
|
||||||
|
IntegagentHostname string `json:"integagentHostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Openbao OpenbaoParams `json:"openbao"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Prometheus PrometheusParams `json:"prometheus"`
|
||||||
|
PsqlAddress string `json:"psqlAddress"`
|
||||||
|
PsqlDatabase string `json:"psqlDatabase"`
|
||||||
|
PsqlPassword string `json:"psqlPassword"`
|
||||||
|
PsqlUsername string `json:"psqlUsername"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
Seaweedfs SeaweedfsParams `json:"seaweedfs"`
|
||||||
|
SecretKey string `json:"secretKey"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OpenbaoParams struct {
|
||||||
|
AuditStorageEnabled bool `json:"auditStorageEnabled"`
|
||||||
|
CsiProviderEnabled bool `json:"csiProviderEnabled"`
|
||||||
|
InjectorEnabled bool `json:"injectorEnabled"`
|
||||||
|
}
|
||||||
|
|
||||||
type ProductDescr struct {
|
type ProductDescr struct {
|
||||||
Depends []string `json:"depends,omitempty"`
|
Depends []string `json:"depends,omitempty"`
|
||||||
DependsAny []DependencyAny `json:"dependsAny,omitempty"`
|
DependsAny []DependencyAny `json:"dependsAny,omitempty"`
|
||||||
@@ -32,12 +383,29 @@ type ProductDescr struct {
|
|||||||
ProductVersion string `json:"productVersion,omitempty"`
|
ProductVersion string `json:"productVersion,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PrometheusParams struct {
|
||||||
|
Alertmanager AlertmanagerParams `json:"alertmanager"`
|
||||||
|
EvaluationInterval string `json:"evaluationInterval"`
|
||||||
|
Retention string `json:"retention"`
|
||||||
|
RetentionSize string `json:"retentionSize"`
|
||||||
|
ScrapeInterval string `json:"scrapeInterval"`
|
||||||
|
Thanos ToggleParams `json:"thanos"`
|
||||||
|
}
|
||||||
|
|
||||||
type Rule struct {
|
type Rule struct {
|
||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SeaweedfsParams struct {
|
||||||
|
MasterReplicas int64 `json:"masterReplicas"`
|
||||||
|
Replication string `json:"replication"`
|
||||||
|
VolumeReplicas int64 `json:"volumeReplicas"`
|
||||||
|
VolumeSizeLimitMB int64 `json:"volumeSizeLimitMB"`
|
||||||
|
VolumeStorageGb int64 `json:"volumeStorageGb"`
|
||||||
|
}
|
||||||
|
|
||||||
type TaskBrief struct {
|
type TaskBrief struct {
|
||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
Done bool `json:"done,omitempty"`
|
Done bool `json:"done,omitempty"`
|
||||||
@@ -52,6 +420,10 @@ type TaskBrief struct {
|
|||||||
SubjectType string `json:"subjectType,omitempty"`
|
SubjectType string `json:"subjectType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ToggleParams struct {
|
||||||
|
Enabled bool `json:"enabled"`
|
||||||
|
}
|
||||||
|
|
||||||
type Version struct {
|
type Version struct {
|
||||||
Major int64 `json:"major,omitempty"`
|
Major int64 `json:"major,omitempty"`
|
||||||
Minor int64 `json:"minor,omitempty"`
|
Minor int64 `json:"minor,omitempty"`
|
||||||
|
|||||||
@@ -8,25 +8,14 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeAPISIXService service
|
type DeAPISIXService service
|
||||||
|
|
||||||
type DescribeRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for checking whether the apisix is installed in the cluster
|
|
||||||
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
|
|
||||||
// true for checking k8s apisix pods liveness and the availability of the API
|
|
||||||
CheckLiveness bool `json:"checkLiveness" form:"checkLiveness"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get apisix by id
|
// Get apisix by id
|
||||||
func (a *DeAPISIXService) Describe(ctx context.Context, req DescribeRequest) (DescribeAPISIXResult, error) {
|
func (a *DeAPISIXService) Describe(ctx context.Context, body DescribeAPISIXRequest) (DescribeAPISIXResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -38,8 +27,8 @@ func (a *DeAPISIXService) Describe(ctx context.Context, req DescribeRequest) (De
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -48,7 +37,7 @@ func (a *DeAPISIXService) Describe(ctx context.Context, req DescribeRequest) (De
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/apisix/describe"
|
requestPath := basePath + "/digitalenergy/apisix/describe"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -61,13 +50,14 @@ func (a *DeAPISIXService) Describe(ctx context.Context, req DescribeRequest) (De
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkLiveness", req.CheckLiveness, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -86,11 +76,13 @@ func (a *DeAPISIXService) Describe(ctx context.Context, req DescribeRequest) (De
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DescribeAPISIXResultWithError
|
var wrappedResp DescribeAPISIXResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -102,35 +94,8 @@ func (a *DeAPISIXService) Describe(ctx context.Context, req DescribeRequest) (De
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstallRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// hostname for apisix
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
Hostname string `json:"hostname" form:"hostname"`
|
|
||||||
// http port
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
HTTPPort int64 `json:"httpPort" form:"httpPort"`
|
|
||||||
// Hostname for integagent
|
|
||||||
IntegagentHostname string `json:"integagentHostname" form:"integagentHostname"`
|
|
||||||
// https port
|
|
||||||
HTTPSPort int64 `json:"httpsPort" form:"httpsPort"`
|
|
||||||
// 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"`
|
|
||||||
// worker group name
|
|
||||||
WorkerGroupName string `json:"workerGroupName" form:"workerGroupName"`
|
|
||||||
// download chart anyway
|
|
||||||
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Install apisix in cluster
|
// Install apisix in cluster
|
||||||
func (a *DeAPISIXService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
|
func (a *DeAPISIXService) Install(ctx context.Context, body InstallAPISIXRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -142,14 +107,8 @@ func (a *DeAPISIXService) Install(ctx context.Context, req InstallRequest) (Crea
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.Hostname) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "hostname")
|
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.HTTPPort) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "httpPort")
|
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -158,7 +117,7 @@ func (a *DeAPISIXService) Install(ctx context.Context, req InstallRequest) (Crea
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/apisix/install"
|
requestPath := basePath + "/digitalenergy/apisix/install"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -171,19 +130,14 @@ func (a *DeAPISIXService) Install(ctx context.Context, req InstallRequest) (Crea
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "httpPort", req.HTTPPort, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "httpsPort", req.HTTPSPort, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -202,11 +156,13 @@ func (a *DeAPISIXService) Install(ctx context.Context, req InstallRequest) (Crea
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -218,19 +174,8 @@ func (a *DeAPISIXService) Install(ctx context.Context, req InstallRequest) (Crea
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type UninstallRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for deleting the apisix even if it is not registered
|
|
||||||
CleanAlways bool `json:"cleanAlways" form:"cleanAlways"`
|
|
||||||
// true for ignoring dns server errors
|
|
||||||
IgnoreDNSError bool `json:"ignoreDnsError" form:"ignoreDnsError"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uninstall apisix from cluster
|
// Uninstall apisix from cluster
|
||||||
func (a *DeAPISIXService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
|
func (a *DeAPISIXService) Uninstall(ctx context.Context, body UninstallAPISIXRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -242,8 +187,8 @@ func (a *DeAPISIXService) Uninstall(ctx context.Context, req UninstallRequest) (
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -252,7 +197,7 @@ func (a *DeAPISIXService) Uninstall(ctx context.Context, req UninstallRequest) (
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/apisix/uninstall"
|
requestPath := basePath + "/digitalenergy/apisix/uninstall"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -265,13 +210,14 @@ func (a *DeAPISIXService) Uninstall(ctx context.Context, req UninstallRequest) (
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -290,11 +236,13 @@ func (a *DeAPISIXService) Uninstall(ctx context.Context, req UninstallRequest) (
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_apisix
|
package de_apisix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -2,6 +2,26 @@
|
|||||||
|
|
||||||
package de_apisix
|
package de_apisix
|
||||||
|
|
||||||
|
type APISIXInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
HTTPPort int64 `json:"httpPort"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
type APISIXRecord struct {
|
type APISIXRecord struct {
|
||||||
Addresses map[string]string `json:"addresses,omitempty"`
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
ClusterID int64 `json:"clusterId,omitempty"`
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
@@ -17,6 +37,12 @@ type APISIXRecord struct {
|
|||||||
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DescribeAPISIXRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
type DescribeAPISIXResult struct {
|
type DescribeAPISIXResult struct {
|
||||||
CheckListOk bool `json:"checkListOk,omitempty"`
|
CheckListOk bool `json:"checkListOk,omitempty"`
|
||||||
Description ProductDescr `json:"description,omitempty"`
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
@@ -31,3 +57,18 @@ type DescribeAPISIXResultWithError struct {
|
|||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Result DescribeAPISIXResult `json:"result,omitempty"`
|
Result DescribeAPISIXResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type InstallAPISIXRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params APISIXInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallAPISIXRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
package de_apisix
|
package de_apisix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
|||||||
@@ -0,0 +1,255 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_argocd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeArgocdService service
|
||||||
|
|
||||||
|
// Get argocd by id
|
||||||
|
func (a *DeArgocdService) Describe(ctx context.Context, body DescribeArgocdRequest) (DescribeArgocdResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result DescribeArgocdResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/argocd/describe"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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 DescribeArgocdResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install argocd in cluster
|
||||||
|
func (a *DeArgocdService) Install(ctx context.Context, body InstallArgocdRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/argocd/install"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uninstall argocd from cluster
|
||||||
|
func (a *DeArgocdService) Uninstall(ctx context.Context, body UninstallArgocdRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/argocd/uninstall"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_argocd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeArgocd *DeArgocdService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeArgocd = (*DeArgocdService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+74
@@ -0,0 +1,74 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_argocd
|
||||||
|
|
||||||
|
type ArgocdInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgocdRecord struct {
|
||||||
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
|
Hostnames map[string]string `json:"hostnames,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
OwnerID int64 `json:"ownerId,omitempty"`
|
||||||
|
Password string `json:"password,omitempty"`
|
||||||
|
ProductName string `json:"productName,omitempty"`
|
||||||
|
ProductVersion string `json:"productVersion,omitempty"`
|
||||||
|
StorageType string `json:"storageType,omitempty"`
|
||||||
|
TaskIDs []int64 `json:"taskIds,omitempty"`
|
||||||
|
Username string `json:"username,omitempty"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeArgocdRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeArgocdResult struct {
|
||||||
|
CheckListOk bool `json:"checkListOk,omitempty"`
|
||||||
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
|
Installed bool `json:"installed,omitempty"`
|
||||||
|
Registered bool `json:"registered,omitempty"`
|
||||||
|
Registry ArgocdRecord `json:"registry,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeArgocdResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result DescribeArgocdResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type InstallArgocdRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params ArgocdInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallArgocdRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_argocd
|
||||||
|
|
||||||
|
import (
|
||||||
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
|
type ProductDescr = shared.ProductDescr
|
||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeAuditsService service
|
type DeAuditsService service
|
||||||
@@ -135,6 +135,7 @@ func (a *DeAuditsService) Link(ctx context.Context, req LinkRequest) (CreateTask
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "nodeId", req.NodeID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "nodeId", req.NodeID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "timeAfter", req.TimeAfter, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "timeAfter", req.TimeAfter, "", "")
|
||||||
@@ -143,10 +144,12 @@ func (a *DeAuditsService) Link(ctx context.Context, req LinkRequest) (CreateTask
|
|||||||
utils.ParameterAddToHeaderOrQuery(formParams, "verb", req.Verb, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "verb", req.Verb, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "decision", req.Decision, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "decision", req.Decision, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "sourceIp", req.SourceIP, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "sourceIp", req.SourceIP, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -165,11 +168,13 @@ func (a *DeAuditsService) Link(ctx context.Context, req LinkRequest) (CreateTask
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -230,14 +235,17 @@ func (a *DeAuditsService) List(ctx context.Context, req ListRequest) (ListLinksA
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "showActive", req.ShowActive, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "showActive", req.ShowActive, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "limit", req.Limit, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "limit", req.Limit, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "page", req.Page, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "page", req.Page, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -256,11 +264,13 @@ func (a *DeAuditsService) List(ctx context.Context, req ListRequest) (ListLinksA
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp ListLinksAuditsResultWithError
|
var wrappedResp ListLinksAuditsResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_audits
|
package de_audits
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
package de_audits
|
package de_audits
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeAutoscalerService service
|
type DeAutoscalerService service
|
||||||
@@ -64,12 +64,15 @@ func (a *DeAutoscalerService) ListAutoscalerDeployments(ctx context.Context, req
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -88,11 +91,13 @@ func (a *DeAutoscalerService) ListAutoscalerDeployments(ctx context.Context, req
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp ListAutoscalerDeploymentsResultWithError
|
var wrappedResp ListAutoscalerDeploymentsResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -161,13 +166,16 @@ func (a *DeAutoscalerService) TurnOffAutoscalerDeployment(ctx context.Context, r
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "nameDeployment", req.NameDeployment, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "nameDeployment", req.NameDeployment, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -186,11 +194,13 @@ func (a *DeAutoscalerService) TurnOffAutoscalerDeployment(ctx context.Context, r
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp TurnOffAutoscalerDeploymentResultWithError
|
var wrappedResp TurnOffAutoscalerDeploymentResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -280,16 +290,19 @@ func (a *DeAutoscalerService) TurnOnAutoscalerDeployment(ctx context.Context, re
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "nameDeployment", req.NameDeployment, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "nameDeployment", req.NameDeployment, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "minPods", req.MinPods, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "minPods", req.MinPods, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "maxPods", req.MaxPods, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "maxPods", req.MaxPods, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cpuPercent", req.CPUPercent, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "cpuPercent", req.CPUPercent, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -308,11 +321,13 @@ func (a *DeAutoscalerService) TurnOnAutoscalerDeployment(ctx context.Context, re
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp TurnOnAutoscalerDeploymentResultWithError
|
var wrappedResp TurnOnAutoscalerDeploymentResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -387,16 +402,19 @@ func (a *DeAutoscalerService) UpdateAutoscalerDeployment(ctx context.Context, re
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "nameDeployment", req.NameDeployment, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "nameDeployment", req.NameDeployment, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "namespace", req.Namespace, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "minPods", req.MinPods, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "minPods", req.MinPods, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "maxPods", req.MaxPods, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "maxPods", req.MaxPods, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cpuPercent", req.CPUPercent, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "cpuPercent", req.CPUPercent, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -415,11 +433,13 @@ func (a *DeAutoscalerService) UpdateAutoscalerDeployment(ctx context.Context, re
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp UpdateAutoscalerDeploymentResultWithError
|
var wrappedResp UpdateAutoscalerDeploymentResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_autoscaler
|
package de_autoscaler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -0,0 +1,255 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_cdxgen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeCdxgenService service
|
||||||
|
|
||||||
|
// Get Cdxgen info by cluster id
|
||||||
|
func (a *DeCdxgenService) Describe(ctx context.Context, body DescribeCdxgenRequest) (DescribeCdxgenResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result DescribeCdxgenResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/cdxgen/describe"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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 DescribeCdxgenResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install Cdxgen in cluster
|
||||||
|
func (a *DeCdxgenService) Install(ctx context.Context, body InstallCdxgenRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/cdxgen/install"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uninstall Cdxgen from cluster
|
||||||
|
func (a *DeCdxgenService) Uninstall(ctx context.Context, body UninstallCdxgenRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/cdxgen/uninstall"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_cdxgen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeCdxgen *DeCdxgenService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeCdxgen = (*DeCdxgenService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+73
@@ -0,0 +1,73 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_cdxgen
|
||||||
|
|
||||||
|
type CdxgenInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CdxgenRecord struct {
|
||||||
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
|
Hostnames map[string]string `json:"hostnames,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
OwnerID int64 `json:"ownerId,omitempty"`
|
||||||
|
Password string `json:"password,omitempty"`
|
||||||
|
ProductName string `json:"productName,omitempty"`
|
||||||
|
ProductVersion string `json:"productVersion,omitempty"`
|
||||||
|
StorageType string `json:"storageType,omitempty"`
|
||||||
|
TaskIDs []int64 `json:"taskIds,omitempty"`
|
||||||
|
Username string `json:"username,omitempty"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeCdxgenRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeCdxgenResult struct {
|
||||||
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
|
Installed bool `json:"installed,omitempty"`
|
||||||
|
Registered bool `json:"registered,omitempty"`
|
||||||
|
Registry CdxgenRecord `json:"registry,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeCdxgenResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result DescribeCdxgenResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type InstallCdxgenRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params CdxgenInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallCdxgenRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_cdxgen
|
||||||
|
|
||||||
|
import (
|
||||||
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
|
type ProductDescr = shared.ProductDescr
|
||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeCertificatesService service
|
type DeCertificatesService service
|
||||||
@@ -57,11 +57,14 @@ func (a *DeCertificatesService) KubeadmCheckExpiration(ctx context.Context, req
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -80,11 +83,13 @@ func (a *DeCertificatesService) KubeadmCheckExpiration(ctx context.Context, req
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp KubeadmCertsCheckExpirationResultWithError
|
var wrappedResp KubeadmCertsCheckExpirationResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -139,11 +144,14 @@ func (a *DeCertificatesService) KubeadmRenew(ctx context.Context, req KubeadmRen
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -162,11 +170,13 @@ func (a *DeCertificatesService) KubeadmRenew(ctx context.Context, req KubeadmRen
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp KubeadmCertsRenewResultWithError
|
var wrappedResp KubeadmCertsRenewResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_certificates
|
package de_certificates
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -8,25 +8,14 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeCertmanagerService service
|
type DeCertmanagerService service
|
||||||
|
|
||||||
type DescribeRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for checking whether the certmanager is installed in the cluster
|
|
||||||
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
|
|
||||||
// true for checking k8s certmanager pods liveness and the availability of the API
|
|
||||||
CheckLiveness bool `json:"CheckLiveness" form:"CheckLiveness"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get certmanager by id
|
// Get certmanager by id
|
||||||
func (a *DeCertmanagerService) Describe(ctx context.Context, req DescribeRequest) (DescribeCertmanagerResult, error) {
|
func (a *DeCertmanagerService) Describe(ctx context.Context, body DescribeCertmanagerRequest) (DescribeCertmanagerResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -38,8 +27,8 @@ func (a *DeCertmanagerService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -48,7 +37,7 @@ func (a *DeCertmanagerService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/certmanager/describe"
|
requestPath := basePath + "/digitalenergy/certmanager/describe"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -61,13 +50,14 @@ func (a *DeCertmanagerService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "CheckLiveness", req.CheckLiveness, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -86,11 +76,13 @@ func (a *DeCertmanagerService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DescribeCertmanagerResultWithError
|
var wrappedResp DescribeCertmanagerResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -102,29 +94,8 @@ func (a *DeCertmanagerService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstallRequest struct {
|
|
||||||
// Cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// Hostname for certmanager
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
ChartsRepositoryID int64 `json:"chartsRepositoryId" form:"chartsRepositoryId"`
|
|
||||||
// worker group name for certmanager
|
|
||||||
WorkerGroupName string `json:"workerGroupName" form:"workerGroupName"`
|
|
||||||
// download chart anyway
|
|
||||||
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Install certmanager in cluster
|
// Install certmanager in cluster
|
||||||
func (a *DeCertmanagerService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
|
func (a *DeCertmanagerService) Install(ctx context.Context, body InstallCertmanagerRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -136,11 +107,8 @@ func (a *DeCertmanagerService) Install(ctx context.Context, req InstallRequest)
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.Hostname) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "hostname")
|
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -149,7 +117,7 @@ func (a *DeCertmanagerService) Install(ctx context.Context, req InstallRequest)
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/certmanager/install"
|
requestPath := basePath + "/digitalenergy/certmanager/install"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -162,17 +130,14 @@ func (a *DeCertmanagerService) Install(ctx context.Context, req InstallRequest)
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -191,11 +156,13 @@ func (a *DeCertmanagerService) Install(ctx context.Context, req InstallRequest)
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -207,19 +174,8 @@ func (a *DeCertmanagerService) Install(ctx context.Context, req InstallRequest)
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type UninstallRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for deleting the certmanager even if it is not registered
|
|
||||||
CleanAlways bool `json:"cleanAlways" form:"cleanAlways"`
|
|
||||||
// true for ignoring dns server errors
|
|
||||||
IgnoreDNSError bool `json:"ignoreDnsError" form:"ignoreDnsError"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uninstall certmanager from cluster
|
// Uninstall certmanager from cluster
|
||||||
func (a *DeCertmanagerService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
|
func (a *DeCertmanagerService) Uninstall(ctx context.Context, body UninstallCertmanagerRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -231,8 +187,8 @@ func (a *DeCertmanagerService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -241,7 +197,7 @@ func (a *DeCertmanagerService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/certmanager/uninstall"
|
requestPath := basePath + "/digitalenergy/certmanager/uninstall"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -254,13 +210,14 @@ func (a *DeCertmanagerService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -279,11 +236,13 @@ func (a *DeCertmanagerService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_certmanager
|
package de_certmanager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -2,6 +2,25 @@
|
|||||||
|
|
||||||
package de_certmanager
|
package de_certmanager
|
||||||
|
|
||||||
|
type CertmanagerInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
type CertmanagerRecord struct {
|
type CertmanagerRecord struct {
|
||||||
Addresses map[string]string `json:"addresses,omitempty"`
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
CACert string `json:"caCert,omitempty"`
|
CACert string `json:"caCert,omitempty"`
|
||||||
@@ -17,6 +36,12 @@ type CertmanagerRecord struct {
|
|||||||
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DescribeCertmanagerRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
type DescribeCertmanagerResult struct {
|
type DescribeCertmanagerResult struct {
|
||||||
CheckListOk bool `json:"checkListOk,omitempty"`
|
CheckListOk bool `json:"checkListOk,omitempty"`
|
||||||
Description ProductDescr `json:"description,omitempty"`
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
@@ -31,3 +56,18 @@ type DescribeCertmanagerResultWithError struct {
|
|||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Result DescribeCertmanagerResult `json:"result,omitempty"`
|
Result DescribeCertmanagerResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type InstallCertmanagerRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params CertmanagerInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallCertmanagerRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
package de_certmanager
|
package de_certmanager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
|||||||
+931
-818
File diff suppressed because it is too large.
Load diff
@@ -3,8 +3,8 @@
|
|||||||
package de_cluster
|
package de_cluster
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
+830
-13
@@ -2,6 +2,284 @@
|
|||||||
|
|
||||||
package de_cluster
|
package de_cluster
|
||||||
|
|
||||||
|
type BalancerForwarding struct {
|
||||||
|
CreatedAt int64 `json:"createdAt,omitempty"`
|
||||||
|
CustomServerSettings bool `json:"customServerSettings,omitempty"`
|
||||||
|
ForwardingPort int64 `json:"forwardingPort,omitempty"`
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Protocol string `json:"protocol,omitempty"`
|
||||||
|
Server BalancerServerSettings `json:"server,omitempty"`
|
||||||
|
ServiceName string `json:"serviceName,omitempty"`
|
||||||
|
TargetAddresses []string `json:"targetAddresses,omitempty"`
|
||||||
|
TargetPort int64 `json:"targetPort,omitempty"`
|
||||||
|
UpdatedAt int64 `json:"updatedAt,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BalancerHaproxyInfo struct {
|
||||||
|
ConfigValid bool `json:"configValid,omitempty"`
|
||||||
|
Enabled bool `json:"enabled,omitempty"`
|
||||||
|
Errors []string `json:"errors,omitempty"`
|
||||||
|
Running bool `json:"running,omitempty"`
|
||||||
|
State string `json:"state,omitempty"`
|
||||||
|
Warnings []string `json:"warnings,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BalancerKeepalivedInfo struct {
|
||||||
|
Enabled bool `json:"enabled,omitempty"`
|
||||||
|
Errors []string `json:"errors,omitempty"`
|
||||||
|
Running bool `json:"running,omitempty"`
|
||||||
|
State string `json:"state,omitempty"`
|
||||||
|
Vrrp []BalancerVrrpData `json:"vrrp,omitempty"`
|
||||||
|
Warnings []string `json:"warnings,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BalancerProxySettings struct {
|
||||||
|
DefaultMaxconn int64 `json:"defaultMaxconn,omitempty"`
|
||||||
|
GlobalMaxconn int64 `json:"globalMaxconn,omitempty"`
|
||||||
|
Retries int64 `json:"retries,omitempty"`
|
||||||
|
Server BalancerServerSettings `json:"server,omitempty"`
|
||||||
|
TimeoutCheck int64 `json:"timeoutCheck,omitempty"`
|
||||||
|
TimeoutClient int64 `json:"timeoutClient,omitempty"`
|
||||||
|
TimeoutConnect int64 `json:"timeoutConnect,omitempty"`
|
||||||
|
TimeoutHTTPKeepAlive int64 `json:"timeoutHttpKeepAlive,omitempty"`
|
||||||
|
TimeoutHTTPRequest int64 `json:"timeoutHttpRequest,omitempty"`
|
||||||
|
TimeoutQueue int64 `json:"timeoutQueue,omitempty"`
|
||||||
|
TimeoutServer int64 `json:"timeoutServer,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BalancerServerSettings struct {
|
||||||
|
CheckFall int64 `json:"checkFall,omitempty"`
|
||||||
|
Downinter int64 `json:"downinter,omitempty"`
|
||||||
|
Inter int64 `json:"inter,omitempty"`
|
||||||
|
Maxconn int64 `json:"maxconn,omitempty"`
|
||||||
|
Maxqueue int64 `json:"maxqueue,omitempty"`
|
||||||
|
Rise int64 `json:"rise,omitempty"`
|
||||||
|
Slowstart int64 `json:"slowstart,omitempty"`
|
||||||
|
Weight int64 `json:"weight,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BalancerVrrpData struct {
|
||||||
|
AdvertInterval int64 `json:"advertInterval,omitempty"`
|
||||||
|
InstanceName string `json:"instanceName,omitempty"`
|
||||||
|
Interface string `json:"interface,omitempty"`
|
||||||
|
Priority int64 `json:"priority,omitempty"`
|
||||||
|
State string `json:"state,omitempty"`
|
||||||
|
VirtualIP string `json:"virtualIp,omitempty"`
|
||||||
|
WantState string `json:"wantState,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefConfigMap struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Keys int64 `json:"keys,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefCronJob struct {
|
||||||
|
Active int64 `json:"active,omitempty"`
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
LastSchedule string `json:"lastSchedule,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
NextExecution string `json:"nextExecution,omitempty"`
|
||||||
|
Schedule string `json:"schedule,omitempty"`
|
||||||
|
Suspend string `json:"suspend,omitempty"`
|
||||||
|
TimeZone string `json:"timeZone,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefDaemonSet struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Available int64 `json:"available,omitempty"`
|
||||||
|
Current int64 `json:"current,omitempty"`
|
||||||
|
Desired int64 `json:"desired,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
NodeSelector string `json:"nodeSelector,omitempty"`
|
||||||
|
Ready int64 `json:"ready,omitempty"`
|
||||||
|
Updated int64 `json:"updated,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefDeployment struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Pods string `json:"pods,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefEndpointSlices struct {
|
||||||
|
AddressType string `json:"addressType,omitempty"`
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Endpoints []string `json:"endpoints,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Ports []string `json:"ports,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefEvent struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Count int64 `json:"count,omitempty"`
|
||||||
|
InvolvedObject BriefInvolvedObject `json:"involvedObject,omitempty"`
|
||||||
|
LastSeen string `json:"lastSeen,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Source string `json:"source,omitempty"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefHorizontalPodAutoscalers struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
MaxPods int64 `json:"maxPods,omitempty"`
|
||||||
|
Metrics string `json:"metrics,omitempty"`
|
||||||
|
MinPods int64 `json:"minPods,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Replicas int64 `json:"replicas,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefIngress struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
LoadBalancers string `json:"loadBalancers,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefIngressClass struct {
|
||||||
|
APIGroup string `json:"apiGroup,omitempty"`
|
||||||
|
Controller string `json:"controller,omitempty"`
|
||||||
|
Kind string `json:"kind,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Scope string `json:"scope,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefInvolvedObject struct {
|
||||||
|
Kind string `json:"kind,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefJob struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Completions string `json:"completions,omitempty"`
|
||||||
|
Conditions string `json:"conditions,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefLimitRange struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefNamespace struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Labels string `json:"labels,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefNetworkPolicy struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
PolicyTypes string `json:"policyTypes,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefPersistentVolume struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Capacity string `json:"capacity,omitempty"`
|
||||||
|
Claim string `json:"claim,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
StorageClass string `json:"storageClass,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefPersistentVolumeClaim struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Pods string `json:"pods,omitempty"`
|
||||||
|
Size string `json:"size,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
StorageClass string `json:"storageClass,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefPod struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
ControlledBy string `json:"controlledBy,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Node string `json:"node,omitempty"`
|
||||||
|
QoSClass string `json:"qosClass,omitempty"`
|
||||||
|
Ready string `json:"ready,omitempty"`
|
||||||
|
Restarts int64 `json:"restarts,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefReplicaSets struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Current int64 `json:"current,omitempty"`
|
||||||
|
Desired int64 `json:"desired,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Ready int64 `json:"ready,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefReplicationController struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Desired int64 `json:"desired,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Replicas int64 `json:"replicas,omitempty"`
|
||||||
|
Selector string `json:"selector,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefResourceQuota struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefSecret struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Keys int64 `json:"keys,omitempty"`
|
||||||
|
Labels string `json:"labels,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefService struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
ClusterIP string `json:"clusterIP,omitempty"`
|
||||||
|
ExternalIP string `json:"externalIP,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Ports []string `json:"ports,omitempty"`
|
||||||
|
Selector string `json:"selector,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefStatefulSet struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Pods string `json:"pods,omitempty"`
|
||||||
|
Replicas int64 `json:"replicas,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BriefStorageClass struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Default string `json:"default,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Provisioner string `json:"provisioner,omitempty"`
|
||||||
|
ReclaimPolicy string `json:"reclaimPolicy,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type Cluster struct {
|
type Cluster struct {
|
||||||
AppContainerRepository string `json:"appContainerRepository,omitempty"`
|
AppContainerRepository string `json:"appContainerRepository,omitempty"`
|
||||||
AuditEnabled bool `json:"auditEnabled,omitempty"`
|
AuditEnabled bool `json:"auditEnabled,omitempty"`
|
||||||
@@ -25,19 +303,20 @@ type Cluster struct {
|
|||||||
DomainResolvers []string `json:"domainResolvers,omitempty"`
|
DomainResolvers []string `json:"domainResolvers,omitempty"`
|
||||||
DynamixCIID int64 `json:"dynamixCIId,omitempty"`
|
DynamixCIID int64 `json:"dynamixCIId,omitempty"`
|
||||||
DynamixCreateTaskID string `json:"dynamixCreateTaskId,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
|
// Dynamyx data
|
||||||
DynamixURL string `json:"dynamixURL,omitempty"`
|
DynamixID int64 `json:"dynamixId,omitempty"`
|
||||||
DynamixVersion DynamixVersion `json:"dynamixVersion,omitempty"`
|
DynamixK8CIID int64 `json:"dynamixK8CIId,omitempty"`
|
||||||
|
DynamixOwnerID int64 `json:"dynamixOwnerId,omitempty"`
|
||||||
|
DynamixPlatform DynamixPlatform `json:"dynamixPlatform,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"`
|
||||||
// Data encryption information
|
// Data encryption information
|
||||||
Encrypted bool `json:"encrypted,omitempty"`
|
Encrypted bool `json:"encrypted,omitempty"`
|
||||||
|
EssAuthToken string `json:"essAuthToken,omitempty"`
|
||||||
ExtVirtualAddress string `json:"extVirtualAddress,omitempty"`
|
ExtVirtualAddress string `json:"extVirtualAddress,omitempty"`
|
||||||
// Virtual addresses
|
// Virtual addresses
|
||||||
ExtVirtualAddressID int64 `json:"extVirtualAddressId,omitempty"`
|
ExtVirtualAddressID int64 `json:"extVirtualAddressId,omitempty"`
|
||||||
@@ -55,9 +334,11 @@ type Cluster struct {
|
|||||||
InitialRuntimeType string `json:"initialRuntimeType,omitempty"`
|
InitialRuntimeType string `json:"initialRuntimeType,omitempty"`
|
||||||
// secure shell
|
// secure shell
|
||||||
InitialSecureShellPort int64 `json:"initialSecureShellPort,omitempty"`
|
InitialSecureShellPort int64 `json:"initialSecureShellPort,omitempty"`
|
||||||
// Instaled Components
|
// Installed Components
|
||||||
InstalledAutoscaler bool `json:"installedAutoscaler,omitempty"`
|
InstalledAutoscaler bool `json:"installedAutoscaler,omitempty"`
|
||||||
InstalledCriobox bool `json:"installedCriobox,omitempty"`
|
InstalledCriobox bool `json:"installedCriobox,omitempty"`
|
||||||
|
InstalledCsiDynamix bool `json:"installedCsiDynamix,omitempty"`
|
||||||
|
InstalledEss bool `json:"installedEss,omitempty"`
|
||||||
InstalledIntegagent bool `json:"installedIntegagent,omitempty"`
|
InstalledIntegagent bool `json:"installedIntegagent,omitempty"`
|
||||||
InstalledKyverno bool `json:"installedKyverno,omitempty"`
|
InstalledKyverno bool `json:"installedKyverno,omitempty"`
|
||||||
InstalledMetricServer bool `json:"installedMetricServer,omitempty"`
|
InstalledMetricServer bool `json:"installedMetricServer,omitempty"`
|
||||||
@@ -65,9 +346,11 @@ type Cluster struct {
|
|||||||
InstalledPodLogger bool `json:"installedPodLogger,omitempty"`
|
InstalledPodLogger bool `json:"installedPodLogger,omitempty"`
|
||||||
InstalledRBACManager bool `json:"installedRbacManager,omitempty"`
|
InstalledRBACManager bool `json:"installedRbacManager,omitempty"`
|
||||||
InstalledServchecker bool `json:"installedServchecker,omitempty"`
|
InstalledServchecker bool `json:"installedServchecker,omitempty"`
|
||||||
|
InstalledTekton bool `json:"installedTekton,omitempty"`
|
||||||
InstalledTrivy bool `json:"installedTrivy,omitempty"`
|
InstalledTrivy bool `json:"installedTrivy,omitempty"`
|
||||||
IntVirtualAddress string `json:"intVirtualAddress,omitempty"`
|
IntVirtualAddress string `json:"intVirtualAddress,omitempty"`
|
||||||
IntVirtualAddressID int64 `json:"intVirtualAddressId,omitempty"`
|
IntVirtualAddressID int64 `json:"intVirtualAddressId,omitempty"`
|
||||||
|
IsRBPO bool `json:"isRBPO,omitempty"`
|
||||||
KubeAddresses []string `json:"kubeAddresses,omitempty"`
|
KubeAddresses []string `json:"kubeAddresses,omitempty"`
|
||||||
KubeConfig string `json:"kubeConfig,omitempty"`
|
KubeConfig string `json:"kubeConfig,omitempty"`
|
||||||
// Repositories used for cluster nodes preparing and post install operatios
|
// Repositories used for cluster nodes preparing and post install operatios
|
||||||
@@ -119,13 +402,16 @@ type ClusterBrief struct {
|
|||||||
// Instaled Components
|
// Instaled Components
|
||||||
InstalledAutoscaler bool `json:"installedAutoscaler,omitempty"`
|
InstalledAutoscaler bool `json:"installedAutoscaler,omitempty"`
|
||||||
InstalledCriobox bool `json:"installedCriobox,omitempty"`
|
InstalledCriobox bool `json:"installedCriobox,omitempty"`
|
||||||
|
InstalledCsiDynamix bool `json:"installedCsiDynamix,omitempty"`
|
||||||
InstalledKyverno bool `json:"installedKyverno,omitempty"`
|
InstalledKyverno bool `json:"installedKyverno,omitempty"`
|
||||||
InstalledMetricServer bool `json:"installedMetricServer,omitempty"`
|
InstalledMetricServer bool `json:"installedMetricServer,omitempty"`
|
||||||
InstalledMonitoring bool `json:"installedMonitoring,omitempty"`
|
InstalledMonitoring bool `json:"installedMonitoring,omitempty"`
|
||||||
InstalledPodLogger bool `json:"installedPodLogger,omitempty"`
|
InstalledPodLogger bool `json:"installedPodLogger,omitempty"`
|
||||||
InstalledRBACManager bool `json:"installedRbacManager,omitempty"`
|
InstalledRBACManager bool `json:"installedRbacManager,omitempty"`
|
||||||
InstalledServchecker bool `json:"installedServchecker,omitempty"`
|
InstalledServchecker bool `json:"installedServchecker,omitempty"`
|
||||||
|
InstalledTekton bool `json:"installedTekton,omitempty"`
|
||||||
InstalledTrivy bool `json:"installedTrivy,omitempty"`
|
InstalledTrivy bool `json:"installedTrivy,omitempty"`
|
||||||
|
IsRPBO bool `json:"isRPBO,omitempty"`
|
||||||
// Generic data
|
// Generic data
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
OwnerID int64 `json:"ownerId,omitempty"`
|
OwnerID int64 `json:"ownerId,omitempty"`
|
||||||
@@ -151,6 +437,79 @@ type ClusterTaskCreationResultWithError struct {
|
|||||||
Result ClusterTaskCreationResult `json:"result,omitempty"`
|
Result ClusterTaskCreationResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CronJob struct {
|
||||||
|
Active int64 `json:"active,omitempty"`
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
AnnotationsCount int64 `json:"annotationsCount,omitempty"`
|
||||||
|
Deleted string `json:"deleted,omitempty"`
|
||||||
|
FailedJobsLimit int64 `json:"failedJobsLimit,omitempty"`
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
LabelsCount int64 `json:"labelsCount,omitempty"`
|
||||||
|
LastSchedule string `json:"lastSchedule,omitempty"`
|
||||||
|
LastSuccessful string `json:"lastSuccessful,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
NextExecution string `json:"nextExecution,omitempty"`
|
||||||
|
Schedule string `json:"schedule,omitempty"`
|
||||||
|
StartingDeadline int64 `json:"startingDeadline,omitempty"`
|
||||||
|
SuccessfulJobsLimit int64 `json:"successfulJobsLimit,omitempty"`
|
||||||
|
Suspend string `json:"suspend,omitempty"`
|
||||||
|
TimeZone string `json:"timeZone,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DaemonSet struct {
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
Conditions []DaemonSetCondition `json:"conditions,omitempty"`
|
||||||
|
CurrentScheduled int64 `json:"currentScheduled,omitempty"`
|
||||||
|
DesiredScheduled int64 `json:"desiredScheduled,omitempty"`
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
MinReadySeconds int64 `json:"minReadySeconds,omitempty"`
|
||||||
|
Misscheduled int64 `json:"misscheduled,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
NodeSelector string `json:"nodeSelector,omitempty"`
|
||||||
|
NumberAvailable int64 `json:"numberAvailable,omitempty"`
|
||||||
|
NumberReady int64 `json:"numberReady,omitempty"`
|
||||||
|
NumberUnavailable int64 `json:"numberUnavailable,omitempty"`
|
||||||
|
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||||
|
PodTemplateSpec PodTemplateSpec `json:"podTemplateSpec,omitempty"`
|
||||||
|
UpdateStrategyType string `json:"updateStrategyType,omitempty"`
|
||||||
|
UpdatedNumberScheduled int64 `json:"updatedNumberScheduled,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DaemonSetCondition struct {
|
||||||
|
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Reason string `json:"reason,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Deployment struct {
|
||||||
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
AnnotationsCount int64 `json:"annotationsCount,omitempty"`
|
||||||
|
AvailableReplicas int64 `json:"availableReplicas,omitempty"`
|
||||||
|
Conditions []DeploymentCondition `json:"conditions,omitempty"`
|
||||||
|
ControlledBy string `json:"controlledBy,omitempty"`
|
||||||
|
Created string `json:"created,omitempty"`
|
||||||
|
Deleted string `json:"deleted,omitempty"`
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
LabelsCount int64 `json:"labelsCount,omitempty"`
|
||||||
|
MinReadySeconds int64 `json:"minReadySeconds,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Paused bool `json:"paused,omitempty"`
|
||||||
|
ReadyReplicas int64 `json:"readyReplicas,omitempty"`
|
||||||
|
Replicas int64 `json:"replicas,omitempty"`
|
||||||
|
RevisionHistoryLimit int64 `json:"revisionHistoryLimit,omitempty"`
|
||||||
|
RollingUpdateMaxSurge string `json:"rollingUpdateMaxSurge,omitempty"`
|
||||||
|
RollingUpdateMaxUnavailable string `json:"rollingUpdateMaxUnavailable,omitempty"`
|
||||||
|
Selector LabelSelector `json:"selector,omitempty"`
|
||||||
|
StatusReplicas int64 `json:"statusReplicas,omitempty"`
|
||||||
|
StrategyType string `json:"strategyType,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type DescribeClusterResult struct {
|
type DescribeClusterResult struct {
|
||||||
IncompleteVerificationTaskBriefs []TaskBrief `json:"incompleteVerificationTaskBriefs,omitempty"`
|
IncompleteVerificationTaskBriefs []TaskBrief `json:"incompleteVerificationTaskBriefs,omitempty"`
|
||||||
TaskBriefs []TaskBrief `json:"taskBriefs,omitempty"`
|
TaskBriefs []TaskBrief `json:"taskBriefs,omitempty"`
|
||||||
@@ -164,6 +523,22 @@ type DescribeClusterResultWithError struct {
|
|||||||
Result DescribeClusterResult `json:"result,omitempty"`
|
Result DescribeClusterResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DescribeLoadBalancerResult struct {
|
||||||
|
Address string `json:"address,omitempty"`
|
||||||
|
Haproxy BalancerHaproxyInfo `json:"haproxy,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Keepalived BalancerKeepalivedInfo `json:"keepalived,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
ServiceShutdown bool `json:"serviceShutdown,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeLoadBalancerResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result DescribeLoadBalancerResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type DynamixVersion struct {
|
type DynamixVersion struct {
|
||||||
Major int64 `json:"major,omitempty"`
|
Major int64 `json:"major,omitempty"`
|
||||||
Minor int64 `json:"minor,omitempty"`
|
Minor int64 `json:"minor,omitempty"`
|
||||||
@@ -200,8 +575,127 @@ type GetClusterResultWithError struct {
|
|||||||
Result GetClusterResult `json:"result,omitempty"`
|
Result GetClusterResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetForwardingResult struct {
|
||||||
|
CreatedAt int64 `json:"createdAt,omitempty"`
|
||||||
|
CustomServerSettings bool `json:"customServerSettings,omitempty"`
|
||||||
|
ForwardingPort int64 `json:"forwardingPort,omitempty"`
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Protocol string `json:"protocol,omitempty"`
|
||||||
|
Server BalancerServerSettings `json:"server,omitempty"`
|
||||||
|
ServiceName string `json:"serviceName,omitempty"`
|
||||||
|
TargetAddresses []string `json:"targetAddresses,omitempty"`
|
||||||
|
TargetPort int64 `json:"targetPort,omitempty"`
|
||||||
|
UpdatedAt int64 `json:"updatedAt,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetForwardingResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result GetForwardingResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeConfigMapResult struct {
|
||||||
|
ConfigMap ConfigMap `json:"configMap,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeCronJobResult struct {
|
||||||
|
CronJob CronJob `json:"cronJob,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeDaemonSetResult struct {
|
||||||
|
DaemonSet DaemonSet `json:"daemonSet,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeDeploymentResult struct {
|
||||||
|
Deployment Deployment `json:"deployment,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeEndpointSliceResult struct {
|
||||||
|
EndpointSlice EndpointSlice `json:"endpointSlice,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeEventResult struct {
|
||||||
|
Event K8sIoAPICoreV1Event `json:"event,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeHorizontalPodAutoscalerResult struct {
|
||||||
|
HorizontalPodAutoscaler HorizontalPodAutoscaler `json:"horizontalPodAutoscaler,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeIngressClassResult struct {
|
||||||
|
IngressClass IngressClass `json:"ingressClass,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeIngressResult struct {
|
||||||
|
Ingress Ingress `json:"ingress,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeJobResult struct {
|
||||||
|
Job Job `json:"job,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeLimitRangeResult struct {
|
||||||
|
LimitRange LimitRange `json:"limitRange,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeNamespaceResult struct {
|
||||||
|
Namespace K8sIoAPICoreV1Namespace `json:"namespace,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeNetworkPolicyResult struct {
|
||||||
|
NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubePersistentVolumeClaimsResult struct {
|
||||||
|
PersistentVolumeClaim PersistentVolumeClaim `json:"persistentVolumeClaim,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubePersistentVolumesResult struct {
|
||||||
|
PersistentVolume PersistentVolumes `json:"persistentVolume,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubePodResult struct {
|
||||||
|
Pod Pod `json:"pod,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeReplicaSetResult struct {
|
||||||
|
ReplicaSet ReplicaSet `json:"replicaSet,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeReplicationControllerResult struct {
|
||||||
|
ReplicationController ReplicationController `json:"replicationController,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeResourceQuotaResult struct {
|
||||||
|
ResourceQuota ResourceQuota `json:"resourceQuota,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type GetKubeResourcesResult struct {
|
type GetKubeResourcesResult struct {
|
||||||
Any any `json:"any,omitempty"`
|
ConfigMap GetKubeConfigMapResult `json:"configMap,omitempty"`
|
||||||
|
CronJob GetKubeCronJobResult `json:"cronJob,omitempty"`
|
||||||
|
DaemonSet GetKubeDaemonSetResult `json:"daemonSet,omitempty"`
|
||||||
|
Deployment GetKubeDeploymentResult `json:"deployment,omitempty"`
|
||||||
|
EndpointSlice GetKubeEndpointSliceResult `json:"endpointSlice,omitempty"`
|
||||||
|
Event GetKubeEventResult `json:"event,omitempty"`
|
||||||
|
HorizontalPodAutoscaler GetKubeHorizontalPodAutoscalerResult `json:"horizontalPodAutoscaler,omitempty"`
|
||||||
|
Ingress GetKubeIngressResult `json:"ingress,omitempty"`
|
||||||
|
IngressClass GetKubeIngressClassResult `json:"ingressClass,omitempty"`
|
||||||
|
Job GetKubeJobResult `json:"job,omitempty"`
|
||||||
|
LimitRange GetKubeLimitRangeResult `json:"limitRange,omitempty"`
|
||||||
|
Namespace GetKubeNamespaceResult `json:"namespace,omitempty"`
|
||||||
|
NetworkPolicy GetKubeNetworkPolicyResult `json:"networkPolicy,omitempty"`
|
||||||
|
PersistentVolume GetKubePersistentVolumesResult `json:"persistentVolume,omitempty"`
|
||||||
|
PersistentVolumeClaim GetKubePersistentVolumeClaimsResult `json:"persistentVolumeClaim,omitempty"`
|
||||||
|
Pod GetKubePodResult `json:"pod,omitempty"`
|
||||||
|
ReplicaSet GetKubeReplicaSetResult `json:"replicaSet,omitempty"`
|
||||||
|
ReplicationController GetKubeReplicationControllerResult `json:"replicationController,omitempty"`
|
||||||
|
ResourceQuota GetKubeResourceQuotaResult `json:"resourceQuota,omitempty"`
|
||||||
|
Secret GetKubeSecretResult `json:"secret,omitempty"`
|
||||||
|
Service GetKubeServicesResult `json:"service,omitempty"`
|
||||||
|
StatefulSet GetKubeStatefulSetResult `json:"statefulSet,omitempty"`
|
||||||
|
StorageClass GetKubeStorageClassResult `json:"storageClass,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetKubeResourcesResultWithError struct {
|
type GetKubeResourcesResultWithError struct {
|
||||||
@@ -211,6 +705,22 @@ type GetKubeResourcesResultWithError struct {
|
|||||||
Result GetKubeResourcesResult `json:"result,omitempty"`
|
Result GetKubeResourcesResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetKubeSecretResult struct {
|
||||||
|
Secret Secret `json:"secret,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeServicesResult struct {
|
||||||
|
Service Service `json:"service,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeStatefulSetResult struct {
|
||||||
|
StatefulSet StatefulSet `json:"statefulSet,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKubeStorageClassResult struct {
|
||||||
|
StorageClass StorageClass `json:"storageClass,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type GetLoadBalancerResult struct {
|
type GetLoadBalancerResult struct {
|
||||||
LoadBalancer LoadBalancer `json:"loadBalancer,omitempty"`
|
LoadBalancer LoadBalancer `json:"loadBalancer,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -233,6 +743,20 @@ type GetMasterResultWithError struct {
|
|||||||
Result GetMasterResult `json:"result,omitempty"`
|
Result GetMasterResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetProxySettingsResult struct {
|
||||||
|
Address string `json:"address,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Settings BalancerProxySettings `json:"settings,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetProxySettingsResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result GetProxySettingsResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type GetWorkerResult struct {
|
type GetWorkerResult struct {
|
||||||
Worker Worker `json:"worker,omitempty"`
|
Worker Worker `json:"worker,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -253,6 +777,23 @@ type GPU struct {
|
|||||||
VideoMemorySize int64 `json:"videoMemorySize,omitempty"`
|
VideoMemorySize int64 `json:"videoMemorySize,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Job struct {
|
||||||
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
AnnotationsCount int64 `json:"annotationsCount,omitempty"`
|
||||||
|
Completions string `json:"completions,omitempty"`
|
||||||
|
Conditions string `json:"conditions,omitempty"`
|
||||||
|
Created string `json:"created,omitempty"`
|
||||||
|
Deleted string `json:"deleted,omitempty"`
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
LabelsCount int64 `json:"labelsCount,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Parallelism int64 `json:"parallelism,omitempty"`
|
||||||
|
Selector LabelSelector `json:"selector,omitempty"`
|
||||||
|
Succeeded int64 `json:"succeeded,omitempty"`
|
||||||
|
Template V1PodTemplateSpec `json:"template,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type ListClustersResult struct {
|
type ListClustersResult struct {
|
||||||
Clusters []ClusterBrief `json:"clusters,omitempty"`
|
Clusters []ClusterBrief `json:"clusters,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -264,8 +805,136 @@ type ListClustersResultWithError struct {
|
|||||||
Result ListClustersResult `json:"result,omitempty"`
|
Result ListClustersResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ListForwardingsResult struct {
|
||||||
|
Forwardings []BalancerForwarding `json:"forwardings,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListForwardingsResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result ListForwardingsResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeConfigMapsResult struct {
|
||||||
|
ConfigMaps []BriefConfigMap `json:"configMaps,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeCronJobsResult struct {
|
||||||
|
CronJobs []BriefCronJob `json:"cronJobs,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeDaemonSetsResult struct {
|
||||||
|
DaemonSets []BriefDaemonSet `json:"daemonSets,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeDeploymentsResult struct {
|
||||||
|
Deployments []BriefDeployment `json:"deployments,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeEndpointSlicesResult struct {
|
||||||
|
EndpointSlices []BriefEndpointSlices `json:"endpointSlices,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeEventsResult struct {
|
||||||
|
Events []BriefEvent `json:"events,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeHorizontalPodAutoscalersResult struct {
|
||||||
|
Hpas []BriefHorizontalPodAutoscalers `json:"hpas,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeIngressClassesResult struct {
|
||||||
|
IngressClasses []BriefIngressClass `json:"ingressClasses,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeIngressesResult struct {
|
||||||
|
Ingresses []BriefIngress `json:"ingresses,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeJobsResult struct {
|
||||||
|
Jobs []BriefJob `json:"jobs,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeLimitRangesResult struct {
|
||||||
|
LimitRanges []BriefLimitRange `json:"limitRanges,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeListPersistentVolumeClaimsResult struct {
|
||||||
|
PersistentVolumeClaims []BriefPersistentVolumeClaim `json:"persistentVolumeClaims,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeNamespacesResult struct {
|
||||||
|
Namespaces []BriefNamespace `json:"namespaces,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeNetworkPoliciesResult struct {
|
||||||
|
NetworkPolicies []BriefNetworkPolicy `json:"networkPolicies,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubePersistentVolumesResult struct {
|
||||||
|
PersistentVolumes []BriefPersistentVolume `json:"persistentVolumes,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubePodsResult struct {
|
||||||
|
Pods []BriefPod `json:"pods,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeReplicaSetsResult struct {
|
||||||
|
ReplicaSets []BriefReplicaSets `json:"replicaSets,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeReplicationControllersResult struct {
|
||||||
|
ReplicationControllers []BriefReplicationController `json:"replicationControllers,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeResourceQuotasResult struct {
|
||||||
|
ResourceQuotas []BriefResourceQuota `json:"resourceQuotas,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type ListKubeResourcesResult struct {
|
type ListKubeResourcesResult struct {
|
||||||
Any any `json:"any,omitempty"`
|
ConfigMaps ListKubeConfigMapsResult `json:"configMaps,omitempty"`
|
||||||
|
CronJobs ListKubeCronJobsResult `json:"cronJobs,omitempty"`
|
||||||
|
DaemonSets ListKubeDaemonSetsResult `json:"daemonSets,omitempty"`
|
||||||
|
Deployments ListKubeDeploymentsResult `json:"deployments,omitempty"`
|
||||||
|
EndpointSlices ListKubeEndpointSlicesResult `json:"endpointSlices,omitempty"`
|
||||||
|
Events ListKubeEventsResult `json:"events,omitempty"`
|
||||||
|
HorizontalPodAutoscalers ListKubeHorizontalPodAutoscalersResult `json:"horizontalPodAutoscalers,omitempty"`
|
||||||
|
IngressClasses ListKubeIngressClassesResult `json:"ingressClasses,omitempty"`
|
||||||
|
Ingresses ListKubeIngressesResult `json:"ingresses,omitempty"`
|
||||||
|
Jobs ListKubeJobsResult `json:"jobs,omitempty"`
|
||||||
|
LimitRanges ListKubeLimitRangesResult `json:"limitRanges,omitempty"`
|
||||||
|
Namespaces ListKubeNamespacesResult `json:"namespaces,omitempty"`
|
||||||
|
NetworkPolicies ListKubeNetworkPoliciesResult `json:"networkPolicies,omitempty"`
|
||||||
|
PersistentVolumeClaims ListKubeListPersistentVolumeClaimsResult `json:"persistentVolumeClaims,omitempty"`
|
||||||
|
PersistentVolumes ListKubePersistentVolumesResult `json:"persistentVolumes,omitempty"`
|
||||||
|
Pods ListKubePodsResult `json:"pods,omitempty"`
|
||||||
|
ReplicaSets ListKubeReplicaSetsResult `json:"replicaSets,omitempty"`
|
||||||
|
ReplicationControllers ListKubeReplicationControllersResult `json:"replicationControllers,omitempty"`
|
||||||
|
ResourceQuotas ListKubeResourceQuotasResult `json:"resourceQuotas,omitempty"`
|
||||||
|
Secrets ListKubeSecretsResult `json:"secrets,omitempty"`
|
||||||
|
Services ListKubeServicesResult `json:"services,omitempty"`
|
||||||
|
StatefulSets ListKubeStatefulSetsResult `json:"statefulSets,omitempty"`
|
||||||
|
StorageClasses ListKubeStorageClassesResult `json:"storageClasses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListKubeResourcesResultWithError struct {
|
type ListKubeResourcesResultWithError struct {
|
||||||
@@ -275,6 +944,26 @@ type ListKubeResourcesResultWithError struct {
|
|||||||
Result ListKubeResourcesResult `json:"result,omitempty"`
|
Result ListKubeResourcesResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ListKubeSecretsResult struct {
|
||||||
|
Secrets []BriefSecret `json:"secrets,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeServicesResult struct {
|
||||||
|
Services []BriefService `json:"services,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeStatefulSetsResult struct {
|
||||||
|
StatefulSets []BriefStatefulSet `json:"statefulSets,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListKubeStorageClassesResult struct {
|
||||||
|
StorageClasses []BriefStorageClass `json:"storageClasses,omitempty"`
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type ListLoadBalancersResult struct {
|
type ListLoadBalancersResult struct {
|
||||||
LoadBalancers []LoadBalancer `json:"loadBalancers,omitempty"`
|
LoadBalancers []LoadBalancer `json:"loadBalancers,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -496,6 +1185,105 @@ type NetworkDescribeResultWithError struct {
|
|||||||
Result NetworkDescribeResult `json:"result,omitempty"`
|
Result NetworkDescribeResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PersistentVolumes struct {
|
||||||
|
// spec.accessModes
|
||||||
|
AccessModes []string `json:"accessModes,omitempty"`
|
||||||
|
// time.Since(kubecore.PersistentVolume.metadata.creationTimestamp).String()
|
||||||
|
Age string `json:"age,omitempty"`
|
||||||
|
// metadata.annotations
|
||||||
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
// kubecore.PersistentVolume.spec.capacity.storage
|
||||||
|
Capacity string `json:"capacity,omitempty"`
|
||||||
|
// kubecore.PersistentVolume.spec.claimRef.name (кому привязан)
|
||||||
|
Claim string `json:"claim,omitempty"`
|
||||||
|
// spec.claimRef.namespace
|
||||||
|
ClaimNamespace string `json:"claimNamespace,omitempty"`
|
||||||
|
// spec.claimRef.kind
|
||||||
|
ClaimType string `json:"claimType,omitempty"`
|
||||||
|
// metadata.creationTimestamp (ISO)
|
||||||
|
Created string `json:"created,omitempty"`
|
||||||
|
// metadata.finalizers
|
||||||
|
Finalizers []string `json:"finalizers,omitempty"`
|
||||||
|
// kubecore.PersistentVolume.metadata.name
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
// spec.hostPath.path
|
||||||
|
Path string `json:"path,omitempty"`
|
||||||
|
// spec.persistentVolumeReclaimPolicy
|
||||||
|
ReclaimPolicy string `json:"reclaimPolicy,omitempty"`
|
||||||
|
// тип источника
|
||||||
|
SourceProvider string `json:"sourceProvider,omitempty"`
|
||||||
|
// status.phase (Available, Bound, Released, Failed)
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
// kubecore.PersistentVolume.spec.storageClassName
|
||||||
|
StorageClass string `json:"storageClass,omitempty"`
|
||||||
|
// spec.hostPath.type
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
// spec.volumeMode
|
||||||
|
VolumeMode string `json:"volumeMode,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Pod struct {
|
||||||
|
Affinity Affinity `json:"affinity,omitempty"`
|
||||||
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
AnnotationsCount int64 `json:"annotationsCount,omitempty"`
|
||||||
|
Conditions []PodCondition `json:"conditions,omitempty"`
|
||||||
|
ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"`
|
||||||
|
Containers []Container `json:"containers,omitempty"`
|
||||||
|
ControlledBy string `json:"controlledBy,omitempty"`
|
||||||
|
Created string `json:"created,omitempty"`
|
||||||
|
Deleted string `json:"deleted,omitempty"`
|
||||||
|
DNSPolicy string `json:"dnsPolicy,omitempty"`
|
||||||
|
EphemeralContainerStatuses []ContainerStatus `json:"ephemeralContainerStatuses,omitempty"`
|
||||||
|
EphemeralContainers []EphemeralContainer `json:"ephemeralContainers,omitempty"`
|
||||||
|
InitContainerStatuses []ContainerStatus `json:"initContainerStatuses,omitempty"`
|
||||||
|
InitContainers []Container `json:"initContainers,omitempty"`
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
LabelsCount int64 `json:"labelsCount,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
Node string `json:"node,omitempty"`
|
||||||
|
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
|
||||||
|
NodeSelectorCount int64 `json:"nodeSelectorCount,omitempty"`
|
||||||
|
Phase string `json:"phase,omitempty"`
|
||||||
|
PodIP string `json:"podIP,omitempty"`
|
||||||
|
PodIPs []string `json:"podIPs,omitempty"`
|
||||||
|
PodVolumes []Volume `json:"podVolumes,omitempty"`
|
||||||
|
PreemptionPolicy string `json:"preemptionPolicy,omitempty"`
|
||||||
|
Priority int64 `json:"priority,omitempty"`
|
||||||
|
PriorityClassName string `json:"priorityClassName,omitempty"`
|
||||||
|
QoSClass string `json:"qosClass,omitempty"`
|
||||||
|
ReadinessGates []string `json:"readinessGates,omitempty"`
|
||||||
|
ResourceClaimStatuses []PodResourceClaimStatus `json:"resourceClaimStatuses,omitempty"`
|
||||||
|
RestartPolicy string `json:"restartPolicy,omitempty"`
|
||||||
|
RuntimeClassName string `json:"runtimeClassName,omitempty"`
|
||||||
|
SecurityContext PodSecurityContext `json:"securityContext,omitempty"`
|
||||||
|
ServiceAccount string `json:"serviceAccount,omitempty"`
|
||||||
|
StartTime string `json:"startTime,omitempty"`
|
||||||
|
Tolerations []Toleration `json:"tolerations,omitempty"`
|
||||||
|
TolerationsCount int64 `json:"tolerationsCount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PodCondition struct {
|
||||||
|
LastProbeTime string `json:"lastProbeTime,omitempty"`
|
||||||
|
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Reason string `json:"reason,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PodResourceClaimStatus struct {
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
ResourceClaimName string `json:"resourceClaimName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PodTemplateSpec struct {
|
||||||
|
Containers []Container `json:"containers,omitempty"`
|
||||||
|
InitContainers []Container `json:"initContainers,omitempty"`
|
||||||
|
PodVolumes []Volume `json:"podVolumes,omitempty"`
|
||||||
|
Tolerations []Toleration `json:"tolerations,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type PolicyBrief struct {
|
type PolicyBrief struct {
|
||||||
Background bool `json:"background,omitempty"`
|
Background bool `json:"background,omitempty"`
|
||||||
Category string `json:"category,omitempty"`
|
Category string `json:"category,omitempty"`
|
||||||
@@ -516,6 +1304,13 @@ type ProductShortDescr struct {
|
|||||||
ProductVersion string `json:"productVersion,omitempty"`
|
ProductVersion string `json:"productVersion,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ResetProxySettingsResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result any `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type SetClusterKubeVersionResultWithError struct {
|
type SetClusterKubeVersionResultWithError struct {
|
||||||
Error bool `json:"error,omitempty"`
|
Error bool `json:"error,omitempty"`
|
||||||
ErrorCode int64 `json:"errorCode,omitempty"`
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
@@ -558,6 +1353,14 @@ type SetWorkerStatusResultWithError struct {
|
|||||||
Result any `json:"result,omitempty"`
|
Result any `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Toleration struct {
|
||||||
|
Effect string `json:"effect,omitempty"`
|
||||||
|
Key string `json:"key,omitempty"`
|
||||||
|
Operator string `json:"operator,omitempty"`
|
||||||
|
TolerationSeconds int64 `json:"tolerationSeconds,omitempty"`
|
||||||
|
Value string `json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type UpdateClusterConfigResult struct {
|
type UpdateClusterConfigResult struct {
|
||||||
KubeConfig string `json:"kubeConfig,omitempty"`
|
KubeConfig string `json:"kubeConfig,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -587,6 +1390,20 @@ type UpdateCNIConfigResultWithError struct {
|
|||||||
Result UpdateCNIConfigResult `json:"result,omitempty"`
|
Result UpdateCNIConfigResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UpdateForwardingSettingsResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result any `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateProxySettingsResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result any `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type VerificationBrief struct {
|
type VerificationBrief struct {
|
||||||
Done bool `json:"done,omitempty"`
|
Done bool `json:"done,omitempty"`
|
||||||
Error bool `json:"error,omitempty"`
|
Error bool `json:"error,omitempty"`
|
||||||
|
|||||||
@@ -3,10 +3,46 @@
|
|||||||
package de_cluster
|
package de_cluster
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
|
|
||||||
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
|
autoscalingv2 "k8s.io/api/autoscaling/v2"
|
||||||
|
corev1 "k8s.io/api/core/v1"
|
||||||
|
discoveryv1 "k8s.io/api/discovery/v1"
|
||||||
|
networkingv1 "k8s.io/api/networking/v1"
|
||||||
|
storagev1 "k8s.io/api/storage/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Affinity = corev1.Affinity
|
||||||
|
type ConfigMap = corev1.ConfigMap
|
||||||
|
type Container = corev1.Container
|
||||||
|
type ContainerStatus = corev1.ContainerStatus
|
||||||
|
type DeploymentCondition = appsv1.DeploymentCondition
|
||||||
|
type EndpointSlice = discoveryv1.EndpointSlice
|
||||||
|
type EphemeralContainer = corev1.EphemeralContainer
|
||||||
|
type HorizontalPodAutoscaler = autoscalingv2.HorizontalPodAutoscaler
|
||||||
|
type Ingress = networkingv1.Ingress
|
||||||
|
type IngressClass = networkingv1.IngressClass
|
||||||
|
type K8sIoAPICoreV1Event = corev1.Event
|
||||||
|
type K8sIoAPICoreV1Namespace = corev1.Namespace
|
||||||
|
type LabelSelector = metav1.LabelSelector
|
||||||
|
type LimitRange = corev1.LimitRange
|
||||||
|
type NetworkPolicy = networkingv1.NetworkPolicy
|
||||||
|
type PersistentVolumeClaim = corev1.PersistentVolumeClaim
|
||||||
|
type PodSecurityContext = corev1.PodSecurityContext
|
||||||
|
type ReplicaSet = appsv1.ReplicaSet
|
||||||
|
type ReplicationController = corev1.ReplicationController
|
||||||
|
type ResourceQuota = corev1.ResourceQuota
|
||||||
|
type Secret = corev1.Secret
|
||||||
|
type Service = corev1.Service
|
||||||
|
type StatefulSet = appsv1.StatefulSet
|
||||||
|
type StorageClass = storagev1.StorageClass
|
||||||
|
type V1PodTemplateSpec = corev1.PodTemplateSpec
|
||||||
|
type Volume = corev1.Volume
|
||||||
|
type CreateClusterRequest = shared.CreateClusterRequest
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
|
type DynamixPlatform = shared.DynamixPlatform
|
||||||
type Rule = shared.Rule
|
type Rule = shared.Rule
|
||||||
type TaskBrief = shared.TaskBrief
|
type TaskBrief = shared.TaskBrief
|
||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeClusterTemplateService service
|
type DeClusterTemplateService service
|
||||||
@@ -57,11 +57,14 @@ func (a *DeClusterTemplateService) Delete(ctx context.Context, req DeleteRequest
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "id", req.ID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "id", req.ID, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -80,11 +83,13 @@ func (a *DeClusterTemplateService) Delete(ctx context.Context, req DeleteRequest
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DeleteClusterTemplateResultWithError
|
var wrappedResp DeleteClusterTemplateResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -145,14 +150,17 @@ func (a *DeClusterTemplateService) Duplicate(ctx context.Context, req DuplicateR
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "id", req.ID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "id", req.ID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterTemplateName", req.ClusterTemplateName, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterTemplateName", req.ClusterTemplateName, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterTemplateDescription", req.ClusterTemplateDescription, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterTemplateDescription", req.ClusterTemplateDescription, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "shareClusterTemplate", req.ShareClusterTemplate, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "shareClusterTemplate", req.ShareClusterTemplate, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -171,11 +179,13 @@ func (a *DeClusterTemplateService) Duplicate(ctx context.Context, req DuplicateR
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DuplicateClusterTemplateResultWithError
|
var wrappedResp DuplicateClusterTemplateResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -230,11 +240,14 @@ func (a *DeClusterTemplateService) Get(ctx context.Context, req GetRequest) (Get
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "id", req.ID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "id", req.ID, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -253,11 +266,13 @@ func (a *DeClusterTemplateService) Get(ctx context.Context, req GetRequest) (Get
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp GetClusterTemplateResultWithError
|
var wrappedResp GetClusterTemplateResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -335,14 +350,17 @@ func (a *DeClusterTemplateService) List(ctx context.Context, req ListRequest) (L
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterType", req.ClusterType, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterType", req.ClusterType, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "sortBy", req.SortBy, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "sortBy", req.SortBy, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "limit", req.Limit, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "limit", req.Limit, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "page", req.Page, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "page", req.Page, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -361,11 +379,13 @@ func (a *DeClusterTemplateService) List(ctx context.Context, req ListRequest) (L
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp ListClusterTemplatesResultWithError
|
var wrappedResp ListClusterTemplatesResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -377,15 +397,8 @@ func (a *DeClusterTemplateService) List(ctx context.Context, req ListRequest) (L
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateRequest struct {
|
|
||||||
// update cluster templates request
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ExtraCluster UpdateClusterTemplateRequest `json:"extraCluster" form:"extraCluster"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update cluster template
|
// Update cluster template
|
||||||
func (a *DeClusterTemplateService) Update(ctx context.Context, req UpdateRequest) (UpdateClusterTemplateResult, error) {
|
func (a *DeClusterTemplateService) Update(ctx context.Context, body UpdateClusterTemplateRequest) (UpdateClusterTemplateResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -397,7 +410,7 @@ func (a *DeClusterTemplateService) Update(ctx context.Context, req UpdateRequest
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ExtraCluster) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "extraCluster")
|
missingRequiredParams = append(missingRequiredParams, "extraCluster")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
@@ -420,11 +433,14 @@ func (a *DeClusterTemplateService) Update(ctx context.Context, req UpdateRequest
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
requestBody = req.ExtraCluster
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -443,11 +459,13 @@ func (a *DeClusterTemplateService) Update(ctx context.Context, req UpdateRequest
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp UpdateClusterTemplateResultWithError
|
var wrappedResp UpdateClusterTemplateResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_cluster_template
|
package de_cluster_template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -28,23 +28,17 @@ type ClusterTemplate struct {
|
|||||||
DenergyRuntimeType string `json:"denergyRuntimeType,omitempty"`
|
DenergyRuntimeType string `json:"denergyRuntimeType,omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
DomainResolvers []string `json:"domainResolvers,omitempty"`
|
DomainResolvers []string `json:"domainResolvers,omitempty"`
|
||||||
DynamixAppID string `json:"dynamixAppId,omitempty"`
|
|
||||||
DynamixAppSecret string `json:"dynamixAppSecret,omitempty"`
|
|
||||||
DynamixAuthDomain string `json:"dynamixAuthDomain,omitempty"`
|
|
||||||
DynamixAuthType string `json:"dynamixAuthType,omitempty"`
|
|
||||||
DynamixK8CIID int64 `json:"dynamixK8CIId,omitempty"`
|
DynamixK8CIID int64 `json:"dynamixK8CIId,omitempty"`
|
||||||
DynamixPassword string `json:"dynamixPassword,omitempty"`
|
DynamixPlatformID int64 `json:"dynamixPlatformId,omitempty"`
|
||||||
DynamixRGID int64 `json:"dynamixRGId,omitempty"`
|
DynamixRGID int64 `json:"dynamixRGId,omitempty"`
|
||||||
DynamixSEPID int64 `json:"dynamixSEPId,omitempty"`
|
DynamixSEPID int64 `json:"dynamixSEPId,omitempty"`
|
||||||
DynamixSEPPool string `json:"dynamixSEPPool,omitempty"`
|
DynamixSEPPool string `json:"dynamixSEPPool,omitempty"`
|
||||||
DynamixSSOURL string `json:"dynamixSSOURL,omitempty"`
|
|
||||||
DynamixURL string `json:"dynamixURL,omitempty"`
|
|
||||||
DynamixUsername string `json:"dynamixUsername,omitempty"`
|
|
||||||
EnableCustomLoadBalancerHostnames bool `json:"enableCustomLoadBalancerHostnames,omitempty"`
|
EnableCustomLoadBalancerHostnames bool `json:"enableCustomLoadBalancerHostnames,omitempty"`
|
||||||
EnableCustomMasterHostnames bool `json:"enableCustomMasterHostnames,omitempty"`
|
EnableCustomMasterHostnames bool `json:"enableCustomMasterHostnames,omitempty"`
|
||||||
EnableCustomWorkerHostnames bool `json:"enableCustomWorkerHostnames,omitempty"`
|
EnableCustomWorkerHostnames bool `json:"enableCustomWorkerHostnames,omitempty"`
|
||||||
// Data encryption information
|
// Data encryption information
|
||||||
Encrypted bool `json:"encrypted,omitempty"`
|
Encrypted bool `json:"encrypted,omitempty"`
|
||||||
|
EssAuthToken string `json:"essAuthToken,omitempty"`
|
||||||
// VirtualAddresses Section
|
// VirtualAddresses Section
|
||||||
ExtVirtualAddress string `json:"extVirtualAddress,omitempty"`
|
ExtVirtualAddress string `json:"extVirtualAddress,omitempty"`
|
||||||
ExternalLBAddresses []string `json:"externalLBAddresses,omitempty"`
|
ExternalLBAddresses []string `json:"externalLBAddresses,omitempty"`
|
||||||
@@ -57,13 +51,15 @@ type ClusterTemplate struct {
|
|||||||
ILoadBalancerMemorySize int64 `json:"iLoadBalancerMemorySize,omitempty"`
|
ILoadBalancerMemorySize int64 `json:"iLoadBalancerMemorySize,omitempty"`
|
||||||
ID int64 `json:"id,omitempty"`
|
ID int64 `json:"id,omitempty"`
|
||||||
InitialSecureShellPort int64 `json:"initialSecureShellPort,omitempty"`
|
InitialSecureShellPort int64 `json:"initialSecureShellPort,omitempty"`
|
||||||
InstallAutoscaler bool `json:"installAutoscaler,omitempty"`
|
|
||||||
InstallCriobox bool `json:"installCriobox,omitempty"`
|
InstallCriobox bool `json:"installCriobox,omitempty"`
|
||||||
|
InstallCsiDynamix bool `json:"installCsiDynamix,omitempty"`
|
||||||
|
InstallEss bool `json:"installEss,omitempty"`
|
||||||
InstallKyverno bool `json:"installKyverno,omitempty"`
|
InstallKyverno bool `json:"installKyverno,omitempty"`
|
||||||
InstallMetrics bool `json:"installMetrics,omitempty"`
|
InstallMetrics bool `json:"installMetrics,omitempty"`
|
||||||
InstallMonitoring bool `json:"installMonitoring,omitempty"`
|
InstallMonitoring bool `json:"installMonitoring,omitempty"`
|
||||||
InstallPodLogger bool `json:"installPodLogger,omitempty"`
|
InstallPodLogger bool `json:"installPodLogger,omitempty"`
|
||||||
InstallRBACManager bool `json:"installRbacManager,omitempty"`
|
InstallRBACManager bool `json:"installRbacManager,omitempty"`
|
||||||
|
InstallTekton bool `json:"installTekton,omitempty"`
|
||||||
InstallTrivy bool `json:"installTrivy,omitempty"`
|
InstallTrivy bool `json:"installTrivy,omitempty"`
|
||||||
IntVirtualAddress string `json:"intVirtualAddress,omitempty"`
|
IntVirtualAddress string `json:"intVirtualAddress,omitempty"`
|
||||||
InternalLBAddresses []string `json:"internalLBAddresses,omitempty"`
|
InternalLBAddresses []string `json:"internalLBAddresses,omitempty"`
|
||||||
@@ -158,140 +154,6 @@ type ClusterTemplateBrief struct {
|
|||||||
Username string `json:"username,omitempty"`
|
Username string `json:"username,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateClusterRequest struct {
|
|
||||||
AppContainerRepository int64 `json:"appContainerRepository"`
|
|
||||||
AuditEnable bool `json:"auditEnable"`
|
|
||||||
AuditLogMaxAge int64 `json:"auditLogMaxAge"`
|
|
||||||
AuditLogMaxBackup int64 `json:"auditLogMaxBackup"`
|
|
||||||
AuditLogMaxSize int64 `json:"auditLogMaxSize"`
|
|
||||||
AuditPolicy string `json:"auditPolicy"`
|
|
||||||
BalancersDynamixSEPID int64 `json:"balancersDynamixSEPId"`
|
|
||||||
BalancersDynamixSEPPool string `json:"balancersDynamixSEPPool"`
|
|
||||||
CertificateIssuerID int64 `json:"certificateIssuerId"`
|
|
||||||
CertificateKey string `json:"certificateKey"`
|
|
||||||
CertificateValidityBefore string `json:"certificateValidityBefore"`
|
|
||||||
ChartRepository int64 `json:"chartRepository"`
|
|
||||||
ClusterHostname string `json:"clusterHostname"`
|
|
||||||
ClusterMachineOSBuild string `json:"clusterMachineOSBuild"`
|
|
||||||
ClusterMachineOSType string `json:"clusterMachineOSType"`
|
|
||||||
ClusterName string `json:"clusterName"`
|
|
||||||
ClusterTemplateDescription string `json:"clusterTemplateDescription"`
|
|
||||||
ClusterTemplateName string `json:"clusterTemplateName"`
|
|
||||||
ClusterType string `json:"clusterType"`
|
|
||||||
ContainerNetworkType string `json:"containerNetworkType"`
|
|
||||||
CreateClusterTemplate bool `json:"createClusterTemplate"`
|
|
||||||
CustomMTU int64 `json:"customMTU"`
|
|
||||||
DenergyRuntimeType string `json:"denergyRuntimeType"`
|
|
||||||
Description string `json:"description"`
|
|
||||||
DomainResolvers []string `json:"domainResolvers,omitempty"`
|
|
||||||
DynamixAppID string `json:"dynamixAppId"`
|
|
||||||
DynamixAppSecret string `json:"dynamixAppSecret"`
|
|
||||||
DynamixAuthDomain string `json:"dynamixAuthDomain"`
|
|
||||||
DynamixAuthType string `json:"dynamixAuthType"`
|
|
||||||
DynamixK8CIID int64 `json:"dynamixK8CIId"`
|
|
||||||
DynamixPassword string `json:"dynamixPassword"`
|
|
||||||
DynamixRGID int64 `json:"dynamixRGId"`
|
|
||||||
DynamixSEPID int64 `json:"dynamixSEPId"`
|
|
||||||
DynamixSEPPool string `json:"dynamixSEPPool"`
|
|
||||||
DynamixSSOURL string `json:"dynamixSSOURL"`
|
|
||||||
DynamixURL string `json:"dynamixURL"`
|
|
||||||
DynamixUsername string `json:"dynamixUsername"`
|
|
||||||
EnableCustomLoadBalancerHostnames bool `json:"enableCustomLoadBalancerHostnames"`
|
|
||||||
EnableCustomMasterHostnames bool `json:"enableCustomMasterHostnames"`
|
|
||||||
EnableCustomWorkerHostnames bool `json:"enableCustomWorkerHostnames"`
|
|
||||||
// VirtualAddresses Section
|
|
||||||
ExtVirtualAddress string `json:"extVirtualAddress"`
|
|
||||||
ExternalLBAddresses []string `json:"externalLBAddresses,omitempty"`
|
|
||||||
GlobalNetworkID int64 `json:"globalNetworkId"`
|
|
||||||
ILoadBalancerCPUCount int64 `json:"iLoadBalancerCPUCount"`
|
|
||||||
ILoadBalancerCloudInit string `json:"iLoadBalancerCloudInit"`
|
|
||||||
ILoadBalancerCount int64 `json:"iLoadBalancerCount"`
|
|
||||||
ILoadBalancerDiskSize int64 `json:"iLoadBalancerDiskSize"`
|
|
||||||
ILoadBalancerGPUIDs []int64 `json:"iLoadBalancerGpuIds,omitempty"`
|
|
||||||
ILoadBalancerMemorySize int64 `json:"iLoadBalancerMemorySize"`
|
|
||||||
InitialSecureShellPort int64 `json:"initialSecureShellPort"`
|
|
||||||
InstallAutoscaler bool `json:"installAutoscaler"`
|
|
||||||
InstallCriobox bool `json:"installCriobox"`
|
|
||||||
InstallKyverno bool `json:"installKyverno"`
|
|
||||||
InstallMetrics bool `json:"installMetrics"`
|
|
||||||
InstallMonitoring bool `json:"installMonitoring"`
|
|
||||||
InstallPodLogger bool `json:"installPodLogger"`
|
|
||||||
InstallRBACManager bool `json:"installRbacManager"`
|
|
||||||
InstallTrivy bool `json:"installTrivy"`
|
|
||||||
IntVirtualAddress string `json:"intVirtualAddress"`
|
|
||||||
InternalLBAddresses []string `json:"internalLBAddresses,omitempty"`
|
|
||||||
KubeConfig string `json:"kubeConfig"`
|
|
||||||
KubeContainerRepository int64 `json:"kubeContainerRepository"`
|
|
||||||
KubeVersion string `json:"kubeVersion"`
|
|
||||||
LoadBalancerExternalIPAddresses []string `json:"loadBalancerExternalIPAddresses,omitempty"`
|
|
||||||
LoadBalancerHostnames []string `json:"loadBalancerHostnames,omitempty"`
|
|
||||||
LoadBalancerInternalIPAddresses []string `json:"loadBalancerInternalIPAddresses,omitempty"`
|
|
||||||
LoadBalancerMachineOSBuild []string `json:"loadBalancerMachineOSBuild,omitempty"`
|
|
||||||
LoadBalancerMachineOSType []string `json:"loadBalancerMachineOSType,omitempty"`
|
|
||||||
LoadBalancerRootPasswords []string `json:"loadBalancerRootPasswords,omitempty"`
|
|
||||||
LoadBalancerRootUsernames []string `json:"loadBalancerRootUsernames,omitempty"`
|
|
||||||
LoadBalancerSecureShellPorts []int64 `json:"loadBalancerSecureShellPorts,omitempty"`
|
|
||||||
LoadBalancerUserPasswords []string `json:"loadBalancerUserPasswords,omitempty"`
|
|
||||||
LoadBalancerUserUsernames []string `json:"loadBalancerUserUsernames,omitempty"`
|
|
||||||
LocalNetworkID int64 `json:"localNetworkId"`
|
|
||||||
MachineOSBuild string `json:"machineOSBuild"`
|
|
||||||
MachineOSImageID int64 `json:"machineOSImageId"`
|
|
||||||
MachineOSType string `json:"machineOSType"`
|
|
||||||
MachineProvider string `json:"machineProvider"`
|
|
||||||
MasterAddresses []string `json:"masterAddresses,omitempty"`
|
|
||||||
MasterCPUCount int64 `json:"masterCPUCount"`
|
|
||||||
MasterCloudInit string `json:"masterCloudInit"`
|
|
||||||
MasterCount int64 `json:"masterCount"`
|
|
||||||
MasterDiskSize int64 `json:"masterDiskSize"`
|
|
||||||
MasterGPUIDs []int64 `json:"masterGpuIds,omitempty"`
|
|
||||||
MasterHostnames []string `json:"masterHostnames,omitempty"`
|
|
||||||
MasterMemorySize int64 `json:"masterMemorySize"`
|
|
||||||
MasterNodesExternalIPAdresses []string `json:"masterNodesExternalIPAdresses,omitempty"`
|
|
||||||
MasterNodesMachineOSBuilds []string `json:"masterNodesMachineOSBuilds,omitempty"`
|
|
||||||
MasterNodesMachineOSTypes []string `json:"masterNodesMachineOSTypes,omitempty"`
|
|
||||||
MasterNodesRootPasswords []string `json:"masterNodesRootPasswords,omitempty"`
|
|
||||||
MasterNodesRootUsernames []string `json:"masterNodesRootUsernames,omitempty"`
|
|
||||||
MasterNodesSecureShellPorts []int64 `json:"masterNodesSecureShellPorts,omitempty"`
|
|
||||||
MasterNodesUserPasswords []string `json:"masterNodesUserPasswords,omitempty"`
|
|
||||||
MasterNodesUserUsernames []string `json:"masterNodesUserUsernames,omitempty"`
|
|
||||||
MastersDynamixSEPID int64 `json:"mastersDynamixSEPId"`
|
|
||||||
MastersDynamixSEPPool string `json:"mastersDynamixSEPPool"`
|
|
||||||
PackageRepository int64 `json:"packageRepository"`
|
|
||||||
ProvideDNS bool `json:"provideDNS"`
|
|
||||||
SaveComputesOnFailedK8SCreation bool `json:"saveComputesOnFailedK8SCreation"`
|
|
||||||
SharedClusterTemplate bool `json:"sharedClusterTemplate"`
|
|
||||||
StoragePolicyID int64 `json:"storagePolicyId"`
|
|
||||||
UseCustomExternalLBAddresses bool `json:"useCustomExternalLBAddresses"`
|
|
||||||
UseCustomInternalLBAddresses bool `json:"useCustomInternalLBAddresses"`
|
|
||||||
UseCustomMasterIPAddresses bool `json:"useCustomMasterIPAddresses"`
|
|
||||||
UseCustomWorkerIPAddresses bool `json:"useCustomWorkerIPAddresses"`
|
|
||||||
UseDynamixExtNet bool `json:"useDynamixExtnet"`
|
|
||||||
ViNSGlobalNetworkID int64 `json:"vinsGlobalNetworkId"`
|
|
||||||
WorkerAddresses []string `json:"workerAddresses,omitempty"`
|
|
||||||
WorkerAnnotations []string `json:"workerAnnotations,omitempty"`
|
|
||||||
WorkerCPUCount int64 `json:"workerCPUCount"`
|
|
||||||
WorkerCloudInit string `json:"workerCloudInit"`
|
|
||||||
WorkerCount int64 `json:"workerCount"`
|
|
||||||
WorkerDiskSize int64 `json:"workerDiskSize"`
|
|
||||||
WorkerGPUIDs []int64 `json:"workerGpuIds,omitempty"`
|
|
||||||
WorkerGroupName string `json:"workerGroupName"`
|
|
||||||
WorkerHostnames []string `json:"workerHostnames,omitempty"`
|
|
||||||
// WorkerGroup string `json:\"workerGroup\" form:\"workerGroup\"`
|
|
||||||
WorkerLabels []string `json:"workerLabels,omitempty"`
|
|
||||||
WorkerMemorySize int64 `json:"workerMemorySize"`
|
|
||||||
WorkerNodesExternalIPAdresses []string `json:"workerNodesExternalIPAdresses,omitempty"`
|
|
||||||
WorkerNodesMachineOSBuilds []string `json:"workerNodesMachineOSBuilds,omitempty"`
|
|
||||||
WorkerNodesMachineOSTypes []string `json:"workerNodesMachineOSTypes,omitempty"`
|
|
||||||
WorkerNodesRootPasswords []string `json:"workerNodesRootPasswords,omitempty"`
|
|
||||||
WorkerNodesRootUsernames []string `json:"workerNodesRootUsernames,omitempty"`
|
|
||||||
WorkerNodesSecureShellPorts []int64 `json:"workerNodesSecureShellPorts,omitempty"`
|
|
||||||
WorkerNodesUserPasswords []string `json:"workerNodesUserPasswords,omitempty"`
|
|
||||||
WorkerNodesUserUsernames []string `json:"workerNodesUserUsernames,omitempty"`
|
|
||||||
WorkerTaints []string `json:"workerTaints,omitempty"`
|
|
||||||
WorkersDynamixSEPID int64 `json:"workersDynamixSEPId"`
|
|
||||||
WorkersDynamixSEPPool string `json:"workersDynamixSEPPool"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type DeleteClusterTemplateResult struct {
|
type DeleteClusterTemplateResult struct {
|
||||||
ID int64 `json:"id,omitempty"`
|
ID int64 `json:"id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_cluster_template
|
||||||
|
|
||||||
|
import (
|
||||||
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateClusterRequest = shared.CreateClusterRequest
|
||||||
@@ -8,25 +8,14 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeCodeScoringService service
|
type DeCodeScoringService service
|
||||||
|
|
||||||
type DescribeRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for checking whether the codescoring is installed in the cluster
|
|
||||||
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
|
|
||||||
// true for checking k8s codescoring pods liveness and the availability of the API
|
|
||||||
CheckLiveness bool `json:"checkLiveness" form:"checkLiveness"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get codescoring by id
|
// Get codescoring by id
|
||||||
func (a *DeCodeScoringService) Describe(ctx context.Context, req DescribeRequest) (DescribeCodeScoringResult, error) {
|
func (a *DeCodeScoringService) Describe(ctx context.Context, body DescribeCodeScoringRequest) (DescribeCodeScoringResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -38,8 +27,8 @@ func (a *DeCodeScoringService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -48,7 +37,7 @@ func (a *DeCodeScoringService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/codescoring/describe"
|
requestPath := basePath + "/digitalenergy/codescoring/describe"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -61,13 +50,14 @@ func (a *DeCodeScoringService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkLiveness", req.CheckLiveness, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -86,11 +76,13 @@ func (a *DeCodeScoringService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DescribeCodeScoringResultWithError
|
var wrappedResp DescribeCodeScoringResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -102,48 +94,8 @@ func (a *DeCodeScoringService) Describe(ctx context.Context, req DescribeRequest
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstallRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// username codescoring
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
Username string `json:"username" form:"username"`
|
|
||||||
// password for codescoring
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
Password string `json:"password" form:"password"`
|
|
||||||
// secret key for codescoring
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
SecretKey string `json:"secretKey" form:"secretKey"`
|
|
||||||
// hostname for codescoring
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
Hostname string `json:"hostname" form:"hostname"`
|
|
||||||
// Hostname for integagent
|
|
||||||
IntegagentHostname string `json:"integagentHostname" form:"integagentHostname"`
|
|
||||||
// storage type
|
|
||||||
//
|
|
||||||
// Allowed values:
|
|
||||||
// - "longhorn"
|
|
||||||
// - "glusterfs"
|
|
||||||
// - ""
|
|
||||||
StorageClass string `json:"storageClass" form:"storageClass"`
|
|
||||||
// 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"`
|
|
||||||
// worker group name
|
|
||||||
WorkerGroupName string `json:"workerGroupName" form:"workerGroupName"`
|
|
||||||
// download chart anyway
|
|
||||||
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Install codescoring in cluster
|
// Install codescoring in cluster
|
||||||
func (a *DeCodeScoringService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
|
func (a *DeCodeScoringService) Install(ctx context.Context, body InstallCodeScoringRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -155,48 +107,17 @@ func (a *DeCodeScoringService) Install(ctx context.Context, req InstallRequest)
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.Username) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "username")
|
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.Password) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "password")
|
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.SecretKey) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "secretKey")
|
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.Hostname) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "hostname")
|
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !utils.IsZeroValue(req.StorageClass) {
|
|
||||||
storageClassValue := req.StorageClass
|
|
||||||
storageClassAllowedValues := []string{
|
|
||||||
"longhorn",
|
|
||||||
"glusterfs",
|
|
||||||
"",
|
|
||||||
}
|
|
||||||
storageClassValid := false
|
|
||||||
for _, allowed := range storageClassAllowedValues {
|
|
||||||
if storageClassValue == allowed {
|
|
||||||
storageClassValid = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !storageClassValid {
|
|
||||||
return result, fmt.Errorf("storageClass must be one of %v", storageClassAllowedValues)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/codescoring/install"
|
requestPath := basePath + "/digitalenergy/codescoring/install"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -209,21 +130,14 @@ func (a *DeCodeScoringService) Install(ctx context.Context, req InstallRequest)
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "username", req.Username, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "password", req.Password, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "secretKey", req.SecretKey, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "storageClass", req.StorageClass, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -242,11 +156,13 @@ func (a *DeCodeScoringService) Install(ctx context.Context, req InstallRequest)
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -258,19 +174,8 @@ func (a *DeCodeScoringService) Install(ctx context.Context, req InstallRequest)
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type UninstallRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for deleting the codescoring even if it is not registered
|
|
||||||
CleanAlways bool `json:"cleanAlways" form:"cleanAlways"`
|
|
||||||
// true for ignoring dns server errors
|
|
||||||
IgnoreDNSError bool `json:"ignoreDnsError" form:"ignoreDnsError"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uninstall codescoring from cluster
|
// Uninstall codescoring from cluster
|
||||||
func (a *DeCodeScoringService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
|
func (a *DeCodeScoringService) Uninstall(ctx context.Context, body UninstallCodeScoringRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -282,8 +187,8 @@ func (a *DeCodeScoringService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -292,7 +197,7 @@ func (a *DeCodeScoringService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/codescoring/uninstall"
|
requestPath := basePath + "/digitalenergy/codescoring/uninstall"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -305,13 +210,14 @@ func (a *DeCodeScoringService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -330,11 +236,13 @@ func (a *DeCodeScoringService) Uninstall(ctx context.Context, req UninstallReque
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_codescoring
|
package de_codescoring
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -2,6 +2,26 @@
|
|||||||
|
|
||||||
package de_codescoring
|
package de_codescoring
|
||||||
|
|
||||||
|
type CodeScoringInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
SecretKey string `json:"secretKey"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
type CodeScoringRecord struct {
|
type CodeScoringRecord struct {
|
||||||
Addresses map[string]string `json:"addresses,omitempty"`
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
ClusterID int64 `json:"clusterId,omitempty"`
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
@@ -19,6 +39,12 @@ type CodeScoringRecord struct {
|
|||||||
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DescribeCodeScoringRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
type DescribeCodeScoringResult struct {
|
type DescribeCodeScoringResult struct {
|
||||||
CheckListOk bool `json:"checkListOk,omitempty"`
|
CheckListOk bool `json:"checkListOk,omitempty"`
|
||||||
Description ProductDescr `json:"description,omitempty"`
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
@@ -33,3 +59,18 @@ type DescribeCodeScoringResultWithError struct {
|
|||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Result DescribeCodeScoringResult `json:"result,omitempty"`
|
Result DescribeCodeScoringResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type InstallCodeScoringRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params CodeScoringInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallCodeScoringRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
package de_codescoring
|
package de_codescoring
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
|||||||
@@ -0,0 +1,433 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_computes
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeComputesService service
|
||||||
|
|
||||||
|
type DiskAttachRequest struct {
|
||||||
|
// ID of compute instance
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
ComputeID int64 `json:"computeId" form:"computeId"`
|
||||||
|
// ID of the disk to attach
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
DiskID int64 `json:"diskId" form:"diskId"`
|
||||||
|
// Desired PCI slot (hex string, e.g.
|
||||||
|
PCISlot string `json:"pciSlot" form:"pciSlot"`
|
||||||
|
// Desired bus number (hex string, e.g.
|
||||||
|
BusNumber string `json:"busNumber" form:"busNumber"`
|
||||||
|
// Mount disk in read-only mode
|
||||||
|
ReadOnly bool `json:"readOnly" form:"readOnly"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attach disk
|
||||||
|
func (a *DeComputesService) DiskAttach(ctx context.Context, req DiskAttachRequest) (any, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result any
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredParamMissing(req.ComputeID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "computeId")
|
||||||
|
}
|
||||||
|
if utils.IsRequiredParamMissing(req.DiskID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "diskId")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/computes/diskAttach"
|
||||||
|
|
||||||
|
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, "computeId", req.ComputeID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "diskId", req.DiskID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "pciSlot", req.PCISlot, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "busNumber", req.BusNumber, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "readOnly", req.ReadOnly, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 DiskAttachResultWithError
|
||||||
|
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 DiskDetachRequest struct {
|
||||||
|
// ID of compute instance
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
ComputeID int64 `json:"computeId" form:"computeId"`
|
||||||
|
// ID of the disk to detach
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
DiskID int64 `json:"diskId" form:"diskId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detach disk
|
||||||
|
func (a *DeComputesService) DiskDetach(ctx context.Context, req DiskDetachRequest) (any, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result any
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredParamMissing(req.ComputeID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "computeId")
|
||||||
|
}
|
||||||
|
if utils.IsRequiredParamMissing(req.DiskID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "diskId")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/computes/diskDetach"
|
||||||
|
|
||||||
|
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, "computeId", req.ComputeID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "diskId", req.DiskID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 DiskDetachResultWithError
|
||||||
|
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 GetRequest struct {
|
||||||
|
// ID of the compute
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
ComputeID int64 `json:"computeId" form:"computeId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get compute
|
||||||
|
func (a *DeComputesService) Get(ctx context.Context, req GetRequest) (GetComputeResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result GetComputeResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredParamMissing(req.ComputeID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "computeId")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/computes/get"
|
||||||
|
|
||||||
|
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, "computeId", req.ComputeID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 GetComputeResultWithError
|
||||||
|
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 ListRequest struct {
|
||||||
|
// Find by id
|
||||||
|
ID int64 `json:"id" form:"id"`
|
||||||
|
// Find by name
|
||||||
|
Name string `json:"name" form:"name"`
|
||||||
|
// Find by account ID
|
||||||
|
AccountID int64 `json:"accountId" form:"accountId"`
|
||||||
|
// Find by resource group name
|
||||||
|
RGName string `json:"rgName" form:"rgName"`
|
||||||
|
// Find by resource group ID
|
||||||
|
RGID int64 `json:"rgId" form:"rgId"`
|
||||||
|
// Find by tech status
|
||||||
|
TechStatus string `json:"techStatus" form:"techStatus"`
|
||||||
|
// Find by status
|
||||||
|
Status string `json:"status" form:"status"`
|
||||||
|
// Find by IP address
|
||||||
|
IPAddress string `json:"ipAddress" form:"ipAddress"`
|
||||||
|
// Find by external network name
|
||||||
|
ExtNetName string `json:"extNetName" form:"extNetName"`
|
||||||
|
// Find by external network ID
|
||||||
|
ExtNetID int64 `json:"extNetId" form:"extNetId"`
|
||||||
|
// Include deleted computes
|
||||||
|
IncludeDeleted bool `json:"includeDeleted" form:"includeDeleted"`
|
||||||
|
// Sort by one of supported fields, format +|-(field)
|
||||||
|
SortBy string `json:"sortBy" form:"sortBy"`
|
||||||
|
// Find by zone id
|
||||||
|
ZoneID int64 `json:"zoneId" form:"zoneId"`
|
||||||
|
// Page number
|
||||||
|
Page int64 `json:"page" form:"page"`
|
||||||
|
// Page size
|
||||||
|
Size int64 `json:"size" form:"size"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List computes
|
||||||
|
func (a *DeComputesService) List(ctx context.Context, req ListRequest) (ListComputesResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result ListComputesResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/computes/list"
|
||||||
|
|
||||||
|
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, "id", req.ID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "name", req.Name, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "accountId", req.AccountID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "rgName", req.RGName, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "rgId", req.RGID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "techStatus", req.TechStatus, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "status", req.Status, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "ipAddress", req.IPAddress, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "extNetName", req.ExtNetName, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "extNetId", req.ExtNetID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "includeDeleted", req.IncludeDeleted, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "sortBy", req.SortBy, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "zoneId", req.ZoneID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "page", req.Page, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "size", req.Size, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 ListComputesResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_computes
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeComputes *DeComputesService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeComputes = (*DeComputesService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+72
@@ -0,0 +1,72 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_computes
|
||||||
|
|
||||||
|
type DiskAttachResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result any `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DiskDetachResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result any `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetComputeDiskResult struct {
|
||||||
|
BusNumber int64 `json:"bus_number,omitempty"`
|
||||||
|
DeviceName string `json:"deviceName,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
PCISlot int64 `json:"pciSlot,omitempty"`
|
||||||
|
ResID string `json:"resId,omitempty"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetComputeResult struct {
|
||||||
|
CPUs int64 `json:"cpus,omitempty"`
|
||||||
|
Disks []GetComputeDiskResult `json:"disks,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
ImageID int64 `json:"imageId,omitempty"`
|
||||||
|
ImageName string `json:"imageName,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
RAM int64 `json:"ram,omitempty"`
|
||||||
|
RGID int64 `json:"rgId,omitempty"`
|
||||||
|
RGName string `json:"rgName,omitempty"`
|
||||||
|
ZoneID int64 `json:"zoneId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetComputeResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result GetComputeResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListComputesResult struct {
|
||||||
|
Data []ListComputesResultItem `json:"data,omitempty"`
|
||||||
|
EntryCount int64 `json:"entryCount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListComputesResultInterfaceItem struct {
|
||||||
|
IPAddress string `json:"ipAddress,omitempty"`
|
||||||
|
NetType string `json:"netType,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListComputesResultItem struct {
|
||||||
|
AccountID int64 `json:"accountId,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Interfaces []ListComputesResultInterfaceItem `json:"interfaces,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
RGID int64 `json:"rgId,omitempty"`
|
||||||
|
ZoneID int64 `json:"zoneId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListComputesResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result ListComputesResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeCrioboxService service
|
type DeCrioboxService service
|
||||||
@@ -59,12 +59,15 @@ func (a *DeCrioboxService) Describe(ctx context.Context, req DescribeRequest) (D
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -83,11 +86,13 @@ func (a *DeCrioboxService) Describe(ctx context.Context, req DescribeRequest) (D
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DescribeCrioboxResultWithError
|
var wrappedResp DescribeCrioboxResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -123,12 +128,12 @@ type InstallRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Install Criobox
|
// Install Criobox
|
||||||
func (a *DeCrioboxService) Install(ctx context.Context, req InstallRequest) (InstallCrioboxResult, error) {
|
func (a *DeCrioboxService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
formFiles []utils.FormFile
|
formFiles []utils.FormFile
|
||||||
result InstallCrioboxResult
|
result CreateTaskResult
|
||||||
)
|
)
|
||||||
|
|
||||||
headerParams := make(map[string]string)
|
headerParams := make(map[string]string)
|
||||||
@@ -180,15 +185,18 @@ func (a *DeCrioboxService) Install(ctx context.Context, req InstallRequest) (Ins
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "logLevel", req.LogLevel, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "logLevel", req.LogLevel, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -207,11 +215,13 @@ func (a *DeCrioboxService) Install(ctx context.Context, req InstallRequest) (Ins
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
var wrappedResp InstallCrioboxResultWithError
|
|
||||||
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -235,12 +245,12 @@ type UninstallRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Uninstall Criobox
|
// Uninstall Criobox
|
||||||
func (a *DeCrioboxService) Uninstall(ctx context.Context, req UninstallRequest) (UninstallCrioboxResult, error) {
|
func (a *DeCrioboxService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
formFiles []utils.FormFile
|
formFiles []utils.FormFile
|
||||||
result UninstallCrioboxResult
|
result CreateTaskResult
|
||||||
)
|
)
|
||||||
|
|
||||||
headerParams := make(map[string]string)
|
headerParams := make(map[string]string)
|
||||||
@@ -270,13 +280,16 @@ func (a *DeCrioboxService) Uninstall(ctx context.Context, req UninstallRequest)
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -295,11 +308,13 @@ func (a *DeCrioboxService) Uninstall(ctx context.Context, req UninstallRequest)
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
var wrappedResp UninstallCrioboxResultWithError
|
|
||||||
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_criobox
|
package de_criobox
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -29,25 +29,3 @@ type DescribeCrioboxResultWithError struct {
|
|||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Result DescribeCrioboxResult `json:"result,omitempty"`
|
Result DescribeCrioboxResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstallCrioboxResult struct {
|
|
||||||
TaskID int64 `json:"taskId,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type InstallCrioboxResultWithError struct {
|
|
||||||
Error bool `json:"error,omitempty"`
|
|
||||||
ErrorCode int64 `json:"errorCode,omitempty"`
|
|
||||||
Message string `json:"message,omitempty"`
|
|
||||||
Result InstallCrioboxResult `json:"result,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type UninstallCrioboxResult struct {
|
|
||||||
TaskID int64 `json:"taskId,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type UninstallCrioboxResultWithError struct {
|
|
||||||
Error bool `json:"error,omitempty"`
|
|
||||||
ErrorCode int64 `json:"errorCode,omitempty"`
|
|
||||||
Message string `json:"message,omitempty"`
|
|
||||||
Result UninstallCrioboxResult `json:"result,omitempty"`
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
package de_criobox
|
package de_criobox
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
type ProductDescr = shared.ProductDescr
|
type ProductDescr = shared.ProductDescr
|
||||||
@@ -0,0 +1,414 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_csidynamix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeCsidynamixService service
|
||||||
|
|
||||||
|
type DescribeRequest struct {
|
||||||
|
// cluster ID
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get csidynamix by id
|
||||||
|
func (a *DeCsidynamixService) Describe(ctx context.Context, req DescribeRequest) (DescribeCsiDynamixResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result DescribeCsiDynamixResult
|
||||||
|
)
|
||||||
|
|
||||||
|
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/csidynamix/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, "", "")
|
||||||
|
|
||||||
|
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 DescribeCsiDynamixResultWithError
|
||||||
|
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"`
|
||||||
|
// 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"`
|
||||||
|
// namespace
|
||||||
|
Namespace string `json:"namespace" form:"namespace"`
|
||||||
|
// SEP pool ID for the cluster (for dynamix type)
|
||||||
|
DynamixSEPID int64 `json:"dynamixSepId" form:"dynamixSepId"`
|
||||||
|
// SEP pool name for the cluster (for dynamix type)
|
||||||
|
DynamixPool string `json:"dynamixPool" form:"dynamixPool"`
|
||||||
|
// Storage policy id (for denergy)
|
||||||
|
DynamixStoragePolicyID int64 `json:"dynamixStoragePolicyId" form:"dynamixStoragePolicyId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
// Resourse group ID for the cluster (for dynamix and denergy type)
|
||||||
|
DynamixRGID int64 `json:"dynamixRGId" form:"dynamixRGId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install CsiDynamix
|
||||||
|
func (a *DeCsidynamixService) 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/csidynamix/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, "namespace", req.Namespace, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixSepId", req.DynamixSEPID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPool", req.DynamixPool, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixStoragePolicyId", req.DynamixStoragePolicyID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixRGId", req.DynamixRGID, "", "")
|
||||||
|
|
||||||
|
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 ReinstallRequest struct {
|
||||||
|
// Cluster ID
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
||||||
|
// 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"`
|
||||||
|
// namespace
|
||||||
|
Namespace string `json:"namespace" form:"namespace"`
|
||||||
|
// SEP pool ID for the cluster (for dynamix type)
|
||||||
|
DynamixSEPID int64 `json:"dynamixSepId" form:"dynamixSepId"`
|
||||||
|
// SEP pool name for the cluster (for dynamix type)
|
||||||
|
DynamixPool string `json:"dynamixPool" form:"dynamixPool"`
|
||||||
|
// Storage policy id (for denergy)
|
||||||
|
DynamixStoragePolicyID int64 `json:"dynamixStoragePolicyId" form:"dynamixStoragePolicyId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
// Resourse group ID for the cluster (for dynamix and denergy type)
|
||||||
|
DynamixRGID int64 `json:"dynamixRGId" form:"dynamixRGId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reinstall CsiDynamix
|
||||||
|
func (a *DeCsidynamixService) Reinstall(ctx context.Context, req ReinstallRequest) (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/csidynamix/reinstall"
|
||||||
|
|
||||||
|
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, "namespace", req.Namespace, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixSepId", req.DynamixSEPID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPool", req.DynamixPool, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixStoragePolicyId", req.DynamixStoragePolicyID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixRGId", req.DynamixRGID, "", "")
|
||||||
|
|
||||||
|
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"`
|
||||||
|
// namespace
|
||||||
|
Namespace string `json:"namespace" form:"namespace"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uninstall CsiDynamix
|
||||||
|
func (a *DeCsidynamixService) 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/csidynamix/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, "namespace", req.Namespace, "", "")
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_csidynamix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeCsidynamix *DeCsidynamixService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeCsidynamix = (*DeCsidynamixService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_csidynamix
|
||||||
|
|
||||||
|
type DescribeCsiDynamixResult struct {
|
||||||
|
Installed bool `json:"installed,omitempty"`
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeCsiDynamixResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result DescribeCsiDynamixResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_csidynamix
|
||||||
|
|
||||||
|
import (
|
||||||
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeCustomAppService service
|
type DeCustomAppService service
|
||||||
@@ -61,13 +61,16 @@ func (a *DeCustomAppService) Describe(ctx context.Context, req DescribeRequest)
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "customAppId", req.CustomAppID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "customAppId", req.CustomAppID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "CheckLiveness", req.CheckLiveness, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "CheckLiveness", req.CheckLiveness, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -86,11 +89,13 @@ func (a *DeCustomAppService) Describe(ctx context.Context, req DescribeRequest)
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DescribeCustomAppResultWithError
|
var wrappedResp DescribeCustomAppResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -119,9 +124,13 @@ type InstallRequest struct {
|
|||||||
//
|
//
|
||||||
// Required.
|
// Required.
|
||||||
ReleaseNamespace string `json:"releaseNamespace" form:"releaseNamespace"`
|
ReleaseNamespace string `json:"releaseNamespace" form:"releaseNamespace"`
|
||||||
// Hostname for custom app
|
// full observes pods over time; lite waits until all pods are Running and Ready, then succeeds immediately.
|
||||||
//
|
//
|
||||||
// Required.
|
// Allowed values:
|
||||||
|
// - "full"
|
||||||
|
// - "lite"
|
||||||
|
CheckType string `json:"checkType" form:"checkType"`
|
||||||
|
// Hostname for custom app
|
||||||
Hostname string `json:"hostname" form:"hostname"`
|
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
|
// 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"`
|
InstallTimeout int64 `json:"installTimeout" form:"installTimeout"`
|
||||||
@@ -154,13 +163,28 @@ func (a *DeCustomAppService) Install(ctx context.Context, req InstallRequest) (C
|
|||||||
if utils.IsRequiredParamMissing(req.ReleaseNamespace) {
|
if utils.IsRequiredParamMissing(req.ReleaseNamespace) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "releaseNamespace")
|
missingRequiredParams = append(missingRequiredParams, "releaseNamespace")
|
||||||
}
|
}
|
||||||
if utils.IsRequiredParamMissing(req.Hostname) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "hostname")
|
|
||||||
}
|
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !utils.IsZeroValue(req.CheckType) {
|
||||||
|
checkTypeValue := req.CheckType
|
||||||
|
checkTypeAllowedValues := []string{
|
||||||
|
"full",
|
||||||
|
"lite",
|
||||||
|
}
|
||||||
|
checkTypeValid := false
|
||||||
|
for _, allowed := range checkTypeAllowedValues {
|
||||||
|
if checkTypeValue == allowed {
|
||||||
|
checkTypeValid = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !checkTypeValid {
|
||||||
|
return result, fmt.Errorf("checkType must be one of %v", checkTypeAllowedValues)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/customapp/install"
|
requestPath := basePath + "/digitalenergy/customapp/install"
|
||||||
|
|
||||||
@@ -177,6 +201,8 @@ func (a *DeCustomAppService) Install(ctx context.Context, req InstallRequest) (C
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "checkType", req.CheckType, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "chartId", req.ChartID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "chartId", req.ChartID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "releaseName", req.ReleaseName, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "releaseName", req.ReleaseName, "", "")
|
||||||
@@ -184,10 +210,12 @@ func (a *DeCustomAppService) Install(ctx context.Context, req InstallRequest) (C
|
|||||||
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "installTimeout", req.InstallTimeout, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "installTimeout", req.InstallTimeout, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -206,11 +234,13 @@ func (a *DeCustomAppService) Install(ctx context.Context, req InstallRequest) (C
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -269,13 +299,16 @@ func (a *DeCustomAppService) List(ctx context.Context, req ListRequest) (ListCus
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "CheckLiveness", req.CheckLiveness, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "CheckLiveness", req.CheckLiveness, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -294,11 +327,13 @@ func (a *DeCustomAppService) List(ctx context.Context, req ListRequest) (ListCus
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp ListCustomAppsResultWithError
|
var wrappedResp ListCustomAppsResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -361,15 +396,18 @@ func (a *DeCustomAppService) Uninstall(ctx context.Context, req UninstallRequest
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "customAppId", req.CustomAppID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "customAppId", req.CustomAppID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "deleteNamespace", req.DeleteNamespace, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "deleteNamespace", req.DeleteNamespace, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "uninstallTimeout", req.UninstallTimeout, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "uninstallTimeout", req.UninstallTimeout, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -388,11 +426,13 @@ func (a *DeCustomAppService) Uninstall(ctx context.Context, req UninstallRequest
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_customapp
|
package de_customapp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
package de_customapp
|
package de_customapp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeDatabaseService service
|
type DeDatabaseService service
|
||||||
@@ -68,14 +68,17 @@ func (a *DeDatabaseService) CreateDatabases(ctx context.Context, req CreateDatab
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "databases", req.Databases, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "databases", req.Databases, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "owner", req.Owner, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "owner", req.Owner, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "dropExisting", req.DropExisting, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "dropExisting", req.DropExisting, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -94,11 +97,13 @@ func (a *DeDatabaseService) CreateDatabases(ctx context.Context, req CreateDatab
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateDatabasesResultWithError
|
var wrappedResp CreateDatabasesResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -171,15 +176,18 @@ func (a *DeDatabaseService) CreateDBUser(ctx context.Context, req CreateDBUserRe
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "username", req.Username, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "username", req.Username, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "password", req.Password, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "password", req.Password, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "dropExisting", req.DropExisting, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "dropExisting", req.DropExisting, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "databases", req.Databases, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "databases", req.Databases, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -198,11 +206,13 @@ func (a *DeDatabaseService) CreateDBUser(ctx context.Context, req CreateDBUserRe
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateDBUserResultWithError
|
var wrappedResp CreateDBUserResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -259,12 +269,15 @@ func (a *DeDatabaseService) DeleteDatabase(ctx context.Context, req DeleteDataba
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "databases", req.Databases, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "databases", req.Databases, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -283,11 +296,13 @@ func (a *DeDatabaseService) DeleteDatabase(ctx context.Context, req DeleteDataba
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DeleteDatabasesResultWithError
|
var wrappedResp DeleteDatabasesResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -356,13 +371,16 @@ func (a *DeDatabaseService) DeleteDBUser(ctx context.Context, req DeleteDBUserRe
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "username", req.Username, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "username", req.Username, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "dropDatabases", req.DropDatabases, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "dropDatabases", req.DropDatabases, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -381,11 +399,13 @@ func (a *DeDatabaseService) DeleteDBUser(ctx context.Context, req DeleteDBUserRe
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DeleteDBUserResultWithError
|
var wrappedResp DeleteDBUserResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_database
|
package de_database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -0,0 +1,255 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_defectdojo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeDefectdojoService service
|
||||||
|
|
||||||
|
// Get defectdojo by id
|
||||||
|
func (a *DeDefectdojoService) Describe(ctx context.Context, body DescribeDefectDojoRequest) (DescribeDefectDojoResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result DescribeDefectDojoResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/defectdojo/describe"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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 DescribeDefectDojoResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install defectdojo in cluster
|
||||||
|
func (a *DeDefectdojoService) Install(ctx context.Context, body InstallDefectDojoRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/defectdojo/install"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uninstall defectdojo from cluster
|
||||||
|
func (a *DeDefectdojoService) Uninstall(ctx context.Context, body UninstallDefectDojoRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/defectdojo/uninstall"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_defectdojo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeDefectdojo *DeDefectdojoService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeDefectdojo = (*DeDefectdojoService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+76
@@ -0,0 +1,76 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_defectdojo
|
||||||
|
|
||||||
|
type DefectDojoInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DefectDojoRecord struct {
|
||||||
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
|
Hostnames map[string]string `json:"hostnames,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
OwnerID int64 `json:"ownerId,omitempty"`
|
||||||
|
Password string `json:"password,omitempty"`
|
||||||
|
ProductName string `json:"productName,omitempty"`
|
||||||
|
ProductVersion string `json:"productVersion,omitempty"`
|
||||||
|
PsqlPassword string `json:"psqlPassword,omitempty"`
|
||||||
|
PsqlUsername string `json:"psqlUsername,omitempty"`
|
||||||
|
StorageType string `json:"storageType,omitempty"`
|
||||||
|
TaskIDs []int64 `json:"taskIds,omitempty"`
|
||||||
|
Username string `json:"username,omitempty"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeDefectDojoRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeDefectDojoResult struct {
|
||||||
|
CheckListOk bool `json:"checkListOk,omitempty"`
|
||||||
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
|
Installed bool `json:"installed,omitempty"`
|
||||||
|
Registered bool `json:"registered,omitempty"`
|
||||||
|
Registry DefectDojoRecord `json:"registry,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeDefectDojoResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result DescribeDefectDojoResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type InstallDefectDojoRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params DefectDojoInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallDefectDojoRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_defectdojo
|
||||||
|
|
||||||
|
import (
|
||||||
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
|
type ProductDescr = shared.ProductDescr
|
||||||
@@ -8,25 +8,14 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeDependencyTrackService service
|
type DeDependencyTrackService service
|
||||||
|
|
||||||
type DescribeRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for checking whether the dtrack is installed in the cluster
|
|
||||||
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
|
|
||||||
// true for checking k8s dtrack pods liveness and the availability of the API
|
|
||||||
CheckLiveness bool `json:"checkLiveness" form:"checkLiveness"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get dependency-track by id
|
// Get dependency-track by id
|
||||||
func (a *DeDependencyTrackService) Describe(ctx context.Context, req DescribeRequest) (DescribeDeptrackResult, error) {
|
func (a *DeDependencyTrackService) Describe(ctx context.Context, body DescribeDeptrackRequest) (DescribeDeptrackResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -38,8 +27,8 @@ func (a *DeDependencyTrackService) Describe(ctx context.Context, req DescribeReq
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -48,7 +37,7 @@ func (a *DeDependencyTrackService) Describe(ctx context.Context, req DescribeReq
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/dependency-track/describe"
|
requestPath := basePath + "/digitalenergy/dependency-track/describe"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -61,13 +50,14 @@ func (a *DeDependencyTrackService) Describe(ctx context.Context, req DescribeReq
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkLiveness", req.CheckLiveness, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -86,11 +76,13 @@ func (a *DeDependencyTrackService) Describe(ctx context.Context, req DescribeReq
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp DescribeDeptrackResultWithError
|
var wrappedResp DescribeDeptrackResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -102,38 +94,8 @@ func (a *DeDependencyTrackService) Describe(ctx context.Context, req DescribeReq
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstallRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// hostname for dependency track
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
Hostname string `json:"hostname" form:"hostname"`
|
|
||||||
// Hostname for integagent
|
|
||||||
IntegagentHostname string `json:"integagentHostname" form:"integagentHostname"`
|
|
||||||
// password for the admin user. Do not use the password 'admin' because it will not work
|
|
||||||
Password string `json:"password" form:"password"`
|
|
||||||
// storage type
|
|
||||||
//
|
|
||||||
// Allowed values:
|
|
||||||
// - "longhorn"
|
|
||||||
// - "glusterfs"
|
|
||||||
// - ""
|
|
||||||
StorageClass string `json:"storageClass" form:"storageClass"`
|
|
||||||
// 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"`
|
|
||||||
// worker group name
|
|
||||||
WorkerGroupName string `json:"workerGroupName" form:"workerGroupName"`
|
|
||||||
// download chart anyway
|
|
||||||
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Install dependency-track in cluster
|
// Install dependency-track in cluster
|
||||||
func (a *DeDependencyTrackService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
|
func (a *DeDependencyTrackService) Install(ctx context.Context, body InstallDeptrackRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -145,39 +107,17 @@ func (a *DeDependencyTrackService) Install(ctx context.Context, req InstallReque
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.Hostname) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "hostname")
|
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !utils.IsZeroValue(req.StorageClass) {
|
|
||||||
storageClassValue := req.StorageClass
|
|
||||||
storageClassAllowedValues := []string{
|
|
||||||
"longhorn",
|
|
||||||
"glusterfs",
|
|
||||||
"",
|
|
||||||
}
|
|
||||||
storageClassValid := false
|
|
||||||
for _, allowed := range storageClassAllowedValues {
|
|
||||||
if storageClassValue == allowed {
|
|
||||||
storageClassValid = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !storageClassValid {
|
|
||||||
return result, fmt.Errorf("storageClass must be one of %v", storageClassAllowedValues)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/dependency-track/install"
|
requestPath := basePath + "/digitalenergy/dependency-track/install"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -190,19 +130,14 @@ func (a *DeDependencyTrackService) Install(ctx context.Context, req InstallReque
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "password", req.Password, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "storageClass", req.StorageClass, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -221,11 +156,13 @@ func (a *DeDependencyTrackService) Install(ctx context.Context, req InstallReque
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -237,19 +174,8 @@ func (a *DeDependencyTrackService) Install(ctx context.Context, req InstallReque
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type UninstallRequest struct {
|
|
||||||
// cluster ID
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
|
||||||
// true for deleting the dtrack even if it is not registered
|
|
||||||
CleanAlways bool `json:"cleanAlways" form:"cleanAlways"`
|
|
||||||
// true for ignoring dns server errors
|
|
||||||
IgnoreDNSError bool `json:"ignoreDnsError" form:"ignoreDnsError"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uninstall dependency-track from cluster
|
// Uninstall dependency-track from cluster
|
||||||
func (a *DeDependencyTrackService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
|
func (a *DeDependencyTrackService) Uninstall(ctx context.Context, body UninstallDeptrackRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -261,8 +187,8 @@ func (a *DeDependencyTrackService) Uninstall(ctx context.Context, req UninstallR
|
|||||||
queryParams := url.Values{}
|
queryParams := url.Values{}
|
||||||
formParams := url.Values{}
|
formParams := url.Values{}
|
||||||
missingRequiredParams := make([]string, 0)
|
missingRequiredParams := make([]string, 0)
|
||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
@@ -271,7 +197,7 @@ func (a *DeDependencyTrackService) Uninstall(ctx context.Context, req UninstallR
|
|||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/dependency-track/uninstall"
|
requestPath := basePath + "/digitalenergy/dependency-track/uninstall"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
contentType := utils.SelectHeaderContentType(contentTypes)
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
@@ -284,13 +210,14 @@ func (a *DeDependencyTrackService) Uninstall(ctx context.Context, req UninstallR
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "cleanAlways", req.CleanAlways, "", "")
|
requestBody = body
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "ignoreDnsError", req.IgnoreDNSError, "", "")
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -309,11 +236,13 @@ func (a *DeDependencyTrackService) Uninstall(ctx context.Context, req UninstallR
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_dependency_track
|
package de_dependency_track
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -2,6 +2,25 @@
|
|||||||
|
|
||||||
package de_dependency_track
|
package de_dependency_track
|
||||||
|
|
||||||
|
type DeptrackInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
type DeptrackRecord struct {
|
type DeptrackRecord struct {
|
||||||
Addresses map[string]string `json:"addresses,omitempty"`
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
ClusterID int64 `json:"clusterId,omitempty"`
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
@@ -20,6 +39,12 @@ type DeptrackRecord struct {
|
|||||||
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DescribeDeptrackRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
type DescribeDeptrackResult struct {
|
type DescribeDeptrackResult struct {
|
||||||
CheckListOk bool `json:"checkListOk,omitempty"`
|
CheckListOk bool `json:"checkListOk,omitempty"`
|
||||||
Description ProductDescr `json:"description,omitempty"`
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
@@ -34,3 +59,18 @@ type DescribeDeptrackResultWithError struct {
|
|||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Result DescribeDeptrackResult `json:"result,omitempty"`
|
Result DescribeDeptrackResult `json:"result,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type InstallDeptrackRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params DeptrackInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallDeptrackRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
package de_dependency_track
|
package de_dependency_track
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeDeploymentService service
|
type DeDeploymentService service
|
||||||
@@ -43,10 +43,12 @@ func (a *DeDeploymentService) Get(ctx context.Context) (GetDeploymentResult, err
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -65,11 +67,13 @@ func (a *DeDeploymentService) Get(ctx context.Context) (GetDeploymentResult, err
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp GetDeploymentResultWithError
|
var wrappedResp GetDeploymentResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_deployment
|
package de_deployment
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
package de_deployment
|
package de_deployment
|
||||||
|
|
||||||
type GetDeploymentResult struct {
|
type GetDeploymentResult struct {
|
||||||
BuildBranchName string `json:"buildBranchName,omitempty"`
|
BuildBranchName string `json:"buildBranchName,omitempty"`
|
||||||
BuildTime string `json:"buildTime,omitempty"`
|
BuildTime string `json:"buildTime,omitempty"`
|
||||||
BuildVersionShort string `json:"buildVersionShort,omitempty"`
|
BuildVersionShort string `json:"buildVersionShort,omitempty"`
|
||||||
CheckIstoreEntityResult string `json:"checkIstoreEntityResult,omitempty"`
|
CheckIstoreEntityResult []string `json:"checkIstoreEntityResult,omitempty"`
|
||||||
ReleaseVersion string `json:"releaseVersion,omitempty"`
|
ReleaseVersion string `json:"releaseVersion,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetDeploymentResultWithError struct {
|
type GetDeploymentResultWithError struct {
|
||||||
|
|||||||
@@ -0,0 +1,535 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeDisksService service
|
||||||
|
|
||||||
|
type CreateRequest struct {
|
||||||
|
// Name of new disk
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
Name string `json:"name" form:"name"`
|
||||||
|
// Resourse group ID for the cluster (for dynamix and denergy type)
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
DynamixRGID int64 `json:"dynamixRGId" form:"dynamixRGId"`
|
||||||
|
// Description
|
||||||
|
Description string `json:"description" form:"description"`
|
||||||
|
// Size in GB, default is 0
|
||||||
|
Size int64 `json:"size" form:"size"`
|
||||||
|
// SEP pool ID for the cluster (for dynamix type)
|
||||||
|
DynamixSEPID int64 `json:"dynamixSepId" form:"dynamixSepId"`
|
||||||
|
// SEP pool name for the cluster (for dynamix type)
|
||||||
|
DynamixPool string `json:"dynamixPool" form:"dynamixPool"`
|
||||||
|
// Storage policy id (for denergy)
|
||||||
|
DynamixStoragePolicyID int64 `json:"dynamixStoragePolicyId" form:"dynamixStoragePolicyId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create disk
|
||||||
|
func (a *DeDisksService) Create(ctx context.Context, req CreateRequest) (CreateDiskResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result CreateDiskResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredParamMissing(req.Name) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "name")
|
||||||
|
}
|
||||||
|
if utils.IsRequiredParamMissing(req.DynamixRGID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "dynamixRGId")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/disks/create"
|
||||||
|
|
||||||
|
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, "name", req.Name, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "description", req.Description, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "size", req.Size, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixSepId", req.DynamixSEPID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPool", req.DynamixPool, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixStoragePolicyId", req.DynamixStoragePolicyID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixRGId", req.DynamixRGID, "", "")
|
||||||
|
|
||||||
|
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 CreateDiskResultWithError
|
||||||
|
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 DeleteRequest struct {
|
||||||
|
// ID of disk to delete
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
DiskID int64 `json:"diskId" form:"diskId"`
|
||||||
|
// Detach disk from machine first
|
||||||
|
Detach bool `json:"detach" form:"detach"`
|
||||||
|
// Whether to completely delete the disk, works only with non attached disks
|
||||||
|
Permanently bool `json:"permanently" form:"permanently"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete disk
|
||||||
|
func (a *DeDisksService) Delete(ctx context.Context, req DeleteRequest) (any, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result any
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredParamMissing(req.DiskID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "diskId")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/disks/delete"
|
||||||
|
|
||||||
|
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, "diskId", req.DiskID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "detach", req.Detach, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "permanently", req.Permanently, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 DeleteDiskResultWithError
|
||||||
|
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 GetRequest struct {
|
||||||
|
// ID of the disk
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
DiskID int64 `json:"diskId" form:"diskId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get disk
|
||||||
|
func (a *DeDisksService) Get(ctx context.Context, req GetRequest) (GetDiskResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result GetDiskResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredParamMissing(req.DiskID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "diskId")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/disks/get"
|
||||||
|
|
||||||
|
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, "diskId", req.DiskID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 GetDiskResultWithError
|
||||||
|
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 ListRequest struct {
|
||||||
|
// Find by id
|
||||||
|
ID int64 `json:"id" form:"id"`
|
||||||
|
// Find by name
|
||||||
|
Name string `json:"name" form:"name"`
|
||||||
|
// Find by account name
|
||||||
|
AccountName string `json:"accountName" form:"accountName"`
|
||||||
|
// Find by max size disk
|
||||||
|
DiskMaxSize int64 `json:"diskMaxSize" form:"diskMaxSize"`
|
||||||
|
// Find by status
|
||||||
|
Status string `json:"status" form:"status"`
|
||||||
|
// Find by shared
|
||||||
|
Shared bool `json:"shared" form:"shared"`
|
||||||
|
// ID of the account the disks belong to
|
||||||
|
AccountID int64 `json:"accountId" form:"accountId"`
|
||||||
|
// Find by sep ID
|
||||||
|
SEPID int64 `json:"sepId" form:"sepId"`
|
||||||
|
// Find by storage policy id
|
||||||
|
StoragePolicyID int64 `json:"storagePolicyId" form:"storagePolicyId"`
|
||||||
|
// Find by pool name
|
||||||
|
Pool string `json:"pool" form:"pool"`
|
||||||
|
// Sort by one of supported fields, format +|-(field)
|
||||||
|
SortBy string `json:"sortBy" form:"sortBy"`
|
||||||
|
// Page number
|
||||||
|
Page int64 `json:"page" form:"page"`
|
||||||
|
// Page size
|
||||||
|
Size int64 `json:"size" form:"size"`
|
||||||
|
// Find by id of the resource group
|
||||||
|
RGID int64 `json:"rgId" form:"rgId"`
|
||||||
|
// Find by id of the compute
|
||||||
|
ComputeID int64 `json:"computeId" form:"computeId"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List disks
|
||||||
|
func (a *DeDisksService) List(ctx context.Context, req ListRequest) (ListDisksResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result ListDisksResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/disks/list"
|
||||||
|
|
||||||
|
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, "id", req.ID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "name", req.Name, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "accountName", req.AccountName, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "diskMaxSize", req.DiskMaxSize, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "status", req.Status, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "shared", req.Shared, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "accountId", req.AccountID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "sepId", req.SEPID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "storagePolicyId", req.StoragePolicyID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "pool", req.Pool, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "sortBy", req.SortBy, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "page", req.Page, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "size", req.Size, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "rgId", req.RGID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "computeId", req.ComputeID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 ListDisksResultWithError
|
||||||
|
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 ResizeRequest struct {
|
||||||
|
// ID of the disk to resize
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
DiskID int64 `json:"diskId" form:"diskId"`
|
||||||
|
// New size of the disk in GB
|
||||||
|
//
|
||||||
|
// Required.
|
||||||
|
Size int64 `json:"size" form:"size"`
|
||||||
|
// Specify which dynamix platform ID to use. If not specified, defaults to the first dynamix user data
|
||||||
|
DynamixPlatformID int64 `json:"dynamixPlatformId" form:"dynamixPlatformId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resize disk
|
||||||
|
func (a *DeDisksService) Resize(ctx context.Context, req ResizeRequest) (any, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result any
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredParamMissing(req.DiskID) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "diskId")
|
||||||
|
}
|
||||||
|
if utils.IsRequiredParamMissing(req.Size) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "size")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/disks/resize"
|
||||||
|
|
||||||
|
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, "diskId", req.DiskID, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "size", req.Size, "", "")
|
||||||
|
utils.ParameterAddToHeaderOrQuery(formParams, "dynamixPlatformId", req.DynamixPlatformID, "", "")
|
||||||
|
|
||||||
|
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 ResizeDiskResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeDisks *DeDisksService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeDisks = (*DeDisksService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+68
@@ -0,0 +1,68 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_disks
|
||||||
|
|
||||||
|
type CreateDiskResult struct {
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateDiskResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result CreateDiskResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteDiskResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result any `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetDiskResult struct {
|
||||||
|
Computes map[string]string `json:"computes,omitempty"`
|
||||||
|
DeviceName string `json:"devicename,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Pool string `json:"pool,omitempty"`
|
||||||
|
ResID string `json:"resId,omitempty"`
|
||||||
|
SEPID int64 `json:"sepId,omitempty"`
|
||||||
|
SizeMax int64 `json:"sizeMax,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
StoragePolicyID int64 `json:"storagePolicyId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetDiskResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result GetDiskResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListDisksResult struct {
|
||||||
|
Data []ListDisksResultItem `json:"data,omitempty"`
|
||||||
|
EntryCount int64 `json:"entryCount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListDisksResultItem struct {
|
||||||
|
Computes map[string]string `json:"computes,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
SizeMax int64 `json:"sizeMax,omitempty"`
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
StoragePolicyID int64 `json:"storagePolicyId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListDisksResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result ListDisksResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ResizeDiskResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result any `json:"result,omitempty"`
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
package de_minio
|
package de_ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@@ -8,30 +8,30 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeMinIOService service
|
type DeEssService service
|
||||||
|
|
||||||
type DescribeRequest struct {
|
type DescribeRequest struct {
|
||||||
// cluster ID
|
// cluster ID
|
||||||
//
|
//
|
||||||
// Required.
|
// Required.
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
||||||
// true for checking whether the minio is installed in the cluster
|
// check whether installed in cluster
|
||||||
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
|
CheckInstallation bool `json:"checkInstallation" form:"checkInstallation"`
|
||||||
// true for checking k8s minio pods liveness and the availability of the API
|
// return rules actually loaded on each node
|
||||||
CheckLiveness bool `json:"checkLiveness" form:"checkLiveness"`
|
CheckRules bool `json:"checkRules" form:"checkRules"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get minio by id
|
// Get ess info in cluster: version, daemonset state, agents status per node, events losses. With checkRules additionally - loaded rules per node
|
||||||
func (a *DeMinIOService) Describe(ctx context.Context, req DescribeRequest) (DescribeMinIOResult, error) {
|
func (a *DeEssService) Describe(ctx context.Context, req DescribeRequest) (DescribeEssResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
formFiles []utils.FormFile
|
formFiles []utils.FormFile
|
||||||
result DescribeMinIOResult
|
result DescribeEssResult
|
||||||
)
|
)
|
||||||
|
|
||||||
headerParams := make(map[string]string)
|
headerParams := make(map[string]string)
|
||||||
@@ -46,7 +46,7 @@ func (a *DeMinIOService) Describe(ctx context.Context, req DescribeRequest) (Des
|
|||||||
}
|
}
|
||||||
|
|
||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/minio/describe"
|
requestPath := basePath + "/digitalenergy/ess/describe"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/x-www-form-urlencoded"}
|
||||||
|
|
||||||
@@ -61,13 +61,16 @@ func (a *DeMinIOService) Describe(ctx context.Context, req DescribeRequest) (Des
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "checkInstallation", req.CheckInstallation, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "checkLiveness", req.CheckLiveness, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "checkRules", req.CheckRules, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -86,11 +89,135 @@ func (a *DeMinIOService) Describe(ctx context.Context, req DescribeRequest) (Des
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
var wrappedResp DescribeMinIOResultWithError
|
|
||||||
|
var wrappedResp DescribeEssResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
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 {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -107,35 +234,20 @@ type InstallRequest struct {
|
|||||||
//
|
//
|
||||||
// Required.
|
// Required.
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
||||||
// password for a minio user
|
// auth token for ess mutation API
|
||||||
//
|
//
|
||||||
// Required.
|
// Required.
|
||||||
Password string `json:"password" form:"password"`
|
AuthToken string `json:"authToken" form:"authToken"`
|
||||||
// hostname for minio
|
|
||||||
//
|
|
||||||
// Required.
|
|
||||||
Hostname string `json:"hostname" form:"hostname"`
|
|
||||||
// storage type
|
|
||||||
//
|
|
||||||
// Allowed values:
|
|
||||||
// - "longhorn"
|
|
||||||
// - "glusterfs"
|
|
||||||
// - ""
|
|
||||||
StorageClass string `json:"storageClass" form:"storageClass"`
|
|
||||||
// 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.
|
// 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"`
|
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.
|
// 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"`
|
ChartsRepositoryID int64 `json:"chartsRepositoryId" form:"chartsRepositoryId"`
|
||||||
// worker group name
|
|
||||||
WorkerGroupName string `json:"workerGroupName" form:"workerGroupName"`
|
|
||||||
// download chart anyway
|
// download chart anyway
|
||||||
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
|
DownloadChartAnyway bool `json:"downloadChartAnyway" form:"downloadChartAnyway"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install minio in cluster
|
// Install ess in cluster
|
||||||
func (a *DeMinIOService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
|
func (a *DeEssService) Install(ctx context.Context, req InstallRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -150,37 +262,15 @@ func (a *DeMinIOService) Install(ctx context.Context, req InstallRequest) (Creat
|
|||||||
if utils.IsRequiredParamMissing(req.ClusterID) {
|
if utils.IsRequiredParamMissing(req.ClusterID) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
missingRequiredParams = append(missingRequiredParams, "clusterId")
|
||||||
}
|
}
|
||||||
if utils.IsRequiredParamMissing(req.Password) {
|
if utils.IsRequiredParamMissing(req.AuthToken) {
|
||||||
missingRequiredParams = append(missingRequiredParams, "password")
|
missingRequiredParams = append(missingRequiredParams, "authToken")
|
||||||
}
|
|
||||||
if utils.IsRequiredParamMissing(req.Hostname) {
|
|
||||||
missingRequiredParams = append(missingRequiredParams, "hostname")
|
|
||||||
}
|
}
|
||||||
if len(missingRequiredParams) > 0 {
|
if len(missingRequiredParams) > 0 {
|
||||||
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !utils.IsZeroValue(req.StorageClass) {
|
|
||||||
storageClassValue := req.StorageClass
|
|
||||||
storageClassAllowedValues := []string{
|
|
||||||
"longhorn",
|
|
||||||
"glusterfs",
|
|
||||||
"",
|
|
||||||
}
|
|
||||||
storageClassValid := false
|
|
||||||
for _, allowed := range storageClassAllowedValues {
|
|
||||||
if storageClassValue == allowed {
|
|
||||||
storageClassValid = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !storageClassValid {
|
|
||||||
return result, fmt.Errorf("storageClass must be one of %v", storageClassAllowedValues)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/minio/install"
|
requestPath := basePath + "/digitalenergy/ess/install"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/x-www-form-urlencoded"}
|
||||||
|
|
||||||
@@ -195,19 +285,18 @@ func (a *DeMinIOService) Install(ctx context.Context, req InstallRequest) (Creat
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "password", req.Password, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "storageClass", req.StorageClass, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "hostname", req.Hostname, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "integagentHostname", req.IntegagentHostname, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "appsRepositoryId", req.AppsRepositoryID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "chartsRepositoryId", req.ChartsRepositoryID, "", "")
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "workerGroupName", req.WorkerGroupName, "", "")
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "downloadChartAnyway", req.DownloadChartAnyway, "", "")
|
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)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -226,11 +315,13 @@ func (a *DeMinIOService) Install(ctx context.Context, req InstallRequest) (Creat
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -247,14 +338,10 @@ type UninstallRequest struct {
|
|||||||
//
|
//
|
||||||
// Required.
|
// Required.
|
||||||
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
ClusterID int64 `json:"clusterId" form:"clusterId"`
|
||||||
// true for deleting the minio even if it is not registered
|
|
||||||
CleanAlways bool `json:"cleanAlways" form:"cleanAlways"`
|
|
||||||
// true for ignoring dns server errors
|
|
||||||
IgnoreDNSError bool `json:"ignoreDnsError" form:"ignoreDnsError"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uninstall minio from cluster
|
// Uninstall ess from cluster: daemonset, configmaps, api auth secret, serviceaccount, clusterrole and clusterrolebinding, service, namespace
|
||||||
func (a *DeMinIOService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
|
func (a *DeEssService) Uninstall(ctx context.Context, req UninstallRequest) (CreateTaskResult, error) {
|
||||||
var (
|
var (
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
requestBody any
|
requestBody any
|
||||||
@@ -274,7 +361,7 @@ func (a *DeMinIOService) Uninstall(ctx context.Context, req UninstallRequest) (C
|
|||||||
}
|
}
|
||||||
|
|
||||||
basePath := a.client.BaseURL()
|
basePath := a.client.BaseURL()
|
||||||
requestPath := basePath + "/digitalenergy/minio/uninstall"
|
requestPath := basePath + "/digitalenergy/ess/uninstall"
|
||||||
|
|
||||||
contentTypes := []string{"application/x-www-form-urlencoded"}
|
contentTypes := []string{"application/x-www-form-urlencoded"}
|
||||||
|
|
||||||
@@ -289,13 +376,14 @@ func (a *DeMinIOService) Uninstall(ctx context.Context, req UninstallRequest) (C
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "clusterId", req.ClusterID, "", "")
|
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)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -314,11 +402,13 @@ func (a *DeMinIOService) Uninstall(ctx context.Context, req UninstallRequest) (C
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp CreateTaskResultWithError
|
var wrappedResp CreateTaskResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
package de_minio
|
package de_ess
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
common service
|
common service
|
||||||
|
|
||||||
DeMinIO *DeMinIOService
|
DeEss *DeEssService
|
||||||
}
|
}
|
||||||
|
|
||||||
type service struct {
|
type service struct {
|
||||||
@@ -21,7 +21,7 @@ func NewAPIClient(cfg *core.Configuration) *APIClient {
|
|||||||
c := &APIClient{}
|
c := &APIClient{}
|
||||||
c.common.client = utils.NewClient(cfg)
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
c.DeMinIO = (*DeMinIOService)(&c.common)
|
c.DeEss = (*DeEssService)(&c.common)
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
Executable
+87
@@ -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"`
|
||||||
|
}
|
||||||
@@ -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/v2/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_falco
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeFalcoService service
|
||||||
|
|
||||||
|
// Get Falco info by cluster id
|
||||||
|
func (a *DeFalcoService) Describe(ctx context.Context, body DescribeFalcoRequest) (DescribeFalcoResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result DescribeFalcoResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/falco/describe"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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 DescribeFalcoResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install Falco in cluster
|
||||||
|
func (a *DeFalcoService) Install(ctx context.Context, body InstallFalcoRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/falco/install"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uninstall Falco from cluster
|
||||||
|
func (a *DeFalcoService) Uninstall(ctx context.Context, body UninstallFalcoRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/falco/uninstall"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_falco
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeFalco *DeFalcoService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeFalco = (*DeFalcoService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+72
@@ -0,0 +1,72 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_falco
|
||||||
|
|
||||||
|
type DescribeFalcoRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeFalcoResult struct {
|
||||||
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
|
Installed bool `json:"installed,omitempty"`
|
||||||
|
Registered bool `json:"registered,omitempty"`
|
||||||
|
Registry FalcoRecord `json:"registry,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeFalcoResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result DescribeFalcoResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FalcoInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FalcoRecord struct {
|
||||||
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
|
CreatedAt int64 `json:"createdAt,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Manifest string `json:"manifest,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"`
|
||||||
|
UpdatedAt int64 `json:"updatedAt,omitempty"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type InstallFalcoRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params FalcoInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallFalcoRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
// Code generated by internal codegen utility; DO NOT EDIT.
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
package de_minio
|
package de_falco
|
||||||
|
|
||||||
import (
|
import (
|
||||||
shared "repository.basistech.ru/BASIS/de-golang-sdk/shared"
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskResult = shared.CreateTaskResult
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_filebeat
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeFilebeatService service
|
||||||
|
|
||||||
|
// Get Filebeat info by cluster id
|
||||||
|
func (a *DeFilebeatService) Describe(ctx context.Context, body DescribeFilebeatRequest) (DescribeFilebeatResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result DescribeFilebeatResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/filebeat/describe"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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 DescribeFilebeatResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install Filebeat in cluster
|
||||||
|
func (a *DeFilebeatService) Install(ctx context.Context, body InstallFilebeatRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/filebeat/install"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uninstall Filebeat from cluster
|
||||||
|
func (a *DeFilebeatService) Uninstall(ctx context.Context, body UninstallFilebeatRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/filebeat/uninstall"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_filebeat
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIClient struct {
|
||||||
|
common service
|
||||||
|
|
||||||
|
DeFilebeat *DeFilebeatService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *utils.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIClient(cfg *core.Configuration) *APIClient {
|
||||||
|
c := &APIClient{}
|
||||||
|
c.common.client = utils.NewClient(cfg)
|
||||||
|
|
||||||
|
c.DeFilebeat = (*DeFilebeatService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
Executable
+75
@@ -0,0 +1,75 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_filebeat
|
||||||
|
|
||||||
|
type DescribeFilebeatRequest struct {
|
||||||
|
CheckInstallation bool `json:"checkInstallation"`
|
||||||
|
CheckLiveness bool `json:"checkLiveness"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeFilebeatResult struct {
|
||||||
|
Description ProductDescr `json:"description,omitempty"`
|
||||||
|
Installed bool `json:"installed,omitempty"`
|
||||||
|
Registered bool `json:"registered,omitempty"`
|
||||||
|
Registry FilebeatRecord `json:"registry,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeFilebeatResultWithError struct {
|
||||||
|
Error bool `json:"error,omitempty"`
|
||||||
|
ErrorCode int64 `json:"errorCode,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
Result DescribeFilebeatResult `json:"result,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilebeatInstallParams struct {
|
||||||
|
Affinity string `json:"affinity"`
|
||||||
|
CPULimit string `json:"cpuLimit"`
|
||||||
|
CPURequest string `json:"cpuRequest"`
|
||||||
|
FilebeatYMLConfig string `json:"filebeatYMLConfig"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
MemoryLimit string `json:"memoryLimit"`
|
||||||
|
MemoryRequest string `json:"memoryRequest"`
|
||||||
|
Namespace string `json:"namespace"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Replicas int64 `json:"replicas"`
|
||||||
|
SecretParams map[string]string `json:"secretParams,omitempty"`
|
||||||
|
ServicePort int64 `json:"servicePort"`
|
||||||
|
ServiceTargetPort int64 `json:"serviceTargetPort"`
|
||||||
|
StorageClass string `json:"storageClass"`
|
||||||
|
StorageSize string `json:"storageSize"`
|
||||||
|
Tolerations string `json:"tolerations"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilebeatRecord struct {
|
||||||
|
Addresses map[string]string `json:"addresses,omitempty"`
|
||||||
|
ClusterID int64 `json:"clusterId,omitempty"`
|
||||||
|
Hostnames map[string]string `json:"hostnames,omitempty"`
|
||||||
|
ID int64 `json:"id,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
OwnerID int64 `json:"ownerId,omitempty"`
|
||||||
|
Password string `json:"password,omitempty"`
|
||||||
|
ProductName string `json:"productName,omitempty"`
|
||||||
|
ProductVersion string `json:"productVersion,omitempty"`
|
||||||
|
StorageType string `json:"storageType,omitempty"`
|
||||||
|
TaskIDs []int64 `json:"taskIds,omitempty"`
|
||||||
|
Username string `json:"username,omitempty"`
|
||||||
|
WorkerGroupName string `json:"workerGroupName,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type InstallFilebeatRequest struct {
|
||||||
|
AppsRepositoryID int64 `json:"appsRepositoryId"`
|
||||||
|
ChartsRepositoryID int64 `json:"chartsRepositoryId"`
|
||||||
|
CheckType string `json:"checkType"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
DownloadChartAnyway bool `json:"downloadChartAnyway"`
|
||||||
|
Params FilebeatInstallParams `json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UninstallFilebeatRequest struct {
|
||||||
|
CleanAlways bool `json:"cleanAlways"`
|
||||||
|
ClusterID int64 `json:"clusterId"`
|
||||||
|
IgnoreDNSError bool `json:"ignoreDnsError"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// Code generated by internal codegen utility; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_filebeat
|
||||||
|
|
||||||
|
import (
|
||||||
|
shared "repository.basistech.ru/BASIS/de-golang-sdk/v2/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateTaskResult = shared.CreateTaskResult
|
||||||
|
type CreateTaskResultWithError = shared.CreateTaskResultWithError
|
||||||
|
type ProductDescr = shared.ProductDescr
|
||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeFilesService service
|
type DeFilesService service
|
||||||
@@ -59,6 +59,7 @@ func (a *DeFilesService) FileUpload(ctx context.Context, req FileUploadRequest)
|
|||||||
if accept != "" {
|
if accept != "" {
|
||||||
headerParams["Accept"] = accept
|
headerParams["Accept"] = accept
|
||||||
}
|
}
|
||||||
|
|
||||||
if file := req.File; file != nil {
|
if file := req.File; file != nil {
|
||||||
formFiles = append(formFiles, utils.FormFile{
|
formFiles = append(formFiles, utils.FormFile{
|
||||||
FieldName: "file",
|
FieldName: "file",
|
||||||
@@ -67,10 +68,12 @@ func (a *DeFilesService) FileUpload(ctx context.Context, req FileUploadRequest)
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
utils.ParameterAddToHeaderOrQuery(formParams, "timeToDelete", req.TimeToDelete, "", "")
|
utils.ParameterAddToHeaderOrQuery(formParams, "timeToDelete", req.TimeToDelete, "", "")
|
||||||
|
|
||||||
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
httpReq, err := a.client.PrepareRequest(ctx, requestPath, method, requestBody, headerParams, queryParams, formParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("prepare request: %w", err)
|
return result, fmt.Errorf("prepare request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := a.client.CallAPI(httpReq, false)
|
resp, err := a.client.CallAPI(httpReq, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@@ -89,11 +92,13 @@ func (a *DeFilesService) FileUpload(ctx context.Context, req FileUploadRequest)
|
|||||||
}
|
}
|
||||||
return result, httpErr
|
return result, httpErr
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrappedResp FileUploadResultWithError
|
var wrappedResp FileUploadResultWithError
|
||||||
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
err = a.client.Decode(&wrappedResp, respBody, resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("decode response body: %w", err)
|
return result, fmt.Errorf("decode response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wrappedResp.Error {
|
if wrappedResp.Error {
|
||||||
return result, &core.BackendError{
|
return result, &core.BackendError{
|
||||||
Code: wrappedResp.ErrorCode,
|
Code: wrappedResp.ErrorCode,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package de_files
|
package de_files
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/core"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
"repository.basistech.ru/BASIS/de-golang-sdk/internal/utils"
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIClient struct {
|
type APIClient struct {
|
||||||
|
|||||||
@@ -0,0 +1,255 @@
|
|||||||
|
// Code generated by OpenAPI Generator; DO NOT EDIT.
|
||||||
|
|
||||||
|
package de_fluentbit
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/core"
|
||||||
|
"repository.basistech.ru/BASIS/de-golang-sdk/v2/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeFluentbitService service
|
||||||
|
|
||||||
|
// Get FluentBit info by cluster id
|
||||||
|
func (a *DeFluentbitService) Describe(ctx context.Context, body DescribeFluentBitRequest) (DescribeFluentBitResult, error) {
|
||||||
|
var (
|
||||||
|
method = http.MethodPost
|
||||||
|
requestBody any
|
||||||
|
formFiles []utils.FormFile
|
||||||
|
result DescribeFluentBitResult
|
||||||
|
)
|
||||||
|
|
||||||
|
headerParams := make(map[string]string)
|
||||||
|
queryParams := url.Values{}
|
||||||
|
formParams := url.Values{}
|
||||||
|
missingRequiredParams := make([]string, 0)
|
||||||
|
if utils.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/fluentbit/describe"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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 DescribeFluentBitResultWithError
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install FluentBit in cluster
|
||||||
|
func (a *DeFluentbitService) Install(ctx context.Context, body InstallFluentBitRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/fluentbit/install"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uninstall FluentBit from cluster
|
||||||
|
func (a *DeFluentbitService) Uninstall(ctx context.Context, body UninstallFluentBitRequest) (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.IsRequiredBodyMissing(body) {
|
||||||
|
missingRequiredParams = append(missingRequiredParams, "request")
|
||||||
|
}
|
||||||
|
if len(missingRequiredParams) > 0 {
|
||||||
|
return result, utils.MissingRequiredParamsError(missingRequiredParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
basePath := a.client.BaseURL()
|
||||||
|
requestPath := basePath + "/digitalenergy/fluentbit/uninstall"
|
||||||
|
|
||||||
|
contentTypes := []string{"application/json"}
|
||||||
|
|
||||||
|
contentType := utils.SelectHeaderContentType(contentTypes)
|
||||||
|
if contentType != "" {
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
accepts := []string{"application/json"}
|
||||||
|
|
||||||
|
accept := utils.SelectHeaderAccept(accepts)
|
||||||
|
if accept != "" {
|
||||||
|
headerParams["Accept"] = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
requestBody = body
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
Loaded 100 of 340 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user