use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class FilesImpl method getNodeFilePropertiesFromComputeNodeAsync.
/**
* Gets the properties of the specified compute node file.
*
* @param poolId The id of the pool that contains the compute node.
* @param nodeId The id of the compute node that contains the file.
* @param fileName The path to the compute node file that you want to get the properties of.
* @param fileGetNodeFilePropertiesFromComputeNodeOptions 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 getNodeFilePropertiesFromComputeNodeAsync(String poolId, String nodeId, String fileName, FileGetNodeFilePropertiesFromComputeNodeOptions fileGetNodeFilePropertiesFromComputeNodeOptions, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
if (poolId == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter poolId is required and cannot be null."));
return null;
}
if (nodeId == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter nodeId is required and cannot be null."));
return null;
}
if (fileName == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter fileName is required and cannot be null."));
return null;
}
if (this.client.apiVersion() == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
return null;
}
Validator.validate(fileGetNodeFilePropertiesFromComputeNodeOptions, serviceCallback);
Integer timeout = null;
if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
timeout = fileGetNodeFilePropertiesFromComputeNodeOptions.timeout();
}
String clientRequestId = null;
if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
clientRequestId = fileGetNodeFilePropertiesFromComputeNodeOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
returnClientRequestId = fileGetNodeFilePropertiesFromComputeNodeOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
ocpDate = fileGetNodeFilePropertiesFromComputeNodeOptions.ocpDate();
}
DateTime ifModifiedSince = null;
if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
ifModifiedSince = fileGetNodeFilePropertiesFromComputeNodeOptions.ifModifiedSince();
}
DateTime ifUnmodifiedSince = null;
if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
ifUnmodifiedSince = fileGetNodeFilePropertiesFromComputeNodeOptions.ifUnmodifiedSince();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
DateTimeRfc1123 ifModifiedSinceConverted = null;
if (ifModifiedSince != null) {
ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince);
}
DateTimeRfc1123 ifUnmodifiedSinceConverted = null;
if (ifUnmodifiedSince != null) {
ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince);
}
Call<Void> call = service.getNodeFilePropertiesFromComputeNode(poolId, nodeId, fileName, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.userAgent());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseEmptyCallback<Void>(serviceCallback) {
@Override
public void onResponse(Call<Void> call, Response<Void> response) {
try {
serviceCallback.success(getNodeFilePropertiesFromComputeNodeDelegate(response));
} catch (BatchErrorException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}
use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class ComputeNodesImpl method deleteUser.
/**
* Deletes a user account from the specified compute node.
*
* @param poolId The id of the pool that contains the compute node.
* @param nodeId The id of the machine on which you want to delete a user account.
* @param userName The name of the user account to delete.
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the {@link ServiceResponseWithHeaders} object if successful.
*/
public ServiceResponseWithHeaders<Void, ComputeNodeDeleteUserHeaders> deleteUser(String poolId, String nodeId, String userName) throws BatchErrorException, IOException, IllegalArgumentException {
if (poolId == null) {
throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
}
if (nodeId == null) {
throw new IllegalArgumentException("Parameter nodeId is required and cannot be null.");
}
if (userName == null) {
throw new IllegalArgumentException("Parameter userName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = 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.deleteUser(poolId, nodeId, userName, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
return deleteUserDelegate(call.execute());
}
use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class FilesImpl method listFromComputeNodeNext.
/**
* Lists all of the files in task directories on the specified compute node.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the List<NodeFile> object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<PageImpl<NodeFile>, FileListFromComputeNodeHeaders> listFromComputeNodeNext(final String nextPageLink) throws BatchErrorException, IOException, IllegalArgumentException {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
final FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = null;
String clientRequestId = null;
Boolean returnClientRequestId = null;
DateTime ocpDate = null;
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.listFromComputeNodeNext(nextPageLink, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
return listFromComputeNodeNextDelegate(call.execute());
}
use of com.microsoft.rest.DateTimeRfc1123 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.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class PoolsImpl method add.
/**
* Adds a pool to the specified account.
*
* @param pool The pool to be added.
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the {@link ServiceResponseWithHeaders} object if successful.
*/
public ServiceResponseWithHeaders<Void, PoolAddHeaders> add(PoolAddParameter pool) throws BatchErrorException, IOException, IllegalArgumentException {
if (pool == null) {
throw new IllegalArgumentException("Parameter pool is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(pool);
final PoolAddOptions poolAddOptions = 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.add(pool, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
return addDelegate(call.execute());
}
Aggregations