Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

lib-cloudinfo

Java HTTP client for the Cloudinfo API, providing cloud provider information including regions and compute products with pricing.

Installation

Gradle

Add the dependency to your build.gradle:

dependencies {
    implementation 'io.seqera:lib-cloudinfo:1.1.2'
}

Note: Check the project's VERSION file for the current version number.

Features

  • Fetch cloud regions for AWS, GCP, and Azure
  • Fetch compute products (instance types) with on-demand and spot pricing
  • Built on lib-httpx with automatic retry and error handling
  • Type-safe JSON deserialization using lib-serde-jackson

Usage

Basic Usage

// 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");

Filtering Products

Pass a ProductsQuery to restrict the products endpoint to instance families with Scheduler support (sched=true) or NVMe local storage (nvme=true). Filters are applied server-side and can be combined; providers without filter config entries return all products unfiltered.

ProductsQuery query = ProductsQuery.builder()
    .sched(true)
    .nvme(true)
    .build();

List<CloudProduct> products = client.getProducts("amazon", "us-east-1", query);

Custom Configuration

CloudInfoClient client = CloudInfoClient.builder()
    .endpoint("https://cloudinfo.seqera.io")
    .connectTimeout(Duration.ofSeconds(30))
    .maxRetries(5)
    .build();

Supported Providers

Provider ID
AWS amazon
GCP google
Azure azure

Model Classes

Class Description
CloudRegion Region identifier and name
CloudProduct Compute instance type with CPU, memory, GPU, pricing, and per-product capability features (SCHED, NVME, GPU, family-type, etc.)
CloudPrice Spot price for a specific zone
CloudResponse API response wrapper containing products
ProductAttributes Additional product attributes
ProductsQuery Optional filters (sched, nvme) for the products endpoint

Dependencies

  • lib-httpx: HTTP client with retry support
  • lib-serde-jackson: JSON serialization/deserialization