Class ConfigurationClient
ConfigurationSettings
in Azure App Configuration Store. Operations allowed by the client are adding, retrieving, deleting, set read-only
status ConfigurationSettings, and listing settings or revision of a setting based on a
filter
.
Instantiating a synchronous Configuration Client
ConfigurationClient configurationClient = new ConfigurationClientBuilder() .connectionString(connectionString) .buildClient();
View this
for additional ways to construct the client.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdds a configuration value in the service if that key and label does not exist.addConfigurationSetting
(String key, String label, String value) Adds a configuration value in the service if that key does not exist.addConfigurationSettingWithResponse
(ConfigurationSetting setting, Context context) Adds a configuration value in the service if that key and label does not exist.Deletes theConfigurationSetting
with a matchingkey
, and optionallabel
and optional ETag combination.deleteConfigurationSetting
(String key, String label) deleteConfigurationSettingWithResponse
(ConfigurationSetting setting, boolean ifUnchanged, Context context) Deletes theConfigurationSetting
with a matchingkey
, and optionallabel
and optional ETag combination.getConfigurationSetting
(String key, String label) Attempts to get a ConfigurationSetting that matches thekey
, and the optionallabel
combination.getConfigurationSetting
(String key, String label, OffsetDateTime acceptDateTime) Attempts to get a ConfigurationSetting that matches thekey
, the optionallabel
, and the optionalacceptDateTime
combination.getConfigurationSettingWithResponse
(ConfigurationSetting setting, OffsetDateTime acceptDateTime, boolean ifChanged, Context context) listConfigurationSettings
(SettingSelector selector) Fetches the configuration settings that match theselector
.listConfigurationSettings
(SettingSelector selector, Context context) Fetches the configuration settings that match theselector
.listRevisions
(SettingSelector selector) Lists chronological/historical representation ofConfigurationSetting
resource(s).listRevisions
(SettingSelector selector, Context context) Lists chronological/historical representation ofConfigurationSetting
resource(s).Creates or updates a configuration value in the service.setConfigurationSetting
(String key, String label, String value) Creates or updates a configuration value in the service with the given key and.setConfigurationSettingWithResponse
(ConfigurationSetting setting, boolean ifUnchanged, Context context) Creates or updates a configuration value in the service.setReadOnly
(ConfigurationSetting setting, boolean isReadOnly) Sets the read-only status for theConfigurationSetting
.setReadOnly
(String key, String label, boolean isReadOnly) setReadOnlyWithResponse
(ConfigurationSetting setting, boolean isReadOnly, Context context) Sets the read-only status for theConfigurationSetting
.void
updateSyncToken
(String token) Adds an external synchronization token to ensure service requests receive up-to-date values.
-
Method Details
-
addConfigurationSetting
Adds a configuration value in the service if that key does not exist. Thelabel
is optional.Code Samples
Add a setting with the key "prodDBConnection", label "westUS" and value "db_connection".
ConfigurationSetting result = configurationClient .addConfigurationSetting("prodDBConnection", "westUS", "db_connection"); System.out.printf("Key: %s, Label: %s, Value: %s", result.getKey(), result.getLabel(), result.getValue());
- Parameters:
key
- The key of the configuration setting to add.label
- The label of the configuration setting to create. Ifnull
no label will be used.value
- The value associated with this configuration setting key.- Returns:
- The
ConfigurationSetting
that was created, ornull
if a key collision occurs or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.ResourceModifiedException
- If a ConfigurationSetting with the same key exists.HttpResponseException
- Ifkey
is an empty string.
-
addConfigurationSetting
Adds a configuration value in the service if that key and label does not exist. The label value of the ConfigurationSetting is optional. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Add a setting with the key "prodDBConnection", label "westUS" and value "db_connection".
ConfigurationSetting setting = configurationClient.addConfigurationSetting( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS").setValue("db_connection")); System.out.printf("Key: %s, Label: %s, Value: %s", setting.getKey(), setting.getLabel(), setting.getValue());
- Parameters:
setting
- The setting to add based on its key and optional label combination.- Returns:
- The
ConfigurationSetting
that was created, ornull
if a key collision occurs or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
NullPointerException
- Ifsetting
isnull
.IllegalArgumentException
- Ifkey
isnull
.ResourceModifiedException
- If a ConfigurationSetting with the same key and label exists.HttpResponseException
- Ifkey
is an empty string.
-
addConfigurationSettingWithResponse
public Response<ConfigurationSetting> addConfigurationSettingWithResponse(ConfigurationSetting setting, Context context) Adds a configuration value in the service if that key and label does not exist. The label value of the ConfigurationSetting is optional. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Add a setting with the key "prodDBConnection", label "westUS", and value "db_connection".
Response<ConfigurationSetting> responseResultSetting = configurationClient .addConfigurationSettingWithResponse( new ConfigurationSetting() .setKey("prodDBConnection").setLabel("westUS").setValue("db_connection"), new Context(key1, value1)); final ConfigurationSetting resultSetting = responseResultSetting.getValue(); System.out.printf("Key: %s, Label: %s, Value: %s", resultSetting.getKey(), resultSetting.getLabel(), resultSetting.getValue());
- Parameters:
setting
- The setting to add based on its key and optional label combination.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response containing the the
ConfigurationSetting
that was created, ornull
, if a key collision occurs or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
NullPointerException
- Ifsetting
isnull
.IllegalArgumentException
- Ifkey
isnull
.ResourceModifiedException
- If a ConfigurationSetting with the same key and label exists.HttpResponseException
- Ifkey
is an empty string.
-
setConfigurationSetting
Creates or updates a configuration value in the service with the given key and. thelabel
is optional.Code Samples
Add a setting with the key "prodDBConnection", "westUS" and value "db_connection".
Update setting's value "db_connection" to "updated_db_connection"
ConfigurationSetting result = configurationClient .setConfigurationSetting("prodDBConnection", "westUS", "db_connection"); System.out.printf("Key: %s, Label: %s, Value: %s", result.getKey(), result.getLabel(), result.getValue()); // Update the value of the setting to "updated_db_connection". result = configurationClient.setConfigurationSetting( "prodDBConnection", "westUS", "updated_db_connection"); System.out.printf("Key: %s, Label: %s, Value: %s", result.getKey(), result.getLabel(), result.getValue());
- Parameters:
key
- The key of the configuration setting to create or update.label
- The label of the configuration setting to create or update. Ifnull
no label will be used.value
- The value of this configuration setting.- Returns:
- The
ConfigurationSetting
that was created or updated, ornull
if the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.ResourceModifiedException
- If the setting exists and is read-only.HttpResponseException
- Ifkey
is an empty string.
-
setConfigurationSetting
Creates or updates a configuration value in the service. Partial updates are not supported and the entire configuration setting is updated. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Add a setting with the key "prodDBConnection" and value "db_connection".
Update setting's value "db_connection" to "updated_db_connection"
ConfigurationSetting setting = configurationClient.setConfigurationSetting( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS").setValue("db_connection")); System.out.printf("Key: %s, Label: %s, Value: %s", setting.getKey(), setting.getLabel(), setting.getValue()); // Update the value of the setting to "updated_db_connection". setting = configurationClient.setConfigurationSetting( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS").setValue("updated_db_connection")); System.out.printf("Key: %s, Label: %s, Value: %s", setting.getKey(), setting.getLabel(), setting.getValue());
- Parameters:
setting
- The setting to create or update based on its key, optional label and optional ETag combination.- Returns:
- The
ConfigurationSetting
that was created or updated, ornull
if the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
NullPointerException
- Ifsetting
isnull
.IllegalArgumentException
- Ifkey
isnull
.ResourceModifiedException
- If theETag
was specified, is not the wildcard character, and the current configuration value's ETag does not match, or the setting exists and is read-only.HttpResponseException
- Ifkey
is an empty string.
-
setConfigurationSettingWithResponse
public Response<ConfigurationSetting> setConfigurationSettingWithResponse(ConfigurationSetting setting, boolean ifUnchanged, Context context) Creates or updates a configuration value in the service. Partial updates are not supported and the entire configuration setting is updated. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
. IfETag
is specified, the configuration value is updated if the current setting's ETag matches. If the ETag's value is equal to the wildcard character ("*"
), the setting will always be updated.Code Samples
Add a setting with the key "prodDBConnection" and value "db_connection".
Update setting's value "db_connection" to "updated_db_connection"
// Add a setting with the key "prodDBConnection", label "westUS", and value "db_connection" Response<ConfigurationSetting> responseSetting = configurationClient.setConfigurationSettingWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS").setValue("db_connection"), false, new Context(key2, value2)); final ConfigurationSetting initSetting = responseSetting.getValue(); System.out.printf("Key: %s, Value: %s", initSetting.getKey(), initSetting.getValue()); // Update the value of the setting to "updated_db_connection". responseSetting = configurationClient.setConfigurationSettingWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS").setValue("updated_db_connection"), false, new Context(key2, value2)); final ConfigurationSetting updatedSetting = responseSetting.getValue(); System.out.printf("Key: %s, Value: %s", updatedSetting.getKey(), updatedSetting.getValue());
- Parameters:
setting
- The setting to create or update based on its key, optional label and optional ETag combination.ifUnchanged
- A boolean indicates ifsetting
ETag
is used as a IF-MATCH header.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response contains the
ConfigurationSetting
that was created or updated, ornull
, if the configuration value does not exist or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
NullPointerException
- Ifsetting
isnull
.IllegalArgumentException
- Ifkey
isnull
.ResourceModifiedException
- If theETag
was specified, is not the wildcard character, and the current configuration value's ETag does not match, or the setting exists and is read-only.HttpResponseException
- Ifkey
is an empty string.
-
getConfigurationSetting
Attempts to get a ConfigurationSetting that matches thekey
, and the optionallabel
combination.Code Samples
Retrieve the setting with the key "prodDBConnection".
ConfigurationSetting resultNoDateTime = configurationClient.getConfigurationSetting("prodDBConnection", null); System.out.printf("Key: %s, Value: %s", resultNoDateTime.getKey(), resultNoDateTime.getValue());
- Parameters:
key
- The key of the setting to retrieve.label
- The label of the configuration setting to retrieve. Ifnull
no label will be used.- Returns:
- The
ConfigurationSetting
stored in the service, ornull
, if the configuration value does not exist or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.ResourceNotFoundException
- If a ConfigurationSetting withkey
does not exist.HttpResponseException
- Ifkey
is an empty string.
-
getConfigurationSetting
public ConfigurationSetting getConfigurationSetting(String key, String label, OffsetDateTime acceptDateTime) Attempts to get a ConfigurationSetting that matches thekey
, the optionallabel
, and the optionalacceptDateTime
combination.Code Samples
Retrieve the setting with the key "prodDBConnection".
ConfigurationSetting result = configurationClient.getConfigurationSetting("prodDBConnection", null, null); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());
- Parameters:
key
- The key of the setting to retrieve.label
- The label of the configuration setting to create or update. Ifnull
no label will be used.acceptDateTime
- Datetime to access a past state of the configuration setting. Ifnull
then the current state of the configuration setting will be returned.- Returns:
- The
ConfigurationSetting
stored in the service, ornull
, if the configuration value does not exist or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.ResourceNotFoundException
- If a ConfigurationSetting withkey
does not exist.HttpResponseException
- Ifkey
is an empty string.
-
getConfigurationSetting
Attempts to get the ConfigurationSetting with a matchingkey
, and optionallabel
, optionalacceptDateTime
and optional ETag combination. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Retrieve the setting with the key "prodDBConnection".
ConfigurationSetting setting = configurationClient.getConfigurationSetting( new ConfigurationSetting().setKey("prodDBConnection")); System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
- Parameters:
setting
- The setting to retrieve.- Returns:
- The
ConfigurationSetting
stored in the service, ornull
, if the configuration value does not exist or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
NullPointerException
- Ifsetting
isnull
.IllegalArgumentException
- Ifkey
isnull
.ResourceNotFoundException
- If a ConfigurationSetting with the same key and label does not exist.HttpResponseException
- If thekey
is an empty string.
-
getConfigurationSettingWithResponse
public Response<ConfigurationSetting> getConfigurationSettingWithResponse(ConfigurationSetting setting, OffsetDateTime acceptDateTime, boolean ifChanged, Context context) Attempts to get the ConfigurationSetting with a matchingkey
, and optionallabel
, optionalacceptDateTime
and optional ETag combination. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Retrieve the setting with the key "prodDBConnection".
// Retrieve the setting with the key-label "prodDBConnection"-"westUS". Response<ConfigurationSetting> responseResultSetting = configurationClient.getConfigurationSettingWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), null, false, new Context(key1, value1)); System.out.printf("Key: %s, Value: %s", responseResultSetting.getValue().getKey(), responseResultSetting.getValue().getValue());
- Parameters:
setting
- The setting to retrieve.acceptDateTime
- Datetime to access a past state of the configuration setting. Ifnull
then the current state of the configuration setting will be returned.ifChanged
- Flag indicating if thesetting
ETag
is used as a If-None-Match header.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response contains the
ConfigurationSetting
stored in the service, ornull
, if the configuration value does not exist or the key is an invalid value (which will also throw ServiceRequestException described below). - Throws:
NullPointerException
- Ifsetting
isnull
.IllegalArgumentException
- Ifkey
isnull
.ResourceNotFoundException
- If a ConfigurationSetting with the same key and label does not exist.HttpResponseException
- If thekey
is an empty string.
-
deleteConfigurationSetting
Deletes theConfigurationSetting
with a matchingkey
and optionallabel
combination.Code Samples
Delete the setting with the key "prodDBConnection".
ConfigurationSetting result = configurationClient.deleteConfigurationSetting("prodDBConnection", null); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());
- Parameters:
key
- The key of configuration setting to delete.label
- The label of configuration setting to delete. Ifnull
no label will be used.- Returns:
- The deleted ConfigurationSetting or
null
if it didn't exist.null
is also returned if thekey
is an invalid value (which will also throw ServiceRequestException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.ResourceModifiedException
- Ifsetting
is read-only.HttpResponseException
- Ifkey
is an empty string.
-
deleteConfigurationSetting
Deletes theConfigurationSetting
with a matchingkey
, and optionallabel
and optional ETag combination. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Delete the setting with the key "prodDBConnection".
ConfigurationSetting setting = configurationClient.deleteConfigurationSetting( new ConfigurationSetting().setKey("prodDBConnection")); System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
- Parameters:
setting
- The setting to delete based on its key, optional label and optional ETag combination.- Returns:
- The deleted ConfigurationSetting or
null
if it didn't exist.null
is also returned if thekey
is an invalid value (which will also throw ServiceRequestException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.NullPointerException
- Whensetting
isnull
.ResourceModifiedException
- Ifsetting
is read-only.ResourceNotFoundException
- IfETag
is specified, not the wildcard character, and does not match the current ETag value.HttpResponseException
- Ifkey
is an empty string.
-
deleteConfigurationSettingWithResponse
public Response<ConfigurationSetting> deleteConfigurationSettingWithResponse(ConfigurationSetting setting, boolean ifUnchanged, Context context) Deletes theConfigurationSetting
with a matchingkey
, and optionallabel
and optional ETag combination. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
. IfETag
is specified and is not the wildcard character ("*"
), then the setting is only deleted if the ETag matches the current ETag; this means that no one has updated the ConfigurationSetting yet.Code Samples
Delete the setting with the key "prodDBConnection".
Response<ConfigurationSetting> responseSetting = configurationClient.deleteConfigurationSettingWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), false, new Context(key2, value2)); System.out.printf( "Key: %s, Value: %s", responseSetting.getValue().getKey(), responseSetting.getValue().getValue());
- Parameters:
setting
- The setting to delete based on its key, optional label and optional ETag combination.ifUnchanged
- Flag indicating if thesetting
ETag
is used as a IF-MATCH header.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response containing the deleted ConfigurationSetting or
null
if didn't exist.null
is also returned if thekey
is an invalid value orETag
is set but does not match the current ETag (which will also throw ServiceRequestException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.NullPointerException
- Whensetting
isnull
.ResourceModifiedException
- Ifsetting
is read-only.ResourceNotFoundException
- IfETag
is specified, not the wildcard character, and does not match the current ETag value.HttpResponseException
- Ifkey
is an empty string.
-
setReadOnly
Sets the read-only status for theConfigurationSetting
that matches thekey
, the optionallabel
.Code Samples
Set the setting to read-only with the key-label "prodDBConnection"-"westUS".
ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS", true); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());
Clear read-only of the setting with the key-label "prodDBConnection"-"westUS".
ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS", false); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());
- Parameters:
key
- The key of configuration setting to set to read-only or not read-only based on theisReadOnly
.label
- The label of configuration setting to set to read-only or not read-only based on theisReadOnly
value, or optionally. Ifnull
no label will be used.isReadOnly
- Flag used to set the read-only status of the configuration.true
will put the configuration into a read-only state,false
will clear the state.- Returns:
- The
ConfigurationSetting
that is read-only, ornull
is also returned if a key collision occurs or the key is an invalid value (which will also throw HttpResponseException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.HttpResponseException
- Ifkey
is an empty string.
-
setReadOnly
Sets the read-only status for theConfigurationSetting
. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Set the setting to read-only with the key-label "prodDBConnection"-"westUS".
ConfigurationSetting setting = configurationClient.setReadOnly( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), true); System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
Clear read-only of the setting with the key-label "prodDBConnection"-"westUS".
ConfigurationSetting setting = configurationClient.setReadOnly( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), false); System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
- Parameters:
setting
- The configuration setting to set to read-only or not read-only based on theisReadOnly
.isReadOnly
- Flag used to set the read-only status of the configuration.true
will put the configuration into a read-only state,false
will clear the state.- Returns:
- The
ConfigurationSetting
that is read-only, ornull
is also returned if a key collision occurs or the key is an invalid value (which will also throw HttpResponseException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.HttpResponseException
- Ifkey
is an empty string.
-
setReadOnlyWithResponse
public Response<ConfigurationSetting> setReadOnlyWithResponse(ConfigurationSetting setting, boolean isReadOnly, Context context) Sets the read-only status for theConfigurationSetting
. For more configuration setting types, seeFeatureFlagConfigurationSetting
andSecretReferenceConfigurationSetting
.Code Samples
Set the setting to read-only with the key-label "prodDBConnection"-"westUS".
ConfigurationSetting resultSetting = configurationClient.setReadOnlyWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), true, Context.NONE) .getValue(); System.out.printf("Key: %s, Value: %s", resultSetting.getKey(), resultSetting.getValue());
Clear read-only of the setting with the key-label "prodDBConnection"-"westUS".
Response<ConfigurationSetting> responseSetting = configurationClient .setConfigurationSettingWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), false, new Context(key2, value2)); System.out.printf("Key: %s, Value: %s", responseSetting.getValue().getKey(), responseSetting.getValue().getValue());
- Parameters:
setting
- The configuration setting to set to read-only or not read-only based on theisReadOnly
.isReadOnly
- Flag used to set the read-only status of the configuration.true
will put the configuration into a read-only state,false
will clear the state.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response containing the read-only or not read-only ConfigurationSetting if
isReadOnly
is true or null, or false respectively. Or returnnull
if the setting didn't exist.null
is also returned if thekey
is an invalid value. (which will also throw HttpResponseException described below). - Throws:
IllegalArgumentException
- Ifkey
isnull
.HttpResponseException
- Ifkey
is an empty string.
-
listConfigurationSettings
Fetches the configuration settings that match theselector
. Ifselector
isnull
, then all theconfiguration settings
are fetched with their current values.Code Samples
Retrieve all settings that use the key "prodDBConnection".
SettingSelector settingSelector = new SettingSelector().setKeyFilter("prodDBConnection"); configurationClient.listConfigurationSettings(settingSelector).forEach(setting -> { System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue()); });
- Parameters:
selector
- Optional. Selector to filter configuration setting results from the service.- Returns:
- A
PagedIterable
of ConfigurationSettings that matches theselector
. If no options were provided, the List contains all of the current settings in the service. - Throws:
HttpResponseException
- If a client or service error occurs, such as a 404, 409, 429 or 500.
-
listConfigurationSettings
public PagedIterable<ConfigurationSetting> listConfigurationSettings(SettingSelector selector, Context context) Fetches the configuration settings that match theselector
. Ifselector
isnull
, then all theconfiguration settings
are fetched with their current values.Code Samples
Retrieve all settings that use the key "prodDBConnection".
SettingSelector settingSelector = new SettingSelector().setKeyFilter("prodDBConnection"); Context ctx = new Context(key2, value2); configurationClient.listConfigurationSettings(settingSelector, ctx).forEach(setting -> { System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue()); });
- Parameters:
selector
- Optional. Selector to filter configuration setting results from the service.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A
PagedIterable
of ConfigurationSettings that matches theselector
. If no options were provided, thePagedIterable
contains all of the current settings in the service. - Throws:
HttpResponseException
- If a client or service error occurs, such as a 404, 409, 429 or 500.
-
listRevisions
Lists chronological/historical representation ofConfigurationSetting
resource(s). Revisions are provided in descending order from theirlastModified
date. Revisions expire after a period of time, see Pricing for more information. Ifselector
isnull
, then all theConfigurationSettings
are fetched in their current state. Otherwise, the results returned match the parameters given inselector
.Code Samples
Retrieve all revisions of the setting that has the key "prodDBConnection".
SettingSelector settingSelector = new SettingSelector().setKeyFilter("prodDBConnection"); client.listRevisions(settingSelector).streamByPage().forEach(resp -> { System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.getHeaders(), resp.getRequest().getUrl(), resp.getStatusCode()); resp.getItems().forEach(value -> { System.out.printf("Response value is %d %n", value); }); });
- Parameters:
selector
- Optional. Used to filter configuration setting revisions from the service.- Returns:
PagedIterable
ofConfigurationSetting
revisions.- Throws:
HttpResponseException
- If a client or service error occurs, such as a 404, 409, 429 or 500.
-
listRevisions
Lists chronological/historical representation ofConfigurationSetting
resource(s). Revisions are provided in descending order from theirlastModified
date. Revisions expire after a period of time, see Pricing for more information. Ifselector
isnull
, then all theConfigurationSettings
are fetched in their current state. Otherwise, the results returned match the parameters given inselector
.Code Samples
Retrieve all revisions of the setting that has the key "prodDBConnection".
SettingSelector settingSelector = new SettingSelector().setKeyFilter("prodDBConnection"); Context ctx = new Context(key2, value2); configurationClient.listRevisions(settingSelector, ctx).forEach(setting -> { System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue()); });
- Parameters:
selector
- Optional. Used to filter configuration setting revisions from the service.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
PagedIterable
ofConfigurationSetting
revisions.- Throws:
HttpResponseException
- If a client or service error occurs, such as a 404, 409, 429 or 500.
-
updateSyncToken
Adds an external synchronization token to ensure service requests receive up-to-date values.- Parameters:
token
- an external synchronization token to ensure service requests receive up-to-date values.- Throws:
NullPointerException
- if the given token is null.
-