This commit is contained in:
2023-07-21 15:14:10 +03:00
parent 0be4d8fb0c
commit 8f152a2f63
47 changed files with 470 additions and 439 deletions

View File

@@ -13,10 +13,26 @@ type ListComputesRequest struct {
// Filter by account ID
// Required: true
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
// Find by rg ID
// Required: false
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
// Find by compute ID
// Required: false
ComputeID uint64 `url:"computeId,omitempty" json:"computeId,omitempty"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// ListComputes gets computes from account with extnets
func (e ExtNet) ListComputes(ctx context.Context, req ListComputesRequest) (ListExtNetComputes, error) {
func (e ExtNet) ListComputes(ctx context.Context, req ListComputesRequest) (*ListExtNetComputes, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
@@ -38,5 +54,5 @@ func (e ExtNet) ListComputes(ctx context.Context, req ListComputesRequest) (List
return nil, err
}
return list, nil
return &list, nil
}

View File

@@ -59,7 +59,13 @@ type ItemExtNetCompute struct {
}
// List of information about computes with external network
type ListExtNetComputes []ItemExtNetCompute
type ListExtNetComputes struct {
// Data
Data []ItemExtNetCompute `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
// QOS
type QOS struct {
@@ -118,6 +124,12 @@ type Excluded struct {
// ClientType
ClientType string `json:"clientType"`
// Domain name
DomainName string `json:"domainname"`
// Host name
HostName string `json:"hostname"`
// IP
IP string `json:"ip"`