use of com.microsoft.azure.management.compute.VirtualMachineScaleSetVMInstanceIDs in project azure-sdk-for-java by Azure.
the class VirtualMachineScaleSetsInner method deallocateWithServiceResponseAsync.
/**
* Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.
*
* @param resourceGroupName The name of the resource group.
* @param vmScaleSetName The name of the VM scale set.
* @param instanceIds The virtual machine scale set instance ids.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<OperationStatusResponseInner>> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (vmScaleSetName == null) {
throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
Validator.validate(instanceIds);
final String apiVersion = "2016-04-30-preview";
VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null;
if (instanceIds != null) {
vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs();
vmInstanceIDs.withInstanceIds(instanceIds);
}
Observable<Response<ResponseBody>> observable = service.deallocate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<OperationStatusResponseInner>() {
}.getType());
}
Aggregations