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.eventhub.implementation;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.AzureServiceFuture;
import com.microsoft.azure.ListOperationCallback;
import com.microsoft.azure.management.eventhub.CheckNameAvailabilityParameter;
import com.microsoft.azure.management.eventhub.ErrorResponseException;
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.Header;
import retrofit2.http.Headers;
import retrofit2.http.HTTP;
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 DisasterRecoveryConfigs.
/**
* An instance of this class provides access to all the operations defined
* in DisasterRecoveryConfigs.
*/
public class DisasterRecoveryConfigsInner {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private DisasterRecoveryConfigsService service;
The service client containing this operation class. /** The service client containing this operation class. */
private EventHubManagementClientImpl client;
Initializes an instance of DisasterRecoveryConfigsInner.
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 DisasterRecoveryConfigsInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public DisasterRecoveryConfigsInner(Retrofit retrofit, EventHubManagementClientImpl client) {
this.service = retrofit.create(DisasterRecoveryConfigsService.class);
this.client = client;
}
The interface defining all the services for DisasterRecoveryConfigs to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for DisasterRecoveryConfigs to be
* used by Retrofit to perform actually REST calls.
*/
interface DisasterRecoveryConfigsService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhub.DisasterRecoveryConfigs checkNameAvailability" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability")
Observable<Response<ResponseBody>> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameter parameters, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhub.DisasterRecoveryConfigs list" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs")
Observable<Response<ResponseBody>> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.eventhub.DisasterRecoveryConfigs createOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}")
Observable<Response<ResponseBody>> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Body ArmDisasterRecoveryInner 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.eventhub.DisasterRecoveryConfigs delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhub.DisasterRecoveryConfigs get" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}")
Observable<Response<ResponseBody>> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhub.DisasterRecoveryConfigs breakPairing" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing")
Observable<Response<ResponseBody>> breakPairing(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhub.DisasterRecoveryConfigs failOver" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover")
Observable<Response<ResponseBody>> failOver(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhub.DisasterRecoveryConfigs listAuthorizationRules" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules")
Observable<Response<ResponseBody>> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhub.DisasterRecoveryConfigs getAuthorizationRule" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}")
Observable<Response<ResponseBody>> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhub.DisasterRecoveryConfigs listKeys" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}/listKeys")
Observable<Response<ResponseBody>> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhub.DisasterRecoveryConfigs listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@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.eventhub.DisasterRecoveryConfigs listAuthorizationRulesNext" })
@GET
Observable<Response<ResponseBody>> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Check the give Namespace name availability.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- name – Name to check the namespace name availability
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the CheckNameAvailabilityResultInner object if successful.
/**
* Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param name Name to check the namespace name availability
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the CheckNameAvailabilityResultInner object if successful.
*/
public CheckNameAvailabilityResultInner checkNameAvailability(String resourceGroupName, String namespaceName, String name) {
return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).toBlocking().single().body();
}
Check the give Namespace name availability.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- name – Name to check the namespace name availability
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param name Name to check the namespace name availability
* @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<CheckNameAvailabilityResultInner> checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name, final ServiceCallback<CheckNameAvailabilityResultInner> serviceCallback) {
return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name), serviceCallback);
}
Check the give Namespace name availability.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- name – Name to check the namespace name availability
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the CheckNameAvailabilityResultInner object
/**
* Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param name Name to check the namespace name availability
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the CheckNameAvailabilityResultInner object
*/
public Observable<CheckNameAvailabilityResultInner> checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name) {
return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).map(new Func1<ServiceResponse<CheckNameAvailabilityResultInner>, CheckNameAvailabilityResultInner>() {
@Override
public CheckNameAvailabilityResultInner call(ServiceResponse<CheckNameAvailabilityResultInner> response) {
return response.body();
}
});
}
Check the give Namespace name availability.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- name – Name to check the namespace name availability
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the CheckNameAvailabilityResultInner object
/**
* Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param name Name to check the namespace name availability
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the CheckNameAvailabilityResultInner object
*/
public Observable<ServiceResponse<CheckNameAvailabilityResultInner>> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, String name) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (name == null) {
throw new IllegalArgumentException("Parameter name is required and cannot be null.");
}
CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter();
parameters.withName(name);
return service.checkNameAvailability(this.client.subscriptionId(), resourceGroupName, namespaceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CheckNameAvailabilityResultInner>>>() {
@Override
public Observable<ServiceResponse<CheckNameAvailabilityResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<CheckNameAvailabilityResultInner> clientResponse = checkNameAvailabilityDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<CheckNameAvailabilityResultInner> checkNameAvailabilityDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<CheckNameAvailabilityResultInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<CheckNameAvailabilityResultInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets all Alias(Disaster Recovery configurations).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ArmDisasterRecoveryInner> object if successful.
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException 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<ArmDisasterRecoveryInner> object if successful.
*/
public PagedList<ArmDisasterRecoveryInner> list(final String resourceGroupName, final String namespaceName) {
ServiceResponse<Page<ArmDisasterRecoveryInner>> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single();
return new PagedList<ArmDisasterRecoveryInner>(response.body()) {
@Override
public Page<ArmDisasterRecoveryInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all Alias(Disaster Recovery configurations).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @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<ArmDisasterRecoveryInner>> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback<ArmDisasterRecoveryInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(resourceGroupName, namespaceName),
new Func1<String, Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all Alias(Disaster Recovery configurations).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ArmDisasterRecoveryInner> object
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ArmDisasterRecoveryInner> object
*/
public Observable<Page<ArmDisasterRecoveryInner>> listAsync(final String resourceGroupName, final String namespaceName) {
return listWithServiceResponseAsync(resourceGroupName, namespaceName)
.map(new Func1<ServiceResponse<Page<ArmDisasterRecoveryInner>>, Page<ArmDisasterRecoveryInner>>() {
@Override
public Page<ArmDisasterRecoveryInner> call(ServiceResponse<Page<ArmDisasterRecoveryInner>> response) {
return response.body();
}
});
}
Gets all Alias(Disaster Recovery configurations).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ArmDisasterRecoveryInner> object
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ArmDisasterRecoveryInner> object
*/
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) {
return listSinglePageAsync(resourceGroupName, namespaceName)
.concatMap(new Func1<ServiceResponse<Page<ArmDisasterRecoveryInner>>, Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> call(ServiceResponse<Page<ArmDisasterRecoveryInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all Alias(Disaster Recovery configurations).
ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription.
ServiceResponse> * @param namespaceName The Namespace name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ArmDisasterRecoveryInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all Alias(Disaster Recovery configurations).
*
ServiceResponse<PageImpl<ArmDisasterRecoveryInner>> * @param resourceGroupName Name of the resource group within the azure subscription.
ServiceResponse<PageImpl<ArmDisasterRecoveryInner>> * @param namespaceName The Namespace name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName 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.list(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ArmDisasterRecoveryInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<ArmDisasterRecoveryInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<ArmDisasterRecoveryInner>> listDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<ArmDisasterRecoveryInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<ArmDisasterRecoveryInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Creates or updates a new Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- parameters – Parameters required to create an Alias(Disaster Recovery configuration)
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ArmDisasterRecoveryInner object if successful.
/**
* Creates or updates a new Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param parameters Parameters required to create an Alias(Disaster Recovery configuration)
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the ArmDisasterRecoveryInner object if successful.
*/
public ArmDisasterRecoveryInner createOrUpdate(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).toBlocking().single().body();
}
Creates or updates a new Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- parameters – Parameters required to create an Alias(Disaster Recovery configuration)
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates or updates a new Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param parameters Parameters required to create an Alias(Disaster Recovery configuration)
* @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<ArmDisasterRecoveryInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters, final ServiceCallback<ArmDisasterRecoveryInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters), serviceCallback);
}
Creates or updates a new Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- parameters – Parameters required to create an Alias(Disaster Recovery configuration)
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ArmDisasterRecoveryInner object
/**
* Creates or updates a new Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param parameters Parameters required to create an Alias(Disaster Recovery configuration)
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ArmDisasterRecoveryInner object
*/
public Observable<ArmDisasterRecoveryInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).map(new Func1<ServiceResponse<ArmDisasterRecoveryInner>, ArmDisasterRecoveryInner>() {
@Override
public ArmDisasterRecoveryInner call(ServiceResponse<ArmDisasterRecoveryInner> response) {
return response.body();
}
});
}
Creates or updates a new Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- parameters – Parameters required to create an Alias(Disaster Recovery configuration)
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ArmDisasterRecoveryInner object
/**
* Creates or updates a new Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param parameters Parameters required to create an Alias(Disaster Recovery configuration)
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ArmDisasterRecoveryInner object
*/
public Observable<ServiceResponse<ArmDisasterRecoveryInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(parameters);
return service.createOrUpdate(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ArmDisasterRecoveryInner>>>() {
@Override
public Observable<ServiceResponse<ArmDisasterRecoveryInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ArmDisasterRecoveryInner> clientResponse = createOrUpdateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ArmDisasterRecoveryInner> createOrUpdateDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ArmDisasterRecoveryInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ArmDisasterRecoveryInner>() { }.getType())
.register(201, new TypeToken<Void>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Deletes an Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Deletes an Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException 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 namespaceName, String alias) {
deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body();
}
Deletes an Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes an Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @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 namespaceName, String alias, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback);
}
Deletes an Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> deleteAsync(String resourceGroupName, String namespaceName, String alias) {
return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes an Alias(Disaster Recovery configuration).
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an Alias(Disaster Recovery configuration).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias 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.delete(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), 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 = deleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> deleteDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ArmDisasterRecoveryInner object if successful.
/**
* Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the ArmDisasterRecoveryInner object if successful.
*/
public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) {
return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body();
}
Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @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<ArmDisasterRecoveryInner> getAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback<ArmDisasterRecoveryInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback);
}
Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ArmDisasterRecoveryInner object
/**
* Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ArmDisasterRecoveryInner object
*/
public Observable<ArmDisasterRecoveryInner> getAsync(String resourceGroupName, String namespaceName, String alias) {
return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1<ServiceResponse<ArmDisasterRecoveryInner>, ArmDisasterRecoveryInner>() {
@Override
public ArmDisasterRecoveryInner call(ServiceResponse<ArmDisasterRecoveryInner> response) {
return response.body();
}
});
}
Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ArmDisasterRecoveryInner object
/**
* Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ArmDisasterRecoveryInner object
*/
public Observable<ServiceResponse<ArmDisasterRecoveryInner>> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.get(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ArmDisasterRecoveryInner>>>() {
@Override
public Observable<ServiceResponse<ArmDisasterRecoveryInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ArmDisasterRecoveryInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ArmDisasterRecoveryInner> getDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ArmDisasterRecoveryInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ArmDisasterRecoveryInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void breakPairing(String resourceGroupName, String namespaceName, String alias) {
breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body();
}
This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @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> breakPairingAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback);
}
This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> breakPairingAsync(String resourceGroupName, String namespaceName, String alias) {
return breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> breakPairingWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias 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.breakPairing(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), 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 = breakPairingDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> breakPairingDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void failOver(String resourceGroupName, String namespaceName, String alias) {
failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body();
}
Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @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> failOverAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback);
}
Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> failOverAsync(String resourceGroupName, String namespaceName, String alias) {
return failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> failOverWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias 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.failOver(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), 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 = failOverDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> failOverDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets a list of authorization rules for a Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<AuthorizationRuleInner> object if successful.
/**
* Gets a list of authorization rules for a Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException 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<AuthorizationRuleInner> object if successful.
*/
public PagedList<AuthorizationRuleInner> listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String alias) {
ServiceResponse<Page<AuthorizationRuleInner>> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias).toBlocking().single();
return new PagedList<AuthorizationRuleInner>(response.body()) {
@Override
public Page<AuthorizationRuleInner> nextPage(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of authorization rules for a Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of authorization rules for a Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @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<AuthorizationRuleInner>> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias, final ListOperationCallback<AuthorizationRuleInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias),
new Func1<String, Observable<ServiceResponse<Page<AuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> call(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of authorization rules for a Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<AuthorizationRuleInner> object
/**
* Gets a list of authorization rules for a Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<AuthorizationRuleInner> object
*/
public Observable<Page<AuthorizationRuleInner>> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias) {
return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, alias)
.map(new Func1<ServiceResponse<Page<AuthorizationRuleInner>>, Page<AuthorizationRuleInner>>() {
@Override
public Page<AuthorizationRuleInner> call(ServiceResponse<Page<AuthorizationRuleInner>> response) {
return response.body();
}
});
}
Gets a list of authorization rules for a Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<AuthorizationRuleInner> object
/**
* Gets a list of authorization rules for a Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<AuthorizationRuleInner> object
*/
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String alias) {
return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias)
.concatMap(new Func1<ServiceResponse<Page<AuthorizationRuleInner>>, Observable<ServiceResponse<Page<AuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> call(ServiceResponse<Page<AuthorizationRuleInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of authorization rules for a Namespace.
ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription.
ServiceResponse> * @param namespaceName The Namespace name
ServiceResponse> * @param alias The Disaster Recovery configuration name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<AuthorizationRuleInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of authorization rules for a Namespace.
*
ServiceResponse<PageImpl<AuthorizationRuleInner>> * @param resourceGroupName Name of the resource group within the azure subscription.
ServiceResponse<PageImpl<AuthorizationRuleInner>> * @param namespaceName The Namespace name
ServiceResponse<PageImpl<AuthorizationRuleInner>> * @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String alias) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias 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.listAuthorizationRules(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<AuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<AuthorizationRuleInner>> result = listAuthorizationRulesDelegate(response);
return Observable.just(new ServiceResponse<Page<AuthorizationRuleInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<AuthorizationRuleInner>> listAuthorizationRulesDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<AuthorizationRuleInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<AuthorizationRuleInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets an AuthorizationRule for a Namespace by rule name.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the AuthorizationRuleInner object if successful.
/**
* Gets an AuthorizationRule for a Namespace by rule name.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the AuthorizationRuleInner object if successful.
*/
public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body();
}
Gets an AuthorizationRule for a Namespace by rule name.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets an AuthorizationRule for a Namespace by rule name.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @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<AuthorizationRuleInner> getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback<AuthorizationRuleInner> serviceCallback) {
return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback);
}
Gets an AuthorizationRule for a Namespace by rule name.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the AuthorizationRuleInner object
/**
* Gets an AuthorizationRule for a Namespace by rule name.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the AuthorizationRuleInner object
*/
public Observable<AuthorizationRuleInner> getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1<ServiceResponse<AuthorizationRuleInner>, AuthorizationRuleInner>() {
@Override
public AuthorizationRuleInner call(ServiceResponse<AuthorizationRuleInner> response) {
return response.body();
}
});
}
Gets an AuthorizationRule for a Namespace by rule name.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the AuthorizationRuleInner object
/**
* Gets an AuthorizationRule for a Namespace by rule name.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the AuthorizationRuleInner object
*/
public Observable<ServiceResponse<AuthorizationRuleInner>> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
}
if (authorizationRuleName == null) {
throw new IllegalArgumentException("Parameter authorizationRuleName 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.getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AuthorizationRuleInner>>>() {
@Override
public Observable<ServiceResponse<AuthorizationRuleInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<AuthorizationRuleInner> clientResponse = getAuthorizationRuleDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<AuthorizationRuleInner> getAuthorizationRuleDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<AuthorizationRuleInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<AuthorizationRuleInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets the primary and secondary connection strings for the Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the AccessKeysInner object if successful.
/**
* Gets the primary and secondary connection strings for the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the AccessKeysInner object if successful.
*/
public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body();
}
Gets the primary and secondary connection strings for the Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets the primary and secondary connection strings for the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @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<AccessKeysInner> listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback<AccessKeysInner> serviceCallback) {
return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback);
}
Gets the primary and secondary connection strings for the Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the AccessKeysInner object
/**
* Gets the primary and secondary connection strings for the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the AccessKeysInner object
*/
public Observable<AccessKeysInner> listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1<ServiceResponse<AccessKeysInner>, AccessKeysInner>() {
@Override
public AccessKeysInner call(ServiceResponse<AccessKeysInner> response) {
return response.body();
}
});
}
Gets the primary and secondary connection strings for the Namespace.
Params: - resourceGroupName – Name of the resource group within the azure subscription.
- namespaceName – The Namespace name
- alias – The Disaster Recovery configuration name
- authorizationRuleName – The authorization rule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the AccessKeysInner object
/**
* Gets the primary and secondary connection strings for the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param alias The Disaster Recovery configuration name
* @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the AccessKeysInner object
*/
public Observable<ServiceResponse<AccessKeysInner>> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (alias == null) {
throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
}
if (authorizationRuleName == null) {
throw new IllegalArgumentException("Parameter authorizationRuleName 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.listKeys(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AccessKeysInner>>>() {
@Override
public Observable<ServiceResponse<AccessKeysInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<AccessKeysInner> clientResponse = listKeysDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<AccessKeysInner> listKeysDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<AccessKeysInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<AccessKeysInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets all Alias(Disaster Recovery configurations).
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ArmDisasterRecoveryInner> object if successful.
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException 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<ArmDisasterRecoveryInner> object if successful.
*/
public PagedList<ArmDisasterRecoveryInner> listNext(final String nextPageLink) {
ServiceResponse<Page<ArmDisasterRecoveryInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<ArmDisasterRecoveryInner>(response.body()) {
@Override
public Page<ArmDisasterRecoveryInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all Alias(Disaster Recovery configurations).
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @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<ArmDisasterRecoveryInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<ArmDisasterRecoveryInner>> serviceFuture, final ListOperationCallback<ArmDisasterRecoveryInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all Alias(Disaster Recovery configurations).
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<ArmDisasterRecoveryInner> object
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @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<ArmDisasterRecoveryInner> object
*/
public Observable<Page<ArmDisasterRecoveryInner>> listNextAsync(final String nextPageLink) {
return listNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<ArmDisasterRecoveryInner>>, Page<ArmDisasterRecoveryInner>>() {
@Override
public Page<ArmDisasterRecoveryInner> call(ServiceResponse<Page<ArmDisasterRecoveryInner>> response) {
return response.body();
}
});
}
Gets all Alias(Disaster Recovery configurations).
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<ArmDisasterRecoveryInner> object
/**
* Gets all Alias(Disaster Recovery configurations).
*
* @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<ArmDisasterRecoveryInner> object
*/
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> listNextWithServiceResponseAsync(final String nextPageLink) {
return listNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<ArmDisasterRecoveryInner>>, Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> call(ServiceResponse<Page<ArmDisasterRecoveryInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all Alias(Disaster Recovery configurations).
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ArmDisasterRecoveryInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all Alias(Disaster Recovery configurations).
*
ServiceResponse<PageImpl<ArmDisasterRecoveryInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> 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<ArmDisasterRecoveryInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ArmDisasterRecoveryInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ArmDisasterRecoveryInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<ArmDisasterRecoveryInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<ArmDisasterRecoveryInner>> listNextDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<ArmDisasterRecoveryInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<ArmDisasterRecoveryInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets a list of authorization rules for a Namespace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<AuthorizationRuleInner> object if successful.
/**
* Gets a list of authorization rules for a Namespace.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException 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<AuthorizationRuleInner> object if successful.
*/
public PagedList<AuthorizationRuleInner> listAuthorizationRulesNext(final String nextPageLink) {
ServiceResponse<Page<AuthorizationRuleInner>> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<AuthorizationRuleInner>(response.body()) {
@Override
public Page<AuthorizationRuleInner> nextPage(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of authorization rules for a Namespace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of authorization rules for a Namespace.
*
* @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<AuthorizationRuleInner>> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture<List<AuthorizationRuleInner>> serviceFuture, final ListOperationCallback<AuthorizationRuleInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAuthorizationRulesNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<AuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> call(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of authorization rules for a Namespace.
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<AuthorizationRuleInner> object
/**
* Gets a list of authorization rules for a Namespace.
*
* @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<AuthorizationRuleInner> object
*/
public Observable<Page<AuthorizationRuleInner>> listAuthorizationRulesNextAsync(final String nextPageLink) {
return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<AuthorizationRuleInner>>, Page<AuthorizationRuleInner>>() {
@Override
public Page<AuthorizationRuleInner> call(ServiceResponse<Page<AuthorizationRuleInner>> response) {
return response.body();
}
});
}
Gets a list of authorization rules for a Namespace.
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<AuthorizationRuleInner> object
/**
* Gets a list of authorization rules for a Namespace.
*
* @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<AuthorizationRuleInner> object
*/
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<AuthorizationRuleInner>>, Observable<ServiceResponse<Page<AuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> call(ServiceResponse<Page<AuthorizationRuleInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of authorization rules for a Namespace.
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<AuthorizationRuleInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of authorization rules for a Namespace.
*
ServiceResponse<PageImpl<AuthorizationRuleInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<AuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<AuthorizationRuleInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<AuthorizationRuleInner>> result = listAuthorizationRulesNextDelegate(response);
return Observable.just(new ServiceResponse<Page<AuthorizationRuleInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<AuthorizationRuleInner>> listAuthorizationRulesNextDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<AuthorizationRuleInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<AuthorizationRuleInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
}