This commit is contained in:
2024-04-16 14:26:06 +03:00
parent bc264c4d90
commit e7c968797b
298 changed files with 11066 additions and 398 deletions

View File

@@ -19,7 +19,7 @@ type AccessAddRequest struct {
}
// Add accountId to sharedWith access list for k8ci.
func (k K8CI) AccessAdd(ctx context.Context, req AccessAddRequest) (string, error) {
func (k K8CI) AccessAdd (ctx context.Context, req AccessAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))

View File

@@ -19,7 +19,7 @@ type AccessRemoveRequest struct {
}
// Remove accountId from sharedWith access list for k8ci.
func (k K8CI) AccessRemove(ctx context.Context, req AccessRemoveRequest) (string, error) {
func (k K8CI) AccessRemove (ctx context.Context, req AccessRemoveRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))

View File

@@ -4,6 +4,8 @@ import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ListRequest struct to get list information about images
@@ -36,6 +38,10 @@ type ListRequest struct {
// Required: false
IncludeDisabled bool `url:"includeDisabled,omitempty" json:"includeDisabled,omitempty"`
// Sort by one of supported fields, format +|-(field)
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
@@ -47,6 +53,7 @@ type ListRequest struct {
// List gets list of all k8ci catalog items available to the current user as a ListK8CI struct
func (k K8CI) List(ctx context.Context, req ListRequest) (*ListK8CI, error) {
res, err := k.ListRaw(ctx, req)
if err != nil {
return nil, err
@@ -64,6 +71,12 @@ func (k K8CI) List(ctx context.Context, req ListRequest) (*ListK8CI, error) {
// ListRaw gets list of all k8ci catalog items available to the current user as an array of bytes
func (k K8CI) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/k8ci/list"
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)

View File

@@ -4,13 +4,15 @@ import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ListDeletedRequest struct to get list information about deleted images
// ListDeletedRequest struct to get list information about deleted k8ci items
type ListDeletedRequest struct {
// Find by ID
// Required: false
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
ByID uint64 `url:"k8cId,omitempty" json:"k8cId,omitempty"`
// Find by name
// Required: false
@@ -26,7 +28,11 @@ type ListDeletedRequest struct {
// Find by network plugin
// Required: false
NetworkPlugins string `url:"netPlugins,omitempty" json:"masterDrnetPluginsiver,omitempty"`
NetworkPlugins string `url:"netPlugins,omitempty" json:"netPlugins,omitempty"`
// Sort by one of supported fields, format +|-(field)
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Page number
// Required: false
@@ -39,6 +45,12 @@ type ListDeletedRequest struct {
// ListDeleted gets list all deleted k8ci catalog items available to the current user
func (k K8CI) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListK8CI, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/k8ci/listDeleted"
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)