Crates.io | cx-api |
lib.rs | cx-api |
version | 0.2.1 |
source | src |
created_at | 2024-08-15 07:44:57.749449 |
updated_at | 2024-08-26 14:04:36.088688 |
description | Coralogix Management API Proxies. Support package for cx-sdk |
homepage | |
repository | https://github.com/coralogix/coralogix-management-sdk |
max_upload_size | |
id | 1338414 |
size | 15,844 |
The Rust SDK is an abstraction over the protobuf files in the root of the repository. Generating the .rs files happens during the build and the output is stored in the target directory (locally).
Use cargo to build and test:
cargo build
- builds the SDK
cd examples && cargo test
- runs all examples
cd examples && cargo test -p archive-logs
- runs the example archive-logs
This is a basic example for how to work with the SDK:
let client = ActionsClient::new(
AuthContext::from_env(),
CoralogixRegion::from_env().unwrap(),
)?;
let _ = client.create(Action {
name: Some("google search action".to_string()),
url: Some("https://www.google.com/search?q={{$p.selected_value}}".to_string()),
is_private: Some(false),
source_type: SourceType::Log.into(),
application_names: vec!["app".to_string()],
subsystem_names: vec!["sub".to_string()],
id: None,
is_hidden: Some(false),
created_by: Some("someone@mycompany.com".into()),
}).await?
You can find more in the directory.
Additional configuration options are supported by the SDK.
The SDK can be configured using environment variables:
CORALOGIX_TEAM_API_KEY
: The API key that is used for all team-level interactions. Note that it has to have appropriate permissions. Read the docs for more information.CORALOGIX_USER_API_KEY
: The API key that is used for all user-level interactions. Note that it has to have appropriate permissions. Read the docs for more information.CORALGOIX_REGION
: The region/cluster to connect to as a shorthand (EU2, AP1, etc. read more here).Please note that for all examples these variables have to be set to a valid cluster and API key.
These are just used within the examples:
TEAM_ID
: This environment variable is required for running some examples and should contain your Coralogix team's id.AWS_TEST_ROLE
: This environment variable is also requried for certain tests and requires a valid AWS role that can access resources required for the test.Apache-2.0