v16.4.0
This commit is contained in:
dayterr committed 2026-09-18 16:56:47 +03:00
1 parent 4c05d94552
commit 2c7f0d29df
159 files changed
+2249 -216

No files matched your search

@@ -0,0 +1,43 @@
package stpolicy
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// AddAccessReplicationProfileRequest struct to grant storage policy access to replication profile
type AddAccessReplicationProfileRequest struct {
// ID of replication profile
// Required: true
ProfileID uint64 `url:"profile_id" json:"profile_id" validate:"required"`
// ID of storage policy
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
}
// AddAccessReplicationProfile grants storage policy access to replication profile
func (sp StPolicy) AddAccessReplicationProfile(ctx context.Context, req AddAccessReplicationProfileRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/storage_policy/add_access_replication_profile"
res, err := sp.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}