ConfigurationClient.addConfigurationSetting Method

Definition

Overloads

addConfigurationSetting(ConfigurationSetting setting)

Adds a configuration value in the service if that key and label does not exist. The label value of the ConfigurationSetting is optional.

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());
addConfigurationSetting(String key, String label, String value)

Adds a configuration value in the service if that key does not exist. The label 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());

addConfigurationSetting(ConfigurationSetting setting)

Adds a configuration value in the service if that key and label does not exist. The label value of the ConfigurationSetting is optional.

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());
public ConfigurationSetting addConfigurationSetting(ConfigurationSetting setting)

Parameters

setting
ConfigurationSetting

The setting to add based on its key and optional label combination.

Returns

The ConfigurationSetting that was created, or null if a key collision occurs or the key is an invalid value (which will also throw ServiceRequestException described below).

addConfigurationSetting(String key, String label, String value)

Adds a configuration value in the service if that key does not exist. The label 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());
public ConfigurationSetting addConfigurationSetting(String key, String label, String value)

Parameters

key
java.lang.String

The key of the configuration setting to add.

label
java.lang.String

The label of the configuration setting to create. If null no label will be used.

value
java.lang.String

The value associated with this configuration setting key.

Returns

The ConfigurationSetting that was created, or null if a key collision occurs or the key is an invalid value (which will also throw ServiceRequestException described below).

Applies to