v1.5.0-gamma2
This commit is contained in:
@@ -14,13 +14,49 @@ type ListComputesRequest struct {
|
||||
// Required: true
|
||||
RGID uint64 `url:"rgId" json:"rgId" validate:"required"`
|
||||
|
||||
// Reason for action
|
||||
// Find by compute id
|
||||
// Required: false
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
ComputeID uint64 `url:"computeId,omitempty" json:"computeId,omitempty"`
|
||||
|
||||
// Find by name
|
||||
// Required: false
|
||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||
|
||||
// ID an account
|
||||
// Required: false
|
||||
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||
|
||||
// Find by tech status
|
||||
// Required: false
|
||||
TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"`
|
||||
|
||||
// Find by status
|
||||
// Required: false
|
||||
Status string `url:"status,omitempty" json:"status,omitempty"`
|
||||
|
||||
// Find by ip address
|
||||
// Required: false
|
||||
IPAddress string `url:"ipAddress,omitempty" json:"ipAddress,omitempty"`
|
||||
|
||||
// Find by external network name
|
||||
// Required: false
|
||||
ExtNetName string `url:"extNetName,omitempty" json:"extNetName,omitempty"`
|
||||
|
||||
// Find by external network id
|
||||
// Required: false
|
||||
ExtNetID uint64 `url:"extNetId,omitempty" json:"extNetId,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 list of all compute instances under specified resource group, accessible by the user
|
||||
func (r RG) ListComputes(ctx context.Context, req ListComputesRequest) (ListComputes, error) {
|
||||
func (r RG) ListComputes(ctx context.Context, req ListComputesRequest) (*ListComputes, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -42,5 +78,5 @@ func (r RG) ListComputes(ctx context.Context, req ListComputesRequest) (ListComp
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return list, nil
|
||||
return &list, nil
|
||||
}
|
||||
|
||||
@@ -8,6 +8,34 @@ import (
|
||||
|
||||
// Request struct for get list deleted resource groups
|
||||
type ListDeletedRequest struct {
|
||||
// Find by ID
|
||||
// Required: false
|
||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
||||
|
||||
// Find by name
|
||||
// Required: false
|
||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||
|
||||
// Find by account ID
|
||||
// Required: false
|
||||
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||
|
||||
// Find by name account
|
||||
// Required: false
|
||||
AccountName string `url:"accountName,omitempty" json:"accountName,omitempty"`
|
||||
|
||||
// Find by created after time (unix timestamp)
|
||||
// Required: false
|
||||
CreatedAfter uint64 `url:"createdAfter,omitempty" json:"createdAfter,omitempty"`
|
||||
|
||||
// Find by created before time (unix timestamp)
|
||||
// Required: false
|
||||
CreatedBefore uint64 `url:"createdBefore,omitempty" json:"createdBefore,omitempty"`
|
||||
|
||||
// Find by status lock
|
||||
// Required: false
|
||||
LockStatus string `url:"lockStatus,omitempty" json:"lockStatus,omitempty"`
|
||||
|
||||
// Page number
|
||||
// Required: false
|
||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||
|
||||
@@ -13,10 +13,46 @@ type ListLBRequest struct {
|
||||
// Resource group ID
|
||||
// Required: true
|
||||
RGID uint64 `url:"rgId" json:"rgId" validate:"required"`
|
||||
|
||||
// Find by ID
|
||||
// Required: false
|
||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
||||
|
||||
// Find by name
|
||||
// Required: false
|
||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||
|
||||
// Find by account ID
|
||||
// Required: false
|
||||
AccountID uint64 `url:"accountID,omitempty" json:"accountID,omitempty"`
|
||||
|
||||
// Find by tech status
|
||||
// Required: false
|
||||
TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"`
|
||||
|
||||
// Find by status
|
||||
// Required: false
|
||||
Status string `url:"status,omitempty" json:"status,omitempty"`
|
||||
|
||||
// Find by frontend Ip
|
||||
// Required: false
|
||||
FrontIP string `url:"frontIp,omitempty" json:"frontIp,omitempty"`
|
||||
|
||||
// Find by backend Ip
|
||||
// Required: false
|
||||
BackIP string `url:"backIp,omitempty" json:"backIp,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"`
|
||||
}
|
||||
|
||||
// ListLB gets list all load balancers in the specified resource group, accessible by the user
|
||||
func (r RG) ListLB(ctx context.Context, req ListLBRequest) (ListLB, error) {
|
||||
func (r RG) ListLB(ctx context.Context, req ListLBRequest) (*ListLB, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -38,5 +74,5 @@ func (r RG) ListLB(ctx context.Context, req ListLBRequest) (ListLB, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return list, nil
|
||||
return &list, nil
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ type ListPFWRequest struct {
|
||||
}
|
||||
|
||||
// ListPFW gets list port forward rules for the specified resource group
|
||||
func (r RG) ListPFW(ctx context.Context, req ListPFWRequest) (ListPortForwards, error) {
|
||||
func (r RG) ListPFW(ctx context.Context, req ListPFWRequest) (*ListPortForwards, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -38,5 +38,5 @@ func (r RG) ListPFW(ctx context.Context, req ListPFWRequest) (ListPortForwards,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return list, nil
|
||||
return &list, nil
|
||||
}
|
||||
|
||||
@@ -14,13 +14,33 @@ type ListVINSRequest struct {
|
||||
// Required: true
|
||||
RGID uint64 `url:"rgId" json:"rgId" validate:"required"`
|
||||
|
||||
// Reason for action
|
||||
// Find by name
|
||||
// Required: false
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||
|
||||
// ID an account
|
||||
// Required: false
|
||||
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||
|
||||
// Find by ip extnet address
|
||||
// Required: false
|
||||
ExtIP string `url:"extIp,omitempty" json:"extIp,omitempty"`
|
||||
|
||||
// Find by vins id
|
||||
// Required: false
|
||||
VINSID uint64 `url:"vinsId,omitempty" json:"vinsId,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"`
|
||||
}
|
||||
|
||||
// ListVINS gets list all ViNSes under specified resource group, accessible by the user
|
||||
func (r RG) ListVINS(ctx context.Context, req ListVINSRequest) (ListVINS, error) {
|
||||
func (r RG) ListVINS(ctx context.Context, req ListVINSRequest) (*ListVINS, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -42,5 +62,5 @@ func (r RG) ListVINS(ctx context.Context, req ListVINSRequest) (ListVINS, error)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return list, nil
|
||||
return &list, nil
|
||||
}
|
||||
|
||||
@@ -449,7 +449,13 @@ type ItemCompute struct {
|
||||
}
|
||||
|
||||
// List of computes
|
||||
type ListComputes []ItemCompute
|
||||
type ListComputes struct {
|
||||
//Data
|
||||
Data []ItemCompute `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about load balancer
|
||||
type RecordLoadBalancer struct {
|
||||
@@ -563,7 +569,13 @@ type ItemBackend struct {
|
||||
type ListBackends []ItemBackend
|
||||
|
||||
// List of load balancers
|
||||
type ListLB []ItemLoadBalancer
|
||||
type ListLB struct {
|
||||
// Data
|
||||
Data []ItemLoadBalancer `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Server settings
|
||||
type RecordServerSettings struct {
|
||||
@@ -704,7 +716,13 @@ type ItemPortForward struct {
|
||||
}
|
||||
|
||||
// List of port forwards
|
||||
type ListPortForwards []ItemPortForward
|
||||
type ListPortForwards struct {
|
||||
//Data
|
||||
Data []ItemPortForward `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about VINS
|
||||
type ItemVINS struct {
|
||||
@@ -761,7 +779,13 @@ type ItemVINS struct {
|
||||
}
|
||||
|
||||
// List of VINSes
|
||||
type ListVINS []ItemVINS
|
||||
type ListVINS struct {
|
||||
// Data
|
||||
Data []ItemVINS `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about usage of resource
|
||||
type RecordResourceUsage struct {
|
||||
|
||||
Reference in New Issue
Block a user