This commit is contained in:
asteam
2025-09-27 01:06:15 +03:00
parent 1ccc37a104
commit cf584c8123
1175 changed files with 11022 additions and 1832 deletions

View File

@@ -0,0 +1,36 @@
package compute
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// StartMigrationINRequest struct to start compute for external migration in
type StartMigrationINRequest struct {
// ID of compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// ID of the stack where the compute will be staged for migration-in
// Required: false
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
}
// StartMigrationIN starts compute for external migration in
func (c Compute) StartMigrationIN(ctx context.Context, req StartRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/start_migration_in"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
return string(res), nil
}