This commit is contained in:
stSolo
2023-03-01 19:05:53 +03:00
parent de12bc2acc
commit 42800ac4fe
573 changed files with 2077 additions and 1844 deletions

View File

@@ -13,18 +13,18 @@ import (
type AddUserRequest struct {
// ID of account to add to
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Name of the user to be given rights
// Required: true
UserName string `url:"username"`
UserName string `url:"username" json:"username"`
// Account permission types:
// - 'R' for read only access
// - 'RCX' for Write
// - 'ARCXDU' for Admin
// Required: true
AccessType string `url:"accesstype"`
AccessType string `url:"accesstype" json:"accesstype"`
}
func (arq AddUserRequest) validate() error {

View File

@@ -11,7 +11,7 @@ import (
type AuditsRequest struct {
// ID of the account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
}
func (arq AuditsRequest) validate() error {

View File

@@ -11,48 +11,48 @@ import (
type CreateRequest struct {
// Display name
// Required: true
Name string `url:"name"`
Name string `url:"name" json:"name"`
// Name of the account
// Required: true
Username string `url:"username"`
Username string `url:"username" json:"username"`
// Email
// Required: false
EmailAddress string `url:"emailaddress,omitempty"`
EmailAddress string `url:"emailaddress,omitempty" json:"emailaddress,omitempty"`
// Max size of memory in MB
// Required: false
MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty"`
MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"`
// Max size of aggregated vdisks in GB
// Required: false
MaxVDiskCapacity int64 `url:"maxVDiskCapacity,omitempty"`
MaxVDiskCapacity int64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"`
// Max number of CPU cores
// Required: false
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty"`
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
// Max sent/received network transfer peering
// Required: false
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty"`
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
// Max number of assigned public IPs
// Required: false
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty"`
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
// If true send emails when a user is granted access to resources
// Required: false
SendAccessEmails bool `url:"sendAccessEmails,omitempty"`
SendAccessEmails bool `url:"sendAccessEmails,omitempty" json:"sendAccessEmails,omitempty"`
// Limit (positive) or disable (0) GPU resources
// Required: false
GPUUnits int64 `url:"gpu_units,omitempty"`
GPUUnits int64 `url:"gpu_units,omitempty" json:"gpu_units,omitempty"`
// List of strings with pools
// i.e.: ["sep1_poolName1", "sep2_poolName2", etc]
// Required: false
UniqPools []string `url:"uniqPools,omitempty"`
UniqPools []string `url:"uniqPools,omitempty" json:"uniqPools,omitempty"`
}
func (arq CreateRequest) validate() error {

View File

@@ -10,15 +10,15 @@ import (
type DeleteRequest struct {
// ID of account to delete
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Reason to delete
// Required: true
Reason string `url:"reason"`
Reason string `url:"reason" json:"reason"`
// Whether to completely delete the account
// Required: false
Permanently bool `url:"permanently,omitempty"`
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}
func (arq DeleteRequest) validate() error {

View File

@@ -10,15 +10,15 @@ import (
type DeleteAccountsRequest struct {
// IDs of accounts
// Required: true
AccountsIDs []uint64 `url:"accountIds"`
AccountsIDs []uint64 `url:"accountIds" json:"accountIds"`
// Reason for deletion
// Required: true
Reason string `url:"reason"`
Reason string `url:"reason" json:"reason"`
// Whether to completely destroy accounts or not
// Required: false
Permanently bool `url:"permanently,omitempty"`
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}
func (arq DeleteAccountsRequest) validate() error {

View File

@@ -11,15 +11,15 @@ import (
type DeleteUserRequest struct {
// ID of the account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// ID or emailaddress of the user to remove
// Required: true
UserName string `url:"username"`
UserName string `url:"username" json:"username"`
// Recursively revoke access rights from owned cloudspaces and vmachines
// Required: false
RecursiveDelete bool `url:"recursivedelete,omitempty"`
RecursiveDelete bool `url:"recursivedelete,omitempty" json:"recursivedelete,omitempty"`
}
func (arq DeleteUserRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type DisableRequest struct {
// ID of account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Reason to disable
// Required: true
Reason string `url:"reason"`
Reason string `url:"reason" json:"reason"`
}
func (arq DisableRequest) validate() error {

View File

@@ -10,7 +10,7 @@ import (
type DisableAccountsRequest struct {
// IDs of accounts
// Required: true
AccountIDs []uint64 `url:"accountIds,omitempty"`
AccountIDs []uint64 `url:"accountIds,omitempty" json:"accountIds,omitempty"`
}
func (arq DisableAccountsRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type EnableRequest struct {
// ID of account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Reason to enable
// Required: true
Reason string `url:"reason"`
Reason string `url:"reason" json:"reason"`
}
func (arq EnableRequest) validate() error {

View File

@@ -10,7 +10,7 @@ import (
type EnableAccountsRequest struct {
// IDs od accounts
// Required: true
AccountIDs []uint64 `url:"accountIds"`
AccountIDs []uint64 `url:"accountIds" json:"accountIds"`
}
func (arq EnableAccountsRequest) validate() error {

View File

@@ -11,7 +11,7 @@ import (
type GetRequest struct {
// ID an account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
}
func (arq GetRequest) validate() error {

View File

@@ -10,11 +10,11 @@ import (
type ListRequest struct {
// Page number
// Required: false
Page uint64 `url:"page"`
Page uint64 `url:"page" json:"page"`
// Page size
// Required: false
Size uint64 `url:"size"`
Size uint64 `url:"size" json:"size"`
}
// List gets list all accounts the user has access to

View File

@@ -11,7 +11,7 @@ import (
type ListComputesRequest struct {
// ID an account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
}
func (arq ListComputesRequest) validate() error {

View File

@@ -10,11 +10,11 @@ import (
type ListDeletedRequest struct {
// Page number
// Required: false
Page uint64 `url:"page"`
Page uint64 `url:"page" json:"page"`
// Page size
// Required: false
Size uint64 `url:"size"`
Size uint64 `url:"size" json:"size"`
}
// ListDeleted gets list all deleted accounts the user has access to

View File

@@ -11,7 +11,7 @@ import (
type ListDisksRequest struct {
// ID an account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
}
func (arq ListDisksRequest) validate() error {

View File

@@ -11,7 +11,7 @@ import (
type ListFLIPGroupsRequest struct {
// ID an account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
}
func (arq ListFLIPGroupsRequest) validate() error {

View File

@@ -11,7 +11,7 @@ import (
type ListRGRequest struct {
// ID an account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
}
func (arq ListRGRequest) validate() error {

View File

@@ -11,7 +11,7 @@ import (
type ListVINSRequest struct {
// ID an account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
}
func (arq ListVINSRequest) validate() error {

View File

@@ -10,11 +10,11 @@ import (
type RestoreRequest struct {
// ID an account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Reason to restore
// Required: true
Reason string `url:"reason"`
Reason string `url:"reason" json:"reason"`
}
func (arq RestoreRequest) validate() error {

View File

@@ -11,52 +11,52 @@ import (
type UpdateRequest struct {
// ID of account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Display name
// Required: true
Name string `url:"name"`
Name string `url:"name" json:"name"`
// Name of the account
// Required: true
Username string `url:"username"`
Username string `url:"username" json:"username"`
// Email
// Required: false
EmailAddress string `url:"emailaddress,omitempty"`
EmailAddress string `url:"emailaddress,omitempty" json:"emailaddress,omitempty"`
// Max size of memory in MB
// Required: false
MaxMemoryCapacity uint64 `url:"maxMemoryCapacity,omitempty"`
MaxMemoryCapacity uint64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"`
// Max size of aggregated vdisks in GB
// Required: false
MaxVDiskCapacity uint64 `url:"maxVDiskCapacity,omitempty"`
MaxVDiskCapacity uint64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"`
// Max number of CPU cores
// Required: false
MaxCPUCapacity uint64 `url:"maxCPUCapacity,omitempty"`
MaxCPUCapacity uint64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
// Max sent/received network transfer peering
// Required: false
MaxNetworkPeerTransfer uint64 `url:"maxNetworkPeerTransfer,omitempty"`
MaxNetworkPeerTransfer uint64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
// Max number of assigned public IPs
// Required: false
MaxNumPublicIP uint64 `url:"maxNumPublicIP,omitempty"`
MaxNumPublicIP uint64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
// If true send emails when a user is granted access to resources
// Required: false
SendAccessEmails bool `url:"sendAccessEmails,omitempty"`
SendAccessEmails bool `url:"sendAccessEmails,omitempty" json:"sendAccessEmails,omitempty"`
// Limit (positive) or disable (0) GPU resources
// Required: false
GPUUnits uint64 `url:"gpu_units,omitempty"`
GPUUnits uint64 `url:"gpu_units,omitempty" json:"gpu_units,omitempty"`
// List of strings with pools
// i.e.: ["sep1_poolName1", "sep2_poolName2", etc]
// Required: false
UniqPools []string `url:"uniqPools,omitempty"`
UniqPools []string `url:"uniqPools,omitempty" json:"uniqPools,omitempty"`
}
func (arq UpdateRequest) validate() error {

View File

@@ -13,7 +13,7 @@ import (
type UpdateResourceTypesRequest struct {
// ID of account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Resource types available to create in this account
// Each element in a resource type slice must be one of:
@@ -24,7 +24,7 @@ type UpdateResourceTypesRequest struct {
// - lb
// - flipgroup
// Required: true
ResTypes []string `url:"resourceTypes"`
ResTypes []string `url:"resourceTypes" json:"resourceTypes"`
}
func (arq UpdateResourceTypesRequest) validate() error {

View File

@@ -11,18 +11,18 @@ import (
type UpdateUserRequest struct {
// ID of the account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// Userid/Email for registered users or emailaddress for unregistered users
// Required: true
UserID string `url:"userId"`
UserID string `url:"userId" json:"userId"`
// Account permission types:
// - 'R' for read only access
// - 'RCX' for Write
// - 'ARCXDU' for Admin
// Required: true
AccessType string `url:"accesstype"`
AccessType string `url:"accesstype" json:"accesstype"`
}
func (arq UpdateUserRequest) validate() error {