Struct datadog_api_client::datadogV2::api::api_cloudflare_integration::CloudflareIntegrationAPI
source · pub struct CloudflareIntegrationAPI { /* private fields */ }Expand description
Manage your Datadog Cloudflare integration directly through the Datadog API. See the Cloudflare integration page for more information.
Implementations§
source§impl CloudflareIntegrationAPI
impl CloudflareIntegrationAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
examples/v2_cloudflare-integration_DeleteCloudflareAccount.rs (line 8)
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api
.delete_cloudflare_account("account_id".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}examples/v2_cloudflare-integration_GetCloudflareAccount.rs (line 10)
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "cloudflare_account" in the system
let cloudflare_account_data_id = std::env::var("CLOUDFLARE_ACCOUNT_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api
.get_cloudflare_account(cloudflare_account_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}examples/v2_cloudflare-integration_CreateCloudflareAccount.rs (line 20)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
async fn main() {
let body = CloudflareAccountCreateRequest::new(CloudflareAccountCreateRequestData::new(
CloudflareAccountCreateRequestAttributes::new(
"fakekey".to_string(),
"examplecloudflareintegration".to_string(),
)
.email("dev@datadoghq.com".to_string()),
CloudflareAccountType::CLOUDFLARE_ACCOUNTS,
));
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api.create_cloudflare_account(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}examples/v2_cloudflare-integration_UpdateCloudflareAccount.rs (line 23)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
async fn main() {
// there is a valid "cloudflare_account" in the system
let cloudflare_account_data_id = std::env::var("CLOUDFLARE_ACCOUNT_DATA_ID").unwrap();
let body = CloudflareAccountUpdateRequest::new(
CloudflareAccountUpdateRequestData::new()
.attributes(
CloudflareAccountUpdateRequestAttributes::new("fakekey".to_string())
.email("dev@datadoghq.com".to_string())
.zones(vec!["zone-id-3".to_string()]),
)
.type_(CloudflareAccountType::CLOUDFLARE_ACCOUNTS),
);
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api
.update_cloudflare_account(cloudflare_account_data_id.clone(), 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 create_cloudflare_account(
&self,
body: CloudflareAccountCreateRequest,
) -> Result<CloudflareAccountResponse, Error<CreateCloudflareAccountError>>
pub async fn create_cloudflare_account( &self, body: CloudflareAccountCreateRequest, ) -> Result<CloudflareAccountResponse, Error<CreateCloudflareAccountError>>
Create a Cloudflare account.
Examples found in repository?
examples/v2_cloudflare-integration_CreateCloudflareAccount.rs (line 21)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
async fn main() {
let body = CloudflareAccountCreateRequest::new(CloudflareAccountCreateRequestData::new(
CloudflareAccountCreateRequestAttributes::new(
"fakekey".to_string(),
"examplecloudflareintegration".to_string(),
)
.email("dev@datadoghq.com".to_string()),
CloudflareAccountType::CLOUDFLARE_ACCOUNTS,
));
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api.create_cloudflare_account(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_cloudflare_account_with_http_info(
&self,
body: CloudflareAccountCreateRequest,
) -> Result<ResponseContent<CloudflareAccountResponse>, Error<CreateCloudflareAccountError>>
pub async fn create_cloudflare_account_with_http_info( &self, body: CloudflareAccountCreateRequest, ) -> Result<ResponseContent<CloudflareAccountResponse>, Error<CreateCloudflareAccountError>>
Create a Cloudflare account.
sourcepub async fn delete_cloudflare_account(
&self,
account_id: String,
) -> Result<(), Error<DeleteCloudflareAccountError>>
pub async fn delete_cloudflare_account( &self, account_id: String, ) -> Result<(), Error<DeleteCloudflareAccountError>>
Delete a Cloudflare account.
Examples found in repository?
examples/v2_cloudflare-integration_DeleteCloudflareAccount.rs (line 10)
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api
.delete_cloudflare_account("account_id".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_cloudflare_account_with_http_info(
&self,
account_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCloudflareAccountError>>
pub async fn delete_cloudflare_account_with_http_info( &self, account_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCloudflareAccountError>>
Delete a Cloudflare account.
sourcepub async fn get_cloudflare_account(
&self,
account_id: String,
) -> Result<CloudflareAccountResponse, Error<GetCloudflareAccountError>>
pub async fn get_cloudflare_account( &self, account_id: String, ) -> Result<CloudflareAccountResponse, Error<GetCloudflareAccountError>>
Get a Cloudflare account.
Examples found in repository?
examples/v2_cloudflare-integration_GetCloudflareAccount.rs (line 12)
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "cloudflare_account" in the system
let cloudflare_account_data_id = std::env::var("CLOUDFLARE_ACCOUNT_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api
.get_cloudflare_account(cloudflare_account_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_cloudflare_account_with_http_info(
&self,
account_id: String,
) -> Result<ResponseContent<CloudflareAccountResponse>, Error<GetCloudflareAccountError>>
pub async fn get_cloudflare_account_with_http_info( &self, account_id: String, ) -> Result<ResponseContent<CloudflareAccountResponse>, Error<GetCloudflareAccountError>>
Get a Cloudflare account.
sourcepub async fn list_cloudflare_accounts(
&self,
) -> Result<CloudflareAccountsResponse, Error<ListCloudflareAccountsError>>
pub async fn list_cloudflare_accounts( &self, ) -> Result<CloudflareAccountsResponse, Error<ListCloudflareAccountsError>>
List Cloudflare accounts.
sourcepub async fn list_cloudflare_accounts_with_http_info(
&self,
) -> Result<ResponseContent<CloudflareAccountsResponse>, Error<ListCloudflareAccountsError>>
pub async fn list_cloudflare_accounts_with_http_info( &self, ) -> Result<ResponseContent<CloudflareAccountsResponse>, Error<ListCloudflareAccountsError>>
List Cloudflare accounts.
sourcepub async fn update_cloudflare_account(
&self,
account_id: String,
body: CloudflareAccountUpdateRequest,
) -> Result<CloudflareAccountResponse, Error<UpdateCloudflareAccountError>>
pub async fn update_cloudflare_account( &self, account_id: String, body: CloudflareAccountUpdateRequest, ) -> Result<CloudflareAccountResponse, Error<UpdateCloudflareAccountError>>
Update a Cloudflare account.
Examples found in repository?
examples/v2_cloudflare-integration_UpdateCloudflareAccount.rs (line 25)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
async fn main() {
// there is a valid "cloudflare_account" in the system
let cloudflare_account_data_id = std::env::var("CLOUDFLARE_ACCOUNT_DATA_ID").unwrap();
let body = CloudflareAccountUpdateRequest::new(
CloudflareAccountUpdateRequestData::new()
.attributes(
CloudflareAccountUpdateRequestAttributes::new("fakekey".to_string())
.email("dev@datadoghq.com".to_string())
.zones(vec!["zone-id-3".to_string()]),
)
.type_(CloudflareAccountType::CLOUDFLARE_ACCOUNTS),
);
let configuration = datadog::Configuration::new();
let api = CloudflareIntegrationAPI::with_config(configuration);
let resp = api
.update_cloudflare_account(cloudflare_account_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_cloudflare_account_with_http_info(
&self,
account_id: String,
body: CloudflareAccountUpdateRequest,
) -> Result<ResponseContent<CloudflareAccountResponse>, Error<UpdateCloudflareAccountError>>
pub async fn update_cloudflare_account_with_http_info( &self, account_id: String, body: CloudflareAccountUpdateRequest, ) -> Result<ResponseContent<CloudflareAccountResponse>, Error<UpdateCloudflareAccountError>>
Update a Cloudflare account.
Trait Implementations§
source§impl Clone for CloudflareIntegrationAPI
impl Clone for CloudflareIntegrationAPI
source§fn clone(&self) -> CloudflareIntegrationAPI
fn clone(&self) -> CloudflareIntegrationAPI
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for CloudflareIntegrationAPI
impl Debug for CloudflareIntegrationAPI
Auto Trait Implementations§
impl Freeze for CloudflareIntegrationAPI
impl !RefUnwindSafe for CloudflareIntegrationAPI
impl Send for CloudflareIntegrationAPI
impl Sync for CloudflareIntegrationAPI
impl Unpin for CloudflareIntegrationAPI
impl !UnwindSafe for CloudflareIntegrationAPI
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)