3 releases (breaking)
new 0.5.0 | Feb 19, 2025 |
---|---|
0.4.0 | Jan 31, 2025 |
0.3.1 | Dec 20, 2024 |
0.3.0 |
|
#1882 in Web programming
154 downloads per month
Used in dsh
265KB
3K
SLoC
DSH resource management API client
This crate contains functions and definitions that provide support for using the functions of the DSH resource management API.
For more information, see the github repository.
Example
A small example will demonstrate the use of the library. More details and more elaborate examples can be found in the project's repository on github.
To make the library available to your rust application add it to your dependencies:
[dependencies]
dsh_api = "0.4.0"
The example will print a list of all the applications that are deployed in a tenant environment. This example requires that the tenant's name, group and user id, platform and API secret are configured via environment variables as follows:.
> export DSH_API_PLATFORM=np-aws-lz-dsh
> export DSH_API_TENANT=my-tenant
> export DSH_API_GUID_MY_TENANT=1234
> export DSH_API_PASSWORD_NP_AWS_LZ_DSH_MY_TENANT=...
Then the following program will list all applications for this tenant on the given platform.
use dsh_api::dsh_api_client_factory::DEFAULT_DSH_API_CLIENT_FACTORY;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let client = &DEFAULT_DSH_API_CLIENT_FACTORY.client().await?;
for (application_id, application) in client.list_applications().await? {
println!("{} -> {}", application_id, application);
}
Ok(())
}
Features
The following features are defined:
actual
- When this feature is enabled the library will include all the "actual" method versions of the REST API. By default, these methods will not be included.generic
- When this feature is enabled the library will also include the generic methods. This feature is disabled by default.
Changelog
See DSH_SDK CHANGELOG.md for all changes per version for SDK.
Contributing
See CONTRIBUTING.md for more information on how to contribute to this project.
License
See LICENSE for more information on the license for this project.
Security
See SECURITY.md for more information on the security policy for this project.
Copyright (c) Koninklijke KPN N.V.
Dependencies
~11–25MB
~378K SLoC