v1.12.1
This commit is contained in:
35
pkg/cloudbroker/compute/migrate_abort.go
Normal file
35
pkg/cloudbroker/compute/migrate_abort.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// MigrateAbortRequest struct to abort migration
|
||||
type MigrateAbortRequest struct {
|
||||
// ID of the compute instance
|
||||
// Required: true
|
||||
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
|
||||
}
|
||||
|
||||
// MigrateAbort aborts compute migration
|
||||
func (c Compute) MigrateAbort(ctx context.Context, req MigrateAbortRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrate_abort"
|
||||
|
||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
result := strings.ReplaceAll(string(res), "\"", "")
|
||||
|
||||
return result, nil
|
||||
}
|
||||
@@ -573,6 +573,9 @@ type ItemInterface struct {
|
||||
// Target
|
||||
Target string `json:"target"`
|
||||
|
||||
// Trunk tags
|
||||
TrunkTags string `json:"trunk_tags"`
|
||||
|
||||
// Type
|
||||
Type string `json:"type"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user