Class KeyVaultSettingsAsyncClient
KeyVaultSettingsAsyncClient provides asynchronous methods to create, update, get and list
settings for the Azure Key Vault.
Instances of this client are obtained by calling the KeyVaultSettingsClientBuilder.buildAsyncClient()
method on a KeyVaultSettingsClientBuilder object.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetSetting(String name) Get the value of a specific account setting.Get the account's settings.Mono<com.azure.core.http.rest.Response<KeyVaultGetSettingsResult>>Get the account's settings.Mono<com.azure.core.http.rest.Response<KeyVaultSetting>>getSettingWithResponse(String name) Get the value of a specific account setting.updateSetting(KeyVaultSetting setting) Updates a givenaccount setting.Mono<com.azure.core.http.rest.Response<KeyVaultSetting>>updateSettingWithResponse(KeyVaultSetting setting) Updates a givenaccount setting.
-
Method Details
-
updateSetting
Updates a givenaccount setting.Code Samples
Updates a given
setting. Prints out the details of the updatedsetting.KeyVaultSetting settingToUpdate = new KeyVaultSetting(settingName, true); keyVaultSettingsAsyncClient.updateSetting(settingToUpdate) .subscribe(updatedSetting -> System.out.printf("Updated setting '%s' to '%s'.%n", updatedSetting.getName(), updatedSetting.asBoolean()));- Parameters:
setting- Theaccount settingto update.- Returns:
- A
Monocontaining the updatedaccount setting. - Throws:
NullPointerException- ifsettingisnull.com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException- thrown if the request is rejected by the server.
-
updateSettingWithResponse
public Mono<com.azure.core.http.rest.Response<KeyVaultSetting>> updateSettingWithResponse(KeyVaultSetting setting) Updates a givenaccount setting.Code Samples
Updates a given
setting. Prints out the details of theHTTP responseand the updatedsetting.KeyVaultSetting mySettingToUpdate = new KeyVaultSetting(settingName, true); keyVaultSettingsAsyncClient.updateSettingWithResponse(mySettingToUpdate) .subscribe(response -> System.out.printf("Response successful with status code: %d. Updated setting '%s' to '%s'.%n", response.getStatusCode(), response.getValue().getName(), response.getValue().asBoolean()));- Parameters:
setting- Theaccount settingto update.- Returns:
- A
Monocontaining aResponsewhosevaluecontains the updatedaccount setting. - Throws:
NullPointerException- ifsettingisnull.com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException- thrown if the request is rejected by the server.
-
getSetting
Get the value of a specific account setting.Code Samples
Retrieves a specific
setting. Prints out the details of the retrievedsetting.keyVaultSettingsAsyncClient.getSetting(settingName) .subscribe(setting -> System.out.printf("Retrieved setting '%s' with value '%s'.%n", setting.getName(), setting.asBoolean()));- Parameters:
name- The name of setting to retrieve the value of.- Returns:
- A
Monocontaining theaccount setting. - Throws:
IllegalArgumentException- thrown if the setting type is not supported.com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException- thrown if the request is rejected by the server.
-
getSettingWithResponse
Get the value of a specific account setting.Code Samples
Retrieves a specific
setting. Prints out the details of theHTTP responseand the retrievedsetting.keyVaultSettingsAsyncClient.getSettingWithResponse(settingName) .subscribe(response -> System.out.printf("Response successful with status code: %d. Retrieved setting '%s' with value '%s'.%n", response.getStatusCode(), response.getValue().getName(), response.getValue().asBoolean()));- Parameters:
name- The name of setting to retrieve the value of.- Returns:
- A
Monocontaining aResponsewhosevaluecontains theaccount setting. - Throws:
IllegalArgumentException- thrown if the setting type is not supported.com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException- thrown if the request is rejected by the server.
-
getSettings
Get the account's settings.Code Samples
Retrieves all the
settingsfor an account. Prints out the details of the retrievedsettings.keyVaultSettingsAsyncClient.getSettings().subscribe(getSettingsResult -> getSettingsResult.getSettings().forEach(setting -> System.out.printf("Retrieved setting with name '%s' and value %s'.%n", setting.getName(), setting.asBoolean())));- Returns:
- A
Monocontaining aresult objectwrapping the list ofaccount settings. - Throws:
IllegalArgumentException- thrown if a setting type in the list is not supported.com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException- thrown if the request is rejected by the server.
-
getSettingsWithResponse
Get the account's settings.Code Samples
Retrieves all
settings for an account. Prints out the details of theHTTP responseand the retrievedsettings.keyVaultSettingsAsyncClient.getSettingsWithResponse() .subscribe(response -> { System.out.printf("Response successful with status code: %d.", response.getStatusCode()); KeyVaultGetSettingsResult getSettingsResult = response.getValue(); List<KeyVaultSetting> settings = getSettingsResult.getSettings(); settings.forEach(setting -> System.out.printf("Retrieved setting with name '%s' and value %s'.%n", setting.getName(), setting.asBoolean())); });- Returns:
- A
Monocontaining aResponsewhosevaluecontains aresult objectwrapping the list ofaccount settings. - Throws:
IllegalArgumentException- thrown if a setting type in the list is not supported.com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException- thrown if the request is rejected by the server.
-