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?
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = RestrictionPoliciesAPI::with_config(configuration);
9 let resp = api
10 .get_restriction_policy("dashboard:test-get".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
More examples
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = RestrictionPoliciesAPI::with_config(configuration);
9 let resp = api
10 .delete_restriction_policy("dashboard:test-delete".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
12async fn main() {
13 // there is a valid "user" in the system
14 let body = RestrictionPolicyUpdateRequest::new(RestrictionPolicy::new(
15 RestrictionPolicyAttributes::new(vec![RestrictionPolicyBinding::new(
16 vec!["org:00000000-0000-beef-0000-000000000000".to_string()],
17 "editor".to_string(),
18 )]),
19 "dashboard:test-update".to_string(),
20 RestrictionPolicyType::RESTRICTION_POLICY,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = RestrictionPoliciesAPI::with_config(configuration);
24 let resp = api
25 .update_restriction_policy(
26 "dashboard:test-update".to_string(),
27 body,
28 UpdateRestrictionPolicyOptionalParams::default(),
29 )
30 .await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
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?
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = RestrictionPoliciesAPI::with_config(configuration);
9 let resp = api
10 .delete_restriction_policy("dashboard:test-delete".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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?
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = RestrictionPoliciesAPI::with_config(configuration);
9 let resp = api
10 .get_restriction_policy("dashboard:test-get".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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,
params: UpdateRestrictionPolicyOptionalParams,
) -> Result<RestrictionPolicyResponse, Error<UpdateRestrictionPolicyError>>
pub async fn update_restriction_policy( &self, resource_id: String, body: RestrictionPolicyUpdateRequest, params: UpdateRestrictionPolicyOptionalParams, ) -> 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
- Integration Accounts:
integration-account
- Integration Services:
integration-service
- Integration Webhooks:
integration-webhook
- Notebooks:
notebook
- Powerpacks:
powerpack
- Reference Tables:
reference-table
- 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
- Workflows:
workflow
- App Builder Apps:
app-builder-app
- Connections:
connection
- Connection Groups:
connection-group
- RUM Applications:
rum-application
- Cross Org Connections:
cross-org-connection
- Spreadsheets:
spreadsheet
§Supported relations for resources
Resource Type | Supported Relations |
---|---|
Dashboards | viewer , editor |
Integration Accounts | viewer , editor |
Integration Services | viewer , editor |
Integration Webhooks | 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 |
Reference Tables | viewer , editor |
Workflows | viewer , runner , editor |
App Builder Apps | viewer , editor |
Connections | viewer , resolver , editor |
Connection Groups | viewer , editor |
RUM Application | viewer , editor |
Cross Org Connections | viewer , editor |
Spreadsheets | viewer , editor |
Examples found in repository?
12async fn main() {
13 // there is a valid "user" in the system
14 let body = RestrictionPolicyUpdateRequest::new(RestrictionPolicy::new(
15 RestrictionPolicyAttributes::new(vec![RestrictionPolicyBinding::new(
16 vec!["org:00000000-0000-beef-0000-000000000000".to_string()],
17 "editor".to_string(),
18 )]),
19 "dashboard:test-update".to_string(),
20 RestrictionPolicyType::RESTRICTION_POLICY,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = RestrictionPoliciesAPI::with_config(configuration);
24 let resp = api
25 .update_restriction_policy(
26 "dashboard:test-update".to_string(),
27 body,
28 UpdateRestrictionPolicyOptionalParams::default(),
29 )
30 .await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
Sourcepub async fn update_restriction_policy_with_http_info(
&self,
resource_id: String,
body: RestrictionPolicyUpdateRequest,
params: UpdateRestrictionPolicyOptionalParams,
) -> Result<ResponseContent<RestrictionPolicyResponse>, Error<UpdateRestrictionPolicyError>>
pub async fn update_restriction_policy_with_http_info( &self, resource_id: String, body: RestrictionPolicyUpdateRequest, params: UpdateRestrictionPolicyOptionalParams, ) -> 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
- Integration Accounts:
integration-account
- Integration Services:
integration-service
- Integration Webhooks:
integration-webhook
- Notebooks:
notebook
- Powerpacks:
powerpack
- Reference Tables:
reference-table
- 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
- Workflows:
workflow
- App Builder Apps:
app-builder-app
- Connections:
connection
- Connection Groups:
connection-group
- RUM Applications:
rum-application
- Cross Org Connections:
cross-org-connection
- Spreadsheets:
spreadsheet
§Supported relations for resources
Resource Type | Supported Relations |
---|---|
Dashboards | viewer , editor |
Integration Accounts | viewer , editor |
Integration Services | viewer , editor |
Integration Webhooks | 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 |
Reference Tables | viewer , editor |
Workflows | viewer , runner , editor |
App Builder Apps | viewer , editor |
Connections | viewer , resolver , editor |
Connection Groups | viewer , editor |
RUM Application | viewer , editor |
Cross Org Connections | viewer , editor |
Spreadsheets | 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 more