Skip to content

Commit 55400d0

Browse files
HantingZhang2nkzou
andauthored
Add documentation for going public (#30)
Co-authored-by: Kevin Zou <[email protected]> Co-authored-by: Kevin Zou <[email protected]>
1 parent e4bc15e commit 55400d0

File tree

6 files changed

+227
-17
lines changed

6 files changed

+227
-17
lines changed

Diff for: CONTRIBUTING.md

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# How to contribute
2+
3+
First of all, thanks for contributing!
4+
5+
This document provides some basic guidelines for contributing to this repository. To propose improvements, feel free to submit a PR.
6+
7+
## Reporting a Bug - Requesting a feature - GitHub Issues
8+
9+
* **Ensure the bug was not already reported** by searching on GitHub under [Issues][1].
10+
* If you're unable to find an open issue addressing the problem, [open a new one][2].
11+
- **Fill out the issue template completely**. Label the issue properly.
12+
- Add `severity/` label.
13+
- Add `documentation` label if this issue is related to documentation changes.
14+
* If you have a feature request, it is encouraged to [contact support][3] so the request can be prioritized and properly tracked.
15+
* **Do not open an issue if you have a question**, instead [contact support][3].
16+
17+
## Suggesting an enhancements - Pull Requests
18+
19+
While you can create an issue to suggest a client enhancement, you won't be able to make a Pull Request for it.
20+
21+
Changes can only be made to:
22+
- Improve tests
23+
- Improve dev tooling
24+
- Improve documentation.
25+
26+
If that's the case, many thanks!
27+
28+
Read the [development guide](DEVELOPMENT.md) for more information on how to get started.
29+
30+
In order to ease/speed up our review, here are some items you can check/improve when submitting your PR:
31+
* **Ensure an Issue has been created.**
32+
* Avoid changing too many things at once. Make sure that your Pull Requests only fixes one Issue at the time.
33+
* Make sure that **all tests pass locally**.
34+
* Summarize your PR with a **meaningful title** and **fill out the pull request description template completely!**
35+
36+
Your pull request must pass all CI tests. If you're seeing an error and don't think it's your fault, it may not be!
37+
[Join us on Slack][5] or send us an email, and together we'll get it sorted out.
38+
39+
### Keep it small, focused
40+
41+
Avoid changing too many things at once. For instance if you're fixing two different
42+
issues at once, it makes reviewing harder and the _time-to-release_ longer.
43+
44+
### Commit Messages
45+
46+
Please don't be this person: `git commit -m "Fixed stuff"`. Take a moment to
47+
write meaningful commit messages.
48+
49+
The commit message should describe the reason for the change and give extra details
50+
that will allow someone later on to understand in 5 seconds the thing you've been
51+
working on for a day.
52+
53+
### Releasing
54+
55+
The release procedure is managed by Datadog, instructions can be found in the [RELEASING](RELEASING.md) document.
56+
However, note that improvements to tests and documentation do not end up in changelogs. Only client improvements do.
57+
58+
59+
## Asking a questions
60+
61+
Need help? Contact [Datadog support][3]
62+
63+
## Additional Notes
64+
65+
### Issue and Pull Request Labels
66+
67+
This section lists the labels we use to help us track and manage issues and pull requests.
68+
69+
| Label name | Usage | Description
70+
|-------------------------------|--------------------------|------------------------------------------------------------
71+
| `backward-incompatible` | Issues and Pull Requests | Warn for backward incompatible changes.
72+
| `changelog/Added` | Pull Request Only | Added features results into a minor version bump.
73+
| `changelog/Changed` | Pull Request Only | Changed features results into a major version bump.
74+
| `changelog/Deprecated` | Pull Request Only | Deprecated features results into a major version bump.
75+
| `changelog/Fixed` | Pull Request Only | Fixed features results into a bug fix version bump.
76+
| `changelog/no-changelog` | Pull Request Only | Changes don't appear in changelog.
77+
| `changelog/Removed` | Pull Request Only | Deprecated features results into a major version bump.
78+
| `changelog/Security` | Pull Request Only | Fixed features results into a bug fix version bump.
79+
| `ci/skip` | Pull Request Only | Skip GitHub action running tests.
80+
| `community/help-wanted` | Issue Only | Community help wanted.
81+
| `community` | Issues and Pull Requests | Community driven changes.
82+
| `dev/testing` | Issues and Pull Requests | Tests related changes.
83+
| `dev/tooling` | Issues and Pull Requests | Tooling related changes.
84+
| `do-not-merge/HOLD` | Pull Request Only | Do not merge this PR.
85+
| `do-not-merge/WIP` | Pull Request Only | Do not merge this PR.
86+
| `documentation` | Issues and Pull Requests | Documentation related changes.
87+
| `duplicate` | Issue Only | Duplicate issue.
88+
| `invalid` | Issue Only | Invalid issue.
89+
| `kind/bug` | Issue Only | Bug related issue.
90+
| `kind/feature-request` | Issue Only | Feature request related issue.
91+
| `severity/critical` | Issue Only | Critical severity issue.
92+
| `severity/major` | Issue Only | Major severity issue.
93+
| `severity/minor` | Issue Only | Minor severity issue.
94+
| `severity/normal` | Issue Only | Normal severity issue.
95+
| `stale` | Issues and Pull Requests | Stale - Bot reminder.
96+
| `stale/exempt` | Issues and Pull Requests | Exempt from being marked as stale.
97+
98+
[1]: https://github.com/DataDog/datadog-api-client-rust/issues
99+
[2]: https://github.com/DataDog/datadog-api-client-rust/issues/new
100+
[3]: https://docs.datadoghq.com/help
101+
[4]: https://keepachangelog.com/en/1.0.0
102+
[5]: https://datadoghq.slack.com

Diff for: Cargo.toml

+7-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ edition = "2021"
99
[dependencies]
1010
lazy_static = "1.4.0"
1111
log = "0.4.20"
12-
reqwest = { version = "^0.11", features = ["multipart"] }
12+
reqwest = { version = "0.11.24", features = ["multipart"] }
1313
reqwest-middleware = "0.1.6"
14-
serde = "^1.0"
15-
serde_derive = "^1.0"
16-
serde_json = "^1.0"
14+
serde = { version = "1.0.197", features = ["derive"] }
15+
serde_json = "1.0.114"
1716
serde_repr = "0.1.17"
18-
serde_with = "^2.0"
19-
url = "^2.2"
17+
serde_with = "3.6.1"
18+
url = "2.5.0"
2019

2120
[build-dependencies]
2221
rustc_version = "0.4.0"
@@ -28,13 +27,13 @@ env_logger = "0.10.0"
2827
futures = "0.3.28"
2928
regex = "1.9.5"
3029
rvcr = { git = "https://github.com/nkzou/rvcr.git", rev = "b8f84bc0dfacd539fdc6f7446637c6276dcbb57c" }
31-
vcr-cassette = "^2.0"
30+
vcr-cassette = "2.0.1"
3231
sha256 = "1.4.0"
3332
tokio = { version = "1.10", features = ["macros", "rt-multi-thread", "time"] }
3433
minijinja = "1.0.10"
3534
convert_case = "0.6.0"
3635
urlencoding = "2.1.3"
3736

3837
[[test]]
39-
harness = false # allows Cucumber to print output instead of libtest
38+
harness = false # allows Cucumber to print output instead of libtest
4039
name = "main"

Diff for: DEVELOPMENT.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Development
2+
3+
This repository contains code that is autogenerated.
4+
5+
As such, code changes must be made against the templates, not against generated code.
6+
7+
## Testing
8+
9+
### Prerequisite
10+
11+
Export the following environment variables:
12+
* `DD_TEST_CLIENT_API_KEY`: The Datadog API key to run integration tests against
13+
* `DD_TEST_CLIENT_APP_KEY`: The Datadog Application key to run integration tests against
14+
15+
**IMPORTANT**: Do not use production keys.
16+
17+
**NOTE**: All recorded URLs will be replaced by `datadoghq.com`. Please make sure that you do NOT leak any sensitive information.
18+
19+
### Commands
20+
21+
This project contains both Integration and Unit tests.
22+
__Never__ run the test suite against an organization with production data.
23+
24+
Navigate to the root directory and run
25+
`cargo test --test main`
26+
27+
Test for a single scenario can be executed via
28+
`cargo test --test main -- --name "<scenario-name>"`
29+
30+
By default integration tests use recorded API responses stored in cassettes. To record new API responses run the tests with `RECORD=true`.
31+
To run integration tests against API without recording cassettes, run the tests with `RECORD=none`.
32+

Diff for: LICENSE-3rdparty.csv

+20-7
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ bumpalo,https://github.com/fitzgen/bumpalo,MIT OR Apache-2.0,Nick Fitzgerald <fi
1212
bytes,https://github.com/tokio-rs/bytes,MIT,"Carl Lerche <[email protected]>, Sean McArthur <[email protected]>"
1313
cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton <[email protected]>
1414
chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors
15-
core-foundation,https://github.com/servo/core-foundation-rs,MIT OR Apache-2.0,The Servo Project Developers
15+
core-foundation,https://github.com/servo/core-foundation-rs,MIT OR Apache-2.0,The Servo Project Developers
1616
darling,https://github.com/TedDriggs/darling,MIT,Ted Driggs <[email protected]>
17+
deranged,https://github.com/jhpratt/deranged,MIT OR Apache-2.0,Jacob Pratt <[email protected]>
1718
encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen <[email protected]>
19+
equivalent,https://github.com/cuviper/equivalent,Apache-2.0 OR MIT,The equivalent Authors
1820
errno,https://github.com/lambda-fairy/rust-errno,MIT OR Apache-2.0,Chris Wong <[email protected]>
19-
errno-dragonfly,https://github.com/mneumann/errno-dragonfly-rs,MIT,Michael Neumann <[email protected]>
2021
fastrand,https://github.com/smol-rs/fastrand,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
2122
fnv,https://github.com/servo/rust-fnv,Apache-2.0 OR MIT,Alex Crichton <[email protected]>
2223
foreign-types,https://github.com/sfackler/foreign-types,MIT OR Apache-2.0,Steven Fackler <[email protected]>
@@ -32,7 +33,7 @@ futures-util,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futur
3233
gimli,https://github.com/gimli-rs/gimli,MIT OR Apache-2.0,The gimli Authors
3334
h2,https://github.com/hyperium/h2,MIT,"Carl Lerche <[email protected]>, Sean McArthur <[email protected]>"
3435
hashbrown,https://github.com/rust-lang/hashbrown,MIT OR Apache-2.0,Amanieu d'Antras <[email protected]>
35-
hermit-abi,https://github.com/hermitcore/hermit-rs,MIT OR Apache-2.0,Stefan Lankes
36+
hermit-abi,https://github.com/hermit-os/hermit-rs,MIT OR Apache-2.0,Stefan Lankes
3637
hex,https://github.com/KokaKiwi/rust-hex,MIT OR Apache-2.0,KokaKiwi <[email protected]>
3738
http,https://github.com/hyperium/http,MIT OR Apache-2.0,"Alex Crichton <[email protected]>, Carl Lerche <[email protected]>, Sean McArthur <[email protected]>"
3839
http-body,https://github.com/hyperium/http-body,MIT,"Carl Lerche <[email protected]>, Lucio Franco <[email protected]>, Sean McArthur <[email protected]>"
@@ -44,6 +45,7 @@ iana-time-zone,https://github.com/strawlab/iana-time-zone,MIT OR Apache-2.0,"And
4445
iana-time-zone-haiku,https://github.com/strawlab/iana-time-zone,MIT OR Apache-2.0,René Kijewski <[email protected]>
4546
ident_case,https://github.com/TedDriggs/ident_case,MIT OR Apache-2.0,Ted Driggs <[email protected]>
4647
indexmap,https://github.com/bluss/indexmap,Apache-2.0 OR MIT,The indexmap Authors
48+
indexmap,https://github.com/indexmap-rs/indexmap,Apache-2.0 OR MIT,The indexmap Authors
4749
ipnet,https://github.com/krisprice/ipnet,MIT OR Apache-2.0,Kris Price <[email protected]>
4850
itoa,https://github.com/dtolnay/itoa,MIT OR Apache-2.0,David Tolnay <[email protected]>
4951
js-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers
@@ -57,6 +59,7 @@ mime_guess,https://github.com/abonander/mime_guess,MIT,Austin Bonander <austin.b
5759
miniz_oxide,https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide,MIT OR Zlib OR Apache-2.0,"Frommi <[email protected]>, oyvindln <[email protected]>"
5860
mio,https://github.com/tokio-rs/mio,MIT,"Carl Lerche <[email protected]>, Thomas de Zeeuw <[email protected]>, Tokio Contributors <[email protected]>"
5961
native-tls,https://github.com/sfackler/rust-native-tls,MIT OR Apache-2.0,Steven Fackler <[email protected]>
62+
num-conv,https://github.com/jhpratt/num-conv,MIT OR Apache-2.0,Jacob Pratt <[email protected]>
6063
num-traits,https://github.com/rust-num/num-traits,MIT OR Apache-2.0,The Rust Project Developers
6164
num_cpus,https://github.com/seanmonstar/num_cpus,MIT OR Apache-2.0,Sean McArthur <[email protected]>
6265
object,https://github.com/gimli-rs/object,Apache-2.0 OR MIT,The object Authors
@@ -67,18 +70,18 @@ openssl-probe,https://github.com/alexcrichton/openssl-probe,MIT OR Apache-2.0,Al
6770
openssl-sys,https://github.com/sfackler/rust-openssl,MIT,"Alex Crichton <[email protected]>, Steven Fackler <[email protected]>"
6871
pin-project-lite,https://github.com/taiki-e/pin-project-lite,Apache-2.0 OR MIT,The pin-project-lite Authors
6972
pin-utils,https://github.com/rust-lang-nursery/pin-utils,MIT OR Apache-2.0,Josef Brandl <[email protected]>
73+
powerfmt,https://github.com/jhpratt/powerfmt,MIT OR Apache-2.0,Jacob Pratt <[email protected]>
7074
proc-macro2,https://github.com/dtolnay/proc-macro2,MIT OR Apache-2.0,"David Tolnay <[email protected]>, Alex Crichton <[email protected]>"
7175
quote,https://github.com/dtolnay/quote,MIT OR Apache-2.0,David Tolnay <[email protected]>
72-
redox_syscall,https://gitlab.redox-os.org/redox-os/syscall,MIT,Jeremy Soller <[email protected]>
7376
reqwest,https://github.com/seanmonstar/reqwest,MIT OR Apache-2.0,Sean McArthur <[email protected]>
7477
reqwest-middleware,https://github.com/TrueLayer/reqwest-middleware,MIT OR Apache-2.0,Rodrigo Gryzinski <[email protected]>
7578
rustc-demangle,https://github.com/alexcrichton/rustc-demangle,MIT OR Apache-2.0,Alex Crichton <[email protected]>
7679
rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,"Dan Gohman <[email protected]>, Jakub Konka <[email protected]>"
80+
rustls-pemfile,https://github.com/rustls/pemfile,Apache-2.0 OR ISC OR MIT,The rustls-pemfile Authors
7781
ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay <[email protected]>
7882
schannel,https://github.com/steffengy/schannel-rs,MIT,"Steven Fackler <[email protected]>, Steffen Butzer <[email protected]>"
7983
security-framework,https://github.com/kornelski/rust-security-framework,MIT OR Apache-2.0,"Steven Fackler <[email protected]>, Kornel <[email protected]>"
8084
serde,https://github.com/serde-rs/serde,MIT OR Apache-2.0,"Erick Tryzelaar <[email protected]>, David Tolnay <[email protected]>"
81-
serde_derive,https://github.com/serde-rs/serde,MIT OR Apache-2.0,David Tolnay <[email protected]>
8285
serde_json,https://github.com/serde-rs/json,MIT OR Apache-2.0,"Erick Tryzelaar <[email protected]>, David Tolnay <[email protected]>"
8386
serde_repr,https://github.com/dtolnay/serde-repr,MIT OR Apache-2.0,David Tolnay <[email protected]>
8487
serde_urlencoded,https://github.com/nox/serde_urlencoded,MIT OR Apache-2.0,Anthony Ramine <[email protected]>
@@ -88,6 +91,8 @@ slab,https://github.com/tokio-rs/slab,MIT,Carl Lerche <[email protected]>
8891
socket2,https://github.com/rust-lang/socket2,MIT OR Apache-2.0,"Alex Crichton <[email protected]>, Thomas de Zeeuw <[email protected]>"
8992
strsim,https://github.com/dguo/strsim-rs,MIT,Danny Guo <[email protected]>
9093
syn,https://github.com/dtolnay/syn,MIT OR Apache-2.0,David Tolnay <[email protected]>
94+
sync_wrapper,https://github.com/Actyx/sync_wrapper,Apache-2.0,Actyx AG <[email protected]>
95+
system-configuration,https://github.com/mullvad/system-configuration-rs,MIT OR Apache-2.0,Mullvad VPN
9196
task-local-extensions,https://github.com/TrueLayer/task-local-extensions,MIT OR Apache-2.0,"Conrad Ludgate <[email protected]>, Rodrigo Gryzinski <[email protected]>"
9297
tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen <[email protected]>, The Rust Project Developers, Ashley Mannix <[email protected]>, Jason White <[email protected]>"
9398
thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <[email protected]>
@@ -115,6 +120,14 @@ wasm-bindgen-macro,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/m
115120
wasm-bindgen-macro-support,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support,MIT OR Apache-2.0,The wasm-bindgen Developers
116121
wasm-bindgen-shared,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared,MIT OR Apache-2.0,The wasm-bindgen Developers
117122
web-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys,MIT OR Apache-2.0,The wasm-bindgen Developers
118-
winapi,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian <[email protected]>
119-
windows,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
123+
windows-core,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
124+
windows-sys,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
125+
windows-targets,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
126+
windows_aarch64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
127+
windows_aarch64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
128+
windows_i686_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
129+
windows_i686_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
130+
windows_x86_64_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
131+
windows_x86_64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
132+
windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
120133
winreg,https://github.com/gentoo90/winreg-rs,MIT,Igor Shaula <[email protected]>

Diff for: README.md

+65-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
# Rust API client for openapi
1+
# datadog-api-client-rust
22

3-
Collection of all Datadog Public endpoints.
3+
This repository contains a Rust API client for the [Datadog API](https://docs.datadoghq.com/api/).
44

55
For more information, please visit [https://www.datadoghq.com/support/](https://www.datadoghq.com/support/)
66

77
## Overview
88

99
This API client was generated from OpenAPI specs by code and templates in the `.generator/` folder.
1010

11+
## Requirements
12+
13+
Building this API client library requires:
14+
``TODO``
15+
1116
## Installation
1217

1318
Add the following to `Cargo.toml` under `[dependencies]`:
@@ -16,6 +21,64 @@ Add the following to `Cargo.toml` under `[dependencies]`:
1621
datadog-api-client = { git = "ssh://[email protected]/DataDog/datadog-api-client-rust.git", branch = "master" }
1722
```
1823

24+
## Getting Started
25+
26+
Please follow the [installation](#installation) instruction and execute the following Rust code:
27+
28+
```Rust
29+
use datadog_api_client::datadog::configuration::Configuration;
30+
use datadog_api_client::datadogV1::api::api_monitors::{MonitorsAPI, GetMonitorOptionalParams};
31+
32+
#[tokio::main]
33+
async fn main() {
34+
env_logger::init();
35+
let configuration = Configuration::new();
36+
let monitors_api = MonitorsAPI::with_config(configuration.clone());
37+
38+
let mut monitor_payload = GetMonitorOptionalParams::default();
39+
monitor_payload.group_states("all".into());
40+
41+
let resp = monitors_api.get_monitor(1234567, monitor_payload).await;
42+
if let Ok(Some(value)) = resp {
43+
println!("{:#?}", value);
44+
} else {
45+
println!("{:#?}", resp.unwrap_err());
46+
}
47+
}
48+
```
49+
50+
### Authentication
51+
52+
By default the library will use the `DD_API_KEY` and `DD_APP_KEY` environment variables to authenticate against the Datadog API.
53+
To provide your own set of credentials, you need to set some keys on the configuration:
54+
55+
```rust
56+
configuration.set_auth_key(
57+
"apiKeyAuth",
58+
APIKey {
59+
key: "<DD-API-KEY>".to_string(),
60+
prefix: "".to_owned(),
61+
},
62+
);
63+
configuration.set_auth_key(
64+
"appKeyAuth",
65+
APIKey {
66+
key: "<DD-APP-KEY>".to_string(),
67+
prefix: "".to_owned(),
68+
},
69+
);
70+
71+
```
72+
73+
### Unstable Endpoints
74+
75+
This client includes access to Datadog API endpoints while they are in an unstable state and may undergo breaking changes. An extra configuration step is required to enable these endpoints:
76+
77+
```rust
78+
configuration.set_unstable_operation_enabled(<OPERATION_NAME>, True )
79+
```
80+
where <OPERATION_NAME> is the API version and name of the method used to interact with that endpoint. For example: `v2.list_incidents`, or `v2.query_timeseries_data`
81+
1982
## Documentation for API Endpoints
2083

2184
To get access to the crate's generated documentation, use:

Diff for: RELEASING.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//TODO

0 commit comments

Comments
 (0)