Skip to content

Latest commit

 

History

History
126 lines (91 loc) · 3.64 KB

File metadata and controls

126 lines (91 loc) · 3.64 KB

StorageRegionsApi

All URIs are relative to https://api.cloudsmith.io

Method HTTP request Description
storageRegionsList GET /storage-regions/ Get a list of all available storage regions.
storageRegionsRead GET /storage-regions/{slug}/ Get a specific storage region.

storageRegionsList

List<StorageRegion> storageRegionsList()

Get a list of all available storage regions.

Get a list of all available storage regions.

Example

// Import classes:
//import io.cloudsmith.api.ApiClient;
//import io.cloudsmith.api.ApiException;
//import io.cloudsmith.api.Configuration;
//import io.cloudsmith.api.auth.*;
//import io.cloudsmith.api.apis.StorageRegionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

StorageRegionsApi apiInstance = new StorageRegionsApi();
try {
    List<StorageRegion> result = apiInstance.storageRegionsList();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling StorageRegionsApi#storageRegionsList");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

List<StorageRegion>

Authorization

apikey, basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

storageRegionsRead

StorageRegion storageRegionsRead(slug)

Get a specific storage region.

Get a specific storage region.

Example

// Import classes:
//import io.cloudsmith.api.ApiClient;
//import io.cloudsmith.api.ApiException;
//import io.cloudsmith.api.Configuration;
//import io.cloudsmith.api.auth.*;
//import io.cloudsmith.api.apis.StorageRegionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

StorageRegionsApi apiInstance = new StorageRegionsApi();
String slug = "slug_example"; // String | 
try {
    StorageRegion result = apiInstance.storageRegionsRead(slug);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling StorageRegionsApi#storageRegionsRead");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
slug String

Return type

StorageRegion

Authorization

apikey, basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json