diff --git a/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md b/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md index 315745e40a7f..f54c1487cc24 100644 --- a/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md +++ b/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 2.0.0 (2023-06-08) +### Breaking Changes + +- `LanguageExtensionImageNamePython3912`, `LanguageExtensionImageNamePython3912IncludeDeepLearning` from enum `LanguageExtensionImageName` has been removed + + ## 1.3.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go deleted file mode 100644 index 3334af6a379c..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go +++ /dev/null @@ -1,244 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoAttachedDatabaseConfigurationCheckNameAvailability.json -func ExampleAttachedDatabaseConfigurationsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAttachedDatabaseConfigurationsClient().CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.AttachedDatabaseConfigurationsCheckNameRequest{ - Name: to.Ptr("adc1"), - Type: to.Ptr("Microsoft.Kusto/clusters/attachedDatabaseConfigurations"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("adc1"), - // Message: to.Ptr("Name 'adc1' is already taken. Please specify a different name"), - // NameAvailable: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoAttachedDatabaseConfigurationsListByCluster.json -func ExampleAttachedDatabaseConfigurationsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAttachedDatabaseConfigurationsClient().NewListByClusterPager("kustorptest", "kustoCluster2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AttachedDatabaseConfigurationListResult = armkusto.AttachedDatabaseConfigurationListResult{ - // Value: []*armkusto.AttachedDatabaseConfiguration{ - // { - // Name: to.Ptr("kustoCluster2/KustoDatabase8"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2/AttachedDatabaseConfigurations/KustoDatabase8"), - // Location: to.Ptr("westus"), - // Properties: &armkusto.AttachedDatabaseConfigurationProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader"), - // DatabaseName: to.Ptr("db1"), - // DefaultPrincipalsModificationKind: to.Ptr(armkusto.DefaultPrincipalsModificationKindUnion), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster2/KustoDatabase9"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2/AttachedDatabaseConfigurations/KustoDatabase9"), - // Location: to.Ptr("westus"), - // Properties: &armkusto.AttachedDatabaseConfigurationProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader"), - // DatabaseName: to.Ptr("db1"), - // DefaultPrincipalsModificationKind: to.Ptr(armkusto.DefaultPrincipalsModificationKindUnion), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // TableLevelSharingProperties: &armkusto.TableLevelSharingProperties{ - // ExternalTablesToExclude: []*string{ - // to.Ptr("ExternalTable2")}, - // ExternalTablesToInclude: []*string{ - // to.Ptr("ExternalTable1")}, - // FunctionsToExclude: []*string{ - // to.Ptr("functionsToExclude2")}, - // FunctionsToInclude: []*string{ - // to.Ptr("functionsToInclude1")}, - // MaterializedViewsToExclude: []*string{ - // to.Ptr("MaterializedViewTable2")}, - // MaterializedViewsToInclude: []*string{ - // to.Ptr("MaterializedViewTable1")}, - // TablesToExclude: []*string{ - // to.Ptr("Table2")}, - // TablesToInclude: []*string{ - // to.Ptr("Table1")}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoAttachedDatabaseConfigurationsGet.json -func ExampleAttachedDatabaseConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAttachedDatabaseConfigurationsClient().Get(ctx, "kustorptest", "kustoCluster2", "attachedDatabaseConfigurationsTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AttachedDatabaseConfiguration = armkusto.AttachedDatabaseConfiguration{ - // Name: to.Ptr("kustoCluster2/attachedDatabaseConfigurationsTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2/AttachedDatabaseConfigurations/attachedDatabaseConfigurationsTest"), - // Location: to.Ptr("westus"), - // Properties: &armkusto.AttachedDatabaseConfigurationProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2"), - // DatabaseName: to.Ptr("*"), - // DatabaseNamePrefix: to.Ptr("prefix"), - // DefaultPrincipalsModificationKind: to.Ptr(armkusto.DefaultPrincipalsModificationKindUnion), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoAttachedDatabaseConfigurationsCreateOrUpdate.json -func ExampleAttachedDatabaseConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAttachedDatabaseConfigurationsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster2", "attachedDatabaseConfigurationsTest", armkusto.AttachedDatabaseConfiguration{ - Location: to.Ptr("westus"), - Properties: &armkusto.AttachedDatabaseConfigurationProperties{ - ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2"), - DatabaseName: to.Ptr("kustodatabase"), - DatabaseNameOverride: to.Ptr("overridekustodatabase"), - DefaultPrincipalsModificationKind: to.Ptr(armkusto.DefaultPrincipalsModificationKindUnion), - TableLevelSharingProperties: &armkusto.TableLevelSharingProperties{ - ExternalTablesToExclude: []*string{ - to.Ptr("ExternalTable2")}, - ExternalTablesToInclude: []*string{ - to.Ptr("ExternalTable1")}, - MaterializedViewsToExclude: []*string{ - to.Ptr("MaterializedViewTable2")}, - MaterializedViewsToInclude: []*string{ - to.Ptr("MaterializedViewTable1")}, - TablesToExclude: []*string{ - to.Ptr("Table2")}, - TablesToInclude: []*string{ - to.Ptr("Table1")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AttachedDatabaseConfiguration = armkusto.AttachedDatabaseConfiguration{ - // Name: to.Ptr("kustoCluster2/attachedDatabaseConfigurationsTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2/attachedDatabaseConfigurations/attachedDatabaseConfigurationsTest"), - // Location: to.Ptr("westus"), - // Properties: &armkusto.AttachedDatabaseConfigurationProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2"), - // DatabaseName: to.Ptr("db1"), - // DatabaseNameOverride: to.Ptr("overridekustodatabase"), - // DefaultPrincipalsModificationKind: to.Ptr(armkusto.DefaultPrincipalsModificationKindUnion), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // TableLevelSharingProperties: &armkusto.TableLevelSharingProperties{ - // ExternalTablesToExclude: []*string{ - // to.Ptr("ExternalTable2")}, - // ExternalTablesToInclude: []*string{ - // to.Ptr("ExternalTable1")}, - // MaterializedViewsToExclude: []*string{ - // to.Ptr("MaterializedViewTable2")}, - // MaterializedViewsToInclude: []*string{ - // to.Ptr("MaterializedViewTable1")}, - // TablesToExclude: []*string{ - // to.Ptr("Table2")}, - // TablesToInclude: []*string{ - // to.Ptr("Table1")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoAttachedDatabaseConfigurationsDelete.json -func ExampleAttachedDatabaseConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAttachedDatabaseConfigurationsClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "attachedDatabaseConfigurationsTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/autorest.md b/sdk/resourcemanager/kusto/armkusto/autorest.md index 65014577f5da..7bcacf0890d0 100644 --- a/sdk/resourcemanager/kusto/armkusto/autorest.md +++ b/sdk/resourcemanager/kusto/armkusto/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.3.1 +module-version: 2.0.0 ``` diff --git a/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go deleted file mode 100644 index d5f5c50e933a..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go +++ /dev/null @@ -1,207 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterPrincipalAssignmentsCheckNameAvailability.json -func ExampleClusterPrincipalAssignmentsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClusterPrincipalAssignmentsClient().CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.ClusterPrincipalAssignmentCheckNameRequest{ - Name: to.Ptr("kustoprincipal1"), - Type: to.Ptr("Microsoft.Kusto/clusters/principalAssignments"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("kustoprincipal1"), - // Message: to.Ptr("Name 'kustoprincipal1' is already taken. Please specify a different name"), - // NameAvailable: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterPrincipalAssignmentsGet.json -func ExampleClusterPrincipalAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClusterPrincipalAssignmentsClient().Get(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPrincipalAssignment = armkusto.ClusterPrincipalAssignment{ - // Name: to.Ptr("kustoCluster/kustoprincipal1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.ClusterPrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.ClusterPrincipalRoleAllDatabasesAdmin), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterPrincipalAssignmentsCreateOrUpdate.json -func ExampleClusterPrincipalAssignmentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPrincipalAssignmentsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", armkusto.ClusterPrincipalAssignment{ - Properties: &armkusto.ClusterPrincipalProperties{ - PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - Role: to.Ptr(armkusto.ClusterPrincipalRoleAllDatabasesAdmin), - TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPrincipalAssignment = armkusto.ClusterPrincipalAssignment{ - // Name: to.Ptr("kustoCluster/kustoprincipal1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.ClusterPrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.ClusterPrincipalRoleAllDatabasesAdmin), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterPrincipalAssignmentsDelete.json -func ExampleClusterPrincipalAssignmentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPrincipalAssignmentsClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterPrincipalAssignmentsList.json -func ExampleClusterPrincipalAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterPrincipalAssignmentsClient().NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterPrincipalAssignmentListResult = armkusto.ClusterPrincipalAssignmentListResult{ - // Value: []*armkusto.ClusterPrincipalAssignment{ - // { - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoprincipal1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.ClusterPrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.ClusterPrincipalRoleAllDatabasesAdmin), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoprincipal2"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.ClusterPrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("11112222-1234-1234-1234-123456789123"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.ClusterPrincipalRoleAllDatabasesViewer), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go deleted file mode 100644 index 1259eda2045f..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go +++ /dev/null @@ -1,1086 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersGet.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "kustorptest", "kustoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armkusto.Cluster{ - // Name: to.Ptr("kustoCluster"), - // Type: to.Ptr("Microsoft.Kusto/Clusters"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("abcd123"), - // Identity: &armkusto.Identity{ - // Type: to.Ptr(armkusto.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("faabad1f-4876-463c-af9d-6ba2d2d2394c"), - // TenantID: to.Ptr("b932977f-6277-4ab7-a2cd-5bd21f07aaf4"), - // UserAssignedIdentities: map[string]*armkusto.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // Properties: &armkusto.ClusterProperties{ - // AllowedFqdnList: []*string{ - // to.Ptr("my-stroage.blob.core.windows.net")}, - // AllowedIPRangeList: []*string{ - // }, - // EnableAutoStop: to.Ptr(true), - // EnableDiskEncryption: to.Ptr(false), - // EnablePurge: to.Ptr(false), - // EnableStreamingIngest: to.Ptr(true), - // EngineType: to.Ptr(armkusto.EngineTypeV3), - // KeyVaultProperties: &armkusto.KeyVaultProperties{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://dummy.keyvault.com"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // PrivateEndpointConnections: []*armkusto.PrivateEndpointConnection{ - // { - // Name: to.Ptr("privateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/privateEndpointConnections/privateEndpointTest"), - // Properties: &armkusto.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("cluster"), - // PrivateEndpoint: &armkusto.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"), - // }, - // PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // PublicIPType: to.Ptr(armkusto.PublicIPTypeIPv4), - // PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armkusto.ClusterNetworkAccessFlagEnabled), - // }, - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // SystemData: &armkusto.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // CreatedBy: to.Ptr("user@microsoft.com"), - // CreatedByType: to.Ptr(armkusto.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // LastModifiedBy: to.Ptr("user@microsoft.com"), - // LastModifiedByType: to.Ptr(armkusto.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersCreateOrUpdate.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", armkusto.Cluster{ - Location: to.Ptr("westus"), - Identity: &armkusto.Identity{ - Type: to.Ptr(armkusto.IdentityTypeSystemAssigned), - }, - Properties: &armkusto.ClusterProperties{ - AllowedIPRangeList: []*string{ - to.Ptr("0.0.0.0/0")}, - EnableAutoStop: to.Ptr(true), - EnableDoubleEncryption: to.Ptr(false), - EnablePurge: to.Ptr(true), - EnableStreamingIngest: to.Ptr(true), - PublicIPType: to.Ptr(armkusto.PublicIPTypeDualStack), - PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - }, - SKU: &armkusto.AzureSKU{ - Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr(armkusto.AzureSKUTierStandard), - }, - }, &armkusto.ClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armkusto.Cluster{ - // Name: to.Ptr("kustoCluster"), - // Type: to.Ptr("Microsoft.Kusto/Clusters"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("abcd"), - // Identity: &armkusto.Identity{ - // Type: to.Ptr(armkusto.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("faabad1f-4876-463c-af9d-6ba2d2d2394c"), - // TenantID: to.Ptr("b932977f-6277-4ab7-a2cd-5bd21f07aaf4"), - // UserAssignedIdentities: map[string]*armkusto.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // Properties: &armkusto.ClusterProperties{ - // AllowedIPRangeList: []*string{ - // to.Ptr("0.0.0.0/0")}, - // EnableAutoStop: to.Ptr(true), - // EnableDiskEncryption: to.Ptr(false), - // EnableDoubleEncryption: to.Ptr(false), - // EnablePurge: to.Ptr(true), - // EnableStreamingIngest: to.Ptr(true), - // EngineType: to.Ptr(armkusto.EngineTypeV3), - // KeyVaultProperties: &armkusto.KeyVaultProperties{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://dummy.keyvault.com"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // PublicIPType: to.Ptr(armkusto.PublicIPTypeDualStack), - // PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armkusto.ClusterNetworkAccessFlagDisabled), - // }, - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersUpdate.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "kustorptest", "kustoCluster2", armkusto.ClusterUpdate{ - Location: to.Ptr("westus"), - }, &armkusto.ClustersClientBeginUpdateOptions{IfMatch: to.Ptr("*")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armkusto.Cluster{ - // Name: to.Ptr("kustoCluster2"), - // Type: to.Ptr("Microsoft.Kusto/Clusters"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("abcd123"), - // Identity: &armkusto.Identity{ - // Type: to.Ptr(armkusto.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("faabad1f-4876-463c-af9d-6ba2d2d2394c"), - // TenantID: to.Ptr("b932977f-6277-4ab7-a2cd-5bd21f07aaf4"), - // UserAssignedIdentities: map[string]*armkusto.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // Properties: &armkusto.ClusterProperties{ - // EnableAutoStop: to.Ptr(true), - // EnableDiskEncryption: to.Ptr(false), - // EnablePurge: to.Ptr(true), - // EnableStreamingIngest: to.Ptr(true), - // EngineType: to.Ptr(armkusto.EngineTypeV3), - // KeyVaultProperties: &armkusto.KeyVaultProperties{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://dummy.keyvault.com"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // PublicIPType: to.Ptr(armkusto.PublicIPTypeIPv4), - // RestrictOutboundNetworkAccess: to.Ptr(armkusto.ClusterNetworkAccessFlagDisabled), - // }, - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersDelete.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "kustorptest", "kustoCluster2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersStop.json -func ExampleClustersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginStop(ctx, "kustorptest", "kustoCluster2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersStart.json -func ExampleClustersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginStart(ctx, "kustorptest", "kustoCluster2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterListFollowerDatabases.json -func ExampleClustersClient_NewListFollowerDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListFollowerDatabasesPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FollowerDatabaseListResult = armkusto.FollowerDatabaseListResult{ - // Value: []*armkusto.FollowerDatabaseDefinition{ - // { - // AttachedDatabaseConfigurationName: to.Ptr("attachedDbConfiguration"), - // ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/follower1"), - // DatabaseName: to.Ptr("*"), - // DatabaseShareOrigin: to.Ptr(armkusto.DatabaseShareOriginDataShare), - // }, - // { - // AttachedDatabaseConfigurationName: to.Ptr("attachedDbConfiguration2"), - // ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/follower4"), - // DatabaseName: to.Ptr("db1"), - // DatabaseShareOrigin: to.Ptr(armkusto.DatabaseShareOriginDirect), - // TableLevelSharingProperties: &armkusto.TableLevelSharingProperties{ - // ExternalTablesToExclude: []*string{ - // to.Ptr("ExternalTable2")}, - // ExternalTablesToInclude: []*string{ - // to.Ptr("ExternalTable1")}, - // MaterializedViewsToExclude: []*string{ - // to.Ptr("MaterializedViewTable2")}, - // MaterializedViewsToInclude: []*string{ - // to.Ptr("MaterializedViewTable1")}, - // TablesToExclude: []*string{ - // to.Ptr("Table2")}, - // TablesToInclude: []*string{ - // to.Ptr("Table1")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterDetachFollowerDatabases.json -func ExampleClustersClient_BeginDetachFollowerDatabases() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDetachFollowerDatabases(ctx, "kustorptest", "kustoCluster", armkusto.FollowerDatabaseDefinition{ - AttachedDatabaseConfigurationName: to.Ptr("attachedDatabaseConfigurationsTest"), - ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/kustoCluster2"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersDiagnoseVirtualNetwork.json -func ExampleClustersClient_BeginDiagnoseVirtualNetwork() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDiagnoseVirtualNetwork(ctx, "kustorptest", "kustoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiagnoseVirtualNetworkResult = armkusto.DiagnoseVirtualNetworkResult{ - // Findings: []*string{ - // to.Ptr("Outbound dependency 'Storage:443' might not be satisfied (Outbound)")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersListByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListByResourceGroupPager("kustorptest", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterListResult = armkusto.ClusterListResult{ - // Value: []*armkusto.Cluster{ - // { - // Name: to.Ptr("KustoClusterRPTest4"), - // Type: to.Ptr("Microsoft.Kusto/Clusters"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterRPTest4"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("abcd123"), - // Properties: &armkusto.ClusterProperties{ - // AllowedFqdnList: []*string{ - // to.Ptr("my-stroage.blob.core.windows.net")}, - // AllowedIPRangeList: []*string{ - // }, - // EnableDiskEncryption: to.Ptr(false), - // EnableStreamingIngest: to.Ptr(true), - // EngineType: to.Ptr(armkusto.EngineTypeV2), - // KeyVaultProperties: &armkusto.KeyVaultProperties{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://dummy.keyvault.com"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armkusto.ClusterNetworkAccessFlagDisabled), - // }, - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("KustoClusterRPTest3"), - // Type: to.Ptr("Microsoft.Kusto/Clusters"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterRPTest3"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("abcd123"), - // Properties: &armkusto.ClusterProperties{ - // AllowedIPRangeList: []*string{ - // to.Ptr("0.0.0.0/0")}, - // EnableDiskEncryption: to.Ptr(true), - // EnableStreamingIngest: to.Ptr(true), - // EngineType: to.Ptr(armkusto.EngineTypeV3), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armkusto.ClusterNetworkAccessFlagDisabled), - // }, - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersList.json -func ExampleClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterListResult = armkusto.ClusterListResult{ - // Value: []*armkusto.Cluster{ - // { - // Name: to.Ptr("kustoCluster"), - // Type: to.Ptr("Microsoft.Kusto/Clusters"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("abcd123"), - // Properties: &armkusto.ClusterProperties{ - // AllowedFqdnList: []*string{ - // to.Ptr("my-stroage.blob.core.windows.net")}, - // AllowedIPRangeList: []*string{ - // }, - // EnableAutoStop: to.Ptr(true), - // EnableDiskEncryption: to.Ptr(false), - // EnableStreamingIngest: to.Ptr(true), - // EngineType: to.Ptr(armkusto.EngineTypeV3), - // KeyVaultProperties: &armkusto.KeyVaultProperties{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://dummy.keyvault.com"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // PrivateEndpointConnections: []*armkusto.PrivateEndpointConnection{ - // { - // Name: to.Ptr("privateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/privateEndpointConnections/privateEndpointTest"), - // Properties: &armkusto.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("cluster"), - // PrivateEndpoint: &armkusto.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"), - // }, - // PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // PublicIPType: to.Ptr(armkusto.PublicIPTypeDualStack), - // PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armkusto.ClusterNetworkAccessFlagEnabled), - // }, - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("KustoClusterRPTest3"), - // Type: to.Ptr("Microsoft.Kusto/Clusters"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterRPTest3"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("abcd123"), - // Properties: &armkusto.ClusterProperties{ - // AllowedIPRangeList: []*string{ - // to.Ptr("0.0.0.0/0")}, - // EnableDiskEncryption: to.Ptr(true), - // EnableStreamingIngest: to.Ptr(true), - // EngineType: to.Ptr(armkusto.EngineTypeV2), - // PrivateEndpointConnections: []*armkusto.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // PublicIPType: to.Ptr(armkusto.PublicIPTypeIPv4), - // PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armkusto.ClusterNetworkAccessFlagDisabled), - // }, - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersListSkus.json -func ExampleClustersClient_NewListSKUsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListSKUsPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUDescriptionList = armkusto.SKUDescriptionList{ - // Value: []*armkusto.SKUDescription{ - // { - // Name: to.Ptr("Standard_L8s_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West Europe"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US"), - // to.Ptr("West Europe")}, - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_L16s_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West Europe"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US"), - // to.Ptr("West Europe")}, - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_L8as_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West Europe"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US"), - // to.Ptr("West Europe")}, - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_L16as_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West Europe"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US"), - // to.Ptr("West Europe")}, - // Tier: to.Ptr("Standard"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersCheckNameAvailability.json -func ExampleClustersClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().CheckNameAvailability(ctx, "westus", armkusto.ClusterCheckNameRequest{ - Name: to.Ptr("kustoCluster"), - Type: to.Ptr("Microsoft.Kusto/clusters"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("kuskusprod"), - // Message: to.Ptr("Name 'kuskusprod' is already taken. Please specify a different name"), - // NameAvailable: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersListResourceSkus.json -func ExampleClustersClient_NewListSKUsByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListSKUsByResourcePager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListResourceSKUsResult = armkusto.ListResourceSKUsResult{ - // Value: []*armkusto.AzureResourceSKU{ - // { - // Capacity: &armkusto.AzureCapacity{ - // Default: to.Ptr[int32](2), - // Maximum: to.Ptr[int32](100), - // Minimum: to.Ptr[int32](2), - // ScaleType: to.Ptr(armkusto.AzureScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("clusters"), - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL8SV3), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }, - // { - // Capacity: &armkusto.AzureCapacity{ - // Default: to.Ptr[int32](2), - // Maximum: to.Ptr[int32](100), - // Minimum: to.Ptr[int32](2), - // ScaleType: to.Ptr(armkusto.AzureScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("clusters"), - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL8AsV3), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }, - // { - // Capacity: &armkusto.AzureCapacity{ - // Default: to.Ptr[int32](2), - // Maximum: to.Ptr[int32](100), - // Minimum: to.Ptr[int32](2), - // ScaleType: to.Ptr(armkusto.AzureScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("clusters"), - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16AsV3), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }, - // { - // Capacity: &armkusto.AzureCapacity{ - // Default: to.Ptr[int32](2), - // Maximum: to.Ptr[int32](100), - // Minimum: to.Ptr[int32](2), - // ScaleType: to.Ptr(armkusto.AzureScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("clusters"), - // SKU: &armkusto.AzureSKU{ - // Name: to.Ptr(armkusto.AzureSKUNameStandardL16SV3), - // Tier: to.Ptr(armkusto.AzureSKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoOutboundNetworkDependenciesList.json -func ExampleClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListOutboundNetworkDependenciesEndpointsPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OutboundNetworkDependenciesEndpointListResult = armkusto.OutboundNetworkDependenciesEndpointListResult{ - // Value: []*armkusto.OutboundNetworkDependenciesEndpoint{ - // { - // Name: to.Ptr("kustoCluster/AzureActiveDirectory"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/OutboundNetworkDependenciesEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/OutboundNetworkDependenciesEndpoints/AzureActiveDirectory"), - // Properties: &armkusto.OutboundNetworkDependenciesEndpointProperties{ - // Category: to.Ptr("Azure Active Directory"), - // Endpoints: []*armkusto.EndpointDependency{ - // { - // DomainName: to.Ptr("login.microsoftonline.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("graph.windows.net"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("graph.microsoft.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("graph.microsoft-ppe.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster/AzureMonitor"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/OutboundNetworkDependenciesEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/OutboundNetworkDependenciesEndpoints/AzureMonitor"), - // Properties: &armkusto.OutboundNetworkDependenciesEndpointProperties{ - // Category: to.Ptr("Azure Monitor"), - // Endpoints: []*armkusto.EndpointDependency{ - // { - // DomainName: to.Ptr("prod.warmpath.msftcloudes.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("gcs.prod.monitoring.core.windows.net"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("production.diagnostics.monitoring.core.windows.net"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("shoebox2.metrics.nsatc.net:443"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster/CertificateAuthority"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/OutboundNetworkDependenciesEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/OutboundNetworkDependenciesEndpoints/CertificateAuthority"), - // Properties: &armkusto.OutboundNetworkDependenciesEndpointProperties{ - // Category: to.Ptr("Certificate Authority"), - // Endpoints: []*armkusto.EndpointDependency{ - // { - // DomainName: to.Ptr("ocsp.msocsp.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // }}, - // }, - // { - // DomainName: to.Ptr("ocsp.digicert.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // }}, - // }, - // { - // DomainName: to.Ptr("crl3.digicert.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // }}, - // }, - // { - // DomainName: to.Ptr("crl.microsoft.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // }}, - // }, - // { - // DomainName: to.Ptr("www.microsoft.com"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // }}, - // }}, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster/AzureStorage"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/OutboundNetworkDependenciesEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/OutboundNetworkDependenciesEndpoints/AzureStorage"), - // Properties: &armkusto.OutboundNetworkDependenciesEndpointProperties{ - // Category: to.Ptr("Azure Storage"), - // Endpoints: []*armkusto.EndpointDependency{ - // { - // DomainName: to.Ptr("clusterinternalsa.blob.core.windows.net"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("clusterinternalsa.queue.core.windows.net"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("clusterinternalsa.table.core.windows.net"), - // EndpointDetails: []*armkusto.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterListLanguageExtensions.json -func ExampleClustersClient_NewListLanguageExtensionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListLanguageExtensionsPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LanguageExtensionsList = armkusto.LanguageExtensionsList{ - // Value: []*armkusto.LanguageExtension{ - // { - // LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNamePYTHON), - // }, - // { - // LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNameR), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterAddLanguageExtensions.json -func ExampleClustersClient_BeginAddLanguageExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginAddLanguageExtensions(ctx, "kustorptest", "kustoCluster", armkusto.LanguageExtensionsList{ - Value: []*armkusto.LanguageExtension{ - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNamePYTHON), - }, - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNameR), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClusterRemoveLanguageExtensions.json -func ExampleClustersClient_BeginRemoveLanguageExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginRemoveLanguageExtensions(ctx, "kustorptest", "kustoCluster", armkusto.LanguageExtensionsList{ - Value: []*armkusto.LanguageExtension{ - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNamePYTHON), - }, - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNameR), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/constants.go b/sdk/resourcemanager/kusto/armkusto/constants.go index 76c5a28052ae..26352222fdcb 100644 --- a/sdk/resourcemanager/kusto/armkusto/constants.go +++ b/sdk/resourcemanager/kusto/armkusto/constants.go @@ -11,7 +11,7 @@ package armkusto const ( moduleName = "armkusto" - moduleVersion = "v1.3.1" + moduleVersion = "v2.0.0" ) // AzureSKUName - SKU name. @@ -593,11 +593,9 @@ func PossibleKindValues() []Kind { type LanguageExtensionImageName string const ( - LanguageExtensionImageNamePython3108 LanguageExtensionImageName = "Python3_10_8" - LanguageExtensionImageNamePython365 LanguageExtensionImageName = "Python3_6_5" - LanguageExtensionImageNamePython3912 LanguageExtensionImageName = "Python3_9_12" - LanguageExtensionImageNamePython3912IncludeDeepLearning LanguageExtensionImageName = "Python3_9_12IncludeDeepLearning" - LanguageExtensionImageNameR LanguageExtensionImageName = "R" + LanguageExtensionImageNamePython3108 LanguageExtensionImageName = "Python3_10_8" + LanguageExtensionImageNamePython365 LanguageExtensionImageName = "Python3_6_5" + LanguageExtensionImageNameR LanguageExtensionImageName = "R" ) // PossibleLanguageExtensionImageNameValues returns the possible values for the LanguageExtensionImageName const type. @@ -605,8 +603,6 @@ func PossibleLanguageExtensionImageNameValues() []LanguageExtensionImageName { return []LanguageExtensionImageName{ LanguageExtensionImageNamePython3108, LanguageExtensionImageNamePython365, - LanguageExtensionImageNamePython3912, - LanguageExtensionImageNamePython3912IncludeDeepLearning, LanguageExtensionImageNameR, } } diff --git a/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go deleted file mode 100644 index fe8e58d69743..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go +++ /dev/null @@ -1,207 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasePrincipalAssignmentsCheckNameAvailability.json -func ExampleDatabasePrincipalAssignmentsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasePrincipalAssignmentsClient().CheckNameAvailability(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", armkusto.DatabasePrincipalAssignmentCheckNameRequest{ - Name: to.Ptr("kustoprincipal1"), - Type: to.Ptr("Microsoft.Kusto/clusters/databases/principalAssignments"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("kustoprincipal1"), - // Message: to.Ptr("Name 'kustoprincipal1' is already taken. Please specify a different name"), - // NameAvailable: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasePrincipalAssignmentsGet.json -func ExampleDatabasePrincipalAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasePrincipalAssignmentsClient().Get(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabasePrincipalAssignment = armkusto.DatabasePrincipalAssignment{ - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoprincipal1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.DatabasePrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasePrincipalAssignmentsCreateOrUpdate.json -func ExampleDatabasePrincipalAssignmentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasePrincipalAssignmentsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", armkusto.DatabasePrincipalAssignment{ - Properties: &armkusto.DatabasePrincipalProperties{ - PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabasePrincipalAssignment = armkusto.DatabasePrincipalAssignment{ - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoprincipal1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.DatabasePrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasePrincipalAssignmentsDelete.json -func ExampleDatabasePrincipalAssignmentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasePrincipalAssignmentsClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasePrincipalAssignmentsList.json -func ExampleDatabasePrincipalAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasePrincipalAssignmentsClient().NewListPager("kustorptest", "kustoCluster", "Kustodatabase8", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabasePrincipalAssignmentListResult = armkusto.DatabasePrincipalAssignmentListResult{ - // Value: []*armkusto.DatabasePrincipalAssignment{ - // { - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoprincipal1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.DatabasePrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("11223344-1234-1234-1234-123456789999"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoprincipal2"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/PrincipalAssignments"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1"), - // Properties: &armkusto.DatabasePrincipalProperties{ - // AADObjectID: to.Ptr("98765432-1234-1234-1234-123456789123"), - // PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // PrincipalName: to.Ptr("TestApp"), - // PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - // TenantName: to.Ptr("tenantName"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go deleted file mode 100644 index 5696832ef4a6..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go +++ /dev/null @@ -1,493 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasesCheckNameAvailability.json -func ExampleDatabasesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.CheckNameRequest{ - Name: to.Ptr("database1"), - Type: to.Ptr(armkusto.TypeMicrosoftKustoClustersDatabases), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("database1"), - // Message: to.Ptr("Name 'database1' is already taken. Please specify a different name"), - // NameAvailable: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasesListByCluster.json -func ExampleDatabasesClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByClusterPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseListResult = armkusto.DatabaseListResult{ - // Value: []armkusto.DatabaseClassification{ - // &armkusto.ReadWriteDatabase{ - // Name: to.Ptr("kustoCluster/KustoDatabase8"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8"), - // Kind: to.Ptr(armkusto.KindReadWrite), - // Location: to.Ptr("westus"), - // Properties: &armkusto.ReadWriteDatabaseProperties{ - // HotCachePeriod: to.Ptr("P1D"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // SoftDeletePeriod: to.Ptr("P1D"), - // }, - // }, - // &armkusto.ReadOnlyFollowingDatabase{ - // Name: to.Ptr("kustoCluster/KustoDatabase9"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase9"), - // Kind: to.Ptr(armkusto.KindReadOnlyFollowing), - // Location: to.Ptr("westus"), - // Properties: &armkusto.ReadOnlyFollowingDatabaseProperties{ - // AttachedDatabaseConfigurationName: to.Ptr("attachedDatabaseConfigurationsTest"), - // DatabaseShareOrigin: to.Ptr(armkusto.DatabaseShareOriginDirect), - // HotCachePeriod: to.Ptr("P1D"), - // LeaderClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2"), - // OriginalDatabaseName: to.Ptr("KustoDatabase9"), - // PrincipalsModificationKind: to.Ptr(armkusto.PrincipalsModificationKindUnion), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // SoftDeletePeriod: to.Ptr("P1D"), - // Statistics: &armkusto.DatabaseStatistics{ - // Size: to.Ptr[float32](1024), - // }, - // TableLevelSharingProperties: &armkusto.TableLevelSharingProperties{ - // ExternalTablesToExclude: []*string{ - // to.Ptr("ExternalTable2")}, - // ExternalTablesToInclude: []*string{ - // to.Ptr("ExternalTable1")}, - // MaterializedViewsToExclude: []*string{ - // to.Ptr("MaterializedViewTable2")}, - // MaterializedViewsToInclude: []*string{ - // to.Ptr("MaterializedViewTable1")}, - // TablesToExclude: []*string{ - // to.Ptr("Table2")}, - // TablesToInclude: []*string{ - // to.Ptr("Table1")}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasesGet.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DatabasesClientGetResponse{ - // DatabaseClassification: &armkusto.ReadWriteDatabase{ - // Name: to.Ptr("kustoCluster/KustoDatabase8"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8"), - // Kind: to.Ptr(armkusto.KindReadWrite), - // Location: to.Ptr("westus"), - // Properties: &armkusto.ReadWriteDatabaseProperties{ - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // SoftDeletePeriod: to.Ptr("P1D"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabaseReadonlyUpdate.json -func ExampleDatabasesClient_BeginCreateOrUpdate_kustoReadOnlyDatabaseUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "kustoReadOnlyDatabase", &armkusto.ReadOnlyFollowingDatabase{ - Kind: to.Ptr(armkusto.KindReadOnlyFollowing), - Location: to.Ptr("westus"), - Properties: &armkusto.ReadOnlyFollowingDatabaseProperties{ - HotCachePeriod: to.Ptr("P1D"), - }, - }, &armkusto.DatabasesClientBeginCreateOrUpdateOptions{CallerRole: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DatabasesClientCreateOrUpdateResponse{ - // DatabaseClassification: &armkusto.ReadOnlyFollowingDatabase{ - // Name: to.Ptr("kustoCluster/kustoReadOnlyDatabase"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/kustoReadOnlyDatabase"), - // Kind: to.Ptr(armkusto.KindReadOnlyFollowing), - // Location: to.Ptr("westus"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasesCreateOrUpdate.json -func ExampleDatabasesClient_BeginCreateOrUpdate_kustoReadWriteDatabaseCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", &armkusto.ReadWriteDatabase{ - Kind: to.Ptr(armkusto.KindReadWrite), - Location: to.Ptr("westus"), - Properties: &armkusto.ReadWriteDatabaseProperties{ - SoftDeletePeriod: to.Ptr("P1D"), - }, - }, &armkusto.DatabasesClientBeginCreateOrUpdateOptions{CallerRole: to.Ptr(armkusto.CallerRoleAdmin)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DatabasesClientCreateOrUpdateResponse{ - // DatabaseClassification: &armkusto.ReadWriteDatabase{ - // Name: to.Ptr("kustoCluster/KustoDatabase8"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8"), - // Kind: to.Ptr(armkusto.KindReadWrite), - // Location: to.Ptr("westus"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasesUpdate.json -func ExampleDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", &armkusto.ReadWriteDatabase{ - Kind: to.Ptr(armkusto.KindReadWrite), - Properties: &armkusto.ReadWriteDatabaseProperties{ - HotCachePeriod: to.Ptr("P1D"), - }, - }, &armkusto.DatabasesClientBeginUpdateOptions{CallerRole: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DatabasesClientUpdateResponse{ - // DatabaseClassification: &armkusto.ReadWriteDatabase{ - // Name: to.Ptr("kustoCluster/KustoDatabase8"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8"), - // Kind: to.Ptr(armkusto.KindReadWrite), - // Location: to.Ptr("westus"), - // Properties: &armkusto.ReadWriteDatabaseProperties{ - // HotCachePeriod: to.Ptr("P1D"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabasesDelete.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabaseListPrincipals.json -func ExampleDatabasesClient_NewListPrincipalsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListPrincipalsPager("kustorptest", "kustoCluster", "KustoDatabase8", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabasePrincipalListResult = armkusto.DatabasePrincipalListResult{ - // Value: []*armkusto.DatabasePrincipal{ - // { - // Name: to.Ptr("Some User"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeUser), - // AppID: to.Ptr(""), - // Email: to.Ptr("user@microsoft.com"), - // Fqn: to.Ptr("aaduser=some_guid"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // }, - // { - // Name: to.Ptr("Kusto"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeGroup), - // AppID: to.Ptr(""), - // Email: to.Ptr("kusto@microsoft.com"), - // Fqn: to.Ptr("aadgroup=some_guid"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - // }, - // { - // Name: to.Ptr("SomeApp"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeApp), - // AppID: to.Ptr("some_guid_app_id"), - // Email: to.Ptr(""), - // Fqn: to.Ptr("aadapp=some_guid_app_id"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabaseAddPrincipals.json -func ExampleDatabasesClient_AddPrincipals() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().AddPrincipals(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DatabasePrincipalListRequest{ - Value: []*armkusto.DatabasePrincipal{ - { - Name: to.Ptr("Some User"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeUser), - AppID: to.Ptr(""), - Email: to.Ptr("user@microsoft.com"), - Fqn: to.Ptr("aaduser=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }, - { - Name: to.Ptr("Kusto"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeGroup), - AppID: to.Ptr(""), - Email: to.Ptr("kusto@microsoft.com"), - Fqn: to.Ptr("aadgroup=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - }, - { - Name: to.Ptr("SomeApp"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeApp), - AppID: to.Ptr("some_guid_app_id"), - Email: to.Ptr(""), - Fqn: to.Ptr("aadapp=some_guid_app_id"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabasePrincipalListResult = armkusto.DatabasePrincipalListResult{ - // Value: []*armkusto.DatabasePrincipal{ - // { - // Name: to.Ptr("Some User"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeUser), - // AppID: to.Ptr(""), - // Email: to.Ptr("user@microsoft.com"), - // Fqn: to.Ptr("aaduser=some_guid"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // }, - // { - // Name: to.Ptr("Kusto"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeGroup), - // AppID: to.Ptr(""), - // Email: to.Ptr("kusto@microsoft.com"), - // Fqn: to.Ptr("aadgroup=some_guid"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - // }, - // { - // Name: to.Ptr("SomeApp"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeApp), - // AppID: to.Ptr("some_guid_app_id"), - // Email: to.Ptr(""), - // Fqn: to.Ptr("aadapp=some_guid_app_id"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDatabaseRemovePrincipals.json -func ExampleDatabasesClient_RemovePrincipals() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().RemovePrincipals(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DatabasePrincipalListRequest{ - Value: []*armkusto.DatabasePrincipal{ - { - Name: to.Ptr("Some User"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeUser), - AppID: to.Ptr(""), - Email: to.Ptr("user@microsoft.com"), - Fqn: to.Ptr("aaduser=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }, - { - Name: to.Ptr("Kusto"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeGroup), - AppID: to.Ptr(""), - Email: to.Ptr("kusto@microsoft.com"), - Fqn: to.Ptr("aadgroup=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - }, - { - Name: to.Ptr("SomeApp"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeApp), - AppID: to.Ptr("some_guid_app_id"), - Email: to.Ptr(""), - Fqn: to.Ptr("aadapp=some_guid_app_id"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabasePrincipalListResult = armkusto.DatabasePrincipalListResult{ - // Value: []*armkusto.DatabasePrincipal{ - // { - // Name: to.Ptr("Some User"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeUser), - // AppID: to.Ptr(""), - // Email: to.Ptr("user@microsoft.com"), - // Fqn: to.Ptr("aaduser=some_guid"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // }, - // { - // Name: to.Ptr("Kusto"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeGroup), - // AppID: to.Ptr(""), - // Email: to.Ptr("kusto@microsoft.com"), - // Fqn: to.Ptr("aadgroup=some_guid"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - // }, - // { - // Name: to.Ptr("SomeApp"), - // Type: to.Ptr(armkusto.DatabasePrincipalTypeApp), - // AppID: to.Ptr("some_guid_app_id"), - // Email: to.Ptr(""), - // Fqn: to.Ptr("aadapp=some_guid_app_id"), - // Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - // }}, - // } -} diff --git a/sdk/resourcemanager/kusto/armkusto/dataconnections_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/dataconnections_client_example_test.go deleted file mode 100644 index 7897ab969508..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/dataconnections_client_example_test.go +++ /dev/null @@ -1,703 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsListByDatabase.json -func ExampleDataConnectionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataConnectionsClient().NewListByDatabasePager("kustorptest", "kustoCluster", "KustoDatabase8", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataConnectionListResult = armkusto.DataConnectionListResult{ - // Value: []armkusto.DataConnectionClassification{ - // &armkusto.EventHubDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/KustoDataConnection1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection1"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventHubConnectionProperties{ - // Compression: to.Ptr(armkusto.CompressionNone), - // ConsumerGroup: to.Ptr("$Default"), - // DataFormat: to.Ptr(armkusto.EventHubDataFormatJSON), - // DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - // EventSystemProperties: []*string{ - // }, - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t}()), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // &armkusto.EventGridDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/KustoDataConnection2"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection2"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventGridConnectionProperties{ - // BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - // ConsumerGroup: to.Ptr("$Default"), - // DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - // DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - // EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - // IgnoreFirstRecord: to.Ptr(false), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // &armkusto.CosmosDbDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/KustoDataConnection3"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection3"), - // Kind: to.Ptr(armkusto.DataConnectionKindCosmosDb), - // Location: to.Ptr("westus"), - // Properties: &armkusto.CosmosDbDataConnectionProperties{ - // CosmosDbAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1"), - // CosmosDbContainer: to.Ptr("cosmosDbContainerTest"), - // CosmosDbDatabase: to.Ptr("cosmosDbDatabaseTest"), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t}()), - // TableName: to.Ptr("TestTable"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionEventGridValidationAsync.json -func ExampleDataConnectionsClient_BeginDataConnectionValidation_kustoDataConnectionEventGridValidation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginDataConnectionValidation(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DataConnectionValidation{ - DataConnectionName: to.Ptr("dataConnectionTest"), - Properties: &armkusto.EventGridDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - Properties: &armkusto.EventGridConnectionProperties{ - BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - ConsumerGroup: to.Ptr("$Default"), - DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - IgnoreFirstRecord: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - TableName: to.Ptr("TestTable"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataConnectionValidationListResult = armkusto.DataConnectionValidationListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionValidationAsync.json -func ExampleDataConnectionsClient_BeginDataConnectionValidation_kustoDataConnectionValidation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginDataConnectionValidation(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DataConnectionValidation{ - DataConnectionName: to.Ptr("dataConnectionTest"), - Properties: &armkusto.EventHubDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - Properties: &armkusto.EventHubConnectionProperties{ - Compression: to.Ptr(armkusto.CompressionNone), - ConsumerGroup: to.Ptr("testConsumerGroup1"), - DataFormat: to.Ptr(armkusto.EventHubDataFormatJSON), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - TableName: to.Ptr("TestTable"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataConnectionValidationListResult = armkusto.DataConnectionValidationListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsCheckNameAvailability.json -func ExampleDataConnectionsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataConnectionsClient().CheckNameAvailability(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DataConnectionCheckNameRequest{ - Name: to.Ptr("DataConnections8"), - Type: to.Ptr("Microsoft.Kusto/clusters/databases/dataConnections"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("DataConnections8"), - // Message: to.Ptr("Name 'DataConnections8' is already taken. Please specify a different name."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armkusto.ReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsCosmosDbGet.json -func ExampleDataConnectionsClient_Get_kustoDataConnectionsCosmosDbGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataConnectionsClient().Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase1", "dataConnectionTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientGetResponse{ - // DataConnectionClassification: &armkusto.CosmosDbDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase1/KustoDataConnection1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase1/DataConnections/KustoDataConnection1"), - // Kind: to.Ptr(armkusto.DataConnectionKindCosmosDb), - // Location: to.Ptr("westus"), - // Properties: &armkusto.CosmosDbDataConnectionProperties{ - // CosmosDbAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1"), - // CosmosDbContainer: to.Ptr("cosmosDbContainerTest"), - // CosmosDbDatabase: to.Ptr("cosmosDbDatabaseTest"), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t}()), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsEventGridGet.json -func ExampleDataConnectionsClient_Get_kustoDataConnectionsEventGridGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataConnectionsClient().Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientGetResponse{ - // DataConnectionClassification: &armkusto.EventGridDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection9"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventGridConnectionProperties{ - // BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - // ConsumerGroup: to.Ptr("$Default"), - // DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - // DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - // EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - // IgnoreFirstRecord: to.Ptr(false), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsGet.json -func ExampleDataConnectionsClient_Get_kustoDataConnectionsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataConnectionsClient().Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientGetResponse{ - // DataConnectionClassification: &armkusto.EventHubDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/dataConnectionTest"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventHubConnectionProperties{ - // Compression: to.Ptr(armkusto.CompressionNone), - // ConsumerGroup: to.Ptr("$Default"), - // DataFormat: to.Ptr(armkusto.EventHubDataFormatJSON), - // DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - // EventSystemProperties: []*string{ - // }, - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // ProvisioningState: to.Ptr(armkusto.ProvisioningStateSucceeded), - // RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t}()), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsCosmosDbCreateOrUpdate.json -func ExampleDataConnectionsClient_BeginCreateOrUpdate_kustoDataConnectionsCosmosDbCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase1", "dataConnectionTest", &armkusto.CosmosDbDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindCosmosDb), - Location: to.Ptr("westus"), - Properties: &armkusto.CosmosDbDataConnectionProperties{ - CosmosDbAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1"), - CosmosDbContainer: to.Ptr("cosmosDbContainerTest"), - CosmosDbDatabase: to.Ptr("cosmosDbDatabaseTest"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t }()), - TableName: to.Ptr("TestTable"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientCreateOrUpdateResponse{ - // DataConnectionClassification: &armkusto.CosmosDbDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase1/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase1/DataConnections/dataConnectionTest"), - // Kind: to.Ptr(armkusto.DataConnectionKindCosmosDb), - // Location: to.Ptr("westus"), - // Properties: &armkusto.CosmosDbDataConnectionProperties{ - // CosmosDbAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1"), - // CosmosDbContainer: to.Ptr("cosmosDbContainerTest"), - // CosmosDbDatabase: to.Ptr("cosmosDbDatabaseTest"), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t}()), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsCreateOrUpdate.json -func ExampleDataConnectionsClient_BeginCreateOrUpdate_kustoDataConnectionsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventHubDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - Location: to.Ptr("westus"), - Properties: &armkusto.EventHubConnectionProperties{ - ConsumerGroup: to.Ptr("testConsumerGroup1"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientCreateOrUpdateResponse{ - // DataConnectionClassification: &armkusto.EventHubDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/dataConnectionTest"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventHubConnectionProperties{ - // Compression: to.Ptr(armkusto.CompressionNone), - // ConsumerGroup: to.Ptr("testConsumerGroup1"), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsEventGridCreateOrUpdate.json -func ExampleDataConnectionsClient_BeginCreateOrUpdate_kustoDataConnectionsEventGridCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventGridDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - Location: to.Ptr("westus"), - Properties: &armkusto.EventGridConnectionProperties{ - BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - ConsumerGroup: to.Ptr("$Default"), - DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - IgnoreFirstRecord: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - TableName: to.Ptr("TestTable"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientCreateOrUpdateResponse{ - // DataConnectionClassification: &armkusto.EventGridDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection9"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventGridConnectionProperties{ - // BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - // ConsumerGroup: to.Ptr("$Default"), - // DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - // DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - // EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - // IgnoreFirstRecord: to.Ptr(false), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsCosmosDbUpdate.json -func ExampleDataConnectionsClient_BeginUpdate_kustoDataConnectionsCosmosDbUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase1", "dataConnectionTest", &armkusto.CosmosDbDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindCosmosDb), - Location: to.Ptr("westus"), - Properties: &armkusto.CosmosDbDataConnectionProperties{ - CosmosDbAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1"), - CosmosDbContainer: to.Ptr("cosmosDbContainerTest"), - CosmosDbDatabase: to.Ptr("cosmosDbDatabaseTest"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t }()), - TableName: to.Ptr("TestTable"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientUpdateResponse{ - // DataConnectionClassification: &armkusto.CosmosDbDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase1/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase1/DataConnections/dataConnectionTest"), - // Kind: to.Ptr(armkusto.DataConnectionKindCosmosDb), - // Location: to.Ptr("westus"), - // Properties: &armkusto.CosmosDbDataConnectionProperties{ - // CosmosDbAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.DocumentDb/databaseAccounts/cosmosDbAccountTest1"), - // CosmosDbContainer: to.Ptr("cosmosDbContainerTest"), - // CosmosDbDatabase: to.Ptr("cosmosDbDatabaseTest"), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // RetrievalStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-29T12:00:00.6554616Z"); return t}()), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsEventGridUpdate.json -func ExampleDataConnectionsClient_BeginUpdate_kustoDataConnectionsEventGridUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventGridDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - Location: to.Ptr("westus"), - Properties: &armkusto.EventGridConnectionProperties{ - BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - ConsumerGroup: to.Ptr("$Default"), - DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - IgnoreFirstRecord: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - TableName: to.Ptr("TestTable"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientUpdateResponse{ - // DataConnectionClassification: &armkusto.EventGridDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/KustoDataConnection9"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventGridConnectionProperties{ - // BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - // ConsumerGroup: to.Ptr("$Default"), - // DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - // DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - // EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - // IgnoreFirstRecord: to.Ptr(false), - // ManagedIdentityObjectID: to.Ptr("87654321-1234-1234-1234-123456789123"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // MappingRuleName: to.Ptr("TestMapping"), - // StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - // TableName: to.Ptr("TestTable"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsUpdate.json -func ExampleDataConnectionsClient_BeginUpdate_kustoDataConnectionsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventHubDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - Location: to.Ptr("westus"), - Properties: &armkusto.EventHubConnectionProperties{ - ConsumerGroup: to.Ptr("testConsumerGroup1"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armkusto.DataConnectionsClientUpdateResponse{ - // DataConnectionClassification: &armkusto.EventHubDataConnection{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/dataConnectionTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/DataConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/DataConnections/dataConnectionTest"), - // Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - // Location: to.Ptr("westus"), - // Properties: &armkusto.EventHubConnectionProperties{ - // Compression: to.Ptr(armkusto.CompressionNone), - // ConsumerGroup: to.Ptr("testConsumerGroup1"), - // EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - // ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoDataConnectionsDelete.json -func ExampleDataConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataConnectionsClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/go.mod b/sdk/resourcemanager/kusto/armkusto/go.mod index be2f1b6defc5..c72a8efce161 100644 --- a/sdk/resourcemanager/kusto/armkusto/go.mod +++ b/sdk/resourcemanager/kusto/armkusto/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/kusto/armkusto/go.sum b/sdk/resourcemanager/kusto/armkusto/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/kusto/armkusto/go.sum +++ b/sdk/resourcemanager/kusto/armkusto/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go deleted file mode 100644 index a35c34936418..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoManagedPrivateEndpointsCheckNameAvailability.json -func ExampleManagedPrivateEndpointsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedPrivateEndpointsClient().CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.ManagedPrivateEndpointsCheckNameRequest{ - Name: to.Ptr("pme1"), - Type: to.Ptr("Microsoft.Kusto/clusters/managedPrivateEndpoints"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("pme1"), - // Message: to.Ptr("Name 'pme1' is already taken. Please specify a different name"), - // NameAvailable: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoManagedPrivateEndpointsList.json -func ExampleManagedPrivateEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedPrivateEndpointsClient().NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedPrivateEndpointListResult = armkusto.ManagedPrivateEndpointListResult{ - // Value: []*armkusto.ManagedPrivateEndpoint{ - // { - // Name: to.Ptr("kustoCluster/KustoDatabase8/kustomanagedPrivateEndpoint1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/ManagedPrivateEndpoints"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/ManagedPrivateEndpoints/kustoManagedPrivateEndpoint1"), - // Properties: &armkusto.ManagedPrivateEndpointProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - // RequestMessage: to.Ptr("Please Approve."), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster/KustoDatabase8/kustomanagedPrivateEndpoint2"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/ManagedPrivateEndpoints"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/ManagedPrivateEndpoints/kustoManagedPrivateEndpoint2"), - // Properties: &armkusto.ManagedPrivateEndpointProperties{ - // GroupID: to.Ptr("namespace"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHubs/storageAccounts/eventHubTest"), - // RequestMessage: to.Ptr("Please Approve."), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoManagedPrivateEndpointsGet.json -func ExampleManagedPrivateEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedPrivateEndpointsClient().Get(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedPrivateEndpoint = armkusto.ManagedPrivateEndpoint{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/managedPrivateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/ManagedPrivateEndpoints"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/ManagedPrivateEndpoints/managedPrivateEndpointTest"), - // Properties: &armkusto.ManagedPrivateEndpointProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - // RequestMessage: to.Ptr("Please Approve."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoManagedPrivateEndpointsCreateOrUpdate.json -func ExampleManagedPrivateEndpointsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", armkusto.ManagedPrivateEndpoint{ - Properties: &armkusto.ManagedPrivateEndpointProperties{ - GroupID: to.Ptr("blob"), - PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - RequestMessage: to.Ptr("Please Approve."), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedPrivateEndpoint = armkusto.ManagedPrivateEndpoint{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/managedPrivateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/ManagedPrivateEndpoints"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/ManagedPrivateEndpoints/managedPrivateEndpointTest"), - // Properties: &armkusto.ManagedPrivateEndpointProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - // RequestMessage: to.Ptr("Please Approve."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoManagedPrivateEndpointsUpdate.json -func ExampleManagedPrivateEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedPrivateEndpointsClient().BeginUpdate(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", armkusto.ManagedPrivateEndpoint{ - Properties: &armkusto.ManagedPrivateEndpointProperties{ - GroupID: to.Ptr("blob"), - PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - RequestMessage: to.Ptr("Please Approve Managed Private Endpoint Request."), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedPrivateEndpoint = armkusto.ManagedPrivateEndpoint{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/managedPrivateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/ManagedPrivateEndpoints"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/ManagedPrivateEndpoints/managedPrivateEndpointTest"), - // Properties: &armkusto.ManagedPrivateEndpointProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - // RequestMessage: to.Ptr("Please Approve Managed Private Endpoint Request."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoManagedPrivateEndpointsDelete.json -func ExampleManagedPrivateEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedPrivateEndpointsClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go deleted file mode 100644 index f29ee14e7d84..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoOperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armkusto.OperationListResult{ - // Value: []*armkusto.Operation{ - // { - // Name: to.Ptr("operationName"), - // Display: &armkusto.OperationDisplay{ - // Description: to.Ptr("operation description"), - // Operation: to.Ptr("operationName"), - // Provider: to.Ptr("providerName"), - // Resource: to.Ptr("resourceName"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go deleted file mode 100644 index 3e5389b997b2..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoOperationResultsGet.json -func ExampleOperationsResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsResultsClient().Get(ctx, "westus", "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResult = armkusto.OperationResult{ - // Name: to.Ptr("30972f1b-b61d-4fd8-bd34-3dcfa24670f3"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-26T13:45:42.7025301Z"); return t}()), - // Error: &armkusto.OperationResultErrorProperties{ - // Code: to.Ptr("CannotAlterFollowerDatabase"), - // Message: to.Ptr("[BadRequest] Cannot alter leader cluster 'test' for resource name 'adc'."), - // }, - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/providers/Microsoft.Kusto/locations/westus/operationresults/30972f1b-b61d-4fd8-bd34-3dcfa24670f3"), - // PercentComplete: to.Ptr[float64](1), - // Properties: &armkusto.OperationResultProperties{ - // OperationKind: to.Ptr("FollowerDatabaseCreate"), - // OperationState: to.Ptr("BadInput"), - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-26T13:45:39.6554616Z"); return t}()), - // Status: to.Ptr(armkusto.StatusFailed), - // } -} diff --git a/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go deleted file mode 100644 index 70560df4f011..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoOperationResultsOperationResultResponseTypeGet.json -func ExampleOperationsResultsLocationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewOperationsResultsLocationClient().Get(ctx, "westus", "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go deleted file mode 100644 index 89badadaa93f..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoPrivateEndpointConnectionsList.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armkusto.PrivateEndpointConnectionListResult{ - // Value: []*armkusto.PrivateEndpointConnection{ - // { - // Name: to.Ptr("privateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/clusters/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/privateEndpointConnections/privateEndpointTest"), - // Properties: &armkusto.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("cluster"), - // PrivateEndpoint: &armkusto.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"), - // }, - // PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("privateEndpointTest2"), - // Type: to.Ptr("Microsoft.Kusto/clusters/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/privateEndpointConnections/privateEndpointTest2"), - // Properties: &armkusto.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("cluster"), - // PrivateEndpoint: &armkusto.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName2"), - // }, - // PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoPrivateEndpointConnectionsGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "kustorptest", "kustoCluster", "privateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armkusto.PrivateEndpointConnection{ - // Name: to.Ptr("privateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/clusters/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/privateEndpointConnections/privateEndpointTest"), - // Properties: &armkusto.PrivateEndpointConnectionProperties{ - // GroupID: to.Ptr("cluster"), - // PrivateEndpoint: &armkusto.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/rg1Network/providers/Microsoft.Network/privateEndpoints/privateEndpointName"), - // }, - // PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoPrivateEndpointConnectionsCreateOrUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoclusterrptest4", "privateEndpointTest", armkusto.PrivateEndpointConnection{ - Properties: &armkusto.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armkusto.PrivateEndpointConnection{ - // Name: to.Ptr("privateEndpointTest"), - // Type: to.Ptr("Microsoft.Kusto/clusters/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterRPTest4/privateEndpointConnections/privateEndpointTest"), - // Properties: &armkusto.PrivateEndpointConnectionProperties{ - // PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoPrivateEndpointConnectionsDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "privateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go deleted file mode 100644 index 086b6c277260..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoPrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armkusto.PrivateLinkResourceListResult{ - // Value: []*armkusto.PrivateLinkResource{ - // { - // Name: to.Ptr("cluster"), - // Type: to.Ptr("Microsoft.Kusto/clusters/PrivateLinkResources"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/privateLinkResources/cluster"), - // Properties: &armkusto.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("cluster"), - // RequiredMembers: []*string{ - // to.Ptr("Engine"), - // to.Ptr("DataManagement"), - // to.Ptr("blob-ne3kstrldkustoCluster00"), - // to.Ptr("queue-ne3kstrldkustoCluster00"), - // to.Ptr("table-ne3kstrldkustoCluster00"), - // to.Ptr("blob-qmukstrldkustoCluster01"), - // to.Ptr("queue-qmukstrldkustoCluster01"), - // to.Ptr("table-qmukstrldkustoCluster01")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.westus2.kusto.windows.net"), - // to.Ptr("privatelink.blob.core.windows.net"), - // to.Ptr("privatelink.queue.core.windows.net"), - // to.Ptr("privatelink.table.core.windows.net")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoPrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "kustorptest", "kustoCluster", "cluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armkusto.PrivateLinkResource{ - // Name: to.Ptr("cluster"), - // Type: to.Ptr("Microsoft.Kusto/clusters/PrivateLinkResources"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/privateLinkResources/cluster"), - // Properties: &armkusto.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("cluster"), - // RequiredMembers: []*string{ - // to.Ptr("Engine"), - // to.Ptr("DataManagement"), - // to.Ptr("blob-ne3kstrldkustoCluster00"), - // to.Ptr("queue-ne3kstrldkustoCluster00"), - // to.Ptr("table-ne3kstrldkustoCluster00"), - // to.Ptr("blob-qmukstrldkustoCluster01"), - // to.Ptr("queue-qmukstrldkustoCluster01"), - // to.Ptr("table-qmukstrldkustoCluster01")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.westus2.kusto.windows.net"), - // to.Ptr("privatelink.blob.core.windows.net"), - // to.Ptr("privatelink.queue.core.windows.net"), - // to.Ptr("privatelink.table.core.windows.net")}, - // }, - // } -} diff --git a/sdk/resourcemanager/kusto/armkusto/scripts_client.go b/sdk/resourcemanager/kusto/armkusto/scripts_client.go index 7d9e7e86a4e4..69f874f477a2 100644 --- a/sdk/resourcemanager/kusto/armkusto/scripts_client.go +++ b/sdk/resourcemanager/kusto/armkusto/scripts_client.go @@ -185,7 +185,7 @@ func (client *ScriptsClient) createOrUpdateCreateRequest(ctx context.Context, re return req, runtime.MarshalAsJSON(req, parameters) } -// BeginDelete - Deletes a Kusto principalAssignment. +// BeginDelete - Deletes a Kusto database script. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-12-29 @@ -206,7 +206,7 @@ func (client *ScriptsClient) BeginDelete(ctx context.Context, resourceGroupName } } -// Delete - Deletes a Kusto principalAssignment. +// Delete - Deletes a Kusto database script. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-12-29 diff --git a/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go deleted file mode 100644 index 7cdfd49e6c3b..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go +++ /dev/null @@ -1,268 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoScriptsListByDatabase.json -func ExampleScriptsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScriptsClient().NewListByDatabasePager("kustorptest", "kustoCluster", "Kustodatabase8", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScriptListResult = armkusto.ScriptListResult{ - // Value: []*armkusto.Script{ - // { - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoScript1"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/Scripts"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/Scripts/kustoScript1"), - // Properties: &armkusto.ScriptProperties{ - // ContinueOnErrors: to.Ptr(true), - // ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - // ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - // }, - // SystemData: &armkusto.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // CreatedBy: to.Ptr("user@microsoft.com"), - // CreatedByType: to.Ptr(armkusto.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // LastModifiedBy: to.Ptr("user@microsoft.com"), - // LastModifiedByType: to.Ptr(armkusto.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoScript2"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/Scripts"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/Scripts/kustoScript2"), - // Properties: &armkusto.ScriptProperties{ - // ContinueOnErrors: to.Ptr(true), - // ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - // ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script2.txt"), - // }, - // SystemData: &armkusto.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // CreatedBy: to.Ptr("user@microsoft.com"), - // CreatedByType: to.Ptr(armkusto.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-30T16:07:55.2831451Z"); return t}()), - // LastModifiedBy: to.Ptr("user2@microsoft.com"), - // LastModifiedByType: to.Ptr(armkusto.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoScriptsGet.json -func ExampleScriptsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptsClient().Get(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoScript", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Script = armkusto.Script{ - // Name: to.Ptr("kustoCluster/Kustodatabase8/kustoScript"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/Scripts"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/Kustodatabase8/Scripts/kustoScript"), - // Properties: &armkusto.ScriptProperties{ - // ContinueOnErrors: to.Ptr(true), - // ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - // ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - // }, - // SystemData: &armkusto.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // CreatedBy: to.Ptr("user@microsoft.com"), - // CreatedByType: to.Ptr(armkusto.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // LastModifiedBy: to.Ptr("user@microsoft.com"), - // LastModifiedByType: to.Ptr(armkusto.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoScriptsCreateOrUpdate.json -func ExampleScriptsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScriptsClient().BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "kustoScript", armkusto.Script{ - Properties: &armkusto.ScriptProperties{ - ContinueOnErrors: to.Ptr(true), - ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - ScriptURLSasToken: to.Ptr("?sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=********************************"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Script = armkusto.Script{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/kustoScript"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/Scripts"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/Scripts/kustoScript"), - // Properties: &armkusto.ScriptProperties{ - // ContinueOnErrors: to.Ptr(true), - // ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - // ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - // }, - // SystemData: &armkusto.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // CreatedBy: to.Ptr("user@microsoft.com"), - // CreatedByType: to.Ptr(armkusto.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T17:16:24.3644126Z"); return t}()), - // LastModifiedBy: to.Ptr("user2@microsoft.com"), - // LastModifiedByType: to.Ptr(armkusto.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoScriptsUpdate.json -func ExampleScriptsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScriptsClient().BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "kustoScript", armkusto.Script{ - Properties: &armkusto.ScriptProperties{ - ContinueOnErrors: to.Ptr(true), - ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - ScriptURLSasToken: to.Ptr("?sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=********************************"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Script = armkusto.Script{ - // Name: to.Ptr("kustoCluster/KustoDatabase8/kustoScript"), - // Type: to.Ptr("Microsoft.Kusto/Clusters/Databases/Scripts"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster/Databases/KustoDatabase8/Scripts/kustoScript"), - // Properties: &armkusto.ScriptProperties{ - // ContinueOnErrors: to.Ptr(true), - // ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - // ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - // }, - // SystemData: &armkusto.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T15:06:54.2757906Z"); return t}()), - // CreatedBy: to.Ptr("user@microsoft.com"), - // CreatedByType: to.Ptr(armkusto.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T17:16:24.3644126Z"); return t}()), - // LastModifiedBy: to.Ptr("user2@microsoft.com"), - // LastModifiedByType: to.Ptr(armkusto.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoScriptsDelete.json -func ExampleScriptsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScriptsClient().BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "kustoScript", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoScriptsCheckNameAvailability.json -func ExampleScriptsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptsClient().CheckNameAvailability(ctx, "kustorptest", "kustoCluster", "db", armkusto.ScriptCheckNameRequest{ - Name: to.Ptr("kustoScriptName1"), - Type: to.Ptr("Microsoft.Kusto/clusters/databases/scripts"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameResult = armkusto.CheckNameResult{ - // Name: to.Ptr("kustoScriptName1"), - // Message: to.Ptr("Name 'kustoScriptName1' is already taken. Please specify a different name"), - // NameAvailable: to.Ptr(false), - // } -} diff --git a/sdk/resourcemanager/kusto/armkusto/skus_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/skus_client_example_test.go deleted file mode 100644 index ba14adb7a31d..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/skus_client_example_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoSkus.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkusto.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUsClient().NewListPager("westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUDescriptionList = armkusto.SKUDescriptionList{ - // Value: []*armkusto.SKUDescription{ - // { - // Name: to.Ptr("Standard_L8s_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US")}, - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_L16s_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US")}, - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_L8as_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US"), - // to.Ptr("West Europe")}, - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_L16as_v3"), - // LocationInfo: []*armkusto.SKULocationInfoItem{ - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Location: to.Ptr("West US"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("West US"), - // to.Ptr("West Europe")}, - // Tier: to.Ptr("Standard"), - // }}, - // } - } -}