Java HTTP client for the Cloudinfo API, providing cloud provider information including regions and compute products with pricing.
Add the dependency to your build.gradle:
dependencies {
implementation 'io.seqera:lib-cloudinfo:2.0.0'
}Note: Check the project's VERSION file for the current version number.
- Fetch cloud regions for AWS, GCP, and Azure
- Fetch compute products (instance types) with on-demand and spot pricing
- Built on
lib-httpxwith automatic retry and error handling - Type-safe JSON deserialization using
lib-serde-jackson
// Create client with default configuration
CloudInfoClient client = CloudInfoClient.create();
// Fetch regions for a cloud provider
List<CloudRegion> regions = client.getRegions("amazon");
List<String> regionIds = client.getRegionIds("amazon");
// Fetch compute products with pricing
List<CloudProduct> products = client.getProducts("amazon", "us-east-1");Pass a ProductsQuery to filter the products endpoint. Filters are applied
server-side and compose with AND semantics; providers without matching data
return an empty result for that filter.
features(List<String>)— keep only products whose capability features contain all the given lowercase tokens. Serialised as?features=a,b,c. The vocabulary isssd,gpu,arm,x86,burst,hibernation,sched, plus GPU vendor tokens (nvidia,amd,habana) and model tokens (a100,tesla-a100,radeon-pro-v520, …).families(List<String>)— keep only products in the given machine families or matching the given instance-type names. Serialised as?families=m5d,c5.large.sched(boolean)/nvme(boolean)— the original boolean filters, retained for backward compatibility (sched=true≡features=sched,nvme=true≡features=ssd). Preferfeatures(...)for new code.
ProductsQuery query = ProductsQuery.builder()
.features(List.of("gpu", "nvidia")) // NVIDIA GPU instances only
.families(List.of("p4d")) // ...within the p4d family
.build();
List<CloudProduct> products = client.getProducts("amazon", "us-east-1", query);Fetch the machine families available for a provider, optionally restricted to those that have at least one product carrying all the requested capability features:
// All families for the provider
List<String> families = client.getFamilies("amazon");
// Only families with an NVIDIA GPU product
List<String> gpuFamilies = client.getFamilies("amazon", List.of("gpu", "nvidia"));An unknown or non-lowercase feature token is rejected by the backend with
HTTP 400; the resulting CloudInfoException exposes the accepted tokens via
getValidCapabilities().
CloudInfoClient client = CloudInfoClient.builder()
.endpoint("https://cloudinfo.seqera.io")
.connectTimeout(Duration.ofSeconds(30))
.maxRetries(5)
.build();| Provider | ID |
|---|---|
| AWS | amazon |
| GCP | google |
| Azure | azure |
| Class | Description |
|---|---|
CloudRegion |
Region identifier and name |
CloudProduct |
Compute instance type with CPU, memory, GPU, pricing, machine family, and per-product capability features (lowercase tokens: ssd, gpu, arm, x86, burst, hibernation, sched, GPU vendor/model, …) |
CloudPrice |
Spot price for a specific zone |
CloudResponse |
API response wrapper containing products |
FamiliesResponse |
Response wrapper for the /families endpoint |
ProductAttributes |
Additional product attributes |
ProductsQuery |
Optional filters (features, families, plus legacy sched, nvme) for the products endpoint |
ErrorResponse |
Parsed API error body (error, validCapabilities) |
lib-httpx: HTTP client with retry supportlib-serde-jackson: JSON serialization/deserialization