v1.12.3
This commit is contained in:
36
pkg/cloudbroker/compute/stop_migration_in.go
Normal file
36
pkg/cloudbroker/compute/stop_migration_in.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// StopMigrationINRequest struct to stop compute for external migration in
|
||||
type StopMigrationINRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||
|
||||
// If provided, indicates the UUID of the VM on the target host and that migration completed.
|
||||
// Required: false
|
||||
NewVMUUID string `url:"new_vm_uuid,omitempty" json:"new_vm_uuid,omitempty"`
|
||||
}
|
||||
|
||||
// StopMigrationIN stops compute for external migration in
|
||||
func (c Compute) StopMigrationIN(ctx context.Context, req StartRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/stop_migration_in"
|
||||
|
||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(res), nil
|
||||
}
|
||||
Reference in New Issue
Block a user