v16.4.0
v16.4.0
This commit is contained in:
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"
|
||||
)
|
||||
|
||||
// RevokeAccessReplicationProfileRequest struct to revoke storage policy access to replication profile
|
||||
type RevokeAccessReplicationProfileRequest 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"`
|
||||
}
|
||||
|
||||
// RevokeAccessReplicationProfile revokes storage policy access to replication profile
|
||||
func (sp StPolicy) RevokeAccessReplicationProfile(ctx context.Context, req RevokeAccessReplicationProfileRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/storage_policy/revoke_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
|
||||
}
|
||||
Reference in new issue
Block a user