This commit is contained in:
2026-06-05 17:30:36 +03:00
parent 3e2edf53a5
commit f1112e5a11
1246 changed files with 6117 additions and 1589 deletions

View File

@@ -0,0 +1,46 @@
package zone
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// GetCPUAlignmentProfileRequest struct to get CPU alignment profile of zone
type GetCPUAlignmentProfileRequest struct {
// ID of zone
// Required: true
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
}
// GetCPUAlignmentProfile gets CPU alignment profile of zone
func (e Zone) GetCPUAlignmentProfile(ctx context.Context, req GetCPUAlignmentProfileRequest) ([]CpuAlignmentProfile, error) {
res, err := e.GetCPUAlignmentProfileRaw(ctx, req)
if err != nil {
return nil, err
}
var profiles []CpuAlignmentProfile
err = json.Unmarshal(res, &profiles)
if err != nil {
return nil, err
}
return profiles, nil
}
// GetCPUAlignmentProfileRaw gets CPU alignment profile of zone as an array of bytes
func (e Zone) GetCPUAlignmentProfileRaw(ctx context.Context, req GetCPUAlignmentProfileRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/zone/get_cpu_alignment_profile"
res, err := e.client.DecortApiCall(ctx, http.MethodGet, url, req)
return res, err
}