[Automation] Collect examples from azure-sdk-for-js#@azure/arm-digitaltwins_3.1.0
Co-authored-by: azure-sdk <azuresdk@microsoft.com>
This commit is contained in:
Родитель
e86324948b
Коммит
ae369d7182
|
@ -0,0 +1,26 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Check if a DigitalTwinsInstance name is available.
|
||||
*
|
||||
* @summary Check if a DigitalTwinsInstance name is available.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsCheckNameAvailability_example.json
|
||||
*/
|
||||
async function checkNameAvailability() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const location = "WestUS2";
|
||||
const digitalTwinsInstanceCheckName = {
|
||||
name: "myadtinstance",
|
||||
type: "Microsoft.DigitalTwins/digitalTwinsInstances",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.checkNameAvailability(
|
||||
location,
|
||||
digitalTwinsInstanceCheckName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
checkNameAvailability().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,20 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Delete a DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsDelete_WithIdentity_example.json
|
||||
*/
|
||||
async function deleteADigitalTwinsInstanceResourceWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginDeleteAndWait(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteADigitalTwinsInstanceResourceWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,20 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Delete a DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsDelete_example.json
|
||||
*/
|
||||
async function deleteADigitalTwinsInstanceResource() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginDeleteAndWait(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteADigitalTwinsInstanceResource().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a DigitalTwinsInstance endpoint.
|
||||
*
|
||||
* @summary Delete a DigitalTwinsInstance endpoint.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointDelete_WithIdentity_example.json
|
||||
*/
|
||||
async function deleteADigitalTwinsInstanceEndpointWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const endpointName = "myendpoint";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwinsEndpoint.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
endpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteADigitalTwinsInstanceEndpointWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a DigitalTwinsInstance endpoint.
|
||||
*
|
||||
* @summary Delete a DigitalTwinsInstance endpoint.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointDelete_example.json
|
||||
*/
|
||||
async function deleteADigitalTwinsInstanceEndpoint() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const endpointName = "myendpoint";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwinsEndpoint.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
endpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteADigitalTwinsInstanceEndpoint().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get DigitalTwinsInstances Endpoint.
|
||||
*
|
||||
* @summary Get DigitalTwinsInstances Endpoint.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointGet_WithIdentity_example.json
|
||||
*/
|
||||
async function getADigitalTwinsInstanceEndpointWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const endpointName = "myServiceBus";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwinsEndpoint.get(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
endpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getADigitalTwinsInstanceEndpointWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get DigitalTwinsInstances Endpoint.
|
||||
*
|
||||
* @summary Get DigitalTwinsInstances Endpoint.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointGet_example.json
|
||||
*/
|
||||
async function getADigitalTwinsInstanceEndpoint() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const endpointName = "myServiceBus";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwinsEndpoint.get(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
endpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getADigitalTwinsInstanceEndpoint().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update DigitalTwinsInstance endpoint.
|
||||
*
|
||||
* @summary Create or update DigitalTwinsInstance endpoint.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointPut_WithIdentity_example.json
|
||||
*/
|
||||
async function putADigitalTwinsEndpointResourceWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const endpointName = "myServiceBus";
|
||||
const endpointDescription = {
|
||||
properties: {
|
||||
authenticationType: "IdentityBased",
|
||||
endpointType: "ServiceBus",
|
||||
endpointUri: "sb://mysb.servicebus.windows.net/",
|
||||
entityPath: "mysbtopic",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwinsEndpoint.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
endpointName,
|
||||
endpointDescription
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
putADigitalTwinsEndpointResourceWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,36 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update DigitalTwinsInstance endpoint.
|
||||
*
|
||||
* @summary Create or update DigitalTwinsInstance endpoint.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointPut_example.json
|
||||
*/
|
||||
async function putADigitalTwinsEndpointResource() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const endpointName = "myServiceBus";
|
||||
const endpointDescription = {
|
||||
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",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwinsEndpoint.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
endpointName,
|
||||
endpointDescription
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
putADigitalTwinsEndpointResource().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,23 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get DigitalTwinsInstance Endpoints.
|
||||
*
|
||||
* @summary Get DigitalTwinsInstance Endpoints.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointsGet_WithIdentity_example.json
|
||||
*/
|
||||
async function getADigitalTwinsInstanceEndpointsWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.digitalTwinsEndpoint.list(resourceGroupName, resourceName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getADigitalTwinsInstanceEndpointsWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,23 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get DigitalTwinsInstance Endpoints.
|
||||
*
|
||||
* @summary Get DigitalTwinsInstance Endpoints.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsEndpointsGet_example.json
|
||||
*/
|
||||
async function getADigitalTwinsInstanceEndpoints() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.digitalTwinsEndpoint.list(resourceGroupName, resourceName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getADigitalTwinsInstanceEndpoints().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,20 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get DigitalTwinsInstances resource.
|
||||
*
|
||||
* @summary Get DigitalTwinsInstances resource.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsGet_WithIdentity_example.json
|
||||
*/
|
||||
async function getADigitalTwinsInstanceResourceWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.get(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getADigitalTwinsInstanceResourceWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,20 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get DigitalTwinsInstances resource.
|
||||
*
|
||||
* @summary Get DigitalTwinsInstances resource.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsGet_WithPrivateEndpointConnection_example.json
|
||||
*/
|
||||
async function getADigitalTwinsInstanceResourceWithAPrivateEndpointConnection() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.get(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getADigitalTwinsInstanceResourceWithAPrivateEndpointConnection().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,20 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get DigitalTwinsInstances resource.
|
||||
*
|
||||
* @summary Get DigitalTwinsInstances resource.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsGet_example.json
|
||||
*/
|
||||
async function getADigitalTwinsInstanceResource() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.get(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getADigitalTwinsInstanceResource().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,22 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all the DigitalTwinsInstances in a resource group.
|
||||
*
|
||||
* @summary Get all the DigitalTwinsInstances in a resource group.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsListByResourceGroup_example.json
|
||||
*/
|
||||
async function getDigitalTwinsInstanceResourcesByResourceGroup() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.digitalTwins.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getDigitalTwinsInstanceResourcesByResourceGroup().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,21 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all the DigitalTwinsInstances in a subscription.
|
||||
*
|
||||
* @summary Get all the DigitalTwinsInstances in a subscription.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsList_example.json
|
||||
*/
|
||||
async function getDigitalTwinsInstanceResourcesBySubscription() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.digitalTwins.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getDigitalTwinsInstanceResourcesBySubscription().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,21 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all of the available DigitalTwins service REST API operations.
|
||||
*
|
||||
* @summary Lists all of the available DigitalTwins service REST API operations.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsOperationsList_example.json
|
||||
*/
|
||||
async function getAvailableOperations() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getAvailableOperations().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,27 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update metadata of DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Update metadata of DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsPatch_WithIdentity_example.json
|
||||
*/
|
||||
async function patchADigitalTwinsInstanceResourceWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const digitalTwinsPatchDescription = {
|
||||
identity: { type: "None" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
digitalTwinsPatchDescription
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchADigitalTwinsInstanceResourceWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,27 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update metadata of DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Update metadata of DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsPatch_WithPublicNetworkAccess.json
|
||||
*/
|
||||
async function patchADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const digitalTwinsPatchDescription = {
|
||||
properties: { publicNetworkAccess: "Disabled" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
digitalTwinsPatchDescription
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,27 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update metadata of DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Update metadata of DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsPatch_example.json
|
||||
*/
|
||||
async function patchADigitalTwinsInstanceResource() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const digitalTwinsPatchDescription = {
|
||||
tags: { purpose: "dev" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
digitalTwinsPatchDescription
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchADigitalTwinsInstanceResource().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,28 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsPut_WithIdentity_example.json
|
||||
*/
|
||||
async function putADigitalTwinsInstanceResourceWithIdentity() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const digitalTwinsCreate = {
|
||||
identity: { type: "SystemAssigned" },
|
||||
location: "WestUS2",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
digitalTwinsCreate
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
putADigitalTwinsInstanceResourceWithIdentity().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,28 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsPut_WithPublicNetworkAccess.json
|
||||
*/
|
||||
async function putADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const digitalTwinsCreate = {
|
||||
location: "WestUS2",
|
||||
publicNetworkAccess: "Enabled",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
digitalTwinsCreate
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
putADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance.
|
||||
*
|
||||
* @summary Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to update the DigitalTwinsInstance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/DigitalTwinsPut_example.json
|
||||
*/
|
||||
async function putADigitalTwinsInstanceResource() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const digitalTwinsCreate = { location: "WestUS2" };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.digitalTwins.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
digitalTwinsCreate
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
putADigitalTwinsInstanceResource().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get private endpoint connection properties for the given private endpoint.
|
||||
*
|
||||
* @summary Get private endpoint connection properties for the given private endpoint.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/PrivateEndpointConnectionByConnectionName_example.json
|
||||
*/
|
||||
async function getPrivateEndpointConnectionPropertiesForTheGivenPrivateEndpoint() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const privateEndpointConnectionName = "myPrivateConnection";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.privateEndpointConnections.get(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
privateEndpointConnectionName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getPrivateEndpointConnectionPropertiesForTheGivenPrivateEndpoint().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete private endpoint connection with the specified name.
|
||||
*
|
||||
* @summary Delete private endpoint connection with the specified name.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/PrivateEndpointConnectionDelete_example.json
|
||||
*/
|
||||
async function deletePrivateEndpointConnectionWithTheSpecifiedName() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const privateEndpointConnectionName = "myPrivateConnection";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.privateEndpointConnections.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
privateEndpointConnectionName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deletePrivateEndpointConnectionWithTheSpecifiedName().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the status of a private endpoint connection with the given name.
|
||||
*
|
||||
* @summary Update the status of a private endpoint connection with the given name.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/PrivateEndpointConnectionPut_example.json
|
||||
*/
|
||||
async function updateTheStatusOfAPrivateEndpointConnectionWithTheGivenName() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const privateEndpointConnectionName = "myPrivateConnection";
|
||||
const privateEndpointConnection = {
|
||||
properties: {
|
||||
privateLinkServiceConnectionState: {
|
||||
description: "Approved by johndoe@company.com.",
|
||||
status: "Approved",
|
||||
},
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
privateEndpointConnectionName,
|
||||
privateEndpointConnection
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateTheStatusOfAPrivateEndpointConnectionWithTheGivenName().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,20 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List private endpoint connection properties.
|
||||
*
|
||||
* @summary List private endpoint connection properties.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/PrivateEndpointConnectionsList_example.json
|
||||
*/
|
||||
async function listPrivateEndpointConnectionProperties() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.privateEndpointConnections.list(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
listPrivateEndpointConnectionProperties().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,21 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the specified private link resource for the given Digital Twin.
|
||||
*
|
||||
* @summary Get the specified private link resource for the given Digital Twin.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/PrivateLinkResourcesByGroupId_example.json
|
||||
*/
|
||||
async function getTheSpecifiedPrivateLinkResourceForTheGivenDigitalTwin() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const resourceId = "subResource";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.privateLinkResources.get(resourceGroupName, resourceName, resourceId);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTheSpecifiedPrivateLinkResourceForTheGivenDigitalTwin().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,20 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List private link resources for given Digital Twin.
|
||||
*
|
||||
* @summary List private link resources for given Digital Twin.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/PrivateLinkResourcesList_example.json
|
||||
*/
|
||||
async function listPrivateLinkResourcesForGivenDigitalTwin() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.privateLinkResources.list(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
listPrivateLinkResourcesForGivenDigitalTwin().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete a time series database connection.
|
||||
*
|
||||
* @summary Delete a time series database connection.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/TimeSeriesDatabaseConnectionsDelete_example.json
|
||||
*/
|
||||
async function deleteATimeSeriesDatabaseConnectionForADigitalTwinsInstance() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const timeSeriesDatabaseConnectionName = "myConnection";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.timeSeriesDatabaseConnections.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
timeSeriesDatabaseConnectionName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteATimeSeriesDatabaseConnectionForADigitalTwinsInstance().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,25 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the description of an existing time series database connection.
|
||||
*
|
||||
* @summary Get the description of an existing time series database connection.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/TimeSeriesDatabaseConnectionsGet_example.json
|
||||
*/
|
||||
async function getTimeSeriesDatabaseConnectionForADigitalTwinsInstance() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const timeSeriesDatabaseConnectionName = "myConnection";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.timeSeriesDatabaseConnections.get(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
timeSeriesDatabaseConnectionName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTimeSeriesDatabaseConnectionForADigitalTwinsInstance().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,26 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all existing time series database connections for this DigitalTwins instance.
|
||||
*
|
||||
* @summary Get all existing time series database connections for this DigitalTwins instance.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/TimeSeriesDatabaseConnectionsList_example.json
|
||||
*/
|
||||
async function listTimeSeriesDatabaseConnectionsForADigitalTwinsInstance() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.timeSeriesDatabaseConnections.list(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listTimeSeriesDatabaseConnectionsForADigitalTwinsInstance().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
|
@ -0,0 +1,40 @@
|
|||
const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a time series database connection.
|
||||
*
|
||||
* @summary Create or update a time series database connection.
|
||||
* x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/stable/2022-05-31/examples/TimeSeriesDatabaseConnectionsPut_example.json
|
||||
*/
|
||||
async function createOrReplaceATimeSeriesDatabaseConnectionForADigitalTwinsInstance() {
|
||||
const subscriptionId = "50016170-c839-41ba-a724-51e9df440b9e";
|
||||
const resourceGroupName = "resRg";
|
||||
const resourceName = "myDigitalTwinsService";
|
||||
const timeSeriesDatabaseConnectionName = "myConnection";
|
||||
const timeSeriesDatabaseConnectionDescription = {
|
||||
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",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId);
|
||||
const result = await client.timeSeriesDatabaseConnections.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
timeSeriesDatabaseConnectionName,
|
||||
timeSeriesDatabaseConnectionDescription
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createOrReplaceATimeSeriesDatabaseConnectionForADigitalTwinsInstance().catch(console.error);
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-digitaltwins_3.1.0/sdk/digitaltwins/arm-digitaltwins/README.md"}
|
Загрузка…
Ссылка в новой задаче