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,45 @@
package zone
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// ListCPUAlignmentProfileRequest struct to list CPU alignment profiles
type ListCPUAlignmentProfileRequest struct {
// ID of zone
// Required: false
ZoneID uint64 `url:"zone_id,omitempty" json:"zone_id,omitempty"`
}
// ListCPUAlignmentProfile gets list of CPU alignment profiles
func (e Zone) ListCPUAlignmentProfile(ctx context.Context, req ListCPUAlignmentProfileRequest) (*ListCPUAlignmentProfiles, error) {
res, err := e.ListCPUAlignmentProfileRaw(ctx, req)
if err != nil {
return nil, err
}
list := ListCPUAlignmentProfiles{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}
// ListCPUAlignmentProfileRaw gets list of CPU alignment profiles as an array of bytes
func (e Zone) ListCPUAlignmentProfileRaw(ctx context.Context, req ListCPUAlignmentProfileRequest) ([]byte, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/zone/list_cpu_alignment_profile"
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
return res, err
}