v16.1.0
This commit is contained in:
dayterr
2026-08-28 16:47:26 +03:00
parent 3c5157281e
commit fe3c7bf63a
142 changed files with 3160 additions and 479 deletions

View File

@@ -0,0 +1,44 @@
package compute
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetACLAccessRequest struct to get detailed information about ACL account in a vm
type GetACLAccessRequest struct {
ID uint64 `url:"id" json:"id" validate:"required"`
}
// Get gets current configuration of the ACL access in a vm as a RecordRGACLAccess struct
func (c Compute) GetACLAccess(ctx context.Context, req GetACLAccessRequest) (*RecordComputeACLAccess, error) {
res, err := c.GetACLAccessRaw(ctx, req)
if err != nil {
return nil, err
}
info := RecordComputeACLAccess{}
err = json.Unmarshal(res, &info)
if err != nil {
return nil, err
}
return &info, nil
}
// GetACLAccessRaw gets current configuration of the ACL access in a vm as an array of bytes
func (c Compute) GetACLAccessRaw(ctx context.Context, req GetACLAccessRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/get_acl_access"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
return res, err
}