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,51 @@
package zone
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// TestCPUAlignmentProfileRequest struct to test CPU alignment profile for zone
type TestCPUAlignmentProfileRequest struct {
// ID of zone
// Required: true
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
// Hypervisor similarity in percentage
// Default: 70
// Required: false
HypervisorSimilarityInPercentage uint64 `url:"hypervisor_similarity_in_percentage,omitempty" json:"hypervisor_similarity_in_percentage,omitempty"`
}
// TestCPUAlignmentProfile tests CPU alignment profile for zone
func (e Zone) TestCPUAlignmentProfile(ctx context.Context, req TestCPUAlignmentProfileRequest) (*TestCPUAlignmentProfileResult, error) {
res, err := e.TestCPUAlignmentProfileRaw(ctx, req)
if err != nil {
return nil, err
}
result := TestCPUAlignmentProfileResult{}
err = json.Unmarshal(res, &result)
if err != nil {
return nil, err
}
return &result, nil
}
// TestCPUAlignmentProfileRaw tests CPU alignment profile for zone and returns the result as an array of bytes
func (e Zone) TestCPUAlignmentProfileRaw(ctx context.Context, req TestCPUAlignmentProfileRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/zone/test_cpu_alignment_profile"
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
return res, err
}