Skip to content

Commit c150453

Browse files
authored
Kusto sample update (Azure#20309)
* Update kusto samples * Update kusto samples * Manually update the kusto samples and version * Update samples to v7 * Delete useless test recordings * Undo changes for common lib * Undo changes for common lib * Undo changes for common lib * Update readme.md
1 parent 88a3475 commit c150453

File tree

214 files changed

+8320
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+8320
-15
lines changed

sdk/kusto/arm-kusto/CHANGELOG.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
## 7.0.1 (Unreleased)
44

5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
5+
Add generated samples from swagger examples.
126

137
## 7.0.0 (2022-01-24)
148

sdk/kusto/arm-kusto/_meta.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247",
2+
"commit": "5ce998f5162da881e2fd418477e5458ec297d5fe",
33
"readme": "specification/azure-kusto/resource-manager/readme.md",
4-
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=C:\\Users\\marygao\\project\\azure-sdk-for-js ../azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md --use=@autorest/[email protected].20211217.1",
4+
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=C:\\Users\\marygao\\project\\azure-sdk-for-js ../azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md --use=@autorest/[email protected].20220114.1 --generate-sample=true",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"use": "@autorest/[email protected].20211217.1"
6+
"use": "@autorest/[email protected].20220114.1"
77
}

sdk/kusto/arm-kusto/package.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,21 @@
9898
"docs": "echo skipped"
9999
},
100100
"sideEffects": false,
101-
"autoPublish": true
101+
"//metadata": {
102+
"constantPaths": [
103+
{
104+
"path": "src/kustoManagementClient.ts",
105+
"prefix": "packageDetails"
106+
}
107+
]
108+
},
109+
"autoPublish": true,
110+
"//sampleConfiguration": {
111+
"productName": "",
112+
"productSlugs": [
113+
"azure"
114+
],
115+
"disableDocsMs": true,
116+
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-kusto?view=azure-node-preview"
117+
}
102118
}

sdk/kusto/arm-kusto/sample.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# App registration secret for AAD authentication
2+
AZURE_CLIENT_SECRET=
3+
AZURE_CLIENT_ID=
4+
AZURE_TENANT_ID=
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT License.
11+
/**
12+
* This sample demonstrates how to Approve or reject a private endpoint connection with a given name.
13+
*
14+
* @summary Approve or reject a private endpoint connection with a given name.
15+
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2021-08-27/examples/KustoPrivateEndpointConnectionsCreateOrUpdate.json
16+
*/
17+
import {
18+
PrivateEndpointConnection,
19+
KustoManagementClient
20+
} from "@azure/arm-kusto";
21+
import { DefaultAzureCredential } from "@azure/identity";
22+
23+
async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() {
24+
const subscriptionId = "12345678-1234-1234-1234-123456789098";
25+
const resourceGroupName = "kustorptest";
26+
const clusterName = "kustoclusterrptest4";
27+
const privateEndpointConnectionName = "privateEndpointConnectionName";
28+
const parameters: PrivateEndpointConnection = {
29+
privateLinkServiceConnectionState: {
30+
description: "Approved by [email protected]",
31+
status: "Approved"
32+
}
33+
};
34+
const credential = new DefaultAzureCredential();
35+
const client = new KustoManagementClient(credential, subscriptionId);
36+
const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait(
37+
resourceGroupName,
38+
clusterName,
39+
privateEndpointConnectionName,
40+
parameters
41+
);
42+
console.log(result);
43+
}
44+
45+
approveOrRejectAPrivateEndpointConnectionWithAGivenName().catch(console.error);
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT License.
11+
/**
12+
* This sample demonstrates how to Creates or updates an attached database configuration.
13+
*
14+
* @summary Creates or updates an attached database configuration.
15+
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2021-08-27/examples/KustoAttachedDatabaseConfigurationsCreateOrUpdate.json
16+
*/
17+
import {
18+
AttachedDatabaseConfiguration,
19+
KustoManagementClient
20+
} from "@azure/arm-kusto";
21+
import { DefaultAzureCredential } from "@azure/identity";
22+
23+
async function attachedDatabaseConfigurationsCreateOrUpdate() {
24+
const subscriptionId = "12345678-1234-1234-1234-123456789098";
25+
const resourceGroupName = "kustorptest";
26+
const clusterName = "kustoclusterrptest4";
27+
const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1";
28+
const parameters: AttachedDatabaseConfiguration = {
29+
clusterResourceId:
30+
"/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader",
31+
databaseName: "kustodatabase",
32+
defaultPrincipalsModificationKind: "Union",
33+
location: "westus",
34+
tableLevelSharingProperties: {
35+
externalTablesToExclude: ["ExternalTable2"],
36+
externalTablesToInclude: ["ExternalTable1"],
37+
materializedViewsToExclude: ["MaterializedViewTable2"],
38+
materializedViewsToInclude: ["MaterializedViewTable1"],
39+
tablesToExclude: ["Table2"],
40+
tablesToInclude: ["Table1"]
41+
}
42+
};
43+
const credential = new DefaultAzureCredential();
44+
const client = new KustoManagementClient(credential, subscriptionId);
45+
const result = await client.attachedDatabaseConfigurations.beginCreateOrUpdateAndWait(
46+
resourceGroupName,
47+
clusterName,
48+
attachedDatabaseConfigurationName,
49+
parameters
50+
);
51+
console.log(result);
52+
}
53+
54+
attachedDatabaseConfigurationsCreateOrUpdate().catch(console.error);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT License.
11+
/**
12+
* This sample demonstrates how to Deletes the attached database configuration with the given name.
13+
*
14+
* @summary Deletes the attached database configuration with the given name.
15+
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2021-08-27/examples/KustoAttachedDatabaseConfigurationsDelete.json
16+
*/
17+
import { KustoManagementClient } from "@azure/arm-kusto";
18+
import { DefaultAzureCredential } from "@azure/identity";
19+
20+
async function attachedDatabaseConfigurationsDelete() {
21+
const subscriptionId = "12345678-1234-1234-1234-123456789098";
22+
const resourceGroupName = "kustorptest";
23+
const clusterName = "kustoclusterrptest4";
24+
const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1";
25+
const credential = new DefaultAzureCredential();
26+
const client = new KustoManagementClient(credential, subscriptionId);
27+
const result = await client.attachedDatabaseConfigurations.beginDeleteAndWait(
28+
resourceGroupName,
29+
clusterName,
30+
attachedDatabaseConfigurationName
31+
);
32+
console.log(result);
33+
}
34+
35+
attachedDatabaseConfigurationsDelete().catch(console.error);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT License.
11+
/**
12+
* This sample demonstrates how to Returns an attached database configuration.
13+
*
14+
* @summary Returns an attached database configuration.
15+
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2021-08-27/examples/KustoAttachedDatabaseConfigurationsGet.json
16+
*/
17+
import { KustoManagementClient } from "@azure/arm-kusto";
18+
import { DefaultAzureCredential } from "@azure/identity";
19+
20+
async function attachedDatabaseConfigurationsGet() {
21+
const subscriptionId = "12345678-1234-1234-1234-123456789098";
22+
const resourceGroupName = "kustorptest";
23+
const clusterName = "kustoclusterrptest4";
24+
const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1";
25+
const credential = new DefaultAzureCredential();
26+
const client = new KustoManagementClient(credential, subscriptionId);
27+
const result = await client.attachedDatabaseConfigurations.get(
28+
resourceGroupName,
29+
clusterName,
30+
attachedDatabaseConfigurationName
31+
);
32+
console.log(result);
33+
}
34+
35+
attachedDatabaseConfigurationsGet().catch(console.error);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT License.
11+
/**
12+
* This sample demonstrates how to Deletes a private endpoint connection with a given name.
13+
*
14+
* @summary Deletes a private endpoint connection with a given name.
15+
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2021-08-27/examples/KustoPrivateEndpointConnectionsDelete.json
16+
*/
17+
import { KustoManagementClient } from "@azure/arm-kusto";
18+
import { DefaultAzureCredential } from "@azure/identity";
19+
20+
async function deletesAPrivateEndpointConnectionWithAGivenName() {
21+
const subscriptionId = "12345678-1234-1234-1234-123456789098";
22+
const resourceGroupName = "kustorptest";
23+
const clusterName = "kustoclusterrptest4";
24+
const privateEndpointConnectionName = "privateEndpointConnectionName";
25+
const credential = new DefaultAzureCredential();
26+
const client = new KustoManagementClient(credential, subscriptionId);
27+
const result = await client.privateEndpointConnections.beginDeleteAndWait(
28+
resourceGroupName,
29+
clusterName,
30+
privateEndpointConnectionName
31+
);
32+
console.log(result);
33+
}
34+
35+
deletesAPrivateEndpointConnectionWithAGivenName().catch(console.error);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT License.
11+
/**
12+
* This sample demonstrates how to Gets the network endpoints of all outbound dependencies of a Kusto cluster
13+
*
14+
* @summary Gets the network endpoints of all outbound dependencies of a Kusto cluster
15+
* x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2021-08-27/examples/KustoOutboundNetworkDependenciesList.json
16+
*/
17+
import { KustoManagementClient } from "@azure/arm-kusto";
18+
import { DefaultAzureCredential } from "@azure/identity";
19+
20+
async function getKustoClusterOutboundNetworkDependencies() {
21+
const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
22+
const resourceGroupName = "kustorptest";
23+
const clusterName = "kustoclusterrptest";
24+
const credential = new DefaultAzureCredential();
25+
const client = new KustoManagementClient(credential, subscriptionId);
26+
const resArray = new Array();
27+
for await (let item of client.clusters.listOutboundNetworkDependenciesEndpoints(
28+
resourceGroupName,
29+
clusterName
30+
)) {
31+
resArray.push(item);
32+
}
33+
console.log(resArray);
34+
}
35+
36+
getKustoClusterOutboundNetworkDependencies().catch(console.error);

0 commit comments

Comments
 (0)