v1.16.1
This commit is contained in:
dayterr
2026-08-28 16:36:41 +03:00
parent eb195dd992
commit b3fccfb000
131 changed files with 3204 additions and 478 deletions

View File

@@ -0,0 +1,44 @@
package compute
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/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
}