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 com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing;
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.ResourcesMoveInfo;
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;
An instance of this class provides access to all the operations defined
in Resources.
/**
* An instance of this class provides access to all the operations defined
* in Resources.
*/
public class ResourcesInner implements InnerSupportsListing<GenericResourceExpandedInner> {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private ResourcesService service;
The service client containing this operation class. /** The service client containing this operation class. */
private ResourceManagementClientImpl client;
Initializes an instance of ResourcesInner.
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 ResourcesInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public ResourcesInner(Retrofit retrofit, ResourceManagementClientImpl client) {
this.service = retrofit.create(ResourcesService.class);
this.client = client;
}
The interface defining all the services for Resources to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for Resources to be
* used by Retrofit to perform actually REST calls.
*/
interface ResourcesService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources listByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources")
Observable<Response<ResponseBody>> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$expand") String expand, @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.Resources moveResources" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources")
Observable<Response<ResponseBody>> moveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfo 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.Resources beginMoveResources" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources")
Observable<Response<ResponseBody>> beginMoveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfo 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.Resources validateMoveResources" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources")
Observable<Response<ResponseBody>> validateMoveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfo 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.Resources beginValidateMoveResources" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources")
Observable<Response<ResponseBody>> beginValidateMoveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfo 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.Resources list" })
@GET("subscriptions/{subscriptionId}/resources")
Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$expand") String expand, @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.Resources checkExistence" })
@HEAD("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}")
Observable<Response<Void>> checkExistence(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @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.Resources delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletion") Boolean forceDeletion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletion") Boolean forceDeletion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources createOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}")
Observable<Response<ResponseBody>> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources beginCreateOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}")
Observable<Response<ResponseBody>> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources update" })
@PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}")
Observable<Response<ResponseBody>> update(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources beginUpdate" })
@PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}")
Observable<Response<ResponseBody>> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources get" })
@GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}")
Observable<Response<ResponseBody>> get(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @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.Resources checkExistenceById" })
@HEAD("{resourceId}")
Observable<Response<Void>> checkExistenceById(@Path(value = "resourceId", encoded = true) String resourceId, @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.Resources deleteById" })
@HTTP(path = "{resourceId}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> deleteById(@Path(value = "resourceId", encoded = true) String resourceId, @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.Resources beginDeleteById" })
@HTTP(path = "{resourceId}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDeleteById(@Path(value = "resourceId", encoded = true) String resourceId, @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.Resources createOrUpdateById" })
@PUT("{resourceId}")
Observable<Response<ResponseBody>> createOrUpdateById(@Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources beginCreateOrUpdateById" })
@PUT("{resourceId}")
Observable<Response<ResponseBody>> beginCreateOrUpdateById(@Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources updateById" })
@PATCH("{resourceId}")
Observable<Response<ResponseBody>> updateById(@Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources beginUpdateById" })
@PATCH("{resourceId}")
Observable<Response<ResponseBody>> beginUpdateById(@Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Body GenericResourceInner 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.Resources getById" })
@GET("{resourceId}")
Observable<Response<ResponseBody>> getById(@Path(value = "resourceId", encoded = true) String resourceId, @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.Resources listByResourceGroupNext" })
@GET
Observable<Response<ResponseBody>> listByResourceGroupNext(@Url String nextUrl, @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.Resources listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
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<GenericResourceExpandedInner> object if successful.
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @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<GenericResourceExpandedInner> object if successful.
*/
public PagedList<GenericResourceExpandedInner> listByResourceGroup(final String resourceGroupName) {
ServiceResponse<Page<GenericResourceExpandedInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single();
return new PagedList<GenericResourceExpandedInner>(response.body()) {
@Override
public Page<GenericResourceExpandedInner> nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @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<GenericResourceExpandedInner>> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback<GenericResourceExpandedInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupSinglePageAsync(resourceGroupName),
new Func1<String, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<GenericResourceExpandedInner> object
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<GenericResourceExpandedInner> object
*/
public Observable<Page<GenericResourceExpandedInner>> listByResourceGroupAsync(final String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
.map(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Page<GenericResourceExpandedInner>>() {
@Override
public Page<GenericResourceExpandedInner> call(ServiceResponse<Page<GenericResourceExpandedInner>> response) {
return response.body();
}
});
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<GenericResourceExpandedInner> object
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<GenericResourceExpandedInner> object
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) {
return listByResourceGroupSinglePageAsync(resourceGroupName)
.concatMap(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(ServiceResponse<Page<GenericResourceExpandedInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<GenericResourceExpandedInner> object wrapped in ServiceResponse
if successful.
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listByResourceGroupSinglePageAsync(final 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 filter = null;
final String expand = null;
final Integer top = null;
return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<GenericResourceExpandedInner>> result = listByResourceGroupDelegate(response);
return Observable.just(new ServiceResponse<Page<GenericResourceExpandedInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
- filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- top – The number of results to return. If null is passed, returns all resources.
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<GenericResourceExpandedInner> object if successful.
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @param top The number of results to return. If null is passed, returns all resources.
* @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<GenericResourceExpandedInner> object if successful.
*/
public PagedList<GenericResourceExpandedInner> listByResourceGroup(final String resourceGroupName, final String filter, final String expand, final Integer top) {
ServiceResponse<Page<GenericResourceExpandedInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top).toBlocking().single();
return new PagedList<GenericResourceExpandedInner>(response.body()) {
@Override
public Page<GenericResourceExpandedInner> nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
- filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- top – The number of results to return. If null is passed, returns all resources.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @param top The number of results to return. If null is passed, returns all resources.
* @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<GenericResourceExpandedInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top, final ListOperationCallback<GenericResourceExpandedInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top),
new Func1<String, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
- filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- top – The number of results to return. If null is passed, returns all resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<GenericResourceExpandedInner> object
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @param top The number of results to return. If null is passed, returns all resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<GenericResourceExpandedInner> object
*/
public Observable<Page<GenericResourceExpandedInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, expand, top)
.map(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Page<GenericResourceExpandedInner>>() {
@Override
public Page<GenericResourceExpandedInner> call(ServiceResponse<Page<GenericResourceExpandedInner>> response) {
return response.body();
}
});
}
Get all the resources for a resource group.
Params: - resourceGroupName – The resource group with the resources to get.
- filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- top – The number of results to return. If null is passed, returns all resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<GenericResourceExpandedInner> object
/**
* Get all the resources for a resource group.
*
* @param resourceGroupName The resource group with the resources to get.
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @param top The number of results to return. If null is passed, returns all resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<GenericResourceExpandedInner> object
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) {
return listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top)
.concatMap(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(ServiceResponse<Page<GenericResourceExpandedInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
Get all the resources for a resource group.
ServiceResponse> * @param resourceGroupName The resource group with the resources to get.
ServiceResponse> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
ServiceResponse> * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
ServiceResponse> * @param top The number of results to return. If null is passed, returns all resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<GenericResourceExpandedInner> object wrapped in ServiceResponse
if successful.
/**
* Get all the resources for a resource group.
*
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param resourceGroupName The resource group with the resources to get.
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param top The number of results to return. If null is passed, returns all resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) {
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.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<GenericResourceExpandedInner>> result = listByResourceGroupDelegate(response);
return Observable.just(new ServiceResponse<Page<GenericResourceExpandedInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<GenericResourceExpandedInner>> listByResourceGroupDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<GenericResourceExpandedInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<GenericResourceExpandedInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
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
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @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 moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().last().body();
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @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> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback);
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
return moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> moveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
if (sourceResourceGroupName == null) {
throw new IllegalArgumentException("Parameter sourceResourceGroupName 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);
Observable<Response<ResponseBody>> observable = service.moveResources(sourceResourceGroupName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
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
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @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 beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().single().body();
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @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> beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback);
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
return beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Moves resources from one resource group to another resource group.
* The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginMoveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
if (sourceResourceGroupName == null) {
throw new IllegalArgumentException("Parameter sourceResourceGroupName 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.beginMoveResources(sourceResourceGroupName, this.client.subscriptionId(), parameters, 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 = beginMoveResourcesDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> beginMoveResourcesDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(202, new TypeToken<Void>() { }.getType())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
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
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @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 validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
validateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().last().body();
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @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> validateMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(validateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback);
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> validateMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
return validateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> validateMoveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
if (sourceResourceGroupName == null) {
throw new IllegalArgumentException("Parameter sourceResourceGroupName 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);
Observable<Response<ResponseBody>> observable = service.validateMoveResources(sourceResourceGroupName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
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
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @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 beginValidateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
beginValidateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().single().body();
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @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> beginValidateMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginValidateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback);
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginValidateMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
return beginValidateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
Params: - sourceResourceGroupName – The name of the resource group containing the resources to validate for move.
- parameters – Parameters for moving resources.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Validates whether resources can be moved from one resource group to another resource group.
* This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
*
* @param sourceResourceGroupName The name of the resource group containing the resources to validate for move.
* @param parameters Parameters for moving resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginValidateMoveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
if (sourceResourceGroupName == null) {
throw new IllegalArgumentException("Parameter sourceResourceGroupName 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.beginValidateMoveResources(sourceResourceGroupName, this.client.subscriptionId(), parameters, 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 = beginValidateMoveResourcesDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> beginValidateMoveResourcesDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(202, new TypeToken<Void>() { }.getType())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Get all the resources in 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<GenericResourceExpandedInner> object if successful.
/**
* Get all the resources in 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<GenericResourceExpandedInner> object if successful.
*/
public PagedList<GenericResourceExpandedInner> list() {
ServiceResponse<Page<GenericResourceExpandedInner>> response = listSinglePageAsync().toBlocking().single();
return new PagedList<GenericResourceExpandedInner>(response.body()) {
@Override
public Page<GenericResourceExpandedInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Get all the resources in 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
/**
* Get all the resources in 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<GenericResourceExpandedInner>> listAsync(final ListOperationCallback<GenericResourceExpandedInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(),
new Func1<String, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Get all the resources in a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<GenericResourceExpandedInner> object
/**
* Get all the resources in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<GenericResourceExpandedInner> object
*/
public Observable<Page<GenericResourceExpandedInner>> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Page<GenericResourceExpandedInner>>() {
@Override
public Page<GenericResourceExpandedInner> call(ServiceResponse<Page<GenericResourceExpandedInner>> response) {
return response.body();
}
});
}
Get all the resources in a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<GenericResourceExpandedInner> object
/**
* Get all the resources in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<GenericResourceExpandedInner> object
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listWithServiceResponseAsync() {
return listSinglePageAsync()
.concatMap(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(ServiceResponse<Page<GenericResourceExpandedInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Get all the resources in a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<GenericResourceExpandedInner> object wrapped in ServiceResponse
if successful.
/**
* Get all the resources in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> 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 String expand = null;
final Integer top = null;
return service.list(this.client.subscriptionId(), filter, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<GenericResourceExpandedInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<GenericResourceExpandedInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Get all the resources in a subscription.
Params: - filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- 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<GenericResourceExpandedInner> object if successful.
/**
* Get all the resources in a subscription.
*
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @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<GenericResourceExpandedInner> object if successful.
*/
public PagedList<GenericResourceExpandedInner> list(final String filter, final String expand, final Integer top) {
ServiceResponse<Page<GenericResourceExpandedInner>> response = listSinglePageAsync(filter, expand, top).toBlocking().single();
return new PagedList<GenericResourceExpandedInner>(response.body()) {
@Override
public Page<GenericResourceExpandedInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Get all the resources in a subscription.
Params: - filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- 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
/**
* Get all the resources in a subscription.
*
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @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<GenericResourceExpandedInner>> listAsync(final String filter, final String expand, final Integer top, final ListOperationCallback<GenericResourceExpandedInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(filter, expand, top),
new Func1<String, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Get all the resources in a subscription.
Params: - filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- 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<GenericResourceExpandedInner> object
/**
* Get all the resources in a subscription.
*
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @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<GenericResourceExpandedInner> object
*/
public Observable<Page<GenericResourceExpandedInner>> listAsync(final String filter, final String expand, final Integer top) {
return listWithServiceResponseAsync(filter, expand, top)
.map(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Page<GenericResourceExpandedInner>>() {
@Override
public Page<GenericResourceExpandedInner> call(ServiceResponse<Page<GenericResourceExpandedInner>> response) {
return response.body();
}
});
}
Get all the resources in a subscription.
Params: - filter – The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
- expand – Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
- 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<GenericResourceExpandedInner> object
/**
* Get all the resources in a subscription.
*
* @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
* @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
* @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<GenericResourceExpandedInner> object
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listWithServiceResponseAsync(final String filter, final String expand, final Integer top) {
return listSinglePageAsync(filter, expand, top)
.concatMap(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(ServiceResponse<Page<GenericResourceExpandedInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Get all the resources in a subscription.
ServiceResponse> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
ServiceResponse> * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
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<GenericResourceExpandedInner> object wrapped in ServiceResponse
if successful.
/**
* Get all the resources in a subscription.
*
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<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'. When you filter by a tag name and value, the tags for each resource are not returned in the results.<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId.
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @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<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listSinglePageAsync(final String filter, final String expand, 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, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<GenericResourceExpandedInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<GenericResourceExpandedInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<GenericResourceExpandedInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<GenericResourceExpandedInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<GenericResourceExpandedInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Checks whether a resource exists.
Params: - resourceGroupName – The name of the resource group containing the resource to check. The name is case insensitive.
- resourceProviderNamespace – The resource provider of the resource to check.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to check whether it exists.
- apiVersion – The API version to use for the 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 boolean object if successful.
/**
* Checks whether a resource exists.
*
* @param resourceGroupName The name of the resource group containing the resource to check. The name is case insensitive.
* @param resourceProviderNamespace The resource provider of the resource to check.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to check whether it exists.
* @param apiVersion The API version to use for the 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 boolean object if successful.
*/
public boolean checkExistence(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return checkExistenceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single().body();
}
Checks whether a resource exists.
Params: - resourceGroupName – The name of the resource group containing the resource to check. The name is case insensitive.
- resourceProviderNamespace – The resource provider of the resource to check.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to check whether it exists.
- apiVersion – The API version to use for the operation.
- 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 exists.
*
* @param resourceGroupName The name of the resource group containing the resource to check. The name is case insensitive.
* @param resourceProviderNamespace The resource provider of the resource to check.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to check whether it exists.
* @param apiVersion The API version to use for the operation.
* @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, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, final ServiceCallback<Boolean> serviceCallback) {
return ServiceFuture.fromResponse(checkExistenceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback);
}
Checks whether a resource exists.
Params: - resourceGroupName – The name of the resource group containing the resource to check. The name is case insensitive.
- resourceProviderNamespace – The resource provider of the resource to check.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to check whether it exists.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the Boolean object
/**
* Checks whether a resource exists.
*
* @param resourceGroupName The name of the resource group containing the resource to check. The name is case insensitive.
* @param resourceProviderNamespace The resource provider of the resource to check.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to check whether it exists.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Boolean object
*/
public Observable<Boolean> checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return checkExistenceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).map(new Func1<ServiceResponse<Boolean>, Boolean>() {
@Override
public Boolean call(ServiceResponse<Boolean> response) {
return response.body();
}
});
}
Checks whether a resource exists.
Params: - resourceGroupName – The name of the resource group containing the resource to check. The name is case insensitive.
- resourceProviderNamespace – The resource provider of the resource to check.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to check whether it exists.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the Boolean object
/**
* Checks whether a resource exists.
*
* @param resourceGroupName The name of the resource group containing the resource to check. The name is case insensitive.
* @param resourceProviderNamespace The resource provider of the resource to check.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to check whether it exists.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Boolean object
*/
public Observable<ServiceResponse<Boolean>> checkExistenceWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
return service.checkExistence(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), 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);
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the 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
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the 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
*/
public void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().last().body();
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- 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.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @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 resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback);
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
final Boolean forceDeletion = null;
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
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.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @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 resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion) {
deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, forceDeletion).toBlocking().last().body();
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
- 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.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @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 resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, forceDeletion), serviceCallback);
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion) {
return deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, forceDeletion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the 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
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the 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
*/
public void beginDelete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
beginDeleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single().body();
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- 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.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @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 resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback);
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
final Boolean forceDeletion = null;
return service.beginDelete(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
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.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @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 resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion) {
beginDeleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, forceDeletion).toBlocking().single().body();
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
- 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.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @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 resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, forceDeletion), serviceCallback);
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, forceDeletion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource.
Params: - resourceGroupName – The name of the resource group that contains the resource to delete. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type.
- resourceName – The name of the resource to delete.
- apiVersion – The API version to use for the operation.
- forceDeletion – The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource.
*
* @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type.
* @param resourceName The name of the resource to delete.
* @param apiVersion The API version to use for the operation.
* @param forceDeletion The resource types you want to force delete. Currently, only the following is supported: forceDeletion=Microsoft.Compute/virtualMachines
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Boolean forceDeletion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
return service.beginDelete(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
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())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
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 GenericResourceInner object if successful.
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).toBlocking().last().body();
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @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<GenericResourceInner> createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters), serviceCallback);
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<GenericResourceInner> createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<GenericResourceInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.createOrUpdate(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<GenericResourceInner>() { }.getType());
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
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 GenericResourceInner object if successful.
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner beginCreateOrUpdate(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).toBlocking().single().body();
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @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<GenericResourceInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters), serviceCallback);
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<GenericResourceInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Creates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to create.
- resourceName – The name of the resource to create.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for creating or updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Creates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to create.
* @param resourceName The name of the resource to create.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for creating or updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<ServiceResponse<GenericResourceInner>> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.beginCreateOrUpdate(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GenericResourceInner>>>() {
@Override
public Observable<ServiceResponse<GenericResourceInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GenericResourceInner> clientResponse = beginCreateOrUpdateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<GenericResourceInner> beginCreateOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<GenericResourceInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<GenericResourceInner>() { }.getType())
.register(201, new TypeToken<GenericResourceInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
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 GenericResourceInner object if successful.
/**
* Updates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).toBlocking().last().body();
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
- 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.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @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<GenericResourceInner> updateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters), serviceCallback);
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Updates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<GenericResourceInner> updateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Updates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<GenericResourceInner>> updateWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.update(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<GenericResourceInner>() { }.getType());
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
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 GenericResourceInner object if successful.
/**
* Updates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner beginUpdate(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).toBlocking().single().body();
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
- 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.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @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<GenericResourceInner> beginUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters), serviceCallback);
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Updates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<GenericResourceInner> beginUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Updates a resource.
Params: - resourceGroupName – The name of the resource group for the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource to update.
- resourceName – The name of the resource to update.
- apiVersion – The API version to use for the operation.
- parameters – Parameters for updating the resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Updates a resource.
*
* @param resourceGroupName The name of the resource group for the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource to update.
* @param resourceName The name of the resource to update.
* @param apiVersion The API version to use for the operation.
* @param parameters Parameters for updating the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<ServiceResponse<GenericResourceInner>> beginUpdateWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.beginUpdate(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GenericResourceInner>>>() {
@Override
public Observable<ServiceResponse<GenericResourceInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GenericResourceInner> clientResponse = beginUpdateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<GenericResourceInner> beginUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<GenericResourceInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<GenericResourceInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a resource.
Params: - resourceGroupName – The name of the resource group containing the resource to get. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource.
- resourceName – The name of the resource to get.
- apiVersion – The API version to use for the 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 GenericResourceInner object if successful.
/**
* Gets a resource.
*
* @param resourceGroupName The name of the resource group containing the resource to get. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource.
* @param resourceName The name of the resource to get.
* @param apiVersion The API version to use for the 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 GenericResourceInner object if successful.
*/
public GenericResourceInner get(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return getWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single().body();
}
Gets a resource.
Params: - resourceGroupName – The name of the resource group containing the resource to get. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource.
- resourceName – The name of the resource to get.
- apiVersion – The API version to use for the operation.
- 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.
*
* @param resourceGroupName The name of the resource group containing the resource to get. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource.
* @param resourceName The name of the resource to get.
* @param apiVersion The API version to use for the operation.
* @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<GenericResourceInner> getAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback);
}
Gets a resource.
Params: - resourceGroupName – The name of the resource group containing the resource to get. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource.
- resourceName – The name of the resource to get.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Gets a resource.
*
* @param resourceGroupName The name of the resource group containing the resource to get. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource.
* @param resourceName The name of the resource to get.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<GenericResourceInner> getAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return getWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Gets a resource.
Params: - resourceGroupName – The name of the resource group containing the resource to get. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource identity.
- resourceType – The resource type of the resource.
- resourceName – The name of the resource to get.
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Gets a resource.
*
* @param resourceGroupName The name of the resource group containing the resource to get. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource identity.
* @param resourceType The resource type of the resource.
* @param resourceName The name of the resource to get.
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<ServiceResponse<GenericResourceInner>> getWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceProviderNamespace == null) {
throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
}
if (parentResourcePath == null) {
throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
}
if (resourceType == null) {
throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName 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 (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
return service.get(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GenericResourceInner>>>() {
@Override
public Observable<ServiceResponse<GenericResourceInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GenericResourceInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<GenericResourceInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<GenericResourceInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<GenericResourceInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Checks by ID whether a resource exists.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the 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 boolean object if successful.
/**
* Checks by ID whether a resource exists.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the 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 boolean object if successful.
*/
public boolean checkExistenceById(String resourceId, String apiVersion) {
return checkExistenceByIdWithServiceResponseAsync(resourceId, apiVersion).toBlocking().single().body();
}
Checks by ID whether a resource exists.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Checks by ID whether a resource exists.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @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> checkExistenceByIdAsync(String resourceId, String apiVersion, final ServiceCallback<Boolean> serviceCallback) {
return ServiceFuture.fromResponse(checkExistenceByIdWithServiceResponseAsync(resourceId, apiVersion), serviceCallback);
}
Checks by ID whether a resource exists.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the Boolean object
/**
* Checks by ID whether a resource exists.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Boolean object
*/
public Observable<Boolean> checkExistenceByIdAsync(String resourceId, String apiVersion) {
return checkExistenceByIdWithServiceResponseAsync(resourceId, apiVersion).map(new Func1<ServiceResponse<Boolean>, Boolean>() {
@Override
public Boolean call(ServiceResponse<Boolean> response) {
return response.body();
}
});
}
Checks by ID whether a resource exists.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the Boolean object
/**
* Checks by ID whether a resource exists.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Boolean object
*/
public Observable<ServiceResponse<Boolean>> checkExistenceByIdWithServiceResponseAsync(String resourceId, String apiVersion) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
return service.checkExistenceById(resourceId, 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 = checkExistenceByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Boolean> checkExistenceByIdDelegate(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);
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the 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
/**
* Deletes a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the 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
*/
public void deleteById(String resourceId, String apiVersion) {
deleteByIdWithServiceResponseAsync(resourceId, apiVersion).toBlocking().last().body();
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- 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 by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @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> deleteByIdAsync(String resourceId, String apiVersion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteByIdWithServiceResponseAsync(resourceId, apiVersion), serviceCallback);
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteByIdAsync(String resourceId, String apiVersion) {
return deleteByIdWithServiceResponseAsync(resourceId, apiVersion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteByIdWithServiceResponseAsync(String resourceId, String apiVersion) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
Observable<Response<ResponseBody>> observable = service.deleteById(resourceId, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the 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
/**
* Deletes a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the 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
*/
public void beginDeleteById(String resourceId, String apiVersion) {
beginDeleteByIdWithServiceResponseAsync(resourceId, apiVersion).toBlocking().single().body();
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- 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 by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @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> beginDeleteByIdAsync(String resourceId, String apiVersion, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteByIdWithServiceResponseAsync(resourceId, apiVersion), serviceCallback);
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteByIdAsync(String resourceId, String apiVersion) {
return beginDeleteByIdWithServiceResponseAsync(resourceId, apiVersion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteByIdWithServiceResponseAsync(String resourceId, String apiVersion) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
return service.beginDeleteById(resourceId, 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 = beginDeleteByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> beginDeleteByIdDelegate(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())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
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 GenericResourceInner object if successful.
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters) {
return createOrUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).toBlocking().last().body();
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @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<GenericResourceInner> createOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters), serviceCallback);
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<GenericResourceInner> createOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
return createOrUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<GenericResourceInner>> createOrUpdateByIdWithServiceResponseAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.createOrUpdateById(resourceId, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<GenericResourceInner>() { }.getType());
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
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 GenericResourceInner object if successful.
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner beginCreateOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginCreateOrUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).toBlocking().single().body();
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @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<GenericResourceInner> beginCreateOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters), serviceCallback);
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<GenericResourceInner> beginCreateOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginCreateOrUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Create a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Create or update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Create a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Create or update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<ServiceResponse<GenericResourceInner>> beginCreateOrUpdateByIdWithServiceResponseAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.beginCreateOrUpdateById(resourceId, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GenericResourceInner>>>() {
@Override
public Observable<ServiceResponse<GenericResourceInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GenericResourceInner> clientResponse = beginCreateOrUpdateByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<GenericResourceInner> beginCreateOrUpdateByIdDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<GenericResourceInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<GenericResourceInner>() { }.getType())
.register(201, new TypeToken<GenericResourceInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
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 GenericResourceInner object if successful.
/**
* Updates a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters) {
return updateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).toBlocking().last().body();
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
- 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 by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @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<GenericResourceInner> updateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(updateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters), serviceCallback);
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Updates a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<GenericResourceInner> updateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
return updateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Updates a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<GenericResourceInner>> updateByIdWithServiceResponseAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.updateById(resourceId, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<GenericResourceInner>() { }.getType());
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
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 GenericResourceInner object if successful.
/**
* Updates a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @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 GenericResourceInner object if successful.
*/
public GenericResourceInner beginUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).toBlocking().single().body();
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
- 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 by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @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<GenericResourceInner> beginUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(beginUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters), serviceCallback);
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Updates a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<GenericResourceInner> beginUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Updates a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- parameters – Update resource parameters.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Updates a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @param parameters Update resource parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<ServiceResponse<GenericResourceInner>> beginUpdateByIdWithServiceResponseAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter 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.beginUpdateById(resourceId, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GenericResourceInner>>>() {
@Override
public Observable<ServiceResponse<GenericResourceInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GenericResourceInner> clientResponse = beginUpdateByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<GenericResourceInner> beginUpdateByIdDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<GenericResourceInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<GenericResourceInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the 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 GenericResourceInner object if successful.
/**
* Gets a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the 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 GenericResourceInner object if successful.
*/
public GenericResourceInner getById(String resourceId, String apiVersion) {
return getByIdWithServiceResponseAsync(resourceId, apiVersion).toBlocking().single().body();
}
Gets a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
- 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 by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @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<GenericResourceInner> getByIdAsync(String resourceId, String apiVersion, final ServiceCallback<GenericResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(getByIdWithServiceResponseAsync(resourceId, apiVersion), serviceCallback);
}
Gets a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Gets a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<GenericResourceInner> getByIdAsync(String resourceId, String apiVersion) {
return getByIdWithServiceResponseAsync(resourceId, apiVersion).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Override
public GenericResourceInner call(ServiceResponse<GenericResourceInner> response) {
return response.body();
}
});
}
Gets a resource by ID.
Params: - resourceId – The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
- apiVersion – The API version to use for the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the GenericResourceInner object
/**
* Gets a resource by ID.
*
* @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
* @param apiVersion The API version to use for the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GenericResourceInner object
*/
public Observable<ServiceResponse<GenericResourceInner>> getByIdWithServiceResponseAsync(String resourceId, String apiVersion) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
return service.getById(resourceId, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GenericResourceInner>>>() {
@Override
public Observable<ServiceResponse<GenericResourceInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GenericResourceInner> clientResponse = getByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<GenericResourceInner> getByIdDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<GenericResourceInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<GenericResourceInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Get all the resources for a resource group.
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<GenericResourceExpandedInner> object if successful.
/**
* Get all the resources for a resource group.
*
* @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<GenericResourceExpandedInner> object if successful.
*/
public PagedList<GenericResourceExpandedInner> listByResourceGroupNext(final String nextPageLink) {
ServiceResponse<Page<GenericResourceExpandedInner>> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<GenericResourceExpandedInner>(response.body()) {
@Override
public Page<GenericResourceExpandedInner> nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Get all the resources for a resource group.
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
/**
* Get all the resources for a resource group.
*
* @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<GenericResourceExpandedInner>> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture<List<GenericResourceExpandedInner>> serviceFuture, final ListOperationCallback<GenericResourceExpandedInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Get all the resources for a resource group.
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<GenericResourceExpandedInner> object
/**
* Get all the resources for a resource group.
*
* @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<GenericResourceExpandedInner> object
*/
public Observable<Page<GenericResourceExpandedInner>> listByResourceGroupNextAsync(final String nextPageLink) {
return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Page<GenericResourceExpandedInner>>() {
@Override
public Page<GenericResourceExpandedInner> call(ServiceResponse<Page<GenericResourceExpandedInner>> response) {
return response.body();
}
});
}
Get all the resources for a resource group.
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<GenericResourceExpandedInner> object
/**
* Get all the resources for a resource group.
*
* @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<GenericResourceExpandedInner> object
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(ServiceResponse<Page<GenericResourceExpandedInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
Get all the resources for a resource group.
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<GenericResourceExpandedInner> object wrapped in ServiceResponse
if successful.
/**
* Get all the resources for a resource group.
*
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<GenericResourceExpandedInner>> result = listByResourceGroupNextDelegate(response);
return Observable.just(new ServiceResponse<Page<GenericResourceExpandedInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<GenericResourceExpandedInner>> listByResourceGroupNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<GenericResourceExpandedInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<GenericResourceExpandedInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Get all the resources in 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<GenericResourceExpandedInner> object if successful.
/**
* Get all the resources in 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<GenericResourceExpandedInner> object if successful.
*/
public PagedList<GenericResourceExpandedInner> listNext(final String nextPageLink) {
ServiceResponse<Page<GenericResourceExpandedInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<GenericResourceExpandedInner>(response.body()) {
@Override
public Page<GenericResourceExpandedInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Get all the resources in 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
/**
* Get all the resources in 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<GenericResourceExpandedInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<GenericResourceExpandedInner>> serviceFuture, final ListOperationCallback<GenericResourceExpandedInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Get all the resources in 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<GenericResourceExpandedInner> object
/**
* Get all the resources in 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<GenericResourceExpandedInner> object
*/
public Observable<Page<GenericResourceExpandedInner>> listNextAsync(final String nextPageLink) {
return listNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Page<GenericResourceExpandedInner>>() {
@Override
public Page<GenericResourceExpandedInner> call(ServiceResponse<Page<GenericResourceExpandedInner>> response) {
return response.body();
}
});
}
Get all the resources in 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<GenericResourceExpandedInner> object
/**
* Get all the resources in 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<GenericResourceExpandedInner> object
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> listNextWithServiceResponseAsync(final String nextPageLink) {
return listNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<GenericResourceExpandedInner>>, Observable<ServiceResponse<Page<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(ServiceResponse<Page<GenericResourceExpandedInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Get all the resources in 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<GenericResourceExpandedInner> object wrapped in ServiceResponse
if successful.
/**
* Get all the resources in a subscription.
*
ServiceResponse<PageImpl<GenericResourceExpandedInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> 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<GenericResourceExpandedInner>>>>() {
@Override
public Observable<ServiceResponse<Page<GenericResourceExpandedInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<GenericResourceExpandedInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<GenericResourceExpandedInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<GenericResourceExpandedInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<GenericResourceExpandedInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<GenericResourceExpandedInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
}