v1.8.0
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// ListRequest struct to get list of all non deleted apiaccess instances.
|
||||
@@ -32,6 +34,10 @@ type ListRequest struct {
|
||||
// Required: false
|
||||
CreatedBefore uint64 `url:"createdBefore,omitempty" json:"createdBefore,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"`
|
||||
@@ -43,6 +49,7 @@ type ListRequest struct {
|
||||
|
||||
// List gets list of all non deleted apiaccess instances as a ListAPIAccess struct
|
||||
func (a APIAccess) List(ctx context.Context, req ListRequest) (*ListAPIAccess, error) {
|
||||
|
||||
res, err := a.ListRaw(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -60,6 +67,11 @@ func (a APIAccess) List(ctx context.Context, req ListRequest) (*ListAPIAccess, e
|
||||
|
||||
// ListRaw gets list of all non deleted apiaccess instances as an array of bytes
|
||||
func (a APIAccess) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
|
||||
|
||||
if err := validators.ValidateRequest(req); err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/list"
|
||||
|
||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
|
||||
@@ -4,10 +4,16 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// ListDeletedRequest struct for getting list of all deleted apiaccess instances.
|
||||
type ListDeletedRequest struct {
|
||||
// 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"`
|
||||
@@ -19,6 +25,11 @@ type ListDeletedRequest struct {
|
||||
|
||||
// ListDeleted gets list of all deleted apiaccess instances.
|
||||
func (a APIAccess) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListAPIAccess, error) {
|
||||
|
||||
if err := validators.ValidateRequest(req); err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/listDeleted"
|
||||
|
||||
info := ListAPIAccess{}
|
||||
|
||||
@@ -124,7 +124,7 @@ type CloudBrokerEndpoints struct {
|
||||
Health []string `json:"health,omitempty"`
|
||||
IaaS []string `json:"iaas,omitempty"`
|
||||
Image []string `json:"image,omitempty"`
|
||||
Job []string `json:"job,omitempty"`
|
||||
Job interface{} `json:"job,omitempty"`
|
||||
K8CI []string `json:"k8ci,omitempty"`
|
||||
K8S []string `json:"k8s,omitempty"`
|
||||
KVMPPC []string `json:"kvmppc,omitempty"`
|
||||
@@ -141,7 +141,7 @@ type CloudBrokerEndpoints struct {
|
||||
PGPU []string `json:"pgpu,omitempty"`
|
||||
Prometheus []string `json:"prometheus,omitempty"`
|
||||
QOS []string `json:"qos,omitempty"`
|
||||
Resmon []string `json:"resmon,omitempty"`
|
||||
Resmon interface{} `json:"resmon,omitempty"`
|
||||
RG []string `json:"rg,omitempty"`
|
||||
Sep []string `json:"sep,omitempty"`
|
||||
Stack []string `json:"stack,omitempty"`
|
||||
|
||||
@@ -13,6 +13,14 @@ type UserListRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"`
|
||||
|
||||
// Page number
|
||||
// Required: false
|
||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||
|
||||
// Page size
|
||||
// Required: false
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// UserList gets a list of users currently included in the specified group.
|
||||
|
||||
Reference in New Issue
Block a user