use of com.microsoft.azure.batch.protocol.models.JobStatistics in project azure-sdk-for-java by Azure.
the class JobsImpl method getAllJobsLifetimeStatisticsAsync.
/**
* Gets lifetime summary statistics for all of the jobs in the specified account.
* Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last update time of the statistics.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/
public ServiceCall getAllJobsLifetimeStatisticsAsync(final ServiceCallback<JobStatistics> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
if (this.client.apiVersion() == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
return null;
}
final JobGetAllJobsLifetimeStatisticsOptions jobGetAllJobsLifetimeStatisticsOptions = null;
Integer timeout = null;
String clientRequestId = null;
Boolean returnClientRequestId = null;
DateTime ocpDate = null;
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.getAllJobsLifetimeStatistics(this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<JobStatistics>(serviceCallback) {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
serviceCallback.success(getAllJobsLifetimeStatisticsDelegate(response));
} catch (BatchErrorException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}
use of com.microsoft.azure.batch.protocol.models.JobStatistics in project azure-sdk-for-java by Azure.
the class JobsImpl method getAllJobsLifetimeStatisticsAsync.
/**
* Gets lifetime summary statistics for all of the jobs in the specified account.
* Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last update time of the statistics.
*
* @param jobGetAllJobsLifetimeStatisticsOptions Additional parameters for the operation
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/
public ServiceCall getAllJobsLifetimeStatisticsAsync(JobGetAllJobsLifetimeStatisticsOptions jobGetAllJobsLifetimeStatisticsOptions, final ServiceCallback<JobStatistics> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
if (this.client.apiVersion() == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
return null;
}
Validator.validate(jobGetAllJobsLifetimeStatisticsOptions, serviceCallback);
Integer timeout = null;
if (jobGetAllJobsLifetimeStatisticsOptions != null) {
timeout = jobGetAllJobsLifetimeStatisticsOptions.timeout();
}
String clientRequestId = null;
if (jobGetAllJobsLifetimeStatisticsOptions != null) {
clientRequestId = jobGetAllJobsLifetimeStatisticsOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (jobGetAllJobsLifetimeStatisticsOptions != null) {
returnClientRequestId = jobGetAllJobsLifetimeStatisticsOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (jobGetAllJobsLifetimeStatisticsOptions != null) {
ocpDate = jobGetAllJobsLifetimeStatisticsOptions.ocpDate();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.getAllJobsLifetimeStatistics(this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<JobStatistics>(serviceCallback) {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
serviceCallback.success(getAllJobsLifetimeStatisticsDelegate(response));
} catch (BatchErrorException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}
Aggregations