Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR hanaonazure/resource-manager] Add new field 'proximityPlacementGroup' to properties of HanaInstance #2886

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public interface HanaInstance extends HasInner<HanaInstanceInner>, Resource, Gro
*/
HanaInstancePowerStateEnum powerState();

/**
* @return the proximityPlacementGroup value.
*/
String proximityPlacementGroup();

/**
* @return the storageProfile value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public HanaInstancePowerStateEnum powerState() {
return this.inner().powerState();
}

@Override
public String proximityPlacementGroup() {
return this.inner().proximityPlacementGroup();
}

@Override
public StorageProfile storageProfile() {
return this.inner().storageProfile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ public class HanaInstanceInner extends Resource {
@JsonProperty(value = "properties.powerState", access = JsonProperty.Access.WRITE_ONLY)
private HanaInstancePowerStateEnum powerState;

/**
* Resource proximity placement group.
*/
@JsonProperty(value = "properties.proximityPlacementGroup", access = JsonProperty.Access.WRITE_ONLY)
private String proximityPlacementGroup;

/**
* Get specifies the hardware settings for the HANA instance.
*
Expand Down Expand Up @@ -159,4 +165,13 @@ public HanaInstancePowerStateEnum powerState() {
return this.powerState;
}

/**
* Get resource proximity placement group.
*
* @return the proximityPlacementGroup value
*/
public String proximityPlacementGroup() {
return this.proximityPlacementGroup;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ interface HanaInstancesService {
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/restart")
Observable<Response<ResponseBody>> restart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hanaInstanceName") String hanaInstanceName, @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.hanaonazure.v2017_11_03_preview.HanaInstances beginRestart" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/restart")
Observable<Response<ResponseBody>> beginRestart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hanaInstanceName") String hanaInstanceName, @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.hanaonazure.v2017_11_03_preview.HanaInstances listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Expand Down Expand Up @@ -611,7 +615,7 @@ private ServiceResponse<HanaInstanceInner> updateDelegate(Response<ResponseBody>
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void restart(String resourceGroupName, String hanaInstanceName) {
restartWithServiceResponseAsync(resourceGroupName, hanaInstanceName).toBlocking().single().body();
restartWithServiceResponseAsync(resourceGroupName, hanaInstanceName).toBlocking().last().body();
}

/**
Expand All @@ -633,7 +637,7 @@ public ServiceFuture<Void> restartAsync(String resourceGroupName, String hanaIns
* @param resourceGroupName Name of the resource group.
* @param hanaInstanceName Name of the SAP HANA on Azure instance.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
* @return the observable for the request
*/
public Observable<Void> restartAsync(String resourceGroupName, String hanaInstanceName) {
return restartWithServiceResponseAsync(resourceGroupName, hanaInstanceName).map(new Func1<ServiceResponse<Void>, Void>() {
Expand All @@ -650,7 +654,7 @@ public Void call(ServiceResponse<Void> response) {
* @param resourceGroupName Name of the resource group.
* @param hanaInstanceName Name of the SAP HANA on Azure instance.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> restartWithServiceResponseAsync(String resourceGroupName, String hanaInstanceName) {
if (this.client.subscriptionId() == null) {
Expand All @@ -665,12 +669,80 @@ public Observable<ServiceResponse<Void>> restartWithServiceResponseAsync(String
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.restart(this.client.subscriptionId(), resourceGroupName, hanaInstanceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
Observable<Response<ResponseBody>> observable = service.restart(this.client.subscriptionId(), resourceGroupName, hanaInstanceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}

/**
* The operation to restart a SAP HANA instance.
*
* @param resourceGroupName Name of the resource group.
* @param hanaInstanceName Name of the SAP HANA on Azure instance.
* @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 beginRestart(String resourceGroupName, String hanaInstanceName) {
beginRestartWithServiceResponseAsync(resourceGroupName, hanaInstanceName).toBlocking().single().body();
}

/**
* The operation to restart a SAP HANA instance.
*
* @param resourceGroupName Name of the resource group.
* @param hanaInstanceName Name of the SAP HANA on Azure instance.
* @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> beginRestartAsync(String resourceGroupName, String hanaInstanceName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, hanaInstanceName), serviceCallback);
}

/**
* The operation to restart a SAP HANA instance.
*
* @param resourceGroupName Name of the resource group.
* @param hanaInstanceName Name of the SAP HANA on Azure instance.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginRestartAsync(String resourceGroupName, String hanaInstanceName) {
return beginRestartWithServiceResponseAsync(resourceGroupName, hanaInstanceName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}

/**
* The operation to restart a SAP HANA instance.
*
* @param resourceGroupName Name of the resource group.
* @param hanaInstanceName Name of the SAP HANA on Azure instance.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginRestartWithServiceResponseAsync(String resourceGroupName, String hanaInstanceName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (hanaInstanceName == null) {
throw new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.beginRestart(this.client.subscriptionId(), resourceGroupName, hanaInstanceName, this.client.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 = restartDelegate(response);
ServiceResponse<Void> clientResponse = beginRestartDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
Expand All @@ -679,8 +751,9 @@ public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
});
}

private ServiceResponse<Void> restartDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
private ServiceResponse<Void> beginRestartDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
Expand Down