v11.2.0
This commit is contained in:
1 parent
0ad1ec7a61
commit
8779f0ad52
4 files changed
+120
-81
No files matched your search
@@ -0,0 +1,28 @@
|
|||||||
|
## Version 11.2.0
|
||||||
|
|
||||||
|
### Добавлено
|
||||||
|
|
||||||
|
#### apiaccess
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-1058 | Опциональные поля `Audit`, `DPDKNet`, `SEP`, `Stack` и `VFPool` в структуру `CloudAPIEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1058 | Опциональные поля `Backup`, `DPDKNet` и `VFPool` в структуру `CloudBrokerEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1058 | Опциональное поле `Cache` в структуру `SystemEndpoints` в cloudbroker/apiaccess |
|
||||||
|
|
||||||
|
### Удалено
|
||||||
|
|
||||||
|
#### apiaccess
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-1058 | Опциональное поле `LibCloud` из структуры `APIsEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1058 | Опциональные поля `CloudSpace`, `ComputeCI`, `DPDK`, `Machine`, `Openshift`, `OpenshiftCI`, `PortForwarding` и `Sizes` из структуры `CloudAPIEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1058 | Опциональные поля `CloudSpace`, `ComputeCI`, `Desnode`, `Diagnostics`, `DPDK`, `IaaS`, `Machine`, `Openshift`, `OpenshiftCI`, `Ovsnode` и `QOS` из структуры `CloudBrokerEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1058 | Опциональные поля `Alerts`, `ErrorConditionHandler`, `Job`, `Log` и `Logo` из структуры `SystemEndpoints` в cloudbroker/apiaccess |
|
||||||
|
|
||||||
|
### Исправлено
|
||||||
|
|
||||||
|
#### apiaccess
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-1058 | Ошибка при вызове метода `Update` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1058 | Исправлен тип ответа методов `Update` и `DescUpdate` в cloudbroker/apiaccess |
|
||||||
@@ -2,8 +2,8 @@ package apiaccess
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
@@ -20,23 +20,25 @@ type DescUpdateRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DescUpdate sets a new text description of the apiaccess group.
|
// DescUpdate sets a new text description of the apiaccess group.
|
||||||
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (bool, error) {
|
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (*ItemAPIAccess, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/apiaccess/descUpdate"
|
url := "/cloudbroker/apiaccess/descUpdate"
|
||||||
|
|
||||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
info := ItemAPIAccess{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return &info, nil
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package apiaccess
|
package apiaccess
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
type ItemAPIAccess struct {
|
type ItemAPIAccess struct {
|
||||||
// APIs
|
// APIs
|
||||||
APIs APIsEndpoints `json:"apis"`
|
APIs APIsEndpoints `json:"apis"`
|
||||||
@@ -88,43 +90,66 @@ type APIsEndpoints struct {
|
|||||||
// CloudBroker endpoints
|
// CloudBroker endpoints
|
||||||
CloudBroker CloudBrokerEndpoints `json:"cloudbroker,omitempty"`
|
CloudBroker CloudBrokerEndpoints `json:"cloudbroker,omitempty"`
|
||||||
|
|
||||||
// LibCloud endpoints
|
|
||||||
LibCloud LibCloudEndpoints `json:"libcloud,omitempty"`
|
|
||||||
|
|
||||||
// System endpoints
|
// System endpoints
|
||||||
System SystemEndpoints `json:"system,omitempty"`
|
System SystemEndpoints `json:"system,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON omits empty namespaces, so that "{}" is not sent in requests.
|
||||||
|
func (a APIsEndpoints) MarshalJSON() ([]byte, error) {
|
||||||
|
namespaces := []struct {
|
||||||
|
key string
|
||||||
|
value interface{}
|
||||||
|
}{
|
||||||
|
{"cloudapi", a.CloudAPI},
|
||||||
|
{"cloudbroker", a.CloudBroker},
|
||||||
|
{"system", a.System},
|
||||||
|
}
|
||||||
|
|
||||||
|
result := make(map[string]json.RawMessage, len(namespaces))
|
||||||
|
|
||||||
|
for _, ns := range namespaces {
|
||||||
|
data, err := json.Marshal(ns.value)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if string(data) == "{}" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
result[ns.key] = data
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.Marshal(result)
|
||||||
|
}
|
||||||
|
|
||||||
type CloudAPIEndpoints struct {
|
type CloudAPIEndpoints struct {
|
||||||
Account []string `json:"account,omitempty"`
|
Account []string `json:"account,omitempty"`
|
||||||
BService []string `json:"bservice,omitempty"`
|
Audit []string `json:"audit,omitempty"`
|
||||||
CloudSpace []string `json:"cloudspace,omitempty"`
|
BService []string `json:"bservice,omitempty"`
|
||||||
Compute []string `json:"compute,omitempty"`
|
Compute []string `json:"compute,omitempty"`
|
||||||
ComputeCI []string `json:"computeci,omitempty"`
|
Disks []string `json:"disks,omitempty"`
|
||||||
Disks []string `json:"disks,omitempty"`
|
DPDKNet []string `json:"dpdknet,omitempty"`
|
||||||
DPDK []string `json:"dpdk,omitempty"`
|
ExtNet []string `json:"extnet,omitempty"`
|
||||||
ExtNet []string `json:"extnet,omitempty"`
|
FLIPGroup []string `json:"flipgroup,omitempty"`
|
||||||
FLIPGroup []string `json:"flipgroup,omitempty"`
|
GPU []string `json:"gpu,omitempty"`
|
||||||
GPU []string `json:"gpu,omitempty"`
|
Image []string `json:"image,omitempty"`
|
||||||
Image []string `json:"image,omitempty"`
|
K8CI []string `json:"k8ci,omitempty"`
|
||||||
K8CI []string `json:"k8ci,omitempty"`
|
K8S []string `json:"k8s,omitempty"`
|
||||||
K8S []string `json:"k8s,omitempty"`
|
KVMX86 []string `json:"kvmx86,omitempty"`
|
||||||
KVMX86 []string `json:"kvmx86,omitempty"`
|
LB []string `json:"lb,omitempty"`
|
||||||
LB []string `json:"lb,omitempty"`
|
Loactions []string `json:"locations,omitempty"`
|
||||||
Loactions []string `json:"locations,omitempty"`
|
PCIDevice []string `json:"pcidevice,omitempty"`
|
||||||
Machine []string `json:"machine,omitempty"`
|
Prometheus []string `json:"prometheus,omitempty"`
|
||||||
Openshift []string `json:"openshift,omitempty"`
|
RG []string `json:"rg,omitempty"`
|
||||||
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
SEP []string `json:"sep,omitempty"`
|
||||||
PCIDevice []string `json:"pcidevice,omitempty"`
|
Stack []string `json:"stack,omitempty"`
|
||||||
PortForwarding []string `json:"portforwarding,omitempty"`
|
Tasks []string `json:"tasks,omitempty"`
|
||||||
Prometheus []string `json:"prometheus,omitempty"`
|
User []string `json:"user,omitempty"`
|
||||||
RG []string `json:"rg,omitempty"`
|
VFPool []string `json:"vfpool,omitempty"`
|
||||||
Sizes []string `json:"sizes,omitempty"`
|
VGPU []string `json:"vgpu,omitempty"`
|
||||||
Tasks []string `json:"tasks,omitempty"`
|
VINS []string `json:"vins,omitempty"`
|
||||||
User []string `json:"user,omitempty"`
|
All bool `json:"ALL,omitempty"`
|
||||||
VGPU []string `json:"vgpu,omitempty"`
|
|
||||||
VINS []string `json:"vins,omitempty"`
|
|
||||||
All bool `json:"ALL,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type CloudBrokerEndpoints struct {
|
type CloudBrokerEndpoints struct {
|
||||||
@@ -133,39 +158,30 @@ type CloudBrokerEndpoints struct {
|
|||||||
Audit interface{} `json:"audit,omitempty"`
|
Audit interface{} `json:"audit,omitempty"`
|
||||||
AuditBeat []string `json:"auditbeat,omitempty"`
|
AuditBeat []string `json:"auditbeat,omitempty"`
|
||||||
AuditCollector []string `json:"auditcollector,omitempty"`
|
AuditCollector []string `json:"auditcollector,omitempty"`
|
||||||
|
Backup []string `json:"backup,omitempty"`
|
||||||
BackupCreator []string `json:"backupcreator,omitempty"`
|
BackupCreator []string `json:"backupcreator,omitempty"`
|
||||||
BService []string `json:"bservice,omitempty"`
|
BService []string `json:"bservice,omitempty"`
|
||||||
CloudSpace []string `json:"cloudspace,omitempty"`
|
|
||||||
Compute []string `json:"compute,omitempty"`
|
Compute []string `json:"compute,omitempty"`
|
||||||
ComputeCI []string `json:"computeci,omitempty"`
|
|
||||||
Desnode []string `json:"desnode,omitempty"`
|
|
||||||
Diagnostics []string `json:"diagnostics,omitempty"`
|
|
||||||
Disks []string `json:"disks,omitempty"`
|
Disks []string `json:"disks,omitempty"`
|
||||||
DPDK []string `json:"dpdk,omitempty"`
|
DPDKNet []string `json:"dpdknet,omitempty"`
|
||||||
Eco []string `json:"eco,omitempty"`
|
Eco []string `json:"eco,omitempty"`
|
||||||
ExtNet []string `json:"extnet,omitempty"`
|
ExtNet []string `json:"extnet,omitempty"`
|
||||||
FlIPgroup []string `json:"flipgroup,omitempty"`
|
FlIPgroup []string `json:"flipgroup,omitempty"`
|
||||||
Grid []string `json:"grid,omitempty"`
|
Grid []string `json:"grid,omitempty"`
|
||||||
Group []string `json:"group,omitempty"`
|
Group []string `json:"group,omitempty"`
|
||||||
Health []string `json:"health,omitempty"`
|
Health []string `json:"health,omitempty"`
|
||||||
IaaS []string `json:"iaas,omitempty"`
|
|
||||||
Image []string `json:"image,omitempty"`
|
Image []string `json:"image,omitempty"`
|
||||||
Job interface{} `json:"job,omitempty"`
|
Job interface{} `json:"job,omitempty"`
|
||||||
K8CI []string `json:"k8ci,omitempty"`
|
K8CI []string `json:"k8ci,omitempty"`
|
||||||
K8S []string `json:"k8s,omitempty"`
|
K8S []string `json:"k8s,omitempty"`
|
||||||
KVMX86 []string `json:"kvmx86,omitempty"`
|
KVMX86 []string `json:"kvmx86,omitempty"`
|
||||||
LB []string `json:"lb,omitempty"`
|
LB []string `json:"lb,omitempty"`
|
||||||
Machine []string `json:"machine,omitempty"`
|
|
||||||
Metering []string `json:"metering,omitempty"`
|
Metering []string `json:"metering,omitempty"`
|
||||||
Milestones []string `json:"milestones,omitempty"`
|
Milestones []string `json:"milestones,omitempty"`
|
||||||
Node []string `json:"node,omitempty"`
|
Node []string `json:"node,omitempty"`
|
||||||
Openshift []string `json:"openshift,omitempty"`
|
|
||||||
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
|
||||||
Ovsnode []string `json:"ovsnode,omitempty"`
|
|
||||||
PCIDevice []string `json:"pcidevice,omitempty"`
|
PCIDevice []string `json:"pcidevice,omitempty"`
|
||||||
PGPU []string `json:"pgpu,omitempty"`
|
PGPU []string `json:"pgpu,omitempty"`
|
||||||
Prometheus []string `json:"prometheus,omitempty"`
|
Prometheus []string `json:"prometheus,omitempty"`
|
||||||
QOS []string `json:"qos,omitempty"`
|
|
||||||
Resmon interface{} `json:"resmon,omitempty"`
|
Resmon interface{} `json:"resmon,omitempty"`
|
||||||
RG []string `json:"rg,omitempty"`
|
RG []string `json:"rg,omitempty"`
|
||||||
Sep []string `json:"sep,omitempty"`
|
Sep []string `json:"sep,omitempty"`
|
||||||
@@ -173,6 +189,7 @@ type CloudBrokerEndpoints struct {
|
|||||||
Tasks []string `json:"tasks,omitempty"`
|
Tasks []string `json:"tasks,omitempty"`
|
||||||
TLock []string `json:"tlock,omitempty"`
|
TLock []string `json:"tlock,omitempty"`
|
||||||
User []string `json:"user,omitempty"`
|
User []string `json:"user,omitempty"`
|
||||||
|
VFPool []string `json:"vfpool,omitempty"`
|
||||||
VGPU []string `json:"vgpu,omitempty"`
|
VGPU []string `json:"vgpu,omitempty"`
|
||||||
VINS []string `json:"vins,omitempty"`
|
VINS []string `json:"vins,omitempty"`
|
||||||
VNFDev []string `json:"vnfdev,omitempty"`
|
VNFDev []string `json:"vnfdev,omitempty"`
|
||||||
@@ -180,28 +197,19 @@ type CloudBrokerEndpoints struct {
|
|||||||
All bool `json:"ALL,omitempty"`
|
All bool `json:"ALL,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LibCloudEndpoints struct {
|
|
||||||
Libvirt []string `json:"libvirt,omitempty"`
|
|
||||||
All bool `json:"ALL,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SystemEndpoints struct {
|
type SystemEndpoints struct {
|
||||||
AgentController []string `json:"agentcontroller,omitempty"`
|
AgentController []string `json:"agentcontroller,omitempty"`
|
||||||
Alerts []string `json:"alerts,omitempty"`
|
Audits []string `json:"audits,omitempty"`
|
||||||
Audits []string `json:"audits,omitempty"`
|
Cache []string `json:"cache,omitempty"`
|
||||||
ContentManager []string `json:"contentmanager,omitempty"`
|
ContentManager []string `json:"contentmanager,omitempty"`
|
||||||
DocGenerator []string `json:"docgenerator,omitempty"`
|
DocGenerator []string `json:"docgenerator,omitempty"`
|
||||||
EmailSender []string `json:"emailsender,omitempty"`
|
EmailSender []string `json:"emailsender,omitempty"`
|
||||||
ErrorConditionHandler []string `json:"errorconditionhandler,omitempty"`
|
GridManager []string `json:"gridmanager,omitempty"`
|
||||||
GridManager []string `json:"gridmanager,omitempty"`
|
Health []string `json:"health,omitempty"`
|
||||||
Health []string `json:"health,omitempty"`
|
Info []string `json:"info,omitempty"`
|
||||||
Info []string `json:"info,omitempty"`
|
InfoMGR []string `json:"infomgr,omitempty"`
|
||||||
InfoMGR []string `json:"infomgr,omitempty"`
|
Oauth []string `json:"oauth,omitempty"`
|
||||||
Job []string `json:"job,omitempty"`
|
Task []string `json:"task,omitempty"`
|
||||||
Log []string `json:"log,omitempty"`
|
UserManager []string `json:"usermanager,omitempty"`
|
||||||
Logo []string `json:"logo,omitempty"`
|
All bool `json:"ALL,omitempty"`
|
||||||
Oauth []string `json:"oauth,omitempty"`
|
|
||||||
Task []string `json:"task,omitempty"`
|
|
||||||
UserManager []string `json:"usermanager,omitempty"`
|
|
||||||
All bool `json:"ALL,omitempty"`
|
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
@@ -27,10 +26,10 @@ type wrapperUpdateRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update updates apis of apiaccess group.
|
// Update updates apis of apiaccess group.
|
||||||
func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (*ItemAPIAccess, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/apiaccess/update"
|
url := "/cloudbroker/apiaccess/update"
|
||||||
@@ -41,20 +40,22 @@ func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error)
|
|||||||
|
|
||||||
apiJSON, err := json.Marshal(&req.APIs)
|
apiJSON, err := json.Marshal(&req.APIs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
reqWrapped.APIString = string(apiJSON)
|
reqWrapped.APIString = string(apiJSON)
|
||||||
|
|
||||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
info := ItemAPIAccess{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return &info, nil
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user