pub struct RestrictionPoliciesAPI { /* private fields */ }Expand description
A restriction policy defines the access control rules for a resource, mapping a set of relations (such as editor and viewer) to a set of allowed principals (such as roles, teams, or users). The restriction policy determines who is authorized to perform what actions on the resource.
Implementations§
source§impl RestrictionPoliciesAPI
impl RestrictionPoliciesAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = RestrictionPoliciesAPI::with_config(configuration);
let resp = api
.get_restriction_policy("dashboard:test-get".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = RestrictionPoliciesAPI::with_config(configuration);
let resp = api
.delete_restriction_policy("dashboard:test-delete".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
async fn main() {
// there is a valid "user" in the system
let body = RestrictionPolicyUpdateRequest::new(RestrictionPolicy::new(
RestrictionPolicyAttributes::new(vec![RestrictionPolicyBinding::new(
vec!["org:00000000-0000-beef-0000-000000000000".to_string()],
"editor".to_string(),
)]),
"dashboard:test-update".to_string(),
RestrictionPolicyType::RESTRICTION_POLICY,
));
let configuration = datadog::Configuration::new();
let api = RestrictionPoliciesAPI::with_config(configuration);
let resp = api
.update_restriction_policy("dashboard:test-update".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn delete_restriction_policy(
&self,
resource_id: String,
) -> Result<(), Error<DeleteRestrictionPolicyError>>
pub async fn delete_restriction_policy( &self, resource_id: String, ) -> Result<(), Error<DeleteRestrictionPolicyError>>
Deletes the restriction policy associated with a specified resource.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = RestrictionPoliciesAPI::with_config(configuration);
let resp = api
.delete_restriction_policy("dashboard:test-delete".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_restriction_policy_with_http_info(
&self,
resource_id: String,
) -> Result<ResponseContent<()>, Error<DeleteRestrictionPolicyError>>
pub async fn delete_restriction_policy_with_http_info( &self, resource_id: String, ) -> Result<ResponseContent<()>, Error<DeleteRestrictionPolicyError>>
Deletes the restriction policy associated with a specified resource.
sourcepub async fn get_restriction_policy(
&self,
resource_id: String,
) -> Result<RestrictionPolicyResponse, Error<GetRestrictionPolicyError>>
pub async fn get_restriction_policy( &self, resource_id: String, ) -> Result<RestrictionPolicyResponse, Error<GetRestrictionPolicyError>>
Retrieves the restriction policy associated with a specified resource.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = RestrictionPoliciesAPI::with_config(configuration);
let resp = api
.get_restriction_policy("dashboard:test-get".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_restriction_policy_with_http_info(
&self,
resource_id: String,
) -> Result<ResponseContent<RestrictionPolicyResponse>, Error<GetRestrictionPolicyError>>
pub async fn get_restriction_policy_with_http_info( &self, resource_id: String, ) -> Result<ResponseContent<RestrictionPolicyResponse>, Error<GetRestrictionPolicyError>>
Retrieves the restriction policy associated with a specified resource.
sourcepub async fn update_restriction_policy(
&self,
resource_id: String,
body: RestrictionPolicyUpdateRequest,
) -> Result<RestrictionPolicyResponse, Error<UpdateRestrictionPolicyError>>
pub async fn update_restriction_policy( &self, resource_id: String, body: RestrictionPolicyUpdateRequest, ) -> Result<RestrictionPolicyResponse, Error<UpdateRestrictionPolicyError>>
Updates the restriction policy associated with a resource.
§Supported resources
Restriction policies can be applied to the following resources:
- Dashboards:
dashboard - Notebooks:
notebook - Powerpacks:
powerpack - Security Rules:
security-rule - Service Level Objectives:
slo - Synthetic Global Variables:
synthetics-global-variable - Synthetic Tests:
synthetics-test - Synthetic Private Locations:
synthetics-private-location - Monitors:
monitor
§Supported relations for resources
| Resource Type | Supported Relations |
|---|---|
| Dashboards | viewer, editor |
| Notebooks | viewer, editor |
| Powerpacks | viewer, editor |
| Security Rules | viewer, editor |
| Service Level Objectives | viewer, editor |
| Synthetic Global Variables | viewer, editor |
| Synthetic Tests | viewer, editor |
| Synthetic Private Locations | viewer, editor |
| Monitors | viewer, editor |
Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
async fn main() {
// there is a valid "user" in the system
let body = RestrictionPolicyUpdateRequest::new(RestrictionPolicy::new(
RestrictionPolicyAttributes::new(vec![RestrictionPolicyBinding::new(
vec!["org:00000000-0000-beef-0000-000000000000".to_string()],
"editor".to_string(),
)]),
"dashboard:test-update".to_string(),
RestrictionPolicyType::RESTRICTION_POLICY,
));
let configuration = datadog::Configuration::new();
let api = RestrictionPoliciesAPI::with_config(configuration);
let resp = api
.update_restriction_policy("dashboard:test-update".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_restriction_policy_with_http_info(
&self,
resource_id: String,
body: RestrictionPolicyUpdateRequest,
) -> Result<ResponseContent<RestrictionPolicyResponse>, Error<UpdateRestrictionPolicyError>>
pub async fn update_restriction_policy_with_http_info( &self, resource_id: String, body: RestrictionPolicyUpdateRequest, ) -> Result<ResponseContent<RestrictionPolicyResponse>, Error<UpdateRestrictionPolicyError>>
Updates the restriction policy associated with a resource.
§Supported resources
Restriction policies can be applied to the following resources:
- Dashboards:
dashboard - Notebooks:
notebook - Powerpacks:
powerpack - Security Rules:
security-rule - Service Level Objectives:
slo - Synthetic Global Variables:
synthetics-global-variable - Synthetic Tests:
synthetics-test - Synthetic Private Locations:
synthetics-private-location - Monitors:
monitor
§Supported relations for resources
| Resource Type | Supported Relations |
|---|---|
| Dashboards | viewer, editor |
| Notebooks | viewer, editor |
| Powerpacks | viewer, editor |
| Security Rules | viewer, editor |
| Service Level Objectives | viewer, editor |
| Synthetic Global Variables | viewer, editor |
| Synthetic Tests | viewer, editor |
| Synthetic Private Locations | viewer, editor |
| Monitors | viewer, editor |
Trait Implementations§
source§impl Clone for RestrictionPoliciesAPI
impl Clone for RestrictionPoliciesAPI
source§fn clone(&self) -> RestrictionPoliciesAPI
fn clone(&self) -> RestrictionPoliciesAPI
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for RestrictionPoliciesAPI
impl Debug for RestrictionPoliciesAPI
Auto Trait Implementations§
impl Freeze for RestrictionPoliciesAPI
impl !RefUnwindSafe for RestrictionPoliciesAPI
impl Send for RestrictionPoliciesAPI
impl Sync for RestrictionPoliciesAPI
impl Unpin for RestrictionPoliciesAPI
impl !UnwindSafe for RestrictionPoliciesAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)