This commit is contained in:
2026-06-19 17:34:28 +03:00
parent cd5d1c9d0b
commit b897b3447a
1513 changed files with 1 additions and 107093 deletions

View File

@@ -1,35 +0,0 @@
package compute
import (
"context"
"net/http"
"strings"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// GetConsoleURLRequest struct to get console URL
type GetConsoleURLRequest struct {
// ID of compute instance to get console for
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
}
// GetConsoleURL gets computes console URL
func (c Compute) GetConsoleURL(ctx context.Context, req GetConsoleURLRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/getConsoleUrl"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
result := strings.ReplaceAll(string(res), "\"", "")
return result, nil
}