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.seeq.api;
import com.seeq.ApiException;
import com.seeq.ApiClient;
import com.seeq.Configuration;
import com.seeq.model.*;
import com.seeq.Pair;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.ProcessingException;
import com.seeq.model.ConnectionsOutputV1;
import com.seeq.model.DatasourceCleanUpInputV1;
import com.seeq.model.DatasourceCleanUpOutputV1;
import com.seeq.model.DatasourceInputV1;
import com.seeq.model.DatasourceOutputListV1;
import com.seeq.model.DatasourceOutputV1;
import com.seeq.model.DatasourceStatusOutputV1;
import com.seeq.model.ItemPreviewListV1;
import com.seeq.model.JobAcceptedOutputV1;
import com.seeq.model.StatusMessageBase;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DatasourcesApi {
private ApiClient apiClient;
private long retryTimeout = 5_000; // Default of 5 seconds
public DatasourcesApi() {
this(Configuration.getDefaultApiClient());
}
public DatasourcesApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public void setRetryTimeout(long retryTimeout) {
this.retryTimeout = retryTimeout;
}
public long getRetryTimeout() {
return this.retryTimeout;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Archive a datasource
*
* @param id ID of the datasource to delete (required)
* @return StatusMessageBase
* @throws ApiException if fails to make API call
*/
public StatusMessageBase archiveDatasource(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = archiveDatasourceWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Archive a datasource
*
* @param id ID of the datasource to delete (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse archiveDatasourceWithHttpInfo(String id) throws ApiException {
Map localVarHeaderParams = new HashMap();
return archiveDatasourceWithHeadersAndHttpInfo(id, localVarHeaderParams);
}
/**
* Archive a datasource
*
* @param id ID of the datasource to delete (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse archiveDatasourceWithHeadersAndHttpInfo(String id, Map customHeaders) 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 archiveDatasource");
}
// create path and map variables
String localVarPath = "/datasources/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Archive stale hosted items
*
* @param id ID of the datasource to clean up (required)
* @param body Input parameters for the Datasource clean-up process (required)
* @return DatasourceCleanUpOutputV1
* @throws ApiException if fails to make API call
*/
public DatasourceCleanUpOutputV1 cleanUp(String id, DatasourceCleanUpInputV1 body) throws ApiException {
ApiClient.ApiResponse localVarResponse = cleanUpWithHttpInfo(id, body);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Archive stale hosted items
*
* @param id ID of the datasource to clean up (required)
* @param body Input parameters for the Datasource clean-up process (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse cleanUpWithHttpInfo(String id, DatasourceCleanUpInputV1 body) throws ApiException {
Map localVarHeaderParams = new HashMap();
return cleanUpWithHeadersAndHttpInfo(id, body, localVarHeaderParams);
}
/**
* Archive stale hosted items
*
* @param id ID of the datasource to clean up (required)
* @param body Input parameters for the Datasource clean-up process (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse cleanUpWithHeadersAndHttpInfo(String id, DatasourceCleanUpInputV1 body, Map customHeaders) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling cleanUp");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling cleanUp");
}
// create path and map variables
String localVarPath = "/datasources/{id}/cleanup"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Create a datasource
*
* @param body Datasource information (required)
* @return DatasourceOutputV1
* @throws ApiException if fails to make API call
*/
public DatasourceOutputV1 createDatasource(DatasourceInputV1 body) throws ApiException {
ApiClient.ApiResponse localVarResponse = createDatasourceWithHttpInfo(body);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Create a datasource
*
* @param body Datasource information (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse createDatasourceWithHttpInfo(DatasourceInputV1 body) throws ApiException {
Map localVarHeaderParams = new HashMap();
return createDatasourceWithHeadersAndHttpInfo(body, localVarHeaderParams);
}
/**
* Create a datasource
*
* @param body Datasource information (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse createDatasourceWithHeadersAndHttpInfo(DatasourceInputV1 body, Map customHeaders) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling createDatasource");
}
// create path and map variables
String localVarPath = "/datasources";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Disable all connections associated with a datasource
*
* @param id ID of the datasource (required)
* @return ConnectionsOutputV1
* @throws ApiException if fails to make API call
*/
public ConnectionsOutputV1 disableConnections(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = disableConnectionsWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Disable all connections associated with a datasource
*
* @param id ID of the datasource (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse disableConnectionsWithHttpInfo(String id) throws ApiException {
Map localVarHeaderParams = new HashMap();
return disableConnectionsWithHeadersAndHttpInfo(id, localVarHeaderParams);
}
/**
* Disable all connections associated with a datasource
*
* @param id ID of the datasource (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse disableConnectionsWithHeadersAndHttpInfo(String id, Map customHeaders) 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 disableConnections");
}
// create path and map variables
String localVarPath = "/datasources/{id}/disable-connections"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Archive a datasource and all items hosted by the datasource
*
* @param id ID of the datasource to archive (required)
* @return JobAcceptedOutputV1
* @throws ApiException if fails to make API call
*/
public JobAcceptedOutputV1 fullyArchiveDatasource(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = fullyArchiveDatasourceWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Archive a datasource and all items hosted by the datasource
*
* @param id ID of the datasource to archive (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse fullyArchiveDatasourceWithHttpInfo(String id) throws ApiException {
Map localVarHeaderParams = new HashMap();
return fullyArchiveDatasourceWithHeadersAndHttpInfo(id, localVarHeaderParams);
}
/**
* Archive a datasource and all items hosted by the datasource
*
* @param id ID of the datasource to archive (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse fullyArchiveDatasourceWithHeadersAndHttpInfo(String id, Map customHeaders) 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 fullyArchiveDatasource");
}
// create path and map variables
String localVarPath = "/datasources/{id}/archive"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get a Datasource
*
* @param id ID of the datasource to retrieve (required)
* @return DatasourceOutputV1
* @throws ApiException if fails to make API call
*/
public DatasourceOutputV1 getDatasource(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = getDatasourceWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a Datasource
*
* @param id ID of the datasource to retrieve (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getDatasourceWithHttpInfo(String id) throws ApiException {
Map localVarHeaderParams = new HashMap();
return getDatasourceWithHeadersAndHttpInfo(id, localVarHeaderParams);
}
/**
* Get a Datasource
*
* @param id ID of the datasource to retrieve (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getDatasourceWithHeadersAndHttpInfo(String id, Map customHeaders) 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 getDatasource");
}
// create path and map variables
String localVarPath = "/datasources/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get a collection of datasources
*
* @param datasourceClass The datasource class, the name of the underlying source, 'CSV File' for example, not specifying this parameter will return datasources of any class (optional)
* @param datasourceId The datasource ID, an identifier that distinguishes a datasource from others of the same datasource class, 'timeseries/salt' for example, not specifying this parameter will return datasources of any ID (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param includeArchived Whether archived datasources should be included (optional, default to false)
* @return DatasourceOutputListV1
* @throws ApiException if fails to make API call
*/
public DatasourceOutputListV1 getDatasources(String datasourceClass, String datasourceId, Integer offset, Integer limit, Boolean includeArchived) throws ApiException {
ApiClient.ApiResponse localVarResponse = getDatasourcesWithHttpInfo(datasourceClass, datasourceId, offset, limit, includeArchived);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a collection of datasources
*
* @param datasourceClass The datasource class, the name of the underlying source, 'CSV File' for example, not specifying this parameter will return datasources of any class (optional)
* @param datasourceId The datasource ID, an identifier that distinguishes a datasource from others of the same datasource class, 'timeseries/salt' for example, not specifying this parameter will return datasources of any ID (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param includeArchived Whether archived datasources should be included (optional, default to false)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getDatasourcesWithHttpInfo(String datasourceClass, String datasourceId, Integer offset, Integer limit, Boolean includeArchived) throws ApiException {
Map localVarHeaderParams = new HashMap();
return getDatasourcesWithHeadersAndHttpInfo(datasourceClass, datasourceId, offset, limit, includeArchived, localVarHeaderParams);
}
/**
* Get a collection of datasources
*
* @param datasourceClass The datasource class, the name of the underlying source, 'CSV File' for example, not specifying this parameter will return datasources of any class (optional)
* @param datasourceId The datasource ID, an identifier that distinguishes a datasource from others of the same datasource class, 'timeseries/salt' for example, not specifying this parameter will return datasources of any ID (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param includeArchived Whether archived datasources should be included (optional, default to false)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getDatasourcesWithHeadersAndHttpInfo(String datasourceClass, String datasourceId, Integer offset, Integer limit, Boolean includeArchived, Map customHeaders) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/datasources";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "datasourceClass", datasourceClass));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "datasourceId", datasourceId));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "includeArchived", includeArchived));
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get a list of the items hosted by this datasource
*
* @param id ID of the datasource (required)
* @param dataId The dataId for a specific hosted item (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @return ItemPreviewListV1
* @throws ApiException if fails to make API call
*/
public ItemPreviewListV1 getItemsHostedByDatasource(String id, String dataId, Integer offset, Integer limit) throws ApiException {
ApiClient.ApiResponse localVarResponse = getItemsHostedByDatasourceWithHttpInfo(id, dataId, offset, limit);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a list of the items hosted by this datasource
*
* @param id ID of the datasource (required)
* @param dataId The dataId for a specific hosted item (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getItemsHostedByDatasourceWithHttpInfo(String id, String dataId, Integer offset, Integer limit) throws ApiException {
Map localVarHeaderParams = new HashMap();
return getItemsHostedByDatasourceWithHeadersAndHttpInfo(id, dataId, offset, limit, localVarHeaderParams);
}
/**
* Get a list of the items hosted by this datasource
*
* @param id ID of the datasource (required)
* @param dataId The dataId for a specific hosted item (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getItemsHostedByDatasourceWithHeadersAndHttpInfo(String id, String dataId, Integer offset, Integer limit, Map customHeaders) 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 getItemsHostedByDatasource");
}
// create path and map variables
String localVarPath = "/datasources/{id}/items"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "dataId", dataId));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get statistics describing the health of remote datasources
*
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @return DatasourceStatusOutputV1
* @throws ApiException if fails to make API call
*/
public DatasourceStatusOutputV1 getStatus(Integer offset, Integer limit) throws ApiException {
ApiClient.ApiResponse localVarResponse = getStatusWithHttpInfo(offset, limit);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get statistics describing the health of remote datasources
*
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getStatusWithHttpInfo(Integer offset, Integer limit) throws ApiException {
Map localVarHeaderParams = new HashMap();
return getStatusWithHeadersAndHttpInfo(offset, limit, localVarHeaderParams);
}
/**
* Get statistics describing the health of remote datasources
*
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getStatusWithHeadersAndHttpInfo(Integer offset, Integer limit, Map customHeaders) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/datasources/status";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Recount item totals for a datasource. Do not run while datasource is indexing
*
* @param id ID of the datasource to recount (required)
* @return DatasourceOutputV1
* @throws ApiException if fails to make API call
*/
public DatasourceOutputV1 recount(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = recountWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Recount item totals for a datasource. Do not run while datasource is indexing
*
* @param id ID of the datasource to recount (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse recountWithHttpInfo(String id) throws ApiException {
Map localVarHeaderParams = new HashMap();
return recountWithHeadersAndHttpInfo(id, localVarHeaderParams);
}
/**
* Recount item totals for a datasource. Do not run while datasource is indexing
*
* @param id ID of the datasource to recount (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse recountWithHeadersAndHttpInfo(String id, Map customHeaders) 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 recount");
}
// create path and map variables
String localVarPath = "/datasources/{id}/recount"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
localVarHeaderParams.putAll(customHeaders);
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
}