GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DataDog/datadog-api-client-rust: Rust client for the Datadog API

BranchesTags
Open more actions menu

Latest commit

 

History

1,806 Commits
1,806 Commits

Folders and files

NameName
Last commit message
Last commit date
.ci/license
.ci/license
 
 
.generator/schemas
.generator/schemas
 
 
.github
.github
 
 
examples
examples
 
 
patches/rvcr
patches/rvcr
 
 
scripts
scripts
 
 
src
src
 
 
tests
tests
 
 
.generated-info
.generated-info
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cargo.toml
Cargo.toml
 
 
DEVELOPMENT.md
DEVELOPMENT.md
 
 
LICENSE
LICENSE
 
 
LICENSE-3rdparty.csv
LICENSE-3rdparty.csv
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
build.rs
build.rs
 
 
format.sh
format.sh
 
 
license-tool.toml
license-tool.toml
 
 
repository.datadog.yaml
repository.datadog.yaml
 
 
run-tests.sh
run-tests.sh
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

Datadog API Client

This repository contains the autogenerated Rust client for the Datadog API. The client code, feature files, and test data are generated from Datadog's public OpenAPI specifications by internal tooling.

We welcome contributions that expand or improve the client's capabilities. As part of the pull request review process, Datadog's internal tooling may regenerate the affected code, feature files, and test data based on the proposed changes.

To submit support or feature requests, please visit https://www.datadoghq.com/support/

Installation

Run cargo add datadog-api-client or add the following to Cargo.toml under [dependencies]:

datadog-api-client = "0"

Getting Started

Please follow the installation instructions and try the following snippet to validate your Datadog API key:

use datadog_api_client::datadog::Configuration;
use datadog_api_client::datadogV1::api_authentication::AuthenticationAPI;

#[tokio::main]
async fn main() {
    let configuration = Configuration::new();
    let api = AuthenticationAPI::with_config(configuration);
    let resp = api.validate().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Example snippets for every callable endpoint can be found in the repository's /examples/ directory.

Authentication

By default the library will use the DD_API_KEY and DD_APP_KEY environment variables to authenticate against the Datadog API.
To provide your own set of credentials, you need to set some keys on the configuration:

configuration.set_auth_key(
    "apiKeyAuth",
    APIKey {
        key: "<DD-API-KEY>".to_string(),
        prefix: "".to_owned(),
    },
);
configuration.set_auth_key(
    "appKeyAuth",
    APIKey {
        key: "<DD-APP-KEY>".to_string(),
        prefix: "".to_owned(),
    },
);

Datacenter Selection

By default the library will use the US1 Datadog datacenter, at datadoghq.com. To change this, we expose OpenAPI-style server index and server variable fields. For example, to switch the target datacenter to the EU datacenter, you can set the following values on the configuration object:

configuration.server_index = 0;
configuration.server_variables.insert("site".into(), "datadoghq.eu".into());

Alternatively, you can set the environment variable DD_SITE=datadoghq.eu to achieve the same result.

For a list of sites and alternative server URL schemes, you can refer to the code here.

Unstable Endpoints

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 use these endpoints:

configuration.set_unstable_operation_enabled("<OPERATION_NAME>", true)

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

Optional Features

  • native-tls (enabled by default): Enables TLS functionality using the native-tls crate.
  • rustls-tls: Enables TLS functionality using the alternative rustls crate.

Contributing

As most of the code in this repository is generated, we will only accept PRs for files that are not modified by our code-generation machinery (changes to the generated files would get overwritten). We happily accept contributions to files that are not autogenerated, such as tests and development tooling.

Author

[email protected]

About

Rust client for the Datadog API

crates.io/crates/datadog-api-client

Resources

Readme

Contributing

Contributing
Activity
Custom properties

Stars

24 stars

Watchers

327 watching

Forks

4 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.