v1.6.7
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set compute CI
|
||||
// ComputeCISetRequest struct to set compute CI
|
||||
type ComputeCISetRequest struct {
|
||||
// ID of the image
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type ComputeCISetRequest struct {
|
||||
ComputeCIID uint64 `url:"computeciId" json:"computeciId" validate:"required"`
|
||||
}
|
||||
|
||||
// ComputeCISet set compute CI ID for image
|
||||
// ComputeCISet sets compute CI ID for image
|
||||
func (i Image) ComputeCISet(ctx context.Context, req ComputeCISetRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/computeciSet"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for unset compute CI
|
||||
// ComputeCIUnsetRequest struct to unset compute CI
|
||||
type ComputeCIUnsetRequest struct {
|
||||
// ID of the image
|
||||
// Required: true
|
||||
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
|
||||
}
|
||||
|
||||
// ComputeCIUnset unset compute CI ID from image
|
||||
// ComputeCIUnset unsets compute CI ID from image
|
||||
func (i Image) ComputeCIUnset(ctx context.Context, req ComputeCIUnsetRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/сomputeciUnset"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create CD-ROM image
|
||||
// CreateCDROMImageRequest struct to create CD-ROM image
|
||||
type CreateCDROMImageRequest struct {
|
||||
// Name of the rescue disk
|
||||
// Required: true
|
||||
@@ -59,9 +59,7 @@ type CreateCDROMImageRequest struct {
|
||||
func (i Image) CreateCDROMImage(ctx context.Context, req CreateCDROMImageRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/createCDROMImage"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create image
|
||||
// CreateRequest struct to create image
|
||||
type CreateRequest struct {
|
||||
// Name of the rescue disk
|
||||
// Required: true
|
||||
@@ -90,9 +90,7 @@ type CreateRequest struct {
|
||||
func (i Image) CreateImage(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/createImage"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create virtual image
|
||||
// CreateVirtualRequest struct to create virtual image
|
||||
type CreateVirtualRequest struct {
|
||||
// Name of the virtual image to create
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type CreateVirtualRequest struct {
|
||||
func (i Image) CreateVirtual(ctx context.Context, req CreateVirtualRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/createVirtual"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete image
|
||||
// DeleteRequest struct to delete image
|
||||
type DeleteRequest struct {
|
||||
// ID of the image to delete
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type DeleteRequest struct {
|
||||
func (i Image) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/delete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete CD-ROM image
|
||||
// DeleteCDROMImageRequest struct to delete CD-ROM image
|
||||
type DeleteCDROMImageRequest struct {
|
||||
// ID of the CD-ROM image to delete
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type DeleteCDROMImageRequest struct {
|
||||
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
|
||||
}
|
||||
|
||||
// DeleteCDROMImage delete a CD-ROM image
|
||||
// DeleteCDROMImage deletes a CD-ROM image
|
||||
func (i Image) DeleteCDROMImage(ctx context.Context, req DeleteCDROMImageRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/deleteCDROMImage"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete images
|
||||
// DeleteImagesRequest struct to delete images
|
||||
type DeleteImagesRequest struct {
|
||||
// List of images to be deleted
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type DeleteImagesRequest struct {
|
||||
func (i Image) DeleteImages(ctx context.Context, req DeleteImagesRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/deleteImages"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for disable image
|
||||
// DisableRequest struct to disable image
|
||||
type DisableRequest struct {
|
||||
// ID of image to be disabled
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type DisableRequest struct {
|
||||
func (i Image) Disable(ctx context.Context, req DisableRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/disable"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for edit image
|
||||
// EditRequest struct to edit image
|
||||
type EditRequest struct {
|
||||
// ID of the image to edit
|
||||
// Required: true
|
||||
@@ -43,9 +43,7 @@ type EditRequest struct {
|
||||
func (i Image) Edit(ctx context.Context, req EditRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/edit"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for enable image
|
||||
// EnableRequest struct to enable image
|
||||
type EnableRequest struct {
|
||||
// ID of image to be enabled
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type EnableRequest struct {
|
||||
func (i Image) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/enable"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (i Image) Get(ctx context.Context, req GetRequest) (*RecordImage, error) {
|
||||
func (i Image) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/get"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for link virtual image to another image
|
||||
// LinkRequest struct to link virtual image to another image
|
||||
type LinkRequest struct {
|
||||
// ID of the virtual image
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type LinkRequest struct {
|
||||
func (i Image) Link(ctx context.Context, req LinkRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/link"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list stack
|
||||
// ListStacksRequest struct to get list of stack
|
||||
type ListStacksRequest struct {
|
||||
// Image ID
|
||||
// Required: true
|
||||
@@ -39,9 +39,7 @@ type ListStacksRequest struct {
|
||||
func (i Image) ListStacks(ctx context.Context, req ListStacksRequest) (*ListStacks, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/listStacks"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for rename image
|
||||
// RenameRequest struct to rename image
|
||||
type RenameRequest struct {
|
||||
// ID of the virtual image to rename
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type RenameRequest struct {
|
||||
func (i Image) Rename(ctx context.Context, req RenameRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/rename"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for share image
|
||||
// ShareRequest struct to share image
|
||||
type ShareRequest struct {
|
||||
// ID of the image to share
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type ShareRequest struct {
|
||||
func (i Image) Share(ctx context.Context, req ShareRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/share"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for sync create image
|
||||
// SyncCreateRequest struct to sync create image
|
||||
type SyncCreateRequest struct {
|
||||
// Name of the rescue disk
|
||||
// Required: true
|
||||
@@ -90,9 +90,7 @@ type SyncCreateRequest struct {
|
||||
func (i Image) SyncCreate(ctx context.Context, req SyncCreateRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/syncCreateImage"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update nodes
|
||||
// UpdateNodesRequest struct to update nodes
|
||||
type UpdateNodesRequest struct {
|
||||
// Image ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type UpdateNodesRequest struct {
|
||||
EnabledStacks []uint64 `url:"enabledStacks,omitempty" json:"enabledStacks,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateNodes udates image availability on nodes
|
||||
// UpdateNodes updates image availability on nodes
|
||||
func (i Image) UpdateNodes(ctx context.Context, req UpdateNodesRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/updateNodes"
|
||||
|
||||
Reference in New Issue
Block a user