Skip to content

Commit 115687e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Cross Org API to Open API specs (#867)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 849cb9a commit 115687e

File tree

58 files changed

+4482
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4482
-1
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 407 additions & 0 deletions
Large diffs are not rendered by default.

LICENSE-3rdparty.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ windows_x86_64_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Mic
194194
windows_x86_64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
195195
windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
196196
winreg,https://github.com/gentoo90/winreg-rs,MIT,Igor Shaula <[email protected]>
197-
wit-bindgen-rt,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wit-bindgen-rt Authors
197+
wit-bindgen,https://github.com/bytecodealliance/wit-bindgen,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Alex Crichton <[email protected]>
198198
writeable,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers
199199
yoke,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <[email protected]>
200200
yoke-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <[email protected]>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Create Org Connection returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_org_connections::OrgConnectionsAPI;
4+
use datadog_api_client::datadogV2::model::OrgConnectionCreate;
5+
use datadog_api_client::datadogV2::model::OrgConnectionCreateAttributes;
6+
use datadog_api_client::datadogV2::model::OrgConnectionCreateRelationships;
7+
use datadog_api_client::datadogV2::model::OrgConnectionCreateRequest;
8+
use datadog_api_client::datadogV2::model::OrgConnectionOrgRelationship;
9+
use datadog_api_client::datadogV2::model::OrgConnectionOrgRelationshipData;
10+
use datadog_api_client::datadogV2::model::OrgConnectionOrgRelationshipDataType;
11+
use datadog_api_client::datadogV2::model::OrgConnectionType;
12+
use datadog_api_client::datadogV2::model::OrgConnectionTypeEnum;
13+
14+
#[tokio::main]
15+
async fn main() {
16+
let body = OrgConnectionCreateRequest::new(OrgConnectionCreate::new(
17+
OrgConnectionCreateAttributes::new(vec![OrgConnectionTypeEnum::LOGS]),
18+
OrgConnectionCreateRelationships::new(
19+
OrgConnectionOrgRelationship::new().data(
20+
OrgConnectionOrgRelationshipData::new()
21+
.id("83999dcd-7f97-11f0-8de1-1ecf66f1aa85".to_string())
22+
.type_(OrgConnectionOrgRelationshipDataType::ORGS),
23+
),
24+
),
25+
OrgConnectionType::ORG_CONNECTION,
26+
));
27+
let configuration = datadog::Configuration::new();
28+
let api = OrgConnectionsAPI::with_config(configuration);
29+
let resp = api.create_org_connections(body).await;
30+
if let Ok(value) = resp {
31+
println!("{:#?}", value);
32+
} else {
33+
println!("{:#?}", resp.unwrap_err());
34+
}
35+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Delete Org Connection returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_org_connections::OrgConnectionsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "org_connection" in the system
8+
let org_connection_data_id =
9+
uuid::Uuid::parse_str(&std::env::var("ORG_CONNECTION_DATA_ID").unwrap())
10+
.expect("Invalid UUID");
11+
let configuration = datadog::Configuration::new();
12+
let api = OrgConnectionsAPI::with_config(configuration);
13+
let resp = api
14+
.delete_org_connections(org_connection_data_id.clone())
15+
.await;
16+
if let Ok(value) = resp {
17+
println!("{:#?}", value);
18+
} else {
19+
println!("{:#?}", resp.unwrap_err());
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// List Org Connections returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_org_connections::OrgConnectionsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = OrgConnectionsAPI::with_config(configuration);
9+
let resp = api.list_org_connections().await;
10+
if let Ok(value) = resp {
11+
println!("{:#?}", value);
12+
} else {
13+
println!("{:#?}", resp.unwrap_err());
14+
}
15+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Update Org Connection returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_org_connections::OrgConnectionsAPI;
4+
use datadog_api_client::datadogV2::model::OrgConnectionType;
5+
use datadog_api_client::datadogV2::model::OrgConnectionTypeEnum;
6+
use datadog_api_client::datadogV2::model::OrgConnectionUpdate;
7+
use datadog_api_client::datadogV2::model::OrgConnectionUpdateAttributes;
8+
use datadog_api_client::datadogV2::model::OrgConnectionUpdateRequest;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
// there is a valid "org_connection" in the system
13+
let org_connection_data_id =
14+
uuid::Uuid::parse_str(&std::env::var("ORG_CONNECTION_DATA_ID").unwrap())
15+
.expect("Invalid UUID");
16+
let body = OrgConnectionUpdateRequest::new(OrgConnectionUpdate::new(
17+
OrgConnectionUpdateAttributes::new(vec![
18+
OrgConnectionTypeEnum::LOGS,
19+
OrgConnectionTypeEnum::METRICS,
20+
]),
21+
org_connection_data_id.clone(),
22+
OrgConnectionType::ORG_CONNECTION,
23+
));
24+
let configuration = datadog::Configuration::new();
25+
let api = OrgConnectionsAPI::with_config(configuration);
26+
let resp = api
27+
.update_org_connections(org_connection_data_id.clone(), body)
28+
.await;
29+
if let Ok(value) = resp {
30+
println!("{:#?}", value);
31+
} else {
32+
println!("{:#?}", resp.unwrap_err());
33+
}
34+
}

0 commit comments

Comments
 (0)