Skip to content

Commit 37aa74f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
document agentless GCP scan options CRUD endpoints (#962)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 13a2477 commit 37aa74f

File tree

96 files changed

+3130
-95
lines changed

Some content is hidden

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

96 files changed

+3130
-95
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 326 additions & 15 deletions
Large diffs are not rendered by default.

LICENSE-3rdparty.csv

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
Component,Origin,License,Copyright
2-
addr2line,https://github.com/gimli-rs/addr2line,Apache-2.0 OR MIT,The addr2line Authors
32
adler2,https://github.com/oyvindln/adler2,0BSD OR MIT OR Apache-2.0,"Jonas Schievink <jonasschievink@gmail.com>, oyvindln <oyvindln@users.noreply.github.com>"
43
android_system_properties,https://github.com/nical/android_system_properties,MIT OR Apache-2.0,Nicolas Silva <nical@fastmail.com>
54
anyhow,https://github.com/dtolnay/anyhow,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
65
async-stream,https://github.com/tokio-rs/async-stream,MIT,Carl Lerche <me@carllerche.com>
76
async-stream-impl,https://github.com/tokio-rs/async-stream,MIT,Carl Lerche <me@carllerche.com>
87
async-trait,https://github.com/dtolnay/async-trait,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
9-
backtrace,https://github.com/rust-lang/backtrace-rs,MIT OR Apache-2.0,The Rust Project Developers
108
base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,"Alice Maz <alice@alicemaz.com>, Marshall Pierce <marshall@mpierce.org>"
119
base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,Marshall Pierce <marshall@mpierce.org>
1210
bitflags,https://github.com/bitflags/bitflags,MIT OR Apache-2.0,The Rust Project Developers
@@ -43,7 +41,6 @@ futures-sink,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futur
4341
futures-task,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-task Authors
4442
futures-util,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-util Authors
4543
getrandom,https://github.com/rust-random/getrandom,MIT OR Apache-2.0,The Rand Project Developers
46-
gimli,https://github.com/gimli-rs/gimli,MIT OR Apache-2.0,The gimli Authors
4744
h2,https://github.com/hyperium/h2,MIT,"Carl Lerche <me@carllerche.com>, Sean McArthur <sean@seanmonstar.com>"
4845
hashbrown,https://github.com/rust-lang/hashbrown,MIT OR Apache-2.0,Amanieu d'Antras <amanieu@gmail.com>
4946
hex,https://github.com/KokaKiwi/rust-hex,MIT OR Apache-2.0,KokaKiwi <kokakiwi@kokakiwi.net>
@@ -68,7 +65,6 @@ idna_adapter,https://github.com/hsivonen/idna_adapter,Apache-2.0 OR MIT,The rust
6865
indexmap,https://github.com/bluss/indexmap,Apache-2.0 OR MIT,The indexmap Authors
6966
indexmap,https://github.com/indexmap-rs/indexmap,Apache-2.0 OR MIT,The indexmap Authors
7067
instant,https://github.com/sebcrozet/instant,BSD-3-Clause,sebcrozet <developer@crozet.re>
71-
io-uring,https://github.com/tokio-rs/io-uring,MIT OR Apache-2.0,quininer <quininer@live.com>
7268
ipnet,https://github.com/krisprice/ipnet,MIT OR Apache-2.0,Kris Price <kris@krisprice.nz>
7369
itoa,https://github.com/dtolnay/itoa,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
7470
js-sys,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers
@@ -86,7 +82,6 @@ mio,https://github.com/tokio-rs/mio,MIT,"Carl Lerche <me@carllerche.com>, Thomas
8682
native-tls,https://github.com/sfackler/rust-native-tls,MIT OR Apache-2.0,Steven Fackler <sfackler@gmail.com>
8783
num-conv,https://github.com/jhpratt/num-conv,MIT OR Apache-2.0,Jacob Pratt <jacob@jhpratt.dev>
8884
num-traits,https://github.com/rust-num/num-traits,MIT OR Apache-2.0,The Rust Project Developers
89-
object,https://github.com/gimli-rs/object,Apache-2.0 OR MIT,The object Authors
9085
once_cell,https://github.com/matklad/once_cell,MIT OR Apache-2.0,Aleksey Kladov <aleksey.kladov@gmail.com>
9186
openssl,https://github.com/sfackler/rust-openssl,Apache-2.0,Steven Fackler <sfackler@gmail.com>
9287
openssl-macros,https://github.com/sfackler/rust-openssl,MIT OR Apache-2.0,The openssl-macros Authors
@@ -113,7 +108,6 @@ reqwest,https://github.com/seanmonstar/reqwest,MIT OR Apache-2.0,Sean McArthur <
113108
reqwest-middleware,https://github.com/TrueLayer/reqwest-middleware,MIT OR Apache-2.0,Rodrigo Gryzinski <rodrigo.gryzinski@truelayer.com>
114109
reqwest-retry,https://github.com/TrueLayer/reqwest-middleware,MIT OR Apache-2.0,Rodrigo Gryzinski <rodrigo.gryzinski@truelayer.com>
115110
retry-policies,https://github.com/TrueLayer/retry-policies,MIT OR Apache-2.0,Luca Palmieri <lpalmieri@truelayer.com>
116-
rustc-demangle,https://github.com/rust-lang/rustc-demangle,MIT OR Apache-2.0,Alex Crichton <alex@alexcrichton.com>
117111
rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,"Dan Gohman <dev@sunfishcode.online>, Jakub Konka <kubkon@jakubkonka.com>"
118112
rustls-pemfile,https://github.com/rustls/pemfile,Apache-2.0 OR ISC OR MIT,The rustls-pemfile Authors
119113
ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay <dtolnay@gmail.com>
@@ -165,7 +159,6 @@ uuid,https://github.com/uuid-rs/uuid,Apache-2.0 OR MIT,"Ashley Mannix<ashleymann
165159
uuid-macro-internal,https://github.com/uuid-rs/uuid,Apache-2.0 OR MIT,QnnOkabayashi
166160
want,https://github.com/seanmonstar/want,MIT,Sean McArthur <sean@seanmonstar.com>
167161
wasi,https://github.com/bytecodealliance/wasi,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The Cranelift Project Developers
168-
wasi,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wasi Authors
169162
wasip2,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wasip2 Authors
170163
wasm-bindgen,https://github.com/wasm-bindgen/wasm-bindgen,MIT OR Apache-2.0,The wasm-bindgen Developers
171164
wasm-bindgen-backend,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/backend,MIT OR Apache-2.0,The wasm-bindgen Developers
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Post GCP Scan Options returns "Agentless scan options enabled successfully."
2+
// response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_agentless_scanning::AgentlessScanningAPI;
5+
use datadog_api_client::datadogV2::model::GcpScanOptions;
6+
use datadog_api_client::datadogV2::model::GcpScanOptionsData;
7+
use datadog_api_client::datadogV2::model::GcpScanOptionsDataAttributes;
8+
use datadog_api_client::datadogV2::model::GcpScanOptionsDataType;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body = GcpScanOptions::new().data(
13+
GcpScanOptionsData::new(
14+
"new-project".to_string(),
15+
GcpScanOptionsDataType::GCP_SCAN_OPTIONS,
16+
)
17+
.attributes(
18+
GcpScanOptionsDataAttributes::new()
19+
.vuln_containers_os(true)
20+
.vuln_host_os(true),
21+
),
22+
);
23+
let configuration = datadog::Configuration::new();
24+
let api = AgentlessScanningAPI::with_config(configuration);
25+
let resp = api.create_gcp_scan_options(body).await;
26+
if let Ok(value) = resp {
27+
println!("{:#?}", value);
28+
} else {
29+
println!("{:#?}", resp.unwrap_err());
30+
}
31+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Delete GCP Scan Options returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_agentless_scanning::AgentlessScanningAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = AgentlessScanningAPI::with_config(configuration);
9+
let resp = api
10+
.delete_gcp_scan_options("company-project-id".to_string())
11+
.await;
12+
if let Ok(value) = resp {
13+
println!("{:#?}", value);
14+
} else {
15+
println!("{:#?}", resp.unwrap_err());
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Get Azure scan options returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_agentless_scanning::AgentlessScanningAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = AgentlessScanningAPI::with_config(configuration);
9+
let resp = api
10+
.get_azure_scan_options("12345678-90ab-cdef-1234-567890abcdef".to_string())
11+
.await;
12+
if let Ok(value) = resp {
13+
println!("{:#?}", value);
14+
} else {
15+
println!("{:#?}", resp.unwrap_err());
16+
}
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Get GCP scan options returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_agentless_scanning::AgentlessScanningAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = AgentlessScanningAPI::with_config(configuration);
9+
let resp = api.get_gcp_scan_options("api-spec-test".to_string()).await;
10+
if let Ok(value) = resp {
11+
println!("{:#?}", value);
12+
} else {
13+
println!("{:#?}", resp.unwrap_err());
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// List GCP Scan Options returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_agentless_scanning::AgentlessScanningAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = AgentlessScanningAPI::with_config(configuration);
9+
let resp = api.list_gcp_scan_options().await;
10+
if let Ok(value) = resp {
11+
println!("{:#?}", value);
12+
} else {
13+
println!("{:#?}", resp.unwrap_err());
14+
}
15+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Patch GCP Scan Options returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_agentless_scanning::AgentlessScanningAPI;
4+
use datadog_api_client::datadogV2::model::GcpScanOptionsInputUpdate;
5+
use datadog_api_client::datadogV2::model::GcpScanOptionsInputUpdateData;
6+
use datadog_api_client::datadogV2::model::GcpScanOptionsInputUpdateDataAttributes;
7+
use datadog_api_client::datadogV2::model::GcpScanOptionsInputUpdateDataType;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = GcpScanOptionsInputUpdate::new().data(
12+
GcpScanOptionsInputUpdateData::new(
13+
"api-spec-test".to_string(),
14+
GcpScanOptionsInputUpdateDataType::GCP_SCAN_OPTIONS,
15+
)
16+
.attributes(GcpScanOptionsInputUpdateDataAttributes::new().vuln_containers_os(false)),
17+
);
18+
let configuration = datadog::Configuration::new();
19+
let api = AgentlessScanningAPI::with_config(configuration);
20+
let resp = api
21+
.update_gcp_scan_options("api-spec-test".to_string(), body)
22+
.await;
23+
if let Ok(value) = resp {
24+
println!("{:#?}", value);
25+
} else {
26+
println!("{:#?}", resp.unwrap_err());
27+
}
28+
}

0 commit comments

Comments
 (0)