Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
Code generated by Microsoft (R) AutoRest Code Generator.
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.resources.implementation;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.AzureServiceFuture;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.ListOperationCallback;
import com.microsoft.azure.management.resources.ExportTemplateRequest;
import com.microsoft.azure.management.resources.ResourceGroupPatchable;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HEAD;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.HTTP;
import retrofit2.http.PATCH;
import retrofit2.http.Path;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;
import retrofit2.http.Url;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;
import com.microsoft.azure.LongRunningFinalState;
import com.microsoft.azure.LongRunningOperationOptions;
An instance of this class provides access to all the operations defined
in ResourceGroups.
/**
* An instance of this class provides access to all the operations defined
* in ResourceGroups.
*/
public class ResourceGroupsInner {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private ResourceGroupsService service;
The service client containing this operation class. /** The service client containing this operation class. */
private ResourceManagementClientImpl client;
Initializes an instance of ResourceGroupsInner.
Params: - retrofit – the Retrofit instance built from a Retrofit Builder.
- client – the instance of the service client containing this operation class.
/**
* Initializes an instance of ResourceGroupsInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public ResourceGroupsInner(Retrofit retrofit, ResourceManagementClientImpl client) {
this.service = retrofit.create(ResourceGroupsService.class);
this.client = client;
}
The interface defining all the services for ResourceGroups to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for ResourceGroups to be
* used by Retrofit to perform actually REST calls.
*/
interface ResourceGroupsService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.ResourceGroups checkExistence" })
@HEAD("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
Observable<Response<Void>> checkExistence(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @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.resources.ResourceGroups createOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
Observable<Response<ResponseBody>> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourceGroupInner parameters, @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.resources.ResourceGroups delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletionResourceTypes") String forceDeletionResourceTypes, @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.resources.ResourceGroups beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletionResourceTypes") String forceDeletionResourceTypes, @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.resources.ResourceGroups get" })
@GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
Observable<Response<ResponseBody>> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @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.resources.ResourceGroups update" })
@PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
Observable<Response<ResponseBody>> update(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourceGroupPatchable parameters, @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.resources.ResourceGroups exportTemplate" })
@POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate")
Observable<Response<ResponseBody>> exportTemplate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Body ExportTemplateRequest parameters, @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.resources.ResourceGroups beginExportTemplate" })
@POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate")
Observable<Response<ResponseBody>> beginExportTemplate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Body ExportTemplateRequest parameters, @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.resources.ResourceGroups list" })
@GET("subscriptions/{subscriptionId}/resourcegroups")
Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @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.resources.ResourceGroups listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Checks whether a resource group exists.
Params: - resourceGroupName – The name of the resource group to check. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the boolean object if successful.
/**
* Checks whether a resource group exists.
*
* @param resourceGroupName The name of the resource group to check. The name is case insensitive.
* @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
* @return the boolean object if successful.
*/
public boolean checkExistence(String resourceGroupName) {
return checkExistenceWithServiceResponseAsync(resourceGroupName).toBlocking().single().body();
}
Checks whether a resource group exists.
Params: - resourceGroupName – The name of the resource group to check. The name is case insensitive.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Checks whether a resource group exists.
*
* @param resourceGroupName The name of the resource group to check. The name is case insensitive.
* @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<Boolean> checkExistenceAsync(String resourceGroupName, final ServiceCallback<Boolean> serviceCallback) {
return ServiceFuture.fromResponse(checkExistenceWithServiceResponseAsync(resourceGroupName), serviceCallback);
}
Checks whether a resource group exists.
Params: - resourceGroupName – The name of the resource group to check. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the Boolean object
/**
* Checks whether a resource group exists.
*
* @param resourceGroupName The name of the resource group to check. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Boolean object
*/
public Observable<Boolean> checkExistenceAsync(String resourceGroupName) {
return checkExistenceWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<Boolean>, Boolean>() {
@Override
public Boolean call(ServiceResponse<Boolean> response) {
return response.body();
}
});
}
Checks whether a resource group exists.
Params: - resourceGroupName – The name of the resource group to check. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the Boolean object
/**
* Checks whether a resource group exists.
*
* @param resourceGroupName The name of the resource group to check. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Boolean object
*/
public Observable<ServiceResponse<Boolean>> checkExistenceWithServiceResponseAsync(String resourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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.checkExistence(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<Void>, Observable<ServiceResponse<Boolean>>>() {
@Override
public Observable<ServiceResponse<Boolean>> call(Response<Void> response) {
try {
ServiceResponse<Boolean> clientResponse = checkExistenceDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Boolean> checkExistenceDelegate(Response<Void> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Boolean, CloudException>newInstance(this.client.serializerAdapter())
.register(204, new TypeToken<Void>() { }.getType())
.register(404, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.buildEmpty(response);
}
Creates or updates a resource group.
Params: - resourceGroupName – The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
- parameters – Parameters supplied to the create or update a resource group.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceGroupInner object if successful.
/**
* Creates or updates a resource group.
*
* @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
* @param parameters Parameters supplied to the create or update a resource group.
* @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
* @return the ResourceGroupInner object if successful.
*/
public ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroupInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().body();
}
Creates or updates a resource group.
Params: - resourceGroupName – The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
- parameters – Parameters supplied to the create or update a resource group.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates or updates a resource group.
*
* @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
* @param parameters Parameters supplied to the create or update a resource group.
* @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<ResourceGroupInner> createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters, final ServiceCallback<ResourceGroupInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback);
}
Creates or updates a resource group.
Params: - resourceGroupName – The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
- parameters – Parameters supplied to the create or update a resource group.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupInner object
/**
* Creates or updates a resource group.
*
* @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
* @param parameters Parameters supplied to the create or update a resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupInner object
*/
public Observable<ResourceGroupInner> createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1<ServiceResponse<ResourceGroupInner>, ResourceGroupInner>() {
@Override
public ResourceGroupInner call(ServiceResponse<ResourceGroupInner> response) {
return response.body();
}
});
}
Creates or updates a resource group.
Params: - resourceGroupName – The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
- parameters – Parameters supplied to the create or update a resource group.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupInner object
/**
* Creates or updates a resource group.
*
* @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
* @param parameters Parameters supplied to the create or update a resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupInner object
*/
public Observable<ServiceResponse<ResourceGroupInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, ResourceGroupInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters 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(parameters);
return service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceGroupInner>>>() {
@Override
public Observable<ServiceResponse<ResourceGroupInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceGroupInner> clientResponse = createOrUpdateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ResourceGroupInner> createOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ResourceGroupInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ResourceGroupInner>() { }.getType())
.register(201, new TypeToken<ResourceGroupInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @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) {
deleteWithServiceResponseAsync(resourceGroupName).toBlocking().last().body();
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @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, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName), serviceCallback);
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteAsync(String resourceGroupName) {
return deleteWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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 String forceDeletionResourceTypes = null;
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, this.client.subscriptionId(), forceDeletionResourceTypes, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @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 forceDeletionResourceTypes) {
deleteWithServiceResponseAsync(resourceGroupName, forceDeletionResourceTypes).toBlocking().last().body();
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @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 forceDeletionResourceTypes, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, forceDeletionResourceTypes), serviceCallback);
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteAsync(String resourceGroupName, String forceDeletionResourceTypes) {
return deleteWithServiceResponseAsync(resourceGroupName, forceDeletionResourceTypes).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String forceDeletionResourceTypes) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, this.client.subscriptionId(), forceDeletionResourceTypes, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @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) {
beginDeleteWithServiceResponseAsync(resourceGroupName).toBlocking().single().body();
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @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, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName), serviceCallback);
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteAsync(String resourceGroupName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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 String forceDeletionResourceTypes = null;
return service.beginDelete(resourceGroupName, this.client.subscriptionId(), forceDeletionResourceTypes, 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 = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @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 forceDeletionResourceTypes) {
beginDeleteWithServiceResponseAsync(resourceGroupName, forceDeletionResourceTypes).toBlocking().single().body();
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @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 forceDeletionResourceTypes, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, forceDeletionResourceTypes), serviceCallback);
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteAsync(String resourceGroupName, String forceDeletionResourceTypes) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, forceDeletionResourceTypes).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
Params: - resourceGroupName – The name of the resource group to delete. The name is case insensitive.
- forceDeletionResourceTypes – The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource group.
* When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations.
*
* @param resourceGroupName The name of the resource group to delete. The name is case insensitive.
* @param forceDeletionResourceTypes The resource types you want to force delete. Currently, only the following is supported: forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String forceDeletionResourceTypes) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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.beginDelete(resourceGroupName, this.client.subscriptionId(), forceDeletionResourceTypes, 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 = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> beginDeleteDelegate(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);
}
Gets a resource group.
Params: - resourceGroupName – The name of the resource group to get. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceGroupInner object if successful.
/**
* Gets a resource group.
*
* @param resourceGroupName The name of the resource group to get. The name is case insensitive.
* @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
* @return the ResourceGroupInner object if successful.
*/
public ResourceGroupInner get(String resourceGroupName) {
return getWithServiceResponseAsync(resourceGroupName).toBlocking().single().body();
}
Gets a resource group.
Params: - resourceGroupName – The name of the resource group to get. The name is case insensitive.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a resource group.
*
* @param resourceGroupName The name of the resource group to get. The name is case insensitive.
* @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<ResourceGroupInner> getAsync(String resourceGroupName, final ServiceCallback<ResourceGroupInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName), serviceCallback);
}
Gets a resource group.
Params: - resourceGroupName – The name of the resource group to get. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupInner object
/**
* Gets a resource group.
*
* @param resourceGroupName The name of the resource group to get. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupInner object
*/
public Observable<ResourceGroupInner> getAsync(String resourceGroupName) {
return getWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<ResourceGroupInner>, ResourceGroupInner>() {
@Override
public ResourceGroupInner call(ServiceResponse<ResourceGroupInner> response) {
return response.body();
}
});
}
Gets a resource group.
Params: - resourceGroupName – The name of the resource group to get. The name is case insensitive.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupInner object
/**
* Gets a resource group.
*
* @param resourceGroupName The name of the resource group to get. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupInner object
*/
public Observable<ServiceResponse<ResourceGroupInner>> getWithServiceResponseAsync(String resourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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.get(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceGroupInner>>>() {
@Override
public Observable<ServiceResponse<ResourceGroupInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceGroupInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ResourceGroupInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ResourceGroupInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ResourceGroupInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Updates a resource group.
Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
Params: - resourceGroupName – The name of the resource group to update. The name is case insensitive.
- parameters – Parameters supplied to update a resource group.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceGroupInner object if successful.
/**
* Updates a resource group.
* Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
*
* @param resourceGroupName The name of the resource group to update. The name is case insensitive.
* @param parameters Parameters supplied to update a resource group.
* @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
* @return the ResourceGroupInner object if successful.
*/
public ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters) {
return updateWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().body();
}
Updates a resource group.
Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
Params: - resourceGroupName – The name of the resource group to update. The name is case insensitive.
- parameters – Parameters supplied to update a resource group.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Updates a resource group.
* Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
*
* @param resourceGroupName The name of the resource group to update. The name is case insensitive.
* @param parameters Parameters supplied to update a resource group.
* @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<ResourceGroupInner> updateAsync(String resourceGroupName, ResourceGroupPatchable parameters, final ServiceCallback<ResourceGroupInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback);
}
Updates a resource group.
Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
Params: - resourceGroupName – The name of the resource group to update. The name is case insensitive.
- parameters – Parameters supplied to update a resource group.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupInner object
/**
* Updates a resource group.
* Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
*
* @param resourceGroupName The name of the resource group to update. The name is case insensitive.
* @param parameters Parameters supplied to update a resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupInner object
*/
public Observable<ResourceGroupInner> updateAsync(String resourceGroupName, ResourceGroupPatchable parameters) {
return updateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1<ServiceResponse<ResourceGroupInner>, ResourceGroupInner>() {
@Override
public ResourceGroupInner call(ServiceResponse<ResourceGroupInner> response) {
return response.body();
}
});
}
Updates a resource group.
Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
Params: - resourceGroupName – The name of the resource group to update. The name is case insensitive.
- parameters – Parameters supplied to update a resource group.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupInner object
/**
* Updates a resource group.
* Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
*
* @param resourceGroupName The name of the resource group to update. The name is case insensitive.
* @param parameters Parameters supplied to update a resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupInner object
*/
public Observable<ServiceResponse<ResourceGroupInner>> updateWithServiceResponseAsync(String resourceGroupName, ResourceGroupPatchable parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters 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(parameters);
return service.update(resourceGroupName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceGroupInner>>>() {
@Override
public Observable<ServiceResponse<ResourceGroupInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceGroupInner> clientResponse = updateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ResourceGroupInner> updateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ResourceGroupInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ResourceGroupInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceGroupExportResultInner object if successful.
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @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
* @return the ResourceGroupExportResultInner object if successful.
*/
public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequest parameters) {
return exportTemplateWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().last().body();
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @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<ResourceGroupExportResultInner> exportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters, final ServiceCallback<ResourceGroupExportResultInner> serviceCallback) {
return ServiceFuture.fromResponse(exportTemplateWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback);
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ResourceGroupExportResultInner> exportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters) {
return exportTemplateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1<ServiceResponse<ResourceGroupExportResultInner>, ResourceGroupExportResultInner>() {
@Override
public ResourceGroupExportResultInner call(ServiceResponse<ResourceGroupExportResultInner> response) {
return response.body();
}
});
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<ResourceGroupExportResultInner>> exportTemplateWithServiceResponseAsync(String resourceGroupName, ExportTemplateRequest parameters) {
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 (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
Observable<Response<ResponseBody>> observable = service.exportTemplate(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken<ResourceGroupExportResultInner>() { }.getType());
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceGroupExportResultInner object if successful.
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @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
* @return the ResourceGroupExportResultInner object if successful.
*/
public ResourceGroupExportResultInner beginExportTemplate(String resourceGroupName, ExportTemplateRequest parameters) {
return beginExportTemplateWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().body();
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @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<ResourceGroupExportResultInner> beginExportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters, final ServiceCallback<ResourceGroupExportResultInner> serviceCallback) {
return ServiceFuture.fromResponse(beginExportTemplateWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback);
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupExportResultInner object
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupExportResultInner object
*/
public Observable<ResourceGroupExportResultInner> beginExportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters) {
return beginExportTemplateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1<ServiceResponse<ResourceGroupExportResultInner>, ResourceGroupExportResultInner>() {
@Override
public ResourceGroupExportResultInner call(ServiceResponse<ResourceGroupExportResultInner> response) {
return response.body();
}
});
}
Captures the specified resource group as a template.
Params: - resourceGroupName – The name of the resource group. The name is case insensitive.
- parameters – Parameters for exporting the template.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceGroupExportResultInner object
/**
* Captures the specified resource group as a template.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param parameters Parameters for exporting the template.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceGroupExportResultInner object
*/
public Observable<ServiceResponse<ResourceGroupExportResultInner>> beginExportTemplateWithServiceResponseAsync(String resourceGroupName, ExportTemplateRequest parameters) {
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 (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
return service.beginExportTemplate(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceGroupExportResultInner>>>() {
@Override
public Observable<ServiceResponse<ResourceGroupExportResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceGroupExportResultInner> clientResponse = beginExportTemplateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ResourceGroupExportResultInner> beginExportTemplateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ResourceGroupExportResultInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ResourceGroupExportResultInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets all the resource groups for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ResourceGroupInner> object if successful.
/**
* Gets all the resource groups for a subscription.
*
* @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
* @return the PagedList<ResourceGroupInner> object if successful.
*/
public PagedList<ResourceGroupInner> list() {
ServiceResponse<Page<ResourceGroupInner>> response = listSinglePageAsync().toBlocking().single();
return new PagedList<ResourceGroupInner>(response.body()) {
@Override
public Page<ResourceGroupInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the resource groups for a subscription.
Params: - serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all the resource groups for a subscription.
*
* @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<List<ResourceGroupInner>> listAsync(final ListOperationCallback<ResourceGroupInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(),
new Func1<String, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the resource groups for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ResourceGroupInner> object
/**
* Gets all the resource groups for a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ResourceGroupInner> object
*/
public Observable<Page<ResourceGroupInner>> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Page<ResourceGroupInner>>() {
@Override
public Page<ResourceGroupInner> call(ServiceResponse<Page<ResourceGroupInner>> response) {
return response.body();
}
});
}
Gets all the resource groups for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ResourceGroupInner> object
/**
* Gets all the resource groups for a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ResourceGroupInner> object
*/
public Observable<ServiceResponse<Page<ResourceGroupInner>>> listWithServiceResponseAsync() {
return listSinglePageAsync()
.concatMap(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(ServiceResponse<Page<ResourceGroupInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all the resource groups for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ResourceGroupInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the resource groups for a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ResourceGroupInner>>> listSinglePageAsync() {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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 String filter = null;
final Integer top = null;
return service.list(this.client.subscriptionId(), filter, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ResourceGroupInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<ResourceGroupInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Gets all the resource groups for a subscription.
Params: - filter – The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
- top – The number of results to return. If null is passed, returns all resource groups.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ResourceGroupInner> object if successful.
/**
* Gets all the resource groups for a subscription.
*
* @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
* @param top The number of results to return. If null is passed, returns all resource groups.
* @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
* @return the PagedList<ResourceGroupInner> object if successful.
*/
public PagedList<ResourceGroupInner> list(final String filter, final Integer top) {
ServiceResponse<Page<ResourceGroupInner>> response = listSinglePageAsync(filter, top).toBlocking().single();
return new PagedList<ResourceGroupInner>(response.body()) {
@Override
public Page<ResourceGroupInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the resource groups for a subscription.
Params: - filter – The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
- top – The number of results to return. If null is passed, returns all resource groups.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all the resource groups for a subscription.
*
* @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
* @param top The number of results to return. If null is passed, returns all resource groups.
* @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<List<ResourceGroupInner>> listAsync(final String filter, final Integer top, final ListOperationCallback<ResourceGroupInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(filter, top),
new Func1<String, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the resource groups for a subscription.
Params: - filter – The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
- top – The number of results to return. If null is passed, returns all resource groups.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ResourceGroupInner> object
/**
* Gets all the resource groups for a subscription.
*
* @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
* @param top The number of results to return. If null is passed, returns all resource groups.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ResourceGroupInner> object
*/
public Observable<Page<ResourceGroupInner>> listAsync(final String filter, final Integer top) {
return listWithServiceResponseAsync(filter, top)
.map(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Page<ResourceGroupInner>>() {
@Override
public Page<ResourceGroupInner> call(ServiceResponse<Page<ResourceGroupInner>> response) {
return response.body();
}
});
}
Gets all the resource groups for a subscription.
Params: - filter – The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
- top – The number of results to return. If null is passed, returns all resource groups.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ResourceGroupInner> object
/**
* Gets all the resource groups for a subscription.
*
* @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
* @param top The number of results to return. If null is passed, returns all resource groups.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ResourceGroupInner> object
*/
public Observable<ServiceResponse<Page<ResourceGroupInner>>> listWithServiceResponseAsync(final String filter, final Integer top) {
return listSinglePageAsync(filter, top)
.concatMap(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(ServiceResponse<Page<ResourceGroupInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all the resource groups for a subscription.
ServiceResponse> * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
ServiceResponse> * @param top The number of results to return. If null is passed, returns all resource groups.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ResourceGroupInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the resource groups for a subscription.
*
ServiceResponse<PageImpl<ResourceGroupInner>> * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
ServiceResponse<PageImpl<ResourceGroupInner>> * @param top The number of results to return. If null is passed, returns all resource groups.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ResourceGroupInner>>> listSinglePageAsync(final String filter, final Integer top) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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.list(this.client.subscriptionId(), filter, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ResourceGroupInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<ResourceGroupInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<ResourceGroupInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<ResourceGroupInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<ResourceGroupInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets all the resource groups for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ResourceGroupInner> object if successful.
/**
* Gets all the resource groups for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @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
* @return the PagedList<ResourceGroupInner> object if successful.
*/
public PagedList<ResourceGroupInner> listNext(final String nextPageLink) {
ServiceResponse<Page<ResourceGroupInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<ResourceGroupInner>(response.body()) {
@Override
public Page<ResourceGroupInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the resource groups for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all the resource groups for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @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<List<ResourceGroupInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<ResourceGroupInner>> serviceFuture, final ListOperationCallback<ResourceGroupInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the resource groups for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ResourceGroupInner> object
/**
* Gets all the resource groups for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ResourceGroupInner> object
*/
public Observable<Page<ResourceGroupInner>> listNextAsync(final String nextPageLink) {
return listNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Page<ResourceGroupInner>>() {
@Override
public Page<ResourceGroupInner> call(ServiceResponse<Page<ResourceGroupInner>> response) {
return response.body();
}
});
}
Gets all the resource groups for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ResourceGroupInner> object
/**
* Gets all the resource groups for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ResourceGroupInner> object
*/
public Observable<ServiceResponse<Page<ResourceGroupInner>>> listNextWithServiceResponseAsync(final String nextPageLink) {
return listNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(ServiceResponse<Page<ResourceGroupInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all the resource groups for a subscription.
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ResourceGroupInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the resource groups for a subscription.
*
ServiceResponse<PageImpl<ResourceGroupInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ResourceGroupInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ResourceGroupInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<ResourceGroupInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<ResourceGroupInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<ResourceGroupInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<ResourceGroupInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
}