[Automation] Collect examples from azure-sdk-for-python#azure-mgmt-digitaltwins_6.4.0

Co-authored-by: azure-sdk <azuresdk@microsoft.com>
This commit is contained in:
Azure-Fluent 2023-03-21 08:02:51 +08:00 коммит произвёл GitHub
Родитель 3bd067e19b
Коммит 815a94e191
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
70 изменённых файлов: 1288 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_check_name_availability_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.check_name_availability(
location="WestUS2",
digital_twins_instance_check_name={
"name": "myadtinstance",
"type": "Microsoft.DigitalTwins/digitalTwinsInstances",
},
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsCheckNameAvailability_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_delete_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_delete(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsDelete_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_delete_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_delete(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsDelete_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoint_delete_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.begin_delete(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
endpoint_name="myendpoint",
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointDelete_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoint_delete_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.begin_delete(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
endpoint_name="myendpoint",
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointDelete_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoint_get_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
endpoint_name="myServiceBus",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointGet_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoint_get_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
endpoint_name="myServiceBus",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointGet_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,42 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoint_put_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
endpoint_name="myServiceBus",
endpoint_description={
"properties": {
"authenticationType": "IdentityBased",
"endpointType": "ServiceBus",
"endpointUri": "sb://mysb.servicebus.windows.net/",
"entityPath": "mysbtopic",
}
},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointPut_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,46 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoint_put_with_user_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
endpoint_name="myServiceBus",
endpoint_description={
"properties": {
"authenticationType": "IdentityBased",
"endpointType": "ServiceBus",
"endpointUri": "sb://mysb.servicebus.windows.net/",
"entityPath": "mysbtopic",
"identity": {
"type": "UserAssigned",
"userAssignedIdentity": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity",
},
}
},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointPut_WithUserIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,42 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoint_put_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
endpoint_name="myServiceBus",
endpoint_description={
"properties": {
"authenticationType": "KeyBased",
"endpointType": "ServiceBus",
"primaryConnectionString": "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc",
"secondaryConnectionString": "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc",
}
},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointPut_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoints_get_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.list(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
for item in response:
print(item)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointsGet_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_endpoints_get_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins_endpoint.list(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
for item in response:
print(item)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsEndpointsGet_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_get_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsGet_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_get_with_private_endpoint_connection_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsGet_WithPrivateEndpointConnection_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_get_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsGet_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_list_by_resource_group_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.list_by_resource_group(
resource_group_name="resRg",
)
for item in response:
print(item)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsListByResourceGroup_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,31 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_list_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.list()
for item in response:
print(item)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsList_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,31 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_operations_list_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.operations.list()
for item in response:
print(item)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsOperationsList_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_patch_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
digital_twins_patch_description={"identity": {"type": "None"}},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPatch_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_patch_with_public_network_access.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
digital_twins_patch_description={"properties": {"publicNetworkAccess": "Disabled"}},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPatch_WithPublicNetworkAccess.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_patch_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
digital_twins_patch_description={"tags": {"purpose": "dev"}},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPatch_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,42 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_put_with_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
digital_twins_create={
"identity": {
"type": "SystemAssigned,UserAssigned",
"userAssignedIdentities": {
"/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {}
},
},
"location": "WestUS2",
},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPut_WithIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_put_with_public_network_access.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
digital_twins_create={"location": "WestUS2", "properties": {"publicNetworkAccess": "Enabled"}},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPut_WithPublicNetworkAccess.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python digital_twins_put_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.digital_twins.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
digital_twins_create={"location": "WestUS2"},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/DigitalTwinsPut_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python private_endpoint_connection_by_connection_name_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.private_endpoint_connections.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
private_endpoint_connection_name="myPrivateConnection",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionByConnectionName_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python private_endpoint_connection_delete_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.private_endpoint_connections.begin_delete(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
private_endpoint_connection_name="myPrivateConnection",
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionDelete_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,42 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python private_endpoint_connection_put_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.private_endpoint_connections.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
private_endpoint_connection_name="myPrivateConnection",
private_endpoint_connection={
"properties": {
"privateLinkServiceConnectionState": {
"description": "Approved by johndoe@company.com.",
"status": "Approved",
}
}
},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionPut_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python private_endpoint_connections_list_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.private_endpoint_connections.list(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateEndpointConnectionsList_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python private_link_resources_by_group_id_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.private_link_resources.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
resource_id="subResource",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateLinkResourcesByGroupId_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python private_link_resources_list_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.private_link_resources.list(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/PrivateLinkResourcesList_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python time_series_database_connections_delete_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.time_series_database_connections.begin_delete(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
time_series_database_connection_name="myConnection",
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsDelete_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python time_series_database_connections_get_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.time_series_database_connections.get(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
time_series_database_connection_name="myConnection",
)
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsGet_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python time_series_database_connections_list_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.time_series_database_connections.list(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
)
for item in response:
print(item)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsList_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,50 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python time_series_database_connections_put_with_user_identity_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.time_series_database_connections.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
time_series_database_connection_name="myConnection",
time_series_database_connection_description={
"properties": {
"adxDatabaseName": "myDatabase",
"adxEndpointUri": "https://mycluster.kusto.windows.net",
"adxResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster",
"adxTableName": "myTable",
"connectionType": "AzureDataExplorer",
"eventHubEndpointUri": "sb://myeh.servicebus.windows.net/",
"eventHubEntityPath": "myeh",
"eventHubNamespaceResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh",
"identity": {
"type": "UserAssigned",
"userAssignedIdentity": "/subscriptions/50016170-c839-41ba-a724-51e9df440b9e/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity",
},
}
},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsPut_WithUserIdentity_example.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-digitaltwins_6.4.0/sdk/digitaltwins/azure-mgmt-digitaltwins/README.md"}

Просмотреть файл

@ -0,0 +1,49 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.digitaltwins import AzureDigitalTwinsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-digitaltwins
# USAGE
python time_series_database_connections_put_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDigitalTwinsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="50016170-c839-41ba-a724-51e9df440b9e",
)
response = client.time_series_database_connections.begin_create_or_update(
resource_group_name="resRg",
resource_name="myDigitalTwinsService",
time_series_database_connection_name="myConnection",
time_series_database_connection_description={
"properties": {
"adxDatabaseName": "myDatabase",
"adxEndpointUri": "https://mycluster.kusto.windows.net",
"adxRelationshipLifecycleEventsTableName": "myRelationshipLifecycleEventsTable",
"adxResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster",
"adxTableName": "myPropertyUpdatesTable",
"adxTwinLifecycleEventsTableName": "myTwinLifecycleEventsTable",
"connectionType": "AzureDataExplorer",
"eventHubEndpointUri": "sb://myeh.servicebus.windows.net/",
"eventHubEntityPath": "myeh",
"eventHubNamespaceResourceId": "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh",
"recordPropertyAndItemRemovals": "true",
}
},
).result()
print(response)
# x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2023-01-31/examples/TimeSeriesDatabaseConnectionsPut_example.json
if __name__ == "__main__":
main()