You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dynamix-golang-sdk/pkg/cloudbroker/compute/migrate_storage_clean_up.go

38 lines
1.1 KiB

package compute
import (
"context"
"net/http"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// MigrateStorageCleanUpRequest struct to cleanup resources after finished migration
type MigrateStorageCleanUpRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
}
// MigrateStorageCleanUp cleanup resources after finished (success of failed) complex compute migration.
// If the migration was successful, then old disks will be removed, else new (target) disks will be removed.
// Do it wisely!
func (c Compute) MigrateStorageCleanUp(ctx context.Context, req MigrateStorageCleanUpRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/migrateStorageCleanup"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
result := strings.ReplaceAll(string(res), "\"", "")
return result, nil
}