Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AppConfig] Resolve name conflict #31260

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions sdk/appconfiguration/azure-appconfiguration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ for item in config_settings:
from azure.appconfiguration import ConfigurationSettingFilter

filters = [ConfigurationSettingFilter(key="my_key1", label="my_label1")]
response = client.begin_create_snapshot(name="my_snapshot_name", filters=filters)
response = client.begin_create_snapshot(name=snapshot_name, filters=filters)
created_snapshot = response.result()
print_snapshot(created_snapshot)
```
Expand All @@ -268,7 +268,7 @@ print_snapshot(created_snapshot)
<!-- SNIPPET:snapshot_samples.get_snapshot -->

```python
received_snapshot = client.get_snapshot(name="my_snapshot_name")
received_snapshot = client.get_snapshot(name=snapshot_name)
```

<!-- END SNIPPET -->
Expand All @@ -278,7 +278,7 @@ received_snapshot = client.get_snapshot(name="my_snapshot_name")
<!-- SNIPPET:snapshot_samples.archive_snapshot -->

```python
archived_snapshot = client.archive_snapshot(name="my_snapshot_name")
archived_snapshot = client.archive_snapshot(name=snapshot_name)
print_snapshot(archived_snapshot)
```

Expand All @@ -289,7 +289,7 @@ print_snapshot(archived_snapshot)
<!-- SNIPPET:snapshot_samples.recover_snapshot -->

```python
recovered_snapshot = client.recover_snapshot(name="my_snapshot_name")
recovered_snapshot = client.recover_snapshot(name=snapshot_name)
print_snapshot(recovered_snapshot)
```

Expand All @@ -311,7 +311,7 @@ for snapshot in client.list_snapshots():
<!-- SNIPPET:snapshot_samples.list_snapshot_configuration_settings -->

```python
for config_setting in client.list_snapshot_configuration_settings(name="my_snapshot_name"):
for config_setting in client.list_snapshot_configuration_settings(name=snapshot_name):
print_configuration_setting(config_setting)
```

Expand Down Expand Up @@ -365,7 +365,7 @@ async for item in config_settings:
from azure.appconfiguration import ConfigurationSettingFilter

filters = [ConfigurationSettingFilter(key="my_key1", label="my_label1")]
response = await client.begin_create_snapshot(name="my_snapshot_name", filters=filters)
response = await client.begin_create_snapshot(name=snapshot_name, filters=filters)
created_snapshot = await response.result()
print_snapshot(created_snapshot)
```
Expand All @@ -375,15 +375,15 @@ print_snapshot(created_snapshot)
<!-- SNIPPET:snapshot_samples_async.get_snapshot -->

```python
received_snapshot = await client.get_snapshot(name="my_snapshot_name")
received_snapshot = await client.get_snapshot(name=snapshot_name)
```

<!-- END SNIPPET -->

<!-- SNIPPET:snapshot_samples_async.archive_snapshot -->

```python
archived_snapshot = await client.archive_snapshot(name="my_snapshot_name")
archived_snapshot = await client.archive_snapshot(name=snapshot_name)
print_snapshot(archived_snapshot)
```

Expand All @@ -392,7 +392,7 @@ print_snapshot(archived_snapshot)
<!-- SNIPPET:snapshot_samples_async.recover_snapshot -->

```python
recovered_snapshot = await client.recover_snapshot(name="my_snapshot_name")
recovered_snapshot = await client.recover_snapshot(name=snapshot_name)
print_snapshot(recovered_snapshot)
```

Expand All @@ -410,7 +410,7 @@ async for snapshot in client.list_snapshots():
<!-- SNIPPET:snapshot_samples_async.list_snapshot_configuration_settings -->

```python
async for config_setting in client.list_snapshot_configuration_settings(name="my_snapshot_name"):
async for config_setting in client.list_snapshot_configuration_settings(name=snapshot_name):
print_configuration_setting(config_setting)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
import os
from azure.appconfiguration import AzureAppConfigurationClient, ConfigurationSetting
from util import print_configuration_setting, print_snapshot
from uuid import uuid4


def main():
CONNECTION_STRING = os.environ["APPCONFIGURATION_CONNECTION_STRING"]
config_setting1 = ConfigurationSetting(key="my_key1", label="my_label1")
config_setting2 = ConfigurationSetting(key="my_key2", label="my_label2")
snapshot_name = uuid4()
with AzureAppConfigurationClient.from_connection_string(CONNECTION_STRING) as client:
client.add_configuration_setting(config_setting1)
client.add_configuration_setting(config_setting2)
Expand All @@ -34,24 +36,24 @@ def main():
from azure.appconfiguration import ConfigurationSettingFilter

filters = [ConfigurationSettingFilter(key="my_key1", label="my_label1")]
response = client.begin_create_snapshot(name="my_snapshot_name", filters=filters)
response = client.begin_create_snapshot(name=snapshot_name, filters=filters)
created_snapshot = response.result()
print_snapshot(created_snapshot)
# [END create_snapshot]
print("")

# [START get_snapshot]
received_snapshot = client.get_snapshot(name="my_snapshot_name")
received_snapshot = client.get_snapshot(name=snapshot_name)
# [END get_snapshot]

# [START archive_snapshot]
archived_snapshot = client.archive_snapshot(name="my_snapshot_name")
archived_snapshot = client.archive_snapshot(name=snapshot_name)
print_snapshot(archived_snapshot)
# [END archive_snapshot]
print("")

# [START recover_snapshot]
recovered_snapshot = client.recover_snapshot(name="my_snapshot_name")
recovered_snapshot = client.recover_snapshot(name=snapshot_name)
print_snapshot(recovered_snapshot)
# [END recover_snapshot]
print("")
Expand All @@ -63,7 +65,7 @@ def main():
print("")

# [START list_snapshot_configuration_settings]
for config_setting in client.list_snapshot_configuration_settings(name="my_snapshot_name"):
for config_setting in client.list_snapshot_configuration_settings(name=snapshot_name):
print_configuration_setting(config_setting)
# [END list_snapshot_configuration_settings]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
from azure.appconfiguration import ConfigurationSetting
from azure.appconfiguration.aio import AzureAppConfigurationClient
from util import print_configuration_setting, print_snapshot
from uuid import uuid4


async def main():
CONNECTION_STRING = os.environ["APPCONFIGURATION_CONNECTION_STRING"]
config_setting1 = ConfigurationSetting(key="my_key1", label="my_label1")
config_setting2 = ConfigurationSetting(key="my_key1", label="my_label2")
snapshot_name = uuid4()
async with AzureAppConfigurationClient.from_connection_string(CONNECTION_STRING) as client:
await client.add_configuration_setting(config_setting1)
await client.add_configuration_setting(config_setting2)
Expand All @@ -36,25 +38,25 @@ async def main():
from azure.appconfiguration import ConfigurationSettingFilter

filters = [ConfigurationSettingFilter(key="my_key1", label="my_label1")]
response = await client.begin_create_snapshot(name="my_snapshot_name", filters=filters)
response = await client.begin_create_snapshot(name=snapshot_name, filters=filters)
created_snapshot = await response.result()
print_snapshot(created_snapshot)
# [END create_snapshot]
print("")

# [START get_snapshot]
received_snapshot = await client.get_snapshot(name="my_snapshot_name")
received_snapshot = await client.get_snapshot(name=snapshot_name)
# [END get_snapshot]
print("")

# [START archive_snapshot]
archived_snapshot = await client.archive_snapshot(name="my_snapshot_name")
archived_snapshot = await client.archive_snapshot(name=snapshot_name)
print_snapshot(archived_snapshot)
# [END archive_snapshot]
print("")

# [START recover_snapshot]
recovered_snapshot = await client.recover_snapshot(name="my_snapshot_name")
recovered_snapshot = await client.recover_snapshot(name=snapshot_name)
print_snapshot(recovered_snapshot)
# [END recover_snapshot]
print("")
Expand All @@ -66,7 +68,7 @@ async def main():
print("")

# [START list_snapshot_configuration_settings]
async for config_setting in client.list_snapshot_configuration_settings(name="my_snapshot_name"):
async for config_setting in client.list_snapshot_configuration_settings(name=snapshot_name):
print_configuration_setting(config_setting)
# [END list_snapshot_configuration_settings]

Expand Down