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.cosmosdb.implementation; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; import com.microsoft.azure.management.cosmosdb.DatabaseAccountCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.DatabaseAccountRegenerateKeyParameters; import com.microsoft.azure.management.cosmosdb.DatabaseAccountUpdateParameters; import com.microsoft.azure.management.cosmosdb.ErrorResponseException; import com.microsoft.azure.management.cosmosdb.FailoverPolicies; import com.microsoft.azure.management.cosmosdb.FailoverPolicy; import com.microsoft.azure.management.cosmosdb.KeyKind; import com.microsoft.azure.management.cosmosdb.RegionForOnlineOffline; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.HEAD; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.PATCH; import retrofit2.http.Path; import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.Response; import rx.functions.Func1; import rx.Observable;
An instance of this class provides access to all the operations defined in DatabaseAccounts.
/** * An instance of this class provides access to all the operations defined * in DatabaseAccounts. */
public class DatabaseAccountsInner implements InnerSupportsGet<DatabaseAccountGetResultsInner>, InnerSupportsDelete<Void>, InnerSupportsListing<DatabaseAccountGetResultsInner> {
The Retrofit service to perform REST calls.
/** The Retrofit service to perform REST calls. */
private DatabaseAccountsService service;
The service client containing this operation class.
/** The service client containing this operation class. */
private CosmosDBImpl client;
Initializes an instance of DatabaseAccountsInner.
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 DatabaseAccountsInner. * * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */
public DatabaseAccountsInner(Retrofit retrofit, CosmosDBImpl client) { this.service = retrofit.create(DatabaseAccountsService.class); this.client = client; }
The interface defining all the services for DatabaseAccounts to be used by Retrofit to perform actually REST calls.
/** * The interface defining all the services for DatabaseAccounts to be * used by Retrofit to perform actually REST calls. */
interface DatabaseAccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") Observable<Response<ResponseBody>> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") Observable<Response<ResponseBody>> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountUpdateParameters updateParameters, @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.cosmosdb.DatabaseAccounts beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") Observable<Response<ResponseBody>> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountUpdateParameters updateParameters, @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.cosmosdb.DatabaseAccounts createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") Observable<Response<ResponseBody>> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountCreateUpdateParameters createUpdateParameters, @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.cosmosdb.DatabaseAccounts beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") Observable<Response<ResponseBody>> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountCreateUpdateParameters createUpdateParameters, @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.cosmosdb.DatabaseAccounts delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts beginDelete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts failoverPriorityChange" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange") Observable<Response<ResponseBody>> failoverPriorityChange(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FailoverPolicies failoverParameters, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts beginFailoverPriorityChange" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange") Observable<Response<ResponseBody>> beginFailoverPriorityChange(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FailoverPolicies failoverParameters, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts") Observable<Response<ResponseBody>> list(@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.cosmosdb.DatabaseAccounts listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts") Observable<Response<ResponseBody>> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts listKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys") Observable<Response<ResponseBody>> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts listConnectionStrings" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings") Observable<Response<ResponseBody>> listConnectionStrings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts offlineRegion" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion") Observable<Response<ResponseBody>> offlineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOffline, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts beginOfflineRegion" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion") Observable<Response<ResponseBody>> beginOfflineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOffline, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts onlineRegion" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion") Observable<Response<ResponseBody>> onlineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOnline, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts beginOnlineRegion" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion") Observable<Response<ResponseBody>> beginOnlineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOnline, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts getReadOnlyKeys" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys") Observable<Response<ResponseBody>> getReadOnlyKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts listReadOnlyKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys") Observable<Response<ResponseBody>> listReadOnlyKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts regenerateKey" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey") Observable<Response<ResponseBody>> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabaseAccountRegenerateKeyParameters keyToRegenerate, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts beginRegenerateKey" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey") Observable<Response<ResponseBody>> beginRegenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabaseAccountRegenerateKeyParameters keyToRegenerate, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.DatabaseAccounts checkNameExists" }) @HEAD("providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}") Observable<Response<Void>> checkNameExists(@Path("accountName") String accountName, @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.cosmosdb.DatabaseAccounts listMetrics" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics") Observable<Response<ResponseBody>> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.DatabaseAccounts listUsages" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages") Observable<Response<ResponseBody>> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.DatabaseAccounts listMetricDefinitions" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions") Observable<Response<ResponseBody>> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); }
Retrieves the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the DatabaseAccountGetResultsInner object if successful.
/** * Retrieves the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountGetResultsInner object if successful. */
public DatabaseAccountGetResultsInner getByResourceGroup(String resourceGroupName, String accountName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Retrieves the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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<DatabaseAccountGetResultsInner> getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback<DatabaseAccountGetResultsInner> serviceCallback) { return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Retrieves the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountGetResultsInner object
/** * Retrieves the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountGetResultsInner object */
public Observable<DatabaseAccountGetResultsInner> getByResourceGroupAsync(String resourceGroupName, String accountName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<DatabaseAccountGetResultsInner>, DatabaseAccountGetResultsInner>() { @Override public DatabaseAccountGetResultsInner call(ServiceResponse<DatabaseAccountGetResultsInner> response) { return response.body(); } }); }
Retrieves the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountGetResultsInner object
/** * Retrieves the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountGetResultsInner object */
public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DatabaseAccountGetResultsInner>>>() { @Override public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DatabaseAccountGetResultsInner> clientResponse = getByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DatabaseAccountGetResultsInner> getByResourceGroupDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DatabaseAccountGetResultsInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DatabaseAccountGetResultsInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
Throws:
Returns:the DatabaseAccountGetResultsInner object if successful.
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountGetResultsInner object if successful. */
public DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).toBlocking().last().body(); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @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<DatabaseAccountGetResultsInner> updateAsync(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, final ServiceCallback<DatabaseAccountGetResultsInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, updateParameters), serviceCallback); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable for the request
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<DatabaseAccountGetResultsInner> updateAsync(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).map(new Func1<ServiceResponse<DatabaseAccountGetResultsInner>, DatabaseAccountGetResultsInner>() { @Override public DatabaseAccountGetResultsInner call(ServiceResponse<DatabaseAccountGetResultsInner> response) { return response.body(); } }); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable for the request
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> updateWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (updateParameters == null) { throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); } Validator.validate(updateParameters); final String apiVersion = "2019-08-01"; Observable<Response<ResponseBody>> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, updateParameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<DatabaseAccountGetResultsInner>() { }.getType()); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
Throws:
Returns:the DatabaseAccountGetResultsInner object if successful.
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountGetResultsInner object if successful. */
public DatabaseAccountGetResultsInner beginUpdate(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).toBlocking().single().body(); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @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<DatabaseAccountGetResultsInner> beginUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, final ServiceCallback<DatabaseAccountGetResultsInner> serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, updateParameters), serviceCallback); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable to the DatabaseAccountGetResultsInner object
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountGetResultsInner object */
public Observable<DatabaseAccountGetResultsInner> beginUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).map(new Func1<ServiceResponse<DatabaseAccountGetResultsInner>, DatabaseAccountGetResultsInner>() { @Override public DatabaseAccountGetResultsInner call(ServiceResponse<DatabaseAccountGetResultsInner> response) { return response.body(); } }); }
Updates the properties of an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • updateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable to the DatabaseAccountGetResultsInner object
/** * Updates the properties of an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountGetResultsInner object */
public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (updateParameters == null) { throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); } Validator.validate(updateParameters); final String apiVersion = "2019-08-01"; return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, updateParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DatabaseAccountGetResultsInner>>>() { @Override public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DatabaseAccountGetResultsInner> clientResponse = beginUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DatabaseAccountGetResultsInner> beginUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DatabaseAccountGetResultsInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DatabaseAccountGetResultsInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
Throws:
Returns:the DatabaseAccountGetResultsInner object if successful.
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountGetResultsInner object if successful. */
public DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).toBlocking().last().body(); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @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<DatabaseAccountGetResultsInner> createOrUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, final ServiceCallback<DatabaseAccountGetResultsInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters), serviceCallback); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable for the request
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<DatabaseAccountGetResultsInner> createOrUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).map(new Func1<ServiceResponse<DatabaseAccountGetResultsInner>, DatabaseAccountGetResultsInner>() { @Override public DatabaseAccountGetResultsInner call(ServiceResponse<DatabaseAccountGetResultsInner> response) { return response.body(); } }); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable for the request
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (createUpdateParameters == null) { throw new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null."); } Validator.validate(createUpdateParameters); final String apiVersion = "2019-08-01"; Observable<Response<ResponseBody>> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, createUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<DatabaseAccountGetResultsInner>() { }.getType()); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
Throws:
Returns:the DatabaseAccountGetResultsInner object if successful.
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountGetResultsInner object if successful. */
public DatabaseAccountGetResultsInner beginCreateOrUpdate(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).toBlocking().single().body(); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @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<DatabaseAccountGetResultsInner> beginCreateOrUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, final ServiceCallback<DatabaseAccountGetResultsInner> serviceCallback) { return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters), serviceCallback); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable to the DatabaseAccountGetResultsInner object
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountGetResultsInner object */
public Observable<DatabaseAccountGetResultsInner> beginCreateOrUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).map(new Func1<ServiceResponse<DatabaseAccountGetResultsInner>, DatabaseAccountGetResultsInner>() { @Override public DatabaseAccountGetResultsInner call(ServiceResponse<DatabaseAccountGetResultsInner> response) { return response.body(); } }); }
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • createUpdateParameters – The parameters to provide for the current database account.
Throws:
Returns:the observable to the DatabaseAccountGetResultsInner object
/** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountGetResultsInner object */
public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (createUpdateParameters == null) { throw new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null."); } Validator.validate(createUpdateParameters); final String apiVersion = "2019-08-01"; return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, createUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DatabaseAccountGetResultsInner>>>() { @Override public Observable<ServiceResponse<DatabaseAccountGetResultsInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DatabaseAccountGetResultsInner> clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DatabaseAccountGetResultsInner> beginCreateOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DatabaseAccountGetResultsInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DatabaseAccountGetResultsInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void delete(String resourceGroupName, String accountName) { deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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 accountName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable for the request
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> deleteAsync(String resourceGroupName, String accountName) { return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable for the request
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; Observable<Response<ResponseBody>> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void beginDelete(String resourceGroupName, String accountName) { beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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> beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginDeleteAsync(String resourceGroupName, String accountName) { return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes an existing Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes an existing Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginDeleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(202, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
Throws:
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void failoverPriorityChange(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) { failoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).toBlocking().last().body(); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @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> failoverPriorityChangeAsync(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(failoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies), serviceCallback); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
Throws:
Returns:the observable for the request
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> failoverPriorityChangeAsync(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) { return failoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
Throws:
Returns:the observable for the request
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> failoverPriorityChangeWithServiceResponseAsync(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (failoverPolicies == null) { throw new IllegalArgumentException("Parameter failoverPolicies is required and cannot be null."); } Validator.validate(failoverPolicies); final String apiVersion = "2019-08-01"; FailoverPolicies failoverParameters = new FailoverPolicies(); failoverParameters.withFailoverPolicies(failoverPolicies); Observable<Response<ResponseBody>> observable = service.failoverPriorityChange(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), failoverParameters, this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
Throws:
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void beginFailoverPriorityChange(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) { beginFailoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).toBlocking().single().body(); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @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> beginFailoverPriorityChangeAsync(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginFailoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies), serviceCallback); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
Throws:
Returns:the ServiceResponse object if successful.
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginFailoverPriorityChangeAsync(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) { return beginFailoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • failoverPolicies – List of failover policies.
Throws:
Returns:the ServiceResponse object if successful.
/** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginFailoverPriorityChangeWithServiceResponseAsync(String resourceGroupName, String accountName, List<FailoverPolicy> failoverPolicies) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (failoverPolicies == null) { throw new IllegalArgumentException("Parameter failoverPolicies is required and cannot be null."); } Validator.validate(failoverPolicies); final String apiVersion = "2019-08-01"; FailoverPolicies failoverParameters = new FailoverPolicies(); failoverParameters.withFailoverPolicies(failoverPolicies); return service.beginFailoverPriorityChange(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), failoverParameters, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginFailoverPriorityChangeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginFailoverPriorityChangeDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(202, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Lists all the Azure Cosmos DB database accounts available under the subscription.
Returns:the PagedList object if successful.
/** * Lists all the Azure Cosmos DB database accounts available under the subscription. * * @return the PagedList<DatabaseAccountGetResultsInner> object if successful. */
public PagedList<DatabaseAccountGetResultsInner> list() { PageImpl<DatabaseAccountGetResultsInner> page = new PageImpl<>(); page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); page.setNextPageLink(null); return new PagedList<DatabaseAccountGetResultsInner>(page) { @Override public Page<DatabaseAccountGetResultsInner> nextPage(String nextPageLink) { return null; } }; }
Lists all the Azure Cosmos DB database accounts available under the subscription.
Params:
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Returns:the ServiceFuture object
/** * Lists all the Azure Cosmos DB database accounts available under the subscription. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceFuture} object */
public ServiceFuture<List<DatabaseAccountGetResultsInner>> listAsync(final ServiceCallback<List<DatabaseAccountGetResultsInner>> serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); }
Lists all the Azure Cosmos DB database accounts available under the subscription.
Returns:the observable to the List<DatabaseAccountGetResultsInner> object
/** * Lists all the Azure Cosmos DB database accounts available under the subscription. * * @return the observable to the List&lt;DatabaseAccountGetResultsInner&gt; object */
public Observable<Page<DatabaseAccountGetResultsInner>> listAsync() { return listWithServiceResponseAsync().map(new Func1<ServiceResponse<List<DatabaseAccountGetResultsInner>>, Page<DatabaseAccountGetResultsInner>>() { @Override public Page<DatabaseAccountGetResultsInner> call(ServiceResponse<List<DatabaseAccountGetResultsInner>> response) { PageImpl<DatabaseAccountGetResultsInner> page = new PageImpl<>(); page.setItems(response.body()); return page; } }); }
Lists all the Azure Cosmos DB database accounts available under the subscription.
Returns:the observable to the List<DatabaseAccountGetResultsInner> object
/** * Lists all the Azure Cosmos DB database accounts available under the subscription. * * @return the observable to the List&lt;DatabaseAccountGetResultsInner&gt; object */
public Observable<ServiceResponse<List<DatabaseAccountGetResultsInner>>> listWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<DatabaseAccountGetResultsInner>>>>() { @Override public Observable<ServiceResponse<List<DatabaseAccountGetResultsInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DatabaseAccountGetResultsInner>> result = listDelegate(response); List<DatabaseAccountGetResultsInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<DatabaseAccountGetResultsInner>> clientResponse = new ServiceResponse<List<DatabaseAccountGetResultsInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DatabaseAccountGetResultsInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DatabaseAccountGetResultsInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DatabaseAccountGetResultsInner>>() { }.getType()) .registerError(CloudException.class) .build(response); }
Lists all the Azure Cosmos DB database accounts available under the given resource group.
Params:
  • resourceGroupName – Name of an Azure resource group.
Returns:the PagedList object if successful.
/** * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName Name of an Azure resource group. * @return the PagedList<DatabaseAccountGetResultsInner> object if successful. */
public PagedList<DatabaseAccountGetResultsInner> listByResourceGroup(String resourceGroupName) { PageImpl<DatabaseAccountGetResultsInner> page = new PageImpl<>(); page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); page.setNextPageLink(null); return new PagedList<DatabaseAccountGetResultsInner>(page) { @Override public Page<DatabaseAccountGetResultsInner> nextPage(String nextPageLink) { return null; } }; }
Lists all the Azure Cosmos DB database accounts available under the given resource group.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Returns:the ServiceFuture object
/** * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName Name of an Azure resource group. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceFuture} object */
public ServiceFuture<List<DatabaseAccountGetResultsInner>> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback<List<DatabaseAccountGetResultsInner>> serviceCallback) { return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); }
Lists all the Azure Cosmos DB database accounts available under the given resource group.
Params:
  • resourceGroupName – Name of an Azure resource group.
Returns:the observable to the List<DatabaseAccountGetResultsInner> object
/** * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName Name of an Azure resource group. * @return the observable to the List&lt;DatabaseAccountGetResultsInner&gt; object */
public Observable<Page<DatabaseAccountGetResultsInner>> listByResourceGroupAsync(String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<DatabaseAccountGetResultsInner>>, Page<DatabaseAccountGetResultsInner>>() { @Override public Page<DatabaseAccountGetResultsInner> call(ServiceResponse<List<DatabaseAccountGetResultsInner>> response) { PageImpl<DatabaseAccountGetResultsInner> page = new PageImpl<>(); page.setItems(response.body()); return page; } }); }
Lists all the Azure Cosmos DB database accounts available under the given resource group.
Params:
  • resourceGroupName – Name of an Azure resource group.
Returns:the observable to the List<DatabaseAccountGetResultsInner> object
/** * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName Name of an Azure resource group. * @return the observable to the List&lt;DatabaseAccountGetResultsInner&gt; object */
public Observable<ServiceResponse<List<DatabaseAccountGetResultsInner>>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<DatabaseAccountGetResultsInner>>>>() { @Override public Observable<ServiceResponse<List<DatabaseAccountGetResultsInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DatabaseAccountGetResultsInner>> result = listByResourceGroupDelegate(response); List<DatabaseAccountGetResultsInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<DatabaseAccountGetResultsInner>> clientResponse = new ServiceResponse<List<DatabaseAccountGetResultsInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DatabaseAccountGetResultsInner>> listByResourceGroupDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DatabaseAccountGetResultsInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DatabaseAccountGetResultsInner>>() { }.getType()) .registerError(CloudException.class) .build(response); }
Lists the access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the DatabaseAccountListKeysResultInner object if successful.
/** * Lists the access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountListKeysResultInner object if successful. */
public DatabaseAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Lists the access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Lists the access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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<DatabaseAccountListKeysResultInner> listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback<DatabaseAccountListKeysResultInner> serviceCallback) { return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Lists the access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListKeysResultInner object
/** * Lists the access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListKeysResultInner object */
public Observable<DatabaseAccountListKeysResultInner> listKeysAsync(String resourceGroupName, String accountName) { return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<DatabaseAccountListKeysResultInner>, DatabaseAccountListKeysResultInner>() { @Override public DatabaseAccountListKeysResultInner call(ServiceResponse<DatabaseAccountListKeysResultInner> response) { return response.body(); } }); }
Lists the access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListKeysResultInner object
/** * Lists the access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListKeysResultInner object */
public Observable<ServiceResponse<DatabaseAccountListKeysResultInner>> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.listKeys(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DatabaseAccountListKeysResultInner>>>() { @Override public Observable<ServiceResponse<DatabaseAccountListKeysResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DatabaseAccountListKeysResultInner> clientResponse = listKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DatabaseAccountListKeysResultInner> listKeysDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DatabaseAccountListKeysResultInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DatabaseAccountListKeysResultInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Lists the connection strings for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the DatabaseAccountListConnectionStringsResultInner object if successful.
/** * Lists the connection strings for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountListConnectionStringsResultInner object if successful. */
public DatabaseAccountListConnectionStringsResultInner listConnectionStrings(String resourceGroupName, String accountName) { return listConnectionStringsWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Lists the connection strings for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Lists the connection strings for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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<DatabaseAccountListConnectionStringsResultInner> listConnectionStringsAsync(String resourceGroupName, String accountName, final ServiceCallback<DatabaseAccountListConnectionStringsResultInner> serviceCallback) { return ServiceFuture.fromResponse(listConnectionStringsWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Lists the connection strings for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListConnectionStringsResultInner object
/** * Lists the connection strings for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListConnectionStringsResultInner object */
public Observable<DatabaseAccountListConnectionStringsResultInner> listConnectionStringsAsync(String resourceGroupName, String accountName) { return listConnectionStringsWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<DatabaseAccountListConnectionStringsResultInner>, DatabaseAccountListConnectionStringsResultInner>() { @Override public DatabaseAccountListConnectionStringsResultInner call(ServiceResponse<DatabaseAccountListConnectionStringsResultInner> response) { return response.body(); } }); }
Lists the connection strings for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListConnectionStringsResultInner object
/** * Lists the connection strings for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListConnectionStringsResultInner object */
public Observable<ServiceResponse<DatabaseAccountListConnectionStringsResultInner>> listConnectionStringsWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.listConnectionStrings(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DatabaseAccountListConnectionStringsResultInner>>>() { @Override public Observable<ServiceResponse<DatabaseAccountListConnectionStringsResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DatabaseAccountListConnectionStringsResultInner> clientResponse = listConnectionStringsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DatabaseAccountListConnectionStringsResultInner> listConnectionStringsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DatabaseAccountListConnectionStringsResultInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DatabaseAccountListConnectionStringsResultInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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 offlineRegion(String resourceGroupName, String accountName, String region) { offlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().last().body(); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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> offlineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(offlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the observable for the request
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> offlineRegionAsync(String resourceGroupName, String accountName, String region) { return offlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the observable for the request
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> offlineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (region == null) { throw new IllegalArgumentException("Parameter region is required and cannot be null."); } final String apiVersion = "2019-08-01"; RegionForOnlineOffline regionParameterForOffline = new RegionForOnlineOffline(); regionParameterForOffline.withRegion(region); Observable<Response<ResponseBody>> observable = service.offlineRegion(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regionParameterForOffline, this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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 beginOfflineRegion(String resourceGroupName, String accountName, String region) { beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().single().body(); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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> beginOfflineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the ServiceResponse object if successful.
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginOfflineRegionAsync(String resourceGroupName, String accountName, String region) { return beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Offline the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the ServiceResponse object if successful.
/** * Offline the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginOfflineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (region == null) { throw new IllegalArgumentException("Parameter region is required and cannot be null."); } final String apiVersion = "2019-08-01"; RegionForOnlineOffline regionParameterForOffline = new RegionForOnlineOffline(); regionParameterForOffline.withRegion(region); return service.beginOfflineRegion(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regionParameterForOffline, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginOfflineRegionDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginOfflineRegionDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(202, new TypeToken<Void>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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 onlineRegion(String resourceGroupName, String accountName, String region) { onlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().last().body(); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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> onlineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(onlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the observable for the request
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> onlineRegionAsync(String resourceGroupName, String accountName, String region) { return onlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the observable for the request
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> onlineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (region == null) { throw new IllegalArgumentException("Parameter region is required and cannot be null."); } final String apiVersion = "2019-08-01"; RegionForOnlineOffline regionParameterForOnline = new RegionForOnlineOffline(); regionParameterForOnline.withRegion(region); Observable<Response<ResponseBody>> observable = service.onlineRegion(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regionParameterForOnline, this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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 beginOnlineRegion(String resourceGroupName, String accountName, String region) { beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().single().body(); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @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> beginOnlineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the ServiceResponse object if successful.
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginOnlineRegionAsync(String resourceGroupName, String accountName, String region) { return beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Online the specified region for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • region – Cosmos DB region, with spaces between words and each word capitalized.
Throws:
Returns:the ServiceResponse object if successful.
/** * Online the specified region for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginOnlineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (region == null) { throw new IllegalArgumentException("Parameter region is required and cannot be null."); } final String apiVersion = "2019-08-01"; RegionForOnlineOffline regionParameterForOnline = new RegionForOnlineOffline(); regionParameterForOnline.withRegion(region); return service.beginOnlineRegion(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), regionParameterForOnline, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginOnlineRegionDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginOnlineRegionDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(202, new TypeToken<Void>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the DatabaseAccountListReadOnlyKeysResultInner object if successful.
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountListReadOnlyKeysResultInner object if successful. */
public DatabaseAccountListReadOnlyKeysResultInner getReadOnlyKeys(String resourceGroupName, String accountName) { return getReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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<DatabaseAccountListReadOnlyKeysResultInner> getReadOnlyKeysAsync(String resourceGroupName, String accountName, final ServiceCallback<DatabaseAccountListReadOnlyKeysResultInner> serviceCallback) { return ServiceFuture.fromResponse(getReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListReadOnlyKeysResultInner object
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object */
public Observable<DatabaseAccountListReadOnlyKeysResultInner> getReadOnlyKeysAsync(String resourceGroupName, String accountName) { return getReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>, DatabaseAccountListReadOnlyKeysResultInner>() { @Override public DatabaseAccountListReadOnlyKeysResultInner call(ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner> response) { return response.body(); } }); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListReadOnlyKeysResultInner object
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object */
public Observable<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>> getReadOnlyKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.getReadOnlyKeys(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>>>() { @Override public Observable<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner> clientResponse = getReadOnlyKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner> getReadOnlyKeysDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DatabaseAccountListReadOnlyKeysResultInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DatabaseAccountListReadOnlyKeysResultInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the DatabaseAccountListReadOnlyKeysResultInner object if successful.
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DatabaseAccountListReadOnlyKeysResultInner object if successful. */
public DatabaseAccountListReadOnlyKeysResultInner listReadOnlyKeys(String resourceGroupName, String accountName) { return listReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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<DatabaseAccountListReadOnlyKeysResultInner> listReadOnlyKeysAsync(String resourceGroupName, String accountName, final ServiceCallback<DatabaseAccountListReadOnlyKeysResultInner> serviceCallback) { return ServiceFuture.fromResponse(listReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListReadOnlyKeysResultInner object
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object */
public Observable<DatabaseAccountListReadOnlyKeysResultInner> listReadOnlyKeysAsync(String resourceGroupName, String accountName) { return listReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>, DatabaseAccountListReadOnlyKeysResultInner>() { @Override public DatabaseAccountListReadOnlyKeysResultInner call(ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner> response) { return response.body(); } }); }
Lists the read-only access keys for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the DatabaseAccountListReadOnlyKeysResultInner object
/** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object */
public Observable<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>> listReadOnlyKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.listReadOnlyKeys(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>>>() { @Override public Observable<ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner> clientResponse = listReadOnlyKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DatabaseAccountListReadOnlyKeysResultInner> listReadOnlyKeysDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DatabaseAccountListReadOnlyKeysResultInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DatabaseAccountListReadOnlyKeysResultInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
Throws:
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void regenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) { regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).toBlocking().last().body(); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @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> regenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind), serviceCallback); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
Throws:
Returns:the observable for the request
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> regenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind) { return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
Throws:
Returns:the observable for the request
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, KeyKind keyKind) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (keyKind == null) { throw new IllegalArgumentException("Parameter keyKind is required and cannot be null."); } final String apiVersion = "2019-08-01"; DatabaseAccountRegenerateKeyParameters keyToRegenerate = new DatabaseAccountRegenerateKeyParameters(); keyToRegenerate.withKeyKind(keyKind); Observable<Response<ResponseBody>> observable = service.regenerateKey(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), keyToRegenerate, this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
Throws:
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void beginRegenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) { beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).toBlocking().single().body(); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @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> beginRegenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind), serviceCallback); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
Throws:
Returns:the ServiceResponse object if successful.
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginRegenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind) { return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Regenerates an access key for the specified Azure Cosmos DB database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • keyKind – The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
Throws:
Returns:the ServiceResponse object if successful.
/** * Regenerates an access key for the specified Azure Cosmos DB database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginRegenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, KeyKind keyKind) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (keyKind == null) { throw new IllegalArgumentException("Parameter keyKind is required and cannot be null."); } final String apiVersion = "2019-08-01"; DatabaseAccountRegenerateKeyParameters keyToRegenerate = new DatabaseAccountRegenerateKeyParameters(); keyToRegenerate.withKeyKind(keyKind); return service.beginRegenerateKey(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), keyToRegenerate, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginRegenerateKeyDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginRegenerateKeyDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(202, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
Params:
  • accountName – Cosmos DB database account name.
Throws:
Returns:the boolean object if successful.
/** * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. * * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the boolean object if successful. */
public boolean checkNameExists(String accountName) { return checkNameExistsWithServiceResponseAsync(accountName).toBlocking().single().body(); }
Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
Params:
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. * * @param accountName Cosmos DB database account 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<Boolean> checkNameExistsAsync(String accountName, final ServiceCallback<Boolean> serviceCallback) { return ServiceFuture.fromResponse(checkNameExistsWithServiceResponseAsync(accountName), serviceCallback); }
Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
Params:
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the Boolean object
/** * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. * * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Boolean object */
public Observable<Boolean> checkNameExistsAsync(String accountName) { return checkNameExistsWithServiceResponseAsync(accountName).map(new Func1<ServiceResponse<Boolean>, Boolean>() { @Override public Boolean call(ServiceResponse<Boolean> response) { return response.body(); } }); }
Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
Params:
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the Boolean object
/** * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. * * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Boolean object */
public Observable<ServiceResponse<Boolean>> checkNameExistsWithServiceResponseAsync(String accountName) { if (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.checkNameExists(accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<Void>, Observable<ServiceResponse<Boolean>>>() { @Override public Observable<ServiceResponse<Boolean>> call(Response<Void> response) { try { ServiceResponse<Boolean> clientResponse = checkNameExistsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Boolean> checkNameExistsDelegate(Response<Void> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Boolean, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(404, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .buildEmpty(response); }
Retrieves the metrics determined by the given filter for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
Throws:
Returns:the List<MetricInner> object if successful.
/** * Retrieves the metrics determined by the given filter for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List&lt;MetricInner&gt; object if successful. */
public List<MetricInner> listMetrics(String resourceGroupName, String accountName, String filter) { return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter).toBlocking().single().body(); }
Retrieves the metrics determined by the given filter for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves the metrics determined by the given filter for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @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<MetricInner>> listMetricsAsync(String resourceGroupName, String accountName, String filter, final ServiceCallback<List<MetricInner>> serviceCallback) { return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter), serviceCallback); }
Retrieves the metrics determined by the given filter for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
Throws:
Returns:the observable to the List<MetricInner> object
/** * Retrieves the metrics determined by the given filter for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;MetricInner&gt; object */
public Observable<List<MetricInner>> listMetricsAsync(String resourceGroupName, String accountName, String filter) { return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter).map(new Func1<ServiceResponse<List<MetricInner>>, List<MetricInner>>() { @Override public List<MetricInner> call(ServiceResponse<List<MetricInner>> response) { return response.body(); } }); }
Retrieves the metrics determined by the given filter for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
Throws:
Returns:the observable to the List<MetricInner> object
/** * Retrieves the metrics determined by the given filter for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;MetricInner&gt; object */
public Observable<ServiceResponse<List<MetricInner>>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String filter) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (filter == null) { throw new IllegalArgumentException("Parameter filter is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<MetricInner>>>>() { @Override public Observable<ServiceResponse<List<MetricInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<MetricInner>> result = listMetricsDelegate(response); List<MetricInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<MetricInner>> clientResponse = new ServiceResponse<List<MetricInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<MetricInner>> listMetricsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<MetricInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<MetricInner>>() { }.getType()) .registerError(CloudException.class) .build(response); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the List<UsageInner> object if successful.
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List&lt;UsageInner&gt; object if successful. */
public List<UsageInner> listUsages(String resourceGroupName, String accountName) { return listUsagesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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<UsageInner>> listUsagesAsync(String resourceGroupName, String accountName, final ServiceCallback<List<UsageInner>> serviceCallback) { return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the List<UsageInner> object
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;UsageInner&gt; object */
public Observable<List<UsageInner>> listUsagesAsync(String resourceGroupName, String accountName) { return listUsagesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<List<UsageInner>>, List<UsageInner>>() { @Override public List<UsageInner> call(ServiceResponse<List<UsageInner>> response) { return response.body(); } }); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the List<UsageInner> object
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;UsageInner&gt; object */
public Observable<ServiceResponse<List<UsageInner>>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; final String filter = null; return service.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<UsageInner>>>>() { @Override public Observable<ServiceResponse<List<UsageInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<UsageInner>> result = listUsagesDelegate(response); List<UsageInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<UsageInner>> clientResponse = new ServiceResponse<List<UsageInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
Throws:
Returns:the List<UsageInner> object if successful.
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List&lt;UsageInner&gt; object if successful. */
public List<UsageInner> listUsages(String resourceGroupName, String accountName, String filter) { return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter).toBlocking().single().body(); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @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<UsageInner>> listUsagesAsync(String resourceGroupName, String accountName, String filter, final ServiceCallback<List<UsageInner>> serviceCallback) { return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter), serviceCallback); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
Throws:
Returns:the observable to the List<UsageInner> object
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;UsageInner&gt; object */
public Observable<List<UsageInner>> listUsagesAsync(String resourceGroupName, String accountName, String filter) { return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter).map(new Func1<ServiceResponse<List<UsageInner>>, List<UsageInner>>() { @Override public List<UsageInner> call(ServiceResponse<List<UsageInner>> response) { return response.body(); } }); }
Retrieves the usages (most recent data) for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • filter – An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
Throws:
Returns:the observable to the List<UsageInner> object
/** * Retrieves the usages (most recent data) for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;UsageInner&gt; object */
public Observable<ServiceResponse<List<UsageInner>>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String filter) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<UsageInner>>>>() { @Override public Observable<ServiceResponse<List<UsageInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<UsageInner>> result = listUsagesDelegate(response); List<UsageInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<UsageInner>> clientResponse = new ServiceResponse<List<UsageInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<UsageInner>> listUsagesDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<UsageInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<UsageInner>>() { }.getType()) .registerError(CloudException.class) .build(response); }
Retrieves metric definitions for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the List<MetricDefinitionInner> object if successful.
/** * Retrieves metric definitions for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List&lt;MetricDefinitionInner&gt; object if successful. */
public List<MetricDefinitionInner> listMetricDefinitions(String resourceGroupName, String accountName) { return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); }
Retrieves metric definitions for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves metric definitions for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account 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<MetricDefinitionInner>> listMetricDefinitionsAsync(String resourceGroupName, String accountName, final ServiceCallback<List<MetricDefinitionInner>> serviceCallback) { return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); }
Retrieves metric definitions for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the List<MetricDefinitionInner> object
/** * Retrieves metric definitions for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;MetricDefinitionInner&gt; object */
public Observable<List<MetricDefinitionInner>> listMetricDefinitionsAsync(String resourceGroupName, String accountName) { return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<List<MetricDefinitionInner>>, List<MetricDefinitionInner>>() { @Override public List<MetricDefinitionInner> call(ServiceResponse<List<MetricDefinitionInner>> response) { return response.body(); } }); }
Retrieves metric definitions for the given database account.
Params:
  • resourceGroupName – Name of an Azure resource group.
  • accountName – Cosmos DB database account name.
Throws:
Returns:the observable to the List<MetricDefinitionInner> object
/** * Retrieves metric definitions for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;MetricDefinitionInner&gt; object */
public Observable<ServiceResponse<List<MetricDefinitionInner>>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String accountName) { 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 (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String apiVersion = "2019-08-01"; return service.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<MetricDefinitionInner>>>>() { @Override public Observable<ServiceResponse<List<MetricDefinitionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<MetricDefinitionInner>> result = listMetricDefinitionsDelegate(response); List<MetricDefinitionInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<MetricDefinitionInner>> clientResponse = new ServiceResponse<List<MetricDefinitionInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<MetricDefinitionInner>> listMetricDefinitionsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<MetricDefinitionInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<MetricDefinitionInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } }