From 52bda1074301309cda7d9edabf242d8edbaa2c23 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 1 Jun 2023 05:25:36 +0000 Subject: [PATCH] CodeGen from PR 24248 in Azure/azure-rest-api-specs Merge 21db649740fb70f4cdb60a3c6fc2046e3ced5370 into b9ce503202d918a37d8a537fbd2a785e3850f836 --- .../armsqlvirtualmachine/CHANGELOG.md | 20 + .../armsqlvirtualmachine/autorest.md | 7 +- .../availabilitygrouplisteners_client.go | 20 +- ...ilitygrouplisteners_client_example_test.go | 260 ------ .../armsqlvirtualmachine/constants.go | 41 +- .../armsqlvirtualmachine/go.mod | 14 +- .../armsqlvirtualmachine/go.sum | 22 +- .../armsqlvirtualmachine/groups_client.go | 30 +- .../groups_client_example_test.go | 384 --------- .../armsqlvirtualmachine/models.go | 15 +- .../armsqlvirtualmachine/models_serde.go | 16 + .../armsqlvirtualmachine/operations_client.go | 4 +- .../operations_client_example_test.go | 187 ----- .../sqlvirtualmachines_client.go | 46 +- .../sqlvirtualmachines_client_example_test.go | 763 ------------------ .../troubleshoot_client.go | 6 +- .../troubleshoot_client_example_test.go | 64 -- 17 files changed, 133 insertions(+), 1766 deletions(-) delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client_example_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client_example_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client_example_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client_example_test.go diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md index f24ed9921890..4ae790a72029 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md @@ -1,5 +1,25 @@ # Release History +## 0.10.0 (2023-06-01) +### Breaking Changes + +- `CommitASYNCHRONOUSCOMMIT`, `CommitSYNCHRONOUSCOMMIT` from enum `Commit` has been removed +- `FailoverAUTOMATIC`, `FailoverMANUAL` from enum `Failover` has been removed +- `ReadableSecondaryALL`, `ReadableSecondaryNO`, `ReadableSecondaryREADONLY` from enum `ReadableSecondary` has been removed +- `RolePRIMARY`, `RoleSECONDARY` from enum `Role` has been removed + +### Features Added + +- New value `CommitAsynchronousCommit`, `CommitSynchronousCommit` added to enum type `Commit` +- New value `FailoverAutomatic`, `FailoverManual` added to enum type `Failover` +- New value `ReadableSecondaryAll`, `ReadableSecondaryNo`, `ReadableSecondaryReadOnly` added to enum type `ReadableSecondary` +- New value `RolePrimary`, `RoleSecondary` added to enum type `Role` +- New field `UseStoragePool` in struct `SQLStorageSettings` +- New field `UseStoragePool` in struct `SQLTempDbSettings` +- New field `EnableStorageConfigBlade` in struct `StorageConfigurationSettings` +- New field `IsSQLServiceAccountGmsa` in struct `WsfcDomainProfile` + + ## 0.9.0 (2023-06-23) ### Features Added diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md index 6deb55314ec9..81154fbd8652 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sqlvirtualmachine/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sqlvirtualmachine/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.9.0 -tag: package-preview-2022-08 +module-version: 0.10.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client.go index d720dce4c318..55fa535f4b0b 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client.go @@ -47,7 +47,7 @@ func NewAvailabilityGroupListenersClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Creates or updates an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -72,7 +72,7 @@ func (client *AvailabilityGroupListenersClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Creates or updates an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *AvailabilityGroupListenersClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, availabilityGroupListenerName string, parameters AvailabilityGroupListener, options *AvailabilityGroupListenersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, parameters, options) if err != nil { @@ -112,7 +112,7 @@ func (client *AvailabilityGroupListenersClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *AvailabilityGroupListenersClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -145,7 +145,7 @@ func (client *AvailabilityGroupListenersClient) BeginDelete(ctx context.Context, // Delete - Deletes an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *AvailabilityGroupListenersClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, availabilityGroupListenerName string, options *AvailabilityGroupListenersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *AvailabilityGroupListenersClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +194,7 @@ func (client *AvailabilityGroupListenersClient) deleteCreateRequest(ctx context. // Get - Gets an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -243,7 +243,7 @@ func (client *AvailabilityGroupListenersClient) getCreateRequest(ctx context.Con if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +260,7 @@ func (client *AvailabilityGroupListenersClient) getHandleResponse(resp *http.Res // NewListByGroupPager - Lists all availability group listeners in a SQL virtual machine group. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -314,7 +314,7 @@ func (client *AvailabilityGroupListenersClient) listByGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client_example_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client_example_test.go deleted file mode 100644 index cbc7c21bb11f..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client_example_test.go +++ /dev/null @@ -1,260 +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 armsqlvirtualmachine_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/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilityGroupListenersClient().Get(ctx, "testrg", "testvmgroup", "agl-test", &armsqlvirtualmachine.AvailabilityGroupListenersClientGetOptions{Expand: 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.AvailabilityGroupListener = armsqlvirtualmachine.AvailabilityGroupListener{ - // Name: to.Ptr("agl-test"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"), - // Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{ - // AvailabilityGroupName: to.Ptr("ag-test"), - // LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{ - // { - // LoadBalancerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb-test"), - // PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - // IPAddress: to.Ptr("10.1.0.112"), - // SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"), - // }, - // ProbePort: to.Ptr[int32](59983), - // SQLVirtualMachineInstances: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2")}, - // }}, - // Port: to.Ptr[int32](1433), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_BeginCreateOrUpdate_createsOrUpdatesAnAvailabilityGroupListenerUsingLoadBalancerThisIsUsedForVMsPresentInSingleSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilityGroupListenersClient().BeginCreateOrUpdate(ctx, "testrg", "testvmgroup", "agl-test", armsqlvirtualmachine.AvailabilityGroupListener{ - Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{ - AvailabilityGroupName: to.Ptr("ag-test"), - LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{ - { - LoadBalancerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb-test"), - PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - IPAddress: to.Ptr("10.1.0.112"), - SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"), - }, - ProbePort: to.Ptr[int32](59983), - SQLVirtualMachineInstances: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3")}, - }}, - Port: to.Ptr[int32](1433), - }, - }, 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.AvailabilityGroupListener = armsqlvirtualmachine.AvailabilityGroupListener{ - // Name: to.Ptr("agl-test"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"), - // Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{ - // LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{ - // { - // PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - // IPAddress: to.Ptr("10.1.0.113"), - // SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"), - // }, - // SQLVirtualMachineInstances: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3")}, - // }}, - // Port: to.Ptr[int32](1433), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListenerWithMultiSubnet.json -func ExampleAvailabilityGroupListenersClient_BeginCreateOrUpdate_createsOrUpdatesAnAvailabilityGroupListenerThisIsUsedForVMsPresentInMultiSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilityGroupListenersClient().BeginCreateOrUpdate(ctx, "testrg", "testvmgroup", "agl-test", armsqlvirtualmachine.AvailabilityGroupListener{ - Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{ - AvailabilityGroupName: to.Ptr("ag-test"), - MultiSubnetIPConfigurations: []*armsqlvirtualmachine.MultiSubnetIPConfiguration{ - { - PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - IPAddress: to.Ptr("10.0.0.112"), - SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"), - }, - SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - }, - { - PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - IPAddress: to.Ptr("10.0.1.112"), - SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/alternate"), - }, - SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"), - }}, - Port: to.Ptr[int32](1433), - }, - }, 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.AvailabilityGroupListener = armsqlvirtualmachine.AvailabilityGroupListener{ - // Name: to.Ptr("agl-test"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"), - // Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{ - // MultiSubnetIPConfigurations: []*armsqlvirtualmachine.MultiSubnetIPConfiguration{ - // { - // PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - // IPAddress: to.Ptr("10.0.0.112"), - // SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"), - // }, - // SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - // }, - // { - // PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - // IPAddress: to.Ptr("10.0.1.112"), - // SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/alternate"), - // }, - // SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"), - // }}, - // Port: to.Ptr[int32](1433), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilityGroupListenersClient().BeginDelete(ctx, "testrg", "testvmgroup", "agl-test", 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/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByGroupAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_NewListByGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilityGroupListenersClient().NewListByGroupPager("testrg", "testvmgroup", 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.AvailabilityGroupListenerListResult = armsqlvirtualmachine.AvailabilityGroupListenerListResult{ - // Value: []*armsqlvirtualmachine.AvailabilityGroupListener{ - // { - // Name: to.Ptr("agl-test"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"), - // Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{ - // AvailabilityGroupName: to.Ptr("ag-test"), - // LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{ - // { - // LoadBalancerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb-test"), - // PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - // IPAddress: to.Ptr("10.1.0.112"), - // SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"), - // }, - // ProbePort: to.Ptr[int32](59983), - // SQLVirtualMachineInstances: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2")}, - // }}, - // Port: to.Ptr[int32](1433), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/constants.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/constants.go index 613df9a124c1..c222d29dcbfb 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/constants.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/constants.go @@ -11,7 +11,7 @@ package armsqlvirtualmachine const ( moduleName = "armsqlvirtualmachine" - moduleVersion = "v0.9.0" + moduleVersion = "v0.10.0" ) // AssessmentDayOfWeek - Day of the week to run assessment. @@ -130,15 +130,15 @@ func PossibleClusterSubnetTypeValues() []ClusterSubnetType { type Commit string const ( - CommitASYNCHRONOUSCOMMIT Commit = "ASYNCHRONOUS_COMMIT" - CommitSYNCHRONOUSCOMMIT Commit = "SYNCHRONOUS_COMMIT" + CommitAsynchronousCommit Commit = "Asynchronous_Commit" + CommitSynchronousCommit Commit = "Synchronous_Commit" ) // PossibleCommitValues returns the possible values for the Commit const type. func PossibleCommitValues() []Commit { return []Commit{ - CommitASYNCHRONOUSCOMMIT, - CommitSYNCHRONOUSCOMMIT, + CommitAsynchronousCommit, + CommitSynchronousCommit, } } @@ -230,15 +230,15 @@ func PossibleDiskConfigurationTypeValues() []DiskConfigurationType { type Failover string const ( - FailoverAUTOMATIC Failover = "AUTOMATIC" - FailoverMANUAL Failover = "MANUAL" + FailoverAutomatic Failover = "Automatic" + FailoverManual Failover = "Manual" ) // PossibleFailoverValues returns the possible values for the Failover const type. func PossibleFailoverValues() []Failover { return []Failover{ - FailoverAUTOMATIC, - FailoverMANUAL, + FailoverAutomatic, + FailoverManual, } } @@ -311,17 +311,17 @@ func PossibleOperationOriginValues() []OperationOrigin { type ReadableSecondary string const ( - ReadableSecondaryALL ReadableSecondary = "ALL" - ReadableSecondaryNO ReadableSecondary = "NO" - ReadableSecondaryREADONLY ReadableSecondary = "READ_ONLY" + ReadableSecondaryAll ReadableSecondary = "All" + ReadableSecondaryNo ReadableSecondary = "No" + ReadableSecondaryReadOnly ReadableSecondary = "Read_Only" ) // PossibleReadableSecondaryValues returns the possible values for the ReadableSecondary const type. func PossibleReadableSecondaryValues() []ReadableSecondary { return []ReadableSecondary{ - ReadableSecondaryALL, - ReadableSecondaryNO, - ReadableSecondaryREADONLY, + ReadableSecondaryAll, + ReadableSecondaryNo, + ReadableSecondaryReadOnly, } } @@ -329,15 +329,15 @@ func PossibleReadableSecondaryValues() []ReadableSecondary { type Role string const ( - RolePRIMARY Role = "PRIMARY" - RoleSECONDARY Role = "SECONDARY" + RolePrimary Role = "Primary" + RoleSecondary Role = "Secondary" ) // PossibleRoleValues returns the possible values for the Role const type. func PossibleRoleValues() []Role { return []Role{ - RolePRIMARY, - RoleSECONDARY, + RolePrimary, + RoleSecondary, } } @@ -363,7 +363,8 @@ func PossibleSQLImageSKUValues() []SQLImageSKU { } } -// SQLManagementMode - SQL Server Management type. +// SQLManagementMode - SQL Server Management type. NOTE: This parameter is not used anymore. API will automatically detect +// the Sql Management, refrain from using it. type SQLManagementMode string const ( diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod index dcafe4aa6e23..a3ac670bb783 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/a go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.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.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.sum b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.sum index 21718b486698..07ab621ddddc 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.sum +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -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.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client.go index df8ed24c8c8b..b50297fcfd21 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client.go @@ -47,7 +47,7 @@ func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -71,7 +71,7 @@ func (client *GroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Creates or updates a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *GroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, parameters Group, options *GroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, parameters, options) if err != nil { @@ -107,7 +107,7 @@ func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -116,7 +116,7 @@ func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deletes a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -138,7 +138,7 @@ func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *GroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, options *GroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, options) if err != nil { @@ -174,7 +174,7 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +183,7 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -223,7 +223,7 @@ func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +240,7 @@ func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClient // NewListPager - Gets all SQL virtual machine groups in a subscription. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - options - GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method. func (client *GroupsClient) NewListPager(options *GroupsClientListOptions) *runtime.Pager[GroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[GroupsClientListResponse]{ @@ -282,7 +282,7 @@ func (client *GroupsClient) listCreateRequest(ctx context.Context, options *Grou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,7 +299,7 @@ func (client *GroupsClient) listHandleResponse(resp *http.Response) (GroupsClien // NewListByResourceGroupPager - Gets all SQL virtual machine groups in a resource group. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - options - GroupsClientListByResourceGroupOptions contains the optional parameters for the GroupsClient.NewListByResourceGroupPager @@ -348,7 +348,7 @@ func (client *GroupsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,7 +366,7 @@ func (client *GroupsClient) listByResourceGroupHandleResponse(resp *http.Respons // BeginUpdate - Updates SQL virtual machine group tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -389,7 +389,7 @@ func (client *GroupsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates SQL virtual machine group tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *GroupsClient) update(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, parameters GroupUpdate, options *GroupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, parameters, options) if err != nil { @@ -425,7 +425,7 @@ func (client *GroupsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client_example_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client_example_test.go deleted file mode 100644 index b20bdafb5e5c..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client_example_test.go +++ /dev/null @@ -1,384 +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 armsqlvirtualmachine_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/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachineGroup.json -func ExampleGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGroupsClient().Get(ctx, "testrg", "testvmgroup", 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.Group = armsqlvirtualmachine.Group{ - // Name: to.Ptr("testvmgroup"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineGroup.json -func ExampleGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGroupsClient().BeginCreateOrUpdate(ctx, "testrg", "testvmgroup", armsqlvirtualmachine.Group{ - Location: to.Ptr("northeurope"), - Tags: map[string]*string{ - "mytag": to.Ptr("myval"), - }, - Properties: &armsqlvirtualmachine.GroupProperties{ - SQLImageOffer: to.Ptr("SQL2016-WS2016"), - SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - ClusterBootstrapAccount: to.Ptr("testrpadmin"), - ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet), - DomainFqdn: to.Ptr("testdomain.com"), - OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - StorageAccountPrimaryKey: to.Ptr(""), - StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - }, - }, - }, 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.Group = armsqlvirtualmachine.Group{ - // Name: to.Ptr("testvmgroup"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachineGroup.json -func ExampleGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGroupsClient().BeginDelete(ctx, "testrg", "testvmgroup", 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/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachineGroup.json -func ExampleGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGroupsClient().BeginUpdate(ctx, "testrg", "testvmgroup", armsqlvirtualmachine.GroupUpdate{ - Tags: map[string]*string{ - "mytag": to.Ptr("myval"), - }, - }, 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.Group = armsqlvirtualmachine.Group{ - // Name: to.Ptr("testvmgroup"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2017-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachineGroup.json -func ExampleGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGroupsClient().NewListByResourceGroupPager("testrg", 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.GroupListResult = armsqlvirtualmachine.GroupListResult{ - // Value: []*armsqlvirtualmachine.Group{ - // { - // Name: to.Ptr("testvmgroup"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2017-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // }, - // { - // Name: to.Ptr("testvmgroup1"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup1"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // }, - // { - // Name: to.Ptr("testvmgroup2"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup2"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachineGroup.json -func ExampleGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGroupsClient().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.GroupListResult = armsqlvirtualmachine.GroupListResult{ - // Value: []*armsqlvirtualmachine.Group{ - // { - // Name: to.Ptr("testvmgroup"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2017-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // }, - // { - // Name: to.Ptr("testvmgroup1"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg1/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // }, - // { - // Name: to.Ptr("testvmgroup2"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg2/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.GroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - // WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - // ClusterBootstrapAccount: to.Ptr("testrpadmin"), - // ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - // ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet), - // DomainFqdn: to.Ptr("testdomain.com"), - // OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - // SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - // StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models.go index 7c31766856ff..533f9af0888b 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models.go @@ -429,7 +429,8 @@ type Properties struct { // SQL Server edition type. SQLImageSKU *SQLImageSKU - // SQL Server Management type. + // SQL Server Management type. NOTE: This parameter is not used anymore. API will automatically detect the Sql Management, + // refrain from using it. SQLManagement *SQLManagementMode // SQL Server license type. @@ -519,6 +520,9 @@ type SQLStorageSettings struct { // Logical Unit Numbers for the disks. Luns []*int32 + + // Use storage pool to build a drive if true or not provided + UseStoragePool *bool } // SQLStorageUpdateSettings - Set disk storage settings for SQL Server. @@ -561,6 +565,9 @@ type SQLTempDbSettings struct { // SQL Server tempdb persist folder location PersistFolderPath *string + + // Use storage pool to build a drive if true or not provided + UseStoragePool *bool } // SQLVMTroubleshooting - Details required for SQL VM troubleshooting @@ -717,6 +724,9 @@ type StorageConfigurationSettings struct { // Disk configuration to apply to SQL Server. DiskConfigurationType *DiskConfigurationType + // Enable SQL IaaS Agent storage configuration blade in Azure Portal. + EnableStorageConfigBlade *bool + // SQL Server Data Storage Settings. SQLDataSettings *SQLStorageSettings @@ -830,6 +840,9 @@ type WsfcDomainProfile struct { // Optional path for fileshare witness. FileShareWitnessPath *string + // The flag to check if SQL service account is GMSA. + IsSQLServiceAccountGmsa *bool + // Organizational Unit path in which the nodes and cluster will be present. OuPath *string diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go index 122d527334b9..6483a8a04c21 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go @@ -1091,6 +1091,7 @@ func (s SQLStorageSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "defaultFilePath", s.DefaultFilePath) populate(objectMap, "luns", s.Luns) + populate(objectMap, "useStoragePool", s.UseStoragePool) return json.Marshal(objectMap) } @@ -1109,6 +1110,9 @@ func (s *SQLStorageSettings) UnmarshalJSON(data []byte) error { case "luns": err = unpopulate(val, "Luns", &s.Luns) delete(rawMsg, key) + case "useStoragePool": + err = unpopulate(val, "UseStoragePool", &s.UseStoragePool) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1164,6 +1168,7 @@ func (s SQLTempDbSettings) MarshalJSON() ([]byte, error) { populate(objectMap, "luns", s.Luns) populate(objectMap, "persistFolder", s.PersistFolder) populate(objectMap, "persistFolderPath", s.PersistFolderPath) + populate(objectMap, "useStoragePool", s.UseStoragePool) return json.Marshal(objectMap) } @@ -1203,6 +1208,9 @@ func (s *SQLTempDbSettings) UnmarshalJSON(data []byte) error { case "persistFolderPath": err = unpopulate(val, "PersistFolderPath", &s.PersistFolderPath) delete(rawMsg, key) + case "useStoragePool": + err = unpopulate(val, "UseStoragePool", &s.UseStoragePool) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1430,6 +1438,7 @@ func (s *ServerConfigurationsManagementSettings) UnmarshalJSON(data []byte) erro func (s StorageConfigurationSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskConfigurationType", s.DiskConfigurationType) + populate(objectMap, "enableStorageConfigBlade", s.EnableStorageConfigBlade) populate(objectMap, "sqlDataSettings", s.SQLDataSettings) populate(objectMap, "sqlLogSettings", s.SQLLogSettings) populate(objectMap, "sqlSystemDbOnDataDisk", s.SQLSystemDbOnDataDisk) @@ -1450,6 +1459,9 @@ func (s *StorageConfigurationSettings) UnmarshalJSON(data []byte) error { case "diskConfigurationType": err = unpopulate(val, "DiskConfigurationType", &s.DiskConfigurationType) delete(rawMsg, key) + case "enableStorageConfigBlade": + err = unpopulate(val, "EnableStorageConfigBlade", &s.EnableStorageConfigBlade) + delete(rawMsg, key) case "sqlDataSettings": err = unpopulate(val, "SQLDataSettings", &s.SQLDataSettings) delete(rawMsg, key) @@ -1691,6 +1703,7 @@ func (w WsfcDomainProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "clusterSubnetType", w.ClusterSubnetType) populate(objectMap, "domainFqdn", w.DomainFqdn) populate(objectMap, "fileShareWitnessPath", w.FileShareWitnessPath) + populate(objectMap, "isSqlServiceAccountGmsa", w.IsSQLServiceAccountGmsa) populate(objectMap, "ouPath", w.OuPath) populate(objectMap, "sqlServiceAccount", w.SQLServiceAccount) populate(objectMap, "storageAccountPrimaryKey", w.StorageAccountPrimaryKey) @@ -1722,6 +1735,9 @@ func (w *WsfcDomainProfile) UnmarshalJSON(data []byte) error { case "fileShareWitnessPath": err = unpopulate(val, "FileShareWitnessPath", &w.FileShareWitnessPath) delete(rawMsg, key) + case "isSqlServiceAccountGmsa": + err = unpopulate(val, "IsSQLServiceAccountGmsa", &w.IsSQLServiceAccountGmsa) + delete(rawMsg, key) case "ouPath": err = unpopulate(val, "OuPath", &w.OuPath) delete(rawMsg, key) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client.go index 8b2edcdb3827..eec5628be80b 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available SQL Virtual Machine Rest API operations. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client_example_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client_example_test.go deleted file mode 100644 index f97b5b1c2824..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client_example_test.go +++ /dev/null @@ -1,187 +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 armsqlvirtualmachine_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListOperation.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 := armsqlvirtualmachine.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 = armsqlvirtualmachine.OperationListResult{ - // Value: []*armsqlvirtualmachine.Operation{ - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Retrive details of SQL virtual machine group"), - // Operation: to.Ptr("Get SQL virtual machine group details"), - // Resource: to.Ptr("SQL virtual machine group"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/write"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Create a new or change properties of existing SQL virtual machine group"), - // Operation: to.Ptr("Create a new or update existing SQL virtual machine group"), - // Resource: to.Ptr("SQL virtual machine group"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/delete"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Delete existing SQL virtual machine group"), - // Operation: to.Ptr("Delete existing SQL virtual machine group"), - // Resource: to.Ptr("SQL virtual machine group"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Retrieve details of SQL availability group listener on a given SQL virtual machine group"), - // Operation: to.Ptr("Get availability group listener details"), - // Resource: to.Ptr("SQL availability group listener"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners/write"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Create a new or changes properties of existing SQL availability group listener"), - // Operation: to.Ptr("Create new or update existing availability group listener"), - // Resource: to.Ptr("SQL availability group listener"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners/delete"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Delete existing availability group listener"), - // Operation: to.Ptr("Delete existing availability group listener"), - // Resource: to.Ptr("SQL availability group listener"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/sqlVirtualMachines/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("List Sql virtual machines by a particular sql virtual virtual machine group"), - // Operation: to.Ptr("List Sql virtual machines by a particular sql virtual virtual machine group"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/startAssessment/action"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/redeploy/action"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Redeploy existing SQL virtual machine"), - // Operation: to.Ptr("Redeploy existing SQL virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Retrieve details of SQL virtual machine"), - // Operation: to.Ptr("Get SQL virtual machine instance details"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/write"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Create a new or change properties of existing SQL virtual machine"), - // Operation: to.Ptr("Create new or update existing SQL virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/delete"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Delete existing SQL virtual machine"), - // Operation: to.Ptr("Delete existing SQL virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/registerSqlVmCandidate/action"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Register SQL Vm Candidate"), - // Operation: to.Ptr("Register SQL Vm Candidate"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/availabilityGroupListenerOperationResults/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Get result of an availability group listener operation"), - // Operation: to.Ptr("Get availability group listener operation result"), - // Resource: to.Ptr("SQL availability group listener"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/register/action"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Register subscription with Microsoft.SqlVirtualMachine resource provider"), - // Operation: to.Ptr("Register subscription for SQL Virtual Machine"), - // Resource: to.Ptr("Microsoft SQL Virtual Machine"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/unregister/action"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Unregister subscription with Microsoft.SqlVirtualMachine resource provider"), - // Operation: to.Ptr("Unregister subscription for SQL Virtual Machine"), - // Resource: to.Ptr("Microsoft SQL Virtual Machine"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/operations/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Resource: to.Ptr("Available REST operations"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/sqlVirtualMachineGroupOperationResults/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Get result of a SQL virtual machine group operation"), - // Operation: to.Ptr("Get SQL virtual machine group operation result"), - // Resource: to.Ptr("SQL virtual machine group"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/sqlVirtualMachineOperationResults/read"), - // Display: &armsqlvirtualmachine.OperationDisplay{ - // Description: to.Ptr("Get result of SQL virtual machine operation"), - // Operation: to.Ptr("Get SQL virtual machine operation result"), - // Resource: to.Ptr("SQL virtual machine"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client.go index c00608e2b76e..7c08cb442d09 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client.go @@ -47,7 +47,7 @@ func NewSQLVirtualMachinesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates or updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineName - Name of the SQL virtual machine. @@ -71,7 +71,7 @@ func (client *SQLVirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *SQLVirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters SQLVirtualMachine, options *SQLVirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, parameters, options) if err != nil { @@ -107,7 +107,7 @@ func (client *SQLVirtualMachinesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -116,7 +116,7 @@ func (client *SQLVirtualMachinesClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineName - Name of the SQL virtual machine. @@ -139,7 +139,7 @@ func (client *SQLVirtualMachinesClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *SQLVirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, options) if err != nil { @@ -175,7 +175,7 @@ func (client *SQLVirtualMachinesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +184,7 @@ func (client *SQLVirtualMachinesClient) deleteCreateRequest(ctx context.Context, // Get - Gets a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineName - Name of the SQL virtual machine. @@ -227,7 +227,7 @@ func (client *SQLVirtualMachinesClient) getCreateRequest(ctx context.Context, re if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,7 +244,7 @@ func (client *SQLVirtualMachinesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets all SQL virtual machines in a subscription. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - options - SQLVirtualMachinesClientListOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListPager // method. func (client *SQLVirtualMachinesClient) NewListPager(options *SQLVirtualMachinesClientListOptions) *runtime.Pager[SQLVirtualMachinesClientListResponse] { @@ -287,7 +287,7 @@ func (client *SQLVirtualMachinesClient) listCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +304,7 @@ func (client *SQLVirtualMachinesClient) listHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Gets all SQL virtual machines in a resource group. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - options - SQLVirtualMachinesClientListByResourceGroupOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListByResourceGroupPager @@ -353,7 +353,7 @@ func (client *SQLVirtualMachinesClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,7 +370,7 @@ func (client *SQLVirtualMachinesClient) listByResourceGroupHandleResponse(resp * // NewListBySQLVMGroupPager - Gets the list of sql virtual machines in a SQL virtual machine group. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -424,7 +424,7 @@ func (client *SQLVirtualMachinesClient) listBySQLVMGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -442,7 +442,7 @@ func (client *SQLVirtualMachinesClient) listBySQLVMGroupHandleResponse(resp *htt // BeginRedeploy - Uninstalls and reinstalls the SQL IaaS Extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineName - Name of the SQL virtual machine. @@ -465,7 +465,7 @@ func (client *SQLVirtualMachinesClient) BeginRedeploy(ctx context.Context, resou // Redeploy - Uninstalls and reinstalls the SQL IaaS Extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *SQLVirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginRedeployOptions) (*http.Response, error) { req, err := client.redeployCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, options) if err != nil { @@ -501,7 +501,7 @@ func (client *SQLVirtualMachinesClient) redeployCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -510,7 +510,7 @@ func (client *SQLVirtualMachinesClient) redeployCreateRequest(ctx context.Contex // BeginStartAssessment - Starts SQL best practices Assessment on SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineName - Name of the SQL virtual machine. @@ -533,7 +533,7 @@ func (client *SQLVirtualMachinesClient) BeginStartAssessment(ctx context.Context // StartAssessment - Starts SQL best practices Assessment on SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *SQLVirtualMachinesClient) startAssessment(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginStartAssessmentOptions) (*http.Response, error) { req, err := client.startAssessmentCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, options) if err != nil { @@ -569,7 +569,7 @@ func (client *SQLVirtualMachinesClient) startAssessmentCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -578,7 +578,7 @@ func (client *SQLVirtualMachinesClient) startAssessmentCreateRequest(ctx context // BeginUpdate - Updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineName - Name of the SQL virtual machine. @@ -602,7 +602,7 @@ func (client *SQLVirtualMachinesClient) BeginUpdate(ctx context.Context, resourc // Update - Updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *SQLVirtualMachinesClient) update(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters Update, options *SQLVirtualMachinesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, parameters, options) if err != nil { @@ -638,7 +638,7 @@ func (client *SQLVirtualMachinesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client_example_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client_example_test.go deleted file mode 100644 index 1fcc07abbbea..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client_example_test.go +++ /dev/null @@ -1,763 +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 armsqlvirtualmachine_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/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListBySqlVirtualMachineGroupSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_NewListBySQLVMGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSQLVirtualMachinesClient().NewListBySQLVMGroupPager("testrg", "testvm", 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.ListResult = armsqlvirtualmachine.ListResult{ - // Value: []*armsqlvirtualmachine.SQLVirtualMachine{ - // { - // Name: to.Ptr("testvm2"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2014-WS2012R2"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSQLVirtualMachinesClient().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.ListResult = armsqlvirtualmachine.ListResult{ - // Value: []*armsqlvirtualmachine.SQLVirtualMachine{ - // { - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypeAHUB), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // }, - // { - // Name: to.Ptr("testvm1"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2017-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm1"), - // }, - // }, - // { - // Name: to.Ptr("testvm2"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg1/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeLightWeight), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg1/providers/Microsoft.Compute/virtualMachines/testvm2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVirtualMachinesClient().Get(ctx, "testrg", "testvm", &armsqlvirtualmachine.SQLVirtualMachinesClientGetOptions{Expand: 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(true), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2017-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateVirtualMachineWithVMGroup.json -func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineAndJoinsItToASqlVirtualMachineGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{ - Location: to.Ptr("northeurope"), - Properties: &armsqlvirtualmachine.Properties{ - SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"), - VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"), - WsfcDomainCredentials: &armsqlvirtualmachine.WsfcDomainCredentials{ - ClusterBootstrapAccountPassword: to.Ptr(""), - ClusterOperatorAccountPassword: to.Ptr(""), - SQLServiceAccountPassword: to.Ptr(""), - }, - WsfcStaticIP: to.Ptr("10.0.0.7"), - }, - }, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm2"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"), - // WsfcStaticIP: to.Ptr("10.0.0.7"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.json -func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineForAutomatedBackUpSettingsWithWeeklyAndDaysOfTheWeekToRunTheBackUp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{ - Location: to.Ptr("northeurope"), - Properties: &armsqlvirtualmachine.Properties{ - AutoBackupSettings: &armsqlvirtualmachine.AutoBackupSettings{ - BackupScheduleType: to.Ptr(armsqlvirtualmachine.BackupScheduleTypeManual), - BackupSystemDbs: to.Ptr(true), - DaysOfWeek: []*armsqlvirtualmachine.AutoBackupDaysOfWeek{ - to.Ptr(armsqlvirtualmachine.AutoBackupDaysOfWeekMonday), - to.Ptr(armsqlvirtualmachine.AutoBackupDaysOfWeekFriday)}, - Enable: to.Ptr(true), - EnableEncryption: to.Ptr(true), - FullBackupFrequency: to.Ptr(armsqlvirtualmachine.FullBackupFrequencyTypeWeekly), - FullBackupStartTime: to.Ptr[int32](6), - FullBackupWindowHours: to.Ptr[int32](11), - LogBackupFrequency: to.Ptr[int32](10), - Password: to.Ptr(""), - RetentionPeriod: to.Ptr[int32](17), - StorageAccessKey: to.Ptr(""), - StorageAccountURL: to.Ptr("https://teststorage.blob.core.windows.net/"), - StorageContainerName: to.Ptr("testcontainer"), - }, - AutoPatchingSettings: &armsqlvirtualmachine.AutoPatchingSettings{ - DayOfWeek: to.Ptr(armsqlvirtualmachine.DayOfWeekSunday), - Enable: to.Ptr(true), - MaintenanceWindowDuration: to.Ptr[int32](60), - MaintenanceWindowStartingHour: to.Ptr[int32](2), - }, - KeyVaultCredentialSettings: &armsqlvirtualmachine.KeyVaultCredentialSettings{ - Enable: to.Ptr(false), - }, - ServerConfigurationsManagementSettings: &armsqlvirtualmachine.ServerConfigurationsManagementSettings{ - AdditionalFeaturesServerConfigurations: &armsqlvirtualmachine.AdditionalFeaturesServerConfigurations{ - IsRServicesEnabled: to.Ptr(false), - }, - SQLConnectivityUpdateSettings: &armsqlvirtualmachine.SQLConnectivityUpdateSettings{ - ConnectivityType: to.Ptr(armsqlvirtualmachine.ConnectivityTypePRIVATE), - Port: to.Ptr[int32](1433), - SQLAuthUpdatePassword: to.Ptr(""), - SQLAuthUpdateUserName: to.Ptr("sqllogin"), - }, - SQLStorageUpdateSettings: &armsqlvirtualmachine.SQLStorageUpdateSettings{ - DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW), - DiskCount: to.Ptr[int32](1), - StartingDeviceID: to.Ptr[int32](2), - }, - SQLWorkloadTypeUpdateSettings: &armsqlvirtualmachine.SQLWorkloadTypeUpdateSettings{ - SQLWorkloadType: to.Ptr(armsqlvirtualmachine.SQLWorkloadTypeOLTP), - }, - }, - SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - }, - }, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.json -func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineForStorageConfigurationSettingsToExtendDataLogOrTempDbStoragePool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{ - Location: to.Ptr("northeurope"), - Properties: &armsqlvirtualmachine.Properties{ - StorageConfigurationSettings: &armsqlvirtualmachine.StorageConfigurationSettings{ - DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeEXTEND), - SQLDataSettings: &armsqlvirtualmachine.SQLStorageSettings{ - Luns: []*int32{ - to.Ptr[int32](2)}, - }, - }, - VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - }, - }, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.json -func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineForStorageConfigurationSettingsToNewDataLogAndTempDbStoragePool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{ - Location: to.Ptr("northeurope"), - Properties: &armsqlvirtualmachine.Properties{ - StorageConfigurationSettings: &armsqlvirtualmachine.StorageConfigurationSettings{ - DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW), - SQLDataSettings: &armsqlvirtualmachine.SQLStorageSettings{ - DefaultFilePath: to.Ptr("F:\\folderpath\\"), - Luns: []*int32{ - to.Ptr[int32](0)}, - }, - SQLLogSettings: &armsqlvirtualmachine.SQLStorageSettings{ - DefaultFilePath: to.Ptr("G:\\folderpath\\"), - Luns: []*int32{ - to.Ptr[int32](1)}, - }, - SQLSystemDbOnDataDisk: to.Ptr(true), - SQLTempDbSettings: &armsqlvirtualmachine.SQLTempDbSettings{ - DataFileCount: to.Ptr[int32](8), - DataFileSize: to.Ptr[int32](256), - DataGrowth: to.Ptr[int32](512), - DefaultFilePath: to.Ptr("D:\\TEMP"), - LogFileSize: to.Ptr[int32](256), - LogGrowth: to.Ptr[int32](512), - }, - StorageWorkloadType: to.Ptr(armsqlvirtualmachine.StorageWorkloadTypeOLTP), - }, - VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - }, - }, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMAX.json -func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineWithMaxParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{ - Location: to.Ptr("northeurope"), - Properties: &armsqlvirtualmachine.Properties{ - AssessmentSettings: &armsqlvirtualmachine.AssessmentSettings{ - Enable: to.Ptr(true), - RunImmediately: to.Ptr(true), - Schedule: &armsqlvirtualmachine.Schedule{ - DayOfWeek: to.Ptr(armsqlvirtualmachine.AssessmentDayOfWeekSunday), - Enable: to.Ptr(true), - StartTime: to.Ptr("23:17"), - WeeklyInterval: to.Ptr[int32](1), - }, - }, - AutoBackupSettings: &armsqlvirtualmachine.AutoBackupSettings{ - BackupScheduleType: to.Ptr(armsqlvirtualmachine.BackupScheduleTypeManual), - BackupSystemDbs: to.Ptr(true), - Enable: to.Ptr(true), - EnableEncryption: to.Ptr(true), - FullBackupFrequency: to.Ptr(armsqlvirtualmachine.FullBackupFrequencyTypeDaily), - FullBackupStartTime: to.Ptr[int32](6), - FullBackupWindowHours: to.Ptr[int32](11), - LogBackupFrequency: to.Ptr[int32](10), - Password: to.Ptr(""), - RetentionPeriod: to.Ptr[int32](17), - StorageAccessKey: to.Ptr(""), - StorageAccountURL: to.Ptr("https://teststorage.blob.core.windows.net/"), - StorageContainerName: to.Ptr("testcontainer"), - }, - AutoPatchingSettings: &armsqlvirtualmachine.AutoPatchingSettings{ - DayOfWeek: to.Ptr(armsqlvirtualmachine.DayOfWeekSunday), - Enable: to.Ptr(true), - MaintenanceWindowDuration: to.Ptr[int32](60), - MaintenanceWindowStartingHour: to.Ptr[int32](2), - }, - EnableAutomaticUpgrade: to.Ptr(true), - KeyVaultCredentialSettings: &armsqlvirtualmachine.KeyVaultCredentialSettings{ - Enable: to.Ptr(false), - }, - LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled), - ServerConfigurationsManagementSettings: &armsqlvirtualmachine.ServerConfigurationsManagementSettings{ - AdditionalFeaturesServerConfigurations: &armsqlvirtualmachine.AdditionalFeaturesServerConfigurations{ - IsRServicesEnabled: to.Ptr(false), - }, - AzureAdAuthenticationSettings: &armsqlvirtualmachine.AADAuthenticationSettings{ - ClientID: to.Ptr("11111111-2222-3333-4444-555555555555"), - }, - SQLConnectivityUpdateSettings: &armsqlvirtualmachine.SQLConnectivityUpdateSettings{ - ConnectivityType: to.Ptr(armsqlvirtualmachine.ConnectivityTypePRIVATE), - Port: to.Ptr[int32](1433), - SQLAuthUpdatePassword: to.Ptr(""), - SQLAuthUpdateUserName: to.Ptr("sqllogin"), - }, - SQLInstanceSettings: &armsqlvirtualmachine.SQLInstanceSettings{ - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - IsIfiEnabled: to.Ptr(true), - IsLpimEnabled: to.Ptr(true), - IsOptimizeForAdHocWorkloadsEnabled: to.Ptr(true), - MaxDop: to.Ptr[int32](8), - MaxServerMemoryMB: to.Ptr[int32](128), - MinServerMemoryMB: to.Ptr[int32](0), - }, - SQLStorageUpdateSettings: &armsqlvirtualmachine.SQLStorageUpdateSettings{ - DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW), - DiskCount: to.Ptr[int32](1), - StartingDeviceID: to.Ptr[int32](2), - }, - SQLWorkloadTypeUpdateSettings: &armsqlvirtualmachine.SQLWorkloadTypeUpdateSettings{ - SQLWorkloadType: to.Ptr(armsqlvirtualmachine.SQLWorkloadTypeOLTP), - }, - }, - SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - }, - }, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(true), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMIN.json -func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate_createsOrUpdatesASqlVirtualMachineWithMinParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{ - Location: to.Ptr("northeurope"), - Properties: &armsqlvirtualmachine.Properties{ - VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - }, - }, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginDelete(ctx, "testrg", "testvm1", 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/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.Update{ - Tags: map[string]*string{ - "mytag": to.Ptr("myval"), - }, - }, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{ - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Tags: map[string]*string{ - // "mytag": to.Ptr("myval"), - // }, - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSQLVirtualMachinesClient().NewListByResourceGroupPager("testrg", 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.ListResult = armsqlvirtualmachine.ListResult{ - // Value: []*armsqlvirtualmachine.SQLVirtualMachine{ - // { - // Name: to.Ptr("testvm"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2016-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"), - // }, - // }, - // { - // Name: to.Ptr("testvm1"), - // Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"), - // Location: to.Ptr("northeurope"), - // Properties: &armsqlvirtualmachine.Properties{ - // EnableAutomaticUpgrade: to.Ptr(false), - // LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet), - // ProvisioningState: to.Ptr("Succeeded"), - // SQLImageOffer: to.Ptr("SQL2017-WS2016"), - // SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise), - // SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeLightWeight), - // SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG), - // VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/StartAssessmentOnSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginStartAssessment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginStartAssessment(ctx, "testrg", "testvm", 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/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/RedeploySqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginRedeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginRedeploy(ctx, "testrg", "testvm", 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/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client.go index 243922124f02..0aa35f09daf6 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client.go @@ -47,7 +47,7 @@ func NewTroubleshootClient(subscriptionID string, credential azcore.TokenCredent // BeginTroubleshoot - Starts SQL virtual machine troubleshooting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview // - resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // - sqlVirtualMachineName - Name of the SQL virtual machine. @@ -71,7 +71,7 @@ func (client *TroubleshootClient) BeginTroubleshoot(ctx context.Context, resourc // Troubleshoot - Starts SQL virtual machine troubleshooting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-01-01-preview func (client *TroubleshootClient) troubleshoot(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters SQLVMTroubleshooting, options *TroubleshootClientBeginTroubleshootOptions) (*http.Response, error) { req, err := client.troubleshootCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, parameters, options) if err != nil { @@ -107,7 +107,7 @@ func (client *TroubleshootClient) troubleshootCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client_example_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client_example_test.go deleted file mode 100644 index 410b959041b3..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/troubleshoot_client_example_test.go +++ /dev/null @@ -1,64 +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 armsqlvirtualmachine_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/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/TroubleshootSqlVirtualMachine.json -func ExampleTroubleshootClient_BeginTroubleshoot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsqlvirtualmachine.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTroubleshootClient().BeginTroubleshoot(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVMTroubleshooting{ - EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T22:10:00Z"); return t }()), - Properties: &armsqlvirtualmachine.TroubleshootingAdditionalProperties{ - UnhealthyReplicaInfo: &armsqlvirtualmachine.UnhealthyReplicaInfo{ - AvailabilityGroupName: to.Ptr("AG1"), - }, - }, - StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T17:10:00Z"); return t }()), - TroubleshootingScenario: to.Ptr(armsqlvirtualmachine.TroubleshootingScenarioUnhealthyReplica), - }, 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.SQLVMTroubleshooting = armsqlvirtualmachine.SQLVMTroubleshooting{ - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T22:10:00Z"); return t}()), - // Properties: &armsqlvirtualmachine.TroubleshootingAdditionalProperties{ - // UnhealthyReplicaInfo: &armsqlvirtualmachine.UnhealthyReplicaInfo{ - // AvailabilityGroupName: to.Ptr("AG1"), - // }, - // }, - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T17:10:00Z"); return t}()), - // TroubleshootingScenario: to.Ptr(armsqlvirtualmachine.TroubleshootingScenarioUnhealthyReplica), - // } -}