-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README updates for go and globally (#17)
docs: README updates for go and globally. Fixes #14
- Loading branch information
Showing
6 changed files
with
83 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,64 @@ | ||
# Coralogix Management SDK for Rust | ||
[![](https://img.shields.io/crates/v/cx-sdk)](https://crates.io/crates/cx-sdk) | ||
![](https://img.shields.io/crates/dv/cx-sdk) | ||
|
||
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). Refer to the examples directory for how to connect to the individual services. | ||
# 🪵 Coralogix Management SDK for Rust | ||
|
||
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` | ||
`cd examples && cargo test -p archive-logs` - runs the example `archive-logs` | ||
|
||
## Examples | ||
|
||
This is a basic example for how to work with the SDK: | ||
|
||
```rust | ||
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 [](examples/) directory. | ||
|
||
## Configuration | ||
|
||
Additional configuration options are supported by the SDK. | ||
|
||
### Environment Variables | ||
|
||
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](https://coralogix.com/docs/api-keys/) 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](https://coralogix.com/docs/api-keys/) for more information. | ||
- `CORALGOIX_REGION`: The region/cluster to connect to as a shorthand (EU2, AP1, etc. read more [here](https://coralogix.com/docs/coralogix-domain/)). | ||
|
||
Please note that for all examples these variables have to be set to a valid cluster and API key. | ||
|
||
### Additional Variables For Examples | ||
|
||
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. | ||
|
||
# License | ||
|
||
Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters