Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/compute/mgmt-v2020_06_01/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.3.2</version>
<relativePath>../../parents/azure-arm-parent/pom.xml</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-compute</artifactId>
<version>1.0.0-beta</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public interface VirtualMachine extends HasInner<VirtualMachineInner>, Indexable
/**
* The entirety of the VirtualMachine definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithLocation, DefinitionStages.WithCreate {
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithLocation, DefinitionStages.WithCreate {
}

/**
Expand All @@ -183,19 +183,19 @@ interface DefinitionStages {
/**
* The first stage of a VirtualMachine definition.
*/
interface Blank extends WithResourceGroup {
interface Blank extends WithLocation {
}

/**
* The stage of the virtualmachine definition allowing to specify Location.
*/
interface WithResourceGroup {
interface WithLocation {
/**
* Specifies resourceGroupName.
* @param resourceGroupName The name of the resource group
* @return the next definition stage
*/
WithLocation withExistingResourceGroup(String resourceGroupName);
WithLocation withExistingLocation(String resourceGroupName);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.microsoft.azure.management.compute.v2020_06_01.InstanceViewStatus;

class ProximityPlacementGroupImpl extends GroupableResourceCoreImpl<ProximityPlacementGroup, ProximityPlacementGroupInner, ProximityPlacementGroupImpl, ComputeManager> implements ProximityPlacementGroup, ProximityPlacementGroup.Definition, ProximityPlacementGroup.Update {
private Map<String, String> utags;
ProximityPlacementGroupImpl(String name, ProximityPlacementGroupInner inner, ComputeManager manager) {
super(name, inner, manager);
}
Expand All @@ -32,7 +33,7 @@ public Observable<ProximityPlacementGroup> createResourceAsync() {
@Override
public Observable<ProximityPlacementGroup> updateResourceAsync() {
ProximityPlacementGroupsInner client = this.manager().inner().proximityPlacementGroups();
return client.updateAsync(this.resourceGroupName(), this.name(), this.tags())
return client.updateAsync(this.resourceGroupName(), this.name(), this.utags)
.map(innerToFluentMap(this));
}

Expand Down Expand Up @@ -84,4 +85,11 @@ public ProximityPlacementGroupImpl withProximityPlacementGroupType(ProximityPlac
this.inner().withProximityPlacementGroupType(proximityPlacementGroupType);
return this;
}

@Override
public ProximityPlacementGroupImpl withTags(Map<String, String> tags) {
this.utags = tags;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public List<String> zones() {
}

@Override
public VirtualMachineImpl withExistingResourceGroup(String resourceGroupName) {
public VirtualMachineImpl withExistingLocation(String resourceGroupName) {
this.resourceGroupName = resourceGroupName;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ interface VirtualMachinesService {

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachines delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletion") Boolean forceDeletion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachines beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletion") Boolean forceDeletion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachines getByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}")
Expand Down Expand Up @@ -922,7 +922,77 @@ public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String r
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-06-01";
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
final Boolean forceDeletion = null;
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void delete(String resourceGroupName, String vmName, Boolean forceDeletion) {
deleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).toBlocking().last().body();
}

/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<Void> deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion), serviceCallback);
}

/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion) {
return deleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}

/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String vmName, Boolean forceDeletion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (vmName == null) {
throw new IllegalArgumentException("Parameter vmName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-06-01";
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}

Expand Down Expand Up @@ -988,7 +1058,88 @@ public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(Str
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-06-01";
return service.beginDelete(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
final Boolean forceDeletion = null;
return service.beginDelete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void beginDelete(String resourceGroupName, String vmName, Boolean forceDeletion) {
beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).toBlocking().single().body();
}

/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<Void> beginDeleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion), serviceCallback);
}

/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}

/**
* The operation to delete a virtual machine.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
* @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName, Boolean forceDeletion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (vmName == null) {
throw new IllegalArgumentException("Parameter vmName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-06-01";
return service.beginDelete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
Expand Down