Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.openshift.cloud.api.kas;
import com.openshift.cloud.api.kas.invoker.ApiException;
import com.openshift.cloud.api.kas.invoker.ApiClient;
import com.openshift.cloud.api.kas.invoker.Configuration;
import com.openshift.cloud.api.kas.invoker.Pair;
import javax.ws.rs.core.GenericType;
import com.openshift.cloud.api.kas.models.CloudProviderList;
import com.openshift.cloud.api.kas.models.CloudRegionList;
import com.openshift.cloud.api.kas.models.Error;
import com.openshift.cloud.api.kas.models.KafkaRequest;
import com.openshift.cloud.api.kas.models.KafkaRequestList;
import com.openshift.cloud.api.kas.models.KafkaRequestPayload;
import com.openshift.cloud.api.kas.models.KafkaUpdateRequest;
import com.openshift.cloud.api.kas.models.MetricsInstantQueryList;
import com.openshift.cloud.api.kas.models.MetricsRangeQueryList;
import com.openshift.cloud.api.kas.models.SupportedKafkaInstanceTypesList;
import com.openshift.cloud.api.kas.models.VersionMetadata;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class DefaultApi {
private ApiClient apiClient;
public DefaultApi() {
this(Configuration.getDefaultApiClient());
}
public DefaultApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
*
* Creates a Kafka request
* @param async Perform the action in an asynchronous manner (required)
* @param kafkaRequestPayload Kafka data (required)
* @return a {@code KafkaRequest}
* @throws ApiException if fails to make API call
*/
public KafkaRequest createKafka(Boolean async, KafkaRequestPayload kafkaRequestPayload) throws ApiException {
Object localVarPostBody = kafkaRequestPayload;
// verify the required parameter 'async' is set
if (async == null) {
throw new ApiException(400, "Missing the required parameter 'async' when calling createKafka");
}
// verify the required parameter 'kafkaRequestPayload' is set
if (kafkaRequestPayload == null) {
throw new ApiException(400, "Missing the required parameter 'kafkaRequestPayload' when calling createKafka");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "async", async));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Deletes a Kafka request by ID
* @param id The ID of record (required)
* @param async Perform the action in an asynchronous manner (required)
* @return a {@code Error}
* @throws ApiException if fails to make API call
*/
public Error deleteKafkaById(String id, Boolean async) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling deleteKafkaById");
}
// verify the required parameter 'async' is set
if (async == null) {
throw new ApiException(400, "Missing the required parameter 'async' when calling deleteKafkaById");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas/{id}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "async", async));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns all metrics in scrapeable format for a given kafka id
* @param id The ID of record (required)
* @return a {@code String}
* @throws ApiException if fails to make API call
*/
public String federateMetrics(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling federateMetrics");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas/{id}/metrics/federate".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"text/plain", "application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns the list of supported regions of the supported cloud provider
* @param id The ID of record (required)
* @param page Page index (optional)
* @param size Number of items in each page (optional)
* @return a {@code CloudRegionList}
* @throws ApiException if fails to make API call
*/
public CloudRegionList getCloudProviderRegions(String id, String page, String size) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getCloudProviderRegions");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/cloud_providers/{id}/regions".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns the list of supported cloud providers
* @param page Page index (optional)
* @param size Number of items in each page (optional)
* @return a {@code CloudProviderList}
* @throws ApiException if fails to make API call
*/
public CloudProviderList getCloudProviders(String page, String size) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/cloud_providers".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns the list of supported Kafka instance types and sizes filtered by cloud provider and region
* @param cloudProvider ID of the supported cloud provider (required)
* @param cloudRegion Name of the supported cloud provider region (required)
* @return a {@code SupportedKafkaInstanceTypesList}
* @throws ApiException if fails to make API call
*/
public SupportedKafkaInstanceTypesList getInstanceTypesByCloudProviderAndRegion(String cloudProvider, String cloudRegion) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'cloudProvider' is set
if (cloudProvider == null) {
throw new ApiException(400, "Missing the required parameter 'cloudProvider' when calling getInstanceTypesByCloudProviderAndRegion");
}
// verify the required parameter 'cloudRegion' is set
if (cloudRegion == null) {
throw new ApiException(400, "Missing the required parameter 'cloudRegion' when calling getInstanceTypesByCloudProviderAndRegion");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/instance_types/{cloud_provider}/{cloud_region}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "cloud_provider" + "\\}", apiClient.escapeString(cloudProvider.toString()))
.replaceAll("\\{" + "cloud_region" + "\\}", apiClient.escapeString(cloudRegion.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns a Kafka request by ID
* @param id The ID of record (required)
* @return a {@code KafkaRequest}
* @throws ApiException if fails to make API call
*/
public KafkaRequest getKafkaById(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getKafkaById");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas/{id}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns a list of Kafka requests
* @param page Page index (optional)
* @param size Number of items in each page (optional)
* @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the following `kafkaRequests` fields: * bootstrap_server_host * admin_api_server_url * cloud_provider * cluster_id * created_at * href * id * instance_type * multi_az * name * organisation_id * owner * reauthentication_enabled * region * status * updated_at * version For example, to return all Kafka instances ordered by their name, use the following syntax: ```sql name asc ``` To return all Kafka instances ordered by their name _and_ created date, use the following syntax: ```sql name asc, created_at asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional)
* @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of an SQL statement. Allowed fields in the search are `cloud_provider`, `name`, `owner`, `region`, and `status`. Allowed comparators are `<>`, `=`, `LIKE`, or `ILIKE`. Allowed joins are `AND` and `OR`. However, you can use a maximum of 10 joins in a search query. Examples: To return a Kafka instance with the name `my-kafka` and the region `aws`, use the following syntax: ``` name = my-kafka and cloud_provider = aws ```[p-] To return a Kafka instance with a name that starts with `my`, use the following syntax: ``` name like my%25 ``` To return a Kafka instance with a name containing `test` matching any character case combinations, use the following syntax: ``` name ilike %25test%25 ``` If the parameter isn't provided, or if the value is empty, then all the Kafka instances that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional)
* @return a {@code KafkaRequestList}
* @throws ApiException if fails to make API call
*/
public KafkaRequestList getKafkas(String page, String size, String orderBy, String search) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "orderBy", orderBy));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns metrics with instant query by Kafka ID
* @param id The ID of record (required)
* @param filters List of metrics to fetch. Fetch all metrics when empty. List entries are Kafka internal metric names. (optional, default to [])
* @return a {@code MetricsInstantQueryList}
* @throws ApiException if fails to make API call
*/
public MetricsInstantQueryList getMetricsByInstantQuery(String id, List filters) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getMetricsByInstantQuery");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas/{id}/metrics/query".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "filters", filters));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns metrics with timeseries range query by Kafka ID
* @param id The ID of record (required)
* @param duration The length of time in minutes for which to return the metrics (required)
* @param interval The interval in seconds between data points (required)
* @param filters List of metrics to fetch. Fetch all metrics when empty. List entries are Kafka internal metric names. (optional, default to [])
* @return a {@code MetricsRangeQueryList}
* @throws ApiException if fails to make API call
*/
public MetricsRangeQueryList getMetricsByRangeQuery(String id, Long duration, Long interval, List filters) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getMetricsByRangeQuery");
}
// verify the required parameter 'duration' is set
if (duration == null) {
throw new ApiException(400, "Missing the required parameter 'duration' when calling getMetricsByRangeQuery");
}
// verify the required parameter 'interval' is set
if (interval == null) {
throw new ApiException(400, "Missing the required parameter 'interval' when calling getMetricsByRangeQuery");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas/{id}/metrics/query_range".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "duration", duration));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "interval", interval));
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "filters", filters));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns the kafka Service Fleet Manager API version metadata
* @return a {@code VersionMetadata}
* @throws ApiException if fails to make API call
*/
public VersionMetadata getVersionMetadata() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Update a Kafka instance by id
* @param id The ID of record (required)
* @param kafkaUpdateRequest Update owner of kafka (required)
* @return a {@code KafkaRequest}
* @throws ApiException if fails to make API call
*/
public KafkaRequest updateKafkaById(String id, KafkaUpdateRequest kafkaUpdateRequest) throws ApiException {
Object localVarPostBody = kafkaUpdateRequest;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updateKafkaById");
}
// verify the required parameter 'kafkaUpdateRequest' is set
if (kafkaUpdateRequest == null) {
throw new ApiException(400, "Missing the required parameter 'kafkaUpdateRequest' when calling updateKafkaById");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/kafkas/{id}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "Bearer" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}