Octelium documentation · Latest
SDKs
On this page +
Octelium APIs are all developed over gRPC. Most octeliumctl commands are wrappers over the Cluster's Core API methods. The SDK clients make it easy for applications to authenticate to the Cluster and manage resources such as Users, Services and Sessions programmatically.
The examples below create an authenticated client, list Users, create and update a User, create a Service and list Sessions. The authenticated User must have a Policy that permits these operations. Read more about authentication-token Credentials here and Policies here.
Golang SDK
The octelium-go library provides an authenticated gRPC connection for the Cluster APIs. It also handles obtaining and refreshing the Session access token used by the connection.
Install the module in your Go application as follows:
Here is a complete management example:
Set OCTELIUM_DOMAIN and OCTELIUM_AUTH_TOKEN before running the program.
TypeScript SDK
The TypeScript/Node.js SDK is provided by @octelium/sdk:
The generated protobuf messages expose create factories, which fill in their default fields and make them ready for API calls. Here is the equivalent management example:
The TypeScript example uses the same OCTELIUM_DOMAIN and OCTELIUM_AUTH_TOKEN environment variables as the Go example.
Python SDK
The Python SDK is provided by octelium-sdk and uses the generated API messages from octelium-apis:
Here is the equivalent asynchronous management example:
The Python example uses the same OCTELIUM_DOMAIN and OCTELIUM_AUTH_TOKEN environment variables as the other examples.
Rust SDK
The Rust SDK is provided by the octelium crate. It re-exports the generated API messages and tonic gRPC clients under octelium::apis, obtains and refreshes the Session access token and hands out authenticated clients for the Cluster APIs:
Here is the equivalent management example:
Protobuf enum fields are generated as i32 values, so enums such as Type::Human are converted with .into(). The Rust example uses the same OCTELIUM_DOMAIN and OCTELIUM_AUTH_TOKEN environment variables as the other examples. You can also use Client::from_env() to read the Cluster domain and the Credential directly from these environment variables.