From 851699dba2cedf21d7d28d2984672325b6c24360 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Tue, 14 Jun 2022 15:05:49 +0100 Subject: [PATCH 01/15] Add support for no-downtime disk resizes. --- .../services/compute/managed_disk_resource.go | 17 ++++++++++++++++- website/docs/r/managed_disk.html.markdown | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 8d9bc832f9af..16550fdd3732 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -263,6 +263,11 @@ func resourceManagedDisk() *pluginsdk.Resource { Optional: true, }, + "no_downtime_resize_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + "zone": commonschema.ZoneSingleOptionalForceNew(), "tags": tags.Schema(), @@ -652,7 +657,9 @@ func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) erro if d.HasChange("disk_size_gb") { if old, new := d.GetChange("disk_size_gb"); new.(int) > old.(int) { - shouldShutDown = true + if !d.Get("no_downtime_resize_enabled").(bool) || shutDownOnResize(old.(int), new.(int)) { + shouldShutDown = true + } diskUpdate.DiskUpdateProperties.DiskSizeGB = utils.Int32(int32(new.(int))) } else { return fmt.Errorf("- New size must be greater than original size. Shrinking disks is not supported on Azure") @@ -977,3 +984,11 @@ func resourceManagedDiskDelete(d *pluginsdk.ResourceData, meta interface{}) erro return nil } + +func shutDownOnResize(oldSizeGB, newSizeGB int) bool { + // Disks smaller than 4 TiB can't be expanded to 4 TiB or larger without downtime. + if oldSizeGB < 4096 && newSizeGB >= 4096 { + return true + } + return false +} diff --git a/website/docs/r/managed_disk.html.markdown b/website/docs/r/managed_disk.html.markdown index a5ee4086193c..9d852520f147 100644 --- a/website/docs/r/managed_disk.html.markdown +++ b/website/docs/r/managed_disk.html.markdown @@ -155,6 +155,8 @@ The following arguments are supported: * `on_demand_bursting_enabled` (Optional) Specifies if On-Demand Bursting is enabled for the Managed Disk. Defaults to `false`. +* `no_downtime_resize_enabled` (Optional) Specifies if no-downtime resizes are enabled for the Managed Disk. Feature is currently in public preview and needs to be opted in. More information can be found in [Resize without downtime (preview) documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#resize-without-downtime-preview) Defaults to `false`. + -> **Note:** Credit-Based Bursting is enabled by default on all eligible disks. More information on [Credit-Based and On-Demand Bursting can be found in the documentation](https://docs.microsoft.com/azure/virtual-machines/disk-bursting#disk-level-bursting). * `tags` - (Optional) A mapping of tags to assign to the resource. From a77f38efed1581bd503485c3d34685024e5cfcbe Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Wed, 15 Jun 2022 10:55:00 +0100 Subject: [PATCH 02/15] review: switch to feature from resource argument --- internal/features/defaults.go | 3 + internal/features/user_flags.go | 5 ++ internal/provider/features.go | 25 ++++++ internal/provider/features_test.go | 81 +++++++++++++++++++ .../services/compute/managed_disk_resource.go | 7 +- .../docs/guides/features-block.html.markdown | 12 +++ website/docs/r/managed_disk.html.markdown | 2 - 7 files changed, 127 insertions(+), 8 deletions(-) diff --git a/internal/features/defaults.go b/internal/features/defaults.go index 56fde6f02b8f..07f739e8cb3b 100644 --- a/internal/features/defaults.go +++ b/internal/features/defaults.go @@ -27,6 +27,9 @@ func Default() UserFeatures { LogAnalyticsWorkspace: LogAnalyticsWorkspaceFeatures{ PermanentlyDeleteOnDestroy: true, }, + ManagedDisk: ManagedDiskFeatures{ + NoDowntimeResize: false, + }, ResourceGroup: ResourceGroupFeatures{ PreventDeletionIfContainsResources: true, }, diff --git a/internal/features/user_flags.go b/internal/features/user_flags.go index c1c6c5df155c..3e6bdf99461c 100644 --- a/internal/features/user_flags.go +++ b/internal/features/user_flags.go @@ -10,6 +10,7 @@ type UserFeatures struct { TemplateDeployment TemplateDeploymentFeatures LogAnalyticsWorkspace LogAnalyticsWorkspaceFeatures ResourceGroup ResourceGroupFeatures + ManagedDisk ManagedDiskFeatures } type CognitiveAccountFeatures struct { @@ -60,3 +61,7 @@ type ApiManagementFeatures struct { type ApplicationInsightFeatures struct { DisableGeneratedRule bool } + +type ManagedDiskFeatures struct { + NoDowntimeResize bool +} diff --git a/internal/provider/features.go b/internal/provider/features.go index 9ee30f43618c..5d84a3f5806c 100644 --- a/internal/provider/features.go +++ b/internal/provider/features.go @@ -243,6 +243,21 @@ func schemaFeatures(supportLegacyTestSuite bool) *pluginsdk.Schema { }, }, }, + + "managed_disk": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "no_downtime_resize": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + }, + }, + }, } // this is a temporary hack to enable us to gradually add provider blocks to test configurations @@ -407,5 +422,15 @@ func expandFeatures(input []interface{}) features.UserFeatures { } } + if raw, ok := val["managed_disk"]; ok { + items := raw.([]interface{}) + if len(items) > 0 { + managedDiskRaw := items[0].(map[string]interface{}) + if v, ok := managedDiskRaw["no_downtime_resize"]; ok { + featuresMap.ManagedDisk.NoDowntimeResize = v.(bool) + } + } + } + return featuresMap } diff --git a/internal/provider/features_test.go b/internal/provider/features_test.go index 7fb620ac91f8..4f1330a5b99d 100644 --- a/internal/provider/features_test.go +++ b/internal/provider/features_test.go @@ -98,6 +98,11 @@ func TestExpandFeatures(t *testing.T) { "permanently_delete_on_destroy": true, }, }, + "managed_disk": []interface{}{ + map[string]interface{}{ + "no_downtime_resize": true, + }, + }, "network": []interface{}{ map[string]interface{}{ "relaxed_locking": true, @@ -154,6 +159,9 @@ func TestExpandFeatures(t *testing.T) { LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ PermanentlyDeleteOnDestroy: true, }, + ManagedDisk: features.ManagedDiskFeatures{ + NoDowntimeResize: true, + }, ResourceGroup: features.ResourceGroupFeatures{ PreventDeletionIfContainsResources: true, }, @@ -210,6 +218,11 @@ func TestExpandFeatures(t *testing.T) { "permanently_delete_on_destroy": false, }, }, + "managed_disk": []interface{}{ + map[string]interface{}{ + "no_downtime_resize": false, + }, + }, "network_locking": []interface{}{ map[string]interface{}{ "relaxed_locking": false, @@ -266,6 +279,9 @@ func TestExpandFeatures(t *testing.T) { LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ PermanentlyDeleteOnDestroy: false, }, + ManagedDisk: features.ManagedDiskFeatures{ + NoDowntimeResize: false, + }, ResourceGroup: features.ResourceGroupFeatures{ PreventDeletionIfContainsResources: false, }, @@ -1025,3 +1041,68 @@ func TestExpandFeaturesResourceGroup(t *testing.T) { } } } + +func TestExpandFeaturesManagedDisk(t *testing.T) { + testData := []struct { + Name string + Input []interface{} + EnvVars map[string]interface{} + Expected features.UserFeatures + }{ + { + Name: "Empty Block", + Input: []interface{}{ + map[string]interface{}{ + "managed_disk": []interface{}{}, + }, + }, + Expected: features.UserFeatures{ + ManagedDisk: features.ManagedDiskFeatures{ + NoDowntimeResize: false, + }, + }, + }, + { + Name: "No Downtime Resize Enabled", + Input: []interface{}{ + map[string]interface{}{ + "managed_disk": []interface{}{ + map[string]interface{}{ + "no_downtime_resize": true, + }, + }, + }, + }, + Expected: features.UserFeatures{ + ManagedDisk: features.ManagedDiskFeatures{ + NoDowntimeResize: true, + }, + }, + }, + { + Name: "No Downtime Resize Disabled", + Input: []interface{}{ + map[string]interface{}{ + "managed_disk": []interface{}{ + map[string]interface{}{ + "no_downtime_resize": false, + }, + }, + }, + }, + Expected: features.UserFeatures{ + ManagedDisk: features.ManagedDiskFeatures{ + NoDowntimeResize: false, + }, + }, + }, + } + + for _, testCase := range testData { + t.Logf("[DEBUG] Test Case: %q", testCase.Name) + result := expandFeatures(testCase.Input) + if !reflect.DeepEqual(result.ManagedDisk, testCase.Expected.ManagedDisk) { + t.Fatalf("Expected %+v but got %+v", result.ManagedDisk, testCase.Expected.ManagedDisk) + } + } +} diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 16550fdd3732..2db4d5df2fcc 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -263,11 +263,6 @@ func resourceManagedDisk() *pluginsdk.Resource { Optional: true, }, - "no_downtime_resize_enabled": { - Type: pluginsdk.TypeBool, - Optional: true, - }, - "zone": commonschema.ZoneSingleOptionalForceNew(), "tags": tags.Schema(), @@ -657,7 +652,7 @@ func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) erro if d.HasChange("disk_size_gb") { if old, new := d.GetChange("disk_size_gb"); new.(int) > old.(int) { - if !d.Get("no_downtime_resize_enabled").(bool) || shutDownOnResize(old.(int), new.(int)) { + if !meta.(*clients.Client).Features.ManagedDisk.NoDowntimeResize || shutDownOnResize(old.(int), new.(int)) { shouldShutDown = true } diskUpdate.DiskUpdateProperties.DiskSizeGB = utils.Int32(int32(new.(int))) diff --git a/website/docs/guides/features-block.html.markdown b/website/docs/guides/features-block.html.markdown index 717be3774fe5..e9fa0d8f2f8c 100644 --- a/website/docs/guides/features-block.html.markdown +++ b/website/docs/guides/features-block.html.markdown @@ -49,6 +49,10 @@ provider "azurerm" { permanently_delete_on_destroy = true } + managed_disk { + no_downtime_resize = true + } + resource_group { prevent_deletion_if_contains_resources = true } @@ -86,6 +90,8 @@ The `features` block supports the following: * `log_analytics_workspace` - (Optional) A `log_analytics_workspace` block as defined below. +* `managed_disk` - (Optional) A `managed_disk` block as defined below. + * `resource_group` - (Optional) A `resource_group` block as defined below. * `template_deployment` - (Optional) A `template_deployment` block as defined below. @@ -148,6 +154,12 @@ The `log_analytics_workspace` block supports the following: --- +The `managed_disk` block supports the following: + +* `no_downtime_resize` (Optional) Specifies if no-downtime resizes are enabled for the Managed Disk. Feature is currently in public preview and needs to be opted in. More information can be found in [Resize without downtime (preview) documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#resize-without-downtime-preview) Defaults to `false`. + +--- + The `resource_group` block supports the following: * `prevent_deletion_if_contains_resources` - (Optional) Should the `azurerm_resource_group` resource check that there are no Resources within the Resource Group during deletion? This means that all Resources within the Resource Group must be deleted prior to deleting the Resource Group. Defaults to `false`. diff --git a/website/docs/r/managed_disk.html.markdown b/website/docs/r/managed_disk.html.markdown index 9d852520f147..a5ee4086193c 100644 --- a/website/docs/r/managed_disk.html.markdown +++ b/website/docs/r/managed_disk.html.markdown @@ -155,8 +155,6 @@ The following arguments are supported: * `on_demand_bursting_enabled` (Optional) Specifies if On-Demand Bursting is enabled for the Managed Disk. Defaults to `false`. -* `no_downtime_resize_enabled` (Optional) Specifies if no-downtime resizes are enabled for the Managed Disk. Feature is currently in public preview and needs to be opted in. More information can be found in [Resize without downtime (preview) documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#resize-without-downtime-preview) Defaults to `false`. - -> **Note:** Credit-Based Bursting is enabled by default on all eligible disks. More information on [Credit-Based and On-Demand Bursting can be found in the documentation](https://docs.microsoft.com/azure/virtual-machines/disk-bursting#disk-level-bursting). * `tags` - (Optional) A mapping of tags to assign to the resource. From 11114710d474382fab8a523385d556c771a298c3 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Wed, 15 Jun 2022 12:01:52 +0100 Subject: [PATCH 03/15] review: check disk type on resize --- internal/services/compute/managed_disk_resource.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 2db4d5df2fcc..245673579f89 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -652,7 +652,7 @@ func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) erro if d.HasChange("disk_size_gb") { if old, new := d.GetChange("disk_size_gb"); new.(int) > old.(int) { - if !meta.(*clients.Client).Features.ManagedDisk.NoDowntimeResize || shutDownOnResize(old.(int), new.(int)) { + if !meta.(*clients.Client).Features.ManagedDisk.NoDowntimeResize || shutDownOnResize(disk, old.(int), new.(int)) { shouldShutDown = true } diskUpdate.DiskUpdateProperties.DiskSizeGB = utils.Int32(int32(new.(int))) @@ -980,7 +980,11 @@ func resourceManagedDiskDelete(d *pluginsdk.ResourceData, meta interface{}) erro return nil } -func shutDownOnResize(oldSizeGB, newSizeGB int) bool { +func shutDownOnResize(disk compute.Disk, oldSizeGB, newSizeGB int) bool { + // OS disks can't be expanded without downtime. + if disk.OsType != "" { + return true + } // Disks smaller than 4 TiB can't be expanded to 4 TiB or larger without downtime. if oldSizeGB < 4096 && newSizeGB >= 4096 { return true From 67dda3ff46f879c590e51aa9bbfc7b34387a4cc8 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Wed, 15 Jun 2022 17:12:30 +0100 Subject: [PATCH 04/15] tweak docs --- website/docs/guides/features-block.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/features-block.html.markdown b/website/docs/guides/features-block.html.markdown index e9fa0d8f2f8c..fb33fa1f0687 100644 --- a/website/docs/guides/features-block.html.markdown +++ b/website/docs/guides/features-block.html.markdown @@ -156,7 +156,7 @@ The `log_analytics_workspace` block supports the following: The `managed_disk` block supports the following: -* `no_downtime_resize` (Optional) Specifies if no-downtime resizes are enabled for the Managed Disk. Feature is currently in public preview and needs to be opted in. More information can be found in [Resize without downtime (preview) documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#resize-without-downtime-preview) Defaults to `false`. +* `no_downtime_resize` (Optional) Specifies if no-downtime resizes are enabled for the managed disk resources. Feature is currently in public preview and needs to be opted in. More information can be found in [Resize without downtime (preview) documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#resize-without-downtime-preview). Defaults to `false`. --- From 80e65c3436e55123fc6e55233c70cfaa92f07c36 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Thu, 21 Jul 2022 22:12:53 +0100 Subject: [PATCH 05/15] flip default to true --- internal/features/defaults.go | 2 +- internal/provider/features.go | 2 +- internal/provider/features_test.go | 2 +- website/docs/guides/features-block.html.markdown | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/features/defaults.go b/internal/features/defaults.go index 07f739e8cb3b..9c4ff206183a 100644 --- a/internal/features/defaults.go +++ b/internal/features/defaults.go @@ -28,7 +28,7 @@ func Default() UserFeatures { PermanentlyDeleteOnDestroy: true, }, ManagedDisk: ManagedDiskFeatures{ - NoDowntimeResize: false, + NoDowntimeResize: true, }, ResourceGroup: ResourceGroupFeatures{ PreventDeletionIfContainsResources: true, diff --git a/internal/provider/features.go b/internal/provider/features.go index 5d84a3f5806c..86c597804c67 100644 --- a/internal/provider/features.go +++ b/internal/provider/features.go @@ -253,7 +253,7 @@ func schemaFeatures(supportLegacyTestSuite bool) *pluginsdk.Schema { "no_downtime_resize": { Type: pluginsdk.TypeBool, Optional: true, - Default: false, + Default: true, }, }, }, diff --git a/internal/provider/features_test.go b/internal/provider/features_test.go index 4f1330a5b99d..4c97757ce5c9 100644 --- a/internal/provider/features_test.go +++ b/internal/provider/features_test.go @@ -1058,7 +1058,7 @@ func TestExpandFeaturesManagedDisk(t *testing.T) { }, Expected: features.UserFeatures{ ManagedDisk: features.ManagedDiskFeatures{ - NoDowntimeResize: false, + NoDowntimeResize: true, }, }, }, diff --git a/website/docs/guides/features-block.html.markdown b/website/docs/guides/features-block.html.markdown index 9656d474570a..e91c54941178 100644 --- a/website/docs/guides/features-block.html.markdown +++ b/website/docs/guides/features-block.html.markdown @@ -156,7 +156,7 @@ The `log_analytics_workspace` block supports the following: The `managed_disk` block supports the following: -* `no_downtime_resize` (Optional) Specifies if no-downtime resizes are enabled for the managed disk resources. Feature is currently in public preview and needs to be opted in. More information can be found in [Resize without downtime (preview) documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#resize-without-downtime-preview). Defaults to `false`. +* `no_downtime_resize` (Optional) Specifies if no-downtime resizes are enabled for the managed disk resources. Defaults to `true`. --- From fa1d8d098dfd34681a2759eae62c7e7b0f37e781 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Thu, 21 Jul 2022 22:16:10 +0100 Subject: [PATCH 06/15] vendor --- .../2022-04-01/applicationinsights/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/README.md index e67de93e11a0..8080cc0ccaf5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/README.md @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationinsights.NewResourceGroupID() +id := applicationinsights.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") // alternatively `client.WorkbooksListByResourceGroup(ctx, id, applicationinsights.DefaultWorkbooksListByResourceGroupOperationOptions())` can be used to do batched pagination items, err := client.WorkbooksListByResourceGroupComplete(ctx, id, applicationinsights.DefaultWorkbooksListByResourceGroupOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationinsights.NewSubscriptionID() +id := applicationinsights.NewSubscriptionID("12345678-1234-9876-4563-123456789012") // alternatively `client.WorkbooksListBySubscription(ctx, id, applicationinsights.DefaultWorkbooksListBySubscriptionOperationOptions())` can be used to do batched pagination items, err := client.WorkbooksListBySubscriptionComplete(ctx, id, applicationinsights.DefaultWorkbooksListBySubscriptionOperationOptions()) From d0fe26ce292b52f8274cde00e6992f452dfdfa23 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Thu, 21 Jul 2022 23:20:18 +0100 Subject: [PATCH 07/15] fix test --- internal/provider/features_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/provider/features_test.go b/internal/provider/features_test.go index 4c97757ce5c9..d41a56e2ddf3 100644 --- a/internal/provider/features_test.go +++ b/internal/provider/features_test.go @@ -42,6 +42,9 @@ func TestExpandFeatures(t *testing.T) { LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ PermanentlyDeleteOnDestroy: true, }, + ManagedDisk: features.ManagedDiskFeatures{ + NoDowntimeResize: true, + }, TemplateDeployment: features.TemplateDeploymentFeatures{ DeleteNestedItemsDuringDeletion: true, }, From bd50a25d75e9b06169119723ba698b53899f91b8 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Fri, 22 Jul 2022 10:16:27 +0100 Subject: [PATCH 08/15] no live resize for Standard HDD --- internal/services/compute/managed_disk_resource.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index fa0de20f10ca..200527ad1376 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -984,6 +984,10 @@ func shutDownOnResize(disk compute.Disk, oldSizeGB, newSizeGB int) bool { if disk.OsType != "" { return true } + // Standard HDD disks can't be expanded without downtime + if disk.Sku.Name == compute.DiskStorageAccountTypesStandardLRS { + return true + } // Disks smaller than 4 TiB can't be expanded to 4 TiB or larger without downtime. if oldSizeGB < 4096 && newSizeGB >= 4096 { return true From 87a68d1b45e5bf3af12315f75001f02acafc6749 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Tue, 26 Jul 2022 11:04:58 +0100 Subject: [PATCH 09/15] ultra ssd also require restart --- internal/services/compute/managed_disk_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 200527ad1376..6bea0cf435ac 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -984,8 +984,8 @@ func shutDownOnResize(disk compute.Disk, oldSizeGB, newSizeGB int) bool { if disk.OsType != "" { return true } - // Standard HDD disks can't be expanded without downtime - if disk.Sku.Name == compute.DiskStorageAccountTypesStandardLRS { + // Standard HDD and Ultra SSD disks can't be expanded without downtime + if disk.Sku.Name == compute.DiskStorageAccountTypesStandardLRS || disk.Sku.Name == compute.DiskStorageAccountTypesUltraSSDLRS { return true } // Disks smaller than 4 TiB can't be expanded to 4 TiB or larger without downtime. From 0f3cb8403d9efa4184544571a82edcaa7f4b4495 Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Wed, 14 Sep 2022 21:41:05 +0100 Subject: [PATCH 10/15] invert disk type matching logic to be more explicit --- .../services/compute/managed_disk_resource.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 6bea0cf435ac..d20537c08f79 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -979,18 +979,26 @@ func resourceManagedDiskDelete(d *pluginsdk.ResourceData, meta interface{}) erro return nil } +// shutDownOnResize implements live resize restrictions according to https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#expand-without-downtime func shutDownOnResize(disk compute.Disk, oldSizeGB, newSizeGB int) bool { // OS disks can't be expanded without downtime. if disk.OsType != "" { return true } - // Standard HDD and Ultra SSD disks can't be expanded without downtime - if disk.Sku.Name == compute.DiskStorageAccountTypesStandardLRS || disk.Sku.Name == compute.DiskStorageAccountTypesUltraSSDLRS { - return true - } // Disks smaller than 4 TiB can't be expanded to 4 TiB or larger without downtime. if oldSizeGB < 4096 && newSizeGB >= 4096 { return true } - return false + // Only Premium SSD v1 and Standard SSD disks support live resize + for _, diskType := range []compute.DiskStorageAccountTypes{ + compute.DiskStorageAccountTypesPremiumLRS, + compute.DiskStorageAccountTypesPremiumZRS, + compute.DiskStorageAccountTypesStandardSSDLRS, + compute.DiskStorageAccountTypesStandardSSDZRS, + } { + if disk.Sku.Name == diskType { + return false + } + } + return true } From 9a7b9985e4afc71e367ef42e546c41c0caac348c Mon Sep 17 00:00:00 2001 From: Kazimierz Budzyk Date: Mon, 10 Oct 2022 13:37:19 +0100 Subject: [PATCH 11/15] update to use disks package instead of compute --- .../services/compute/managed_disk_resource.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 278c6097dc7d..b74978591bf4 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -673,7 +673,7 @@ func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) erro if d.HasChange("disk_size_gb") { if old, new := d.GetChange("disk_size_gb"); new.(int) > old.(int) { - if !meta.(*clients.Client).Features.ManagedDisk.NoDowntimeResize || shutDownOnResize(disk, old.(int), new.(int)) { + if !meta.(*clients.Client).Features.ManagedDisk.NoDowntimeResize || shutDownOnResize(disk.Model, old.(int), new.(int)) { shouldShutDown = true } diskUpdate.Properties.DiskSizeGB = utils.Int64(int64(new.(int))) @@ -1004,9 +1004,9 @@ func resourceManagedDiskDelete(d *pluginsdk.ResourceData, meta interface{}) erro } // shutDownOnResize implements live resize restrictions according to https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#expand-without-downtime -func shutDownOnResize(disk compute.Disk, oldSizeGB, newSizeGB int) bool { +func shutDownOnResize(disk *disks.Disk, oldSizeGB, newSizeGB int) bool { // OS disks can't be expanded without downtime. - if disk.OsType != "" { + if *disk.Properties.OsType != "" { return true } // Disks smaller than 4 TiB can't be expanded to 4 TiB or larger without downtime. @@ -1014,13 +1014,13 @@ func shutDownOnResize(disk compute.Disk, oldSizeGB, newSizeGB int) bool { return true } // Only Premium SSD v1 and Standard SSD disks support live resize - for _, diskType := range []compute.DiskStorageAccountTypes{ - compute.DiskStorageAccountTypesPremiumLRS, - compute.DiskStorageAccountTypesPremiumZRS, - compute.DiskStorageAccountTypesStandardSSDLRS, - compute.DiskStorageAccountTypesStandardSSDZRS, + for _, diskType := range []disks.DiskStorageAccountTypes{ + disks.DiskStorageAccountTypesPremiumLRS, + disks.DiskStorageAccountTypesPremiumZRS, + disks.DiskStorageAccountTypesStandardSSDLRS, + disks.DiskStorageAccountTypesStandardSSDZRS, } { - if disk.Sku.Name == diskType { + if *disk.Sku.Name == diskType { return false } } From 87c55105f1d9ecf98e135f800e238b2d8338daa2 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Mon, 7 Nov 2022 15:56:48 +0100 Subject: [PATCH 12/15] r/managed_disk: support for Expand Without Downtime This extends the work done by @kazimierzbudzyk to ensure we check the Virtual Machine and Managed Disk to confirm that they support Expand Without Downtime (and fallback to shutting the machine down if not). Unfortunately we're unable to output a warning either way at this time (since that'd require Framework) - as such this PR includes adding notes to the documentation calling out we'll best-effort this. --- internal/features/defaults.go | 2 +- internal/features/user_flags.go | 2 +- internal/provider/features.go | 4 +- internal/provider/features_test.go | 20 +-- internal/services/compute/client/client.go | 12 ++ .../services/compute/managed_disk_resource.go | 47 +++--- .../compute/managed_disk_resource_test.go | 146 ++++++++++++++++++ .../services/compute/no_downtime_resize.go | 127 +++++++++++++++ internal/services/monitor/client/client.go | 5 + .../docs/guides/features-block.html.markdown | 6 +- website/docs/r/managed_disk.html.markdown | 4 +- 11 files changed, 331 insertions(+), 44 deletions(-) create mode 100644 internal/services/compute/no_downtime_resize.go diff --git a/internal/features/defaults.go b/internal/features/defaults.go index c5605d8a8374..32c656b254f3 100644 --- a/internal/features/defaults.go +++ b/internal/features/defaults.go @@ -32,7 +32,7 @@ func Default() UserFeatures { PermanentlyDeleteOnDestroy: true, }, ManagedDisk: ManagedDiskFeatures{ - NoDowntimeResize: true, + ExpandWithoutDowntime: true, }, ResourceGroup: ResourceGroupFeatures{ PreventDeletionIfContainsResources: true, diff --git a/internal/features/user_flags.go b/internal/features/user_flags.go index d593f36f4fee..836730920a51 100644 --- a/internal/features/user_flags.go +++ b/internal/features/user_flags.go @@ -64,7 +64,7 @@ type ApplicationInsightFeatures struct { } type ManagedDiskFeatures struct { - NoDowntimeResize bool + ExpandWithoutDowntime bool } type AppConfigurationFeatures struct { diff --git a/internal/provider/features.go b/internal/provider/features.go index 7b11ea4a3ae1..12e6e54d33de 100644 --- a/internal/provider/features.go +++ b/internal/provider/features.go @@ -460,8 +460,8 @@ func expandFeatures(input []interface{}) features.UserFeatures { items := raw.([]interface{}) if len(items) > 0 { managedDiskRaw := items[0].(map[string]interface{}) - if v, ok := managedDiskRaw["no_downtime_resize"]; ok { - featuresMap.ManagedDisk.NoDowntimeResize = v.(bool) + if v, ok := managedDiskRaw["expand_without_downtime"]; ok { + featuresMap.ManagedDisk.ExpandWithoutDowntime = v.(bool) } } } diff --git a/internal/provider/features_test.go b/internal/provider/features_test.go index 3128ad63dda7..a2eaeeab68de 100644 --- a/internal/provider/features_test.go +++ b/internal/provider/features_test.go @@ -47,7 +47,7 @@ func TestExpandFeatures(t *testing.T) { PermanentlyDeleteOnDestroy: true, }, ManagedDisk: features.ManagedDiskFeatures{ - NoDowntimeResize: true, + ExpandWithoutDowntime: true, }, TemplateDeployment: features.TemplateDeploymentFeatures{ DeleteNestedItemsDuringDeletion: true, @@ -113,7 +113,7 @@ func TestExpandFeatures(t *testing.T) { }, "managed_disk": []interface{}{ map[string]interface{}{ - "no_downtime_resize": true, + "expand_without_downtime": true, }, }, "network": []interface{}{ @@ -177,7 +177,7 @@ func TestExpandFeatures(t *testing.T) { PermanentlyDeleteOnDestroy: true, }, ManagedDisk: features.ManagedDiskFeatures{ - NoDowntimeResize: true, + ExpandWithoutDowntime: true, }, ResourceGroup: features.ResourceGroupFeatures{ PreventDeletionIfContainsResources: true, @@ -243,7 +243,7 @@ func TestExpandFeatures(t *testing.T) { }, "managed_disk": []interface{}{ map[string]interface{}{ - "no_downtime_resize": false, + "expand_without_downtime": false, }, }, "network_locking": []interface{}{ @@ -307,7 +307,7 @@ func TestExpandFeatures(t *testing.T) { PermanentlyDeleteOnDestroy: false, }, ManagedDisk: features.ManagedDiskFeatures{ - NoDowntimeResize: false, + ExpandWithoutDowntime: false, }, ResourceGroup: features.ResourceGroupFeatures{ PreventDeletionIfContainsResources: false, @@ -1155,7 +1155,7 @@ func TestExpandFeaturesManagedDisk(t *testing.T) { }, Expected: features.UserFeatures{ ManagedDisk: features.ManagedDiskFeatures{ - NoDowntimeResize: true, + ExpandWithoutDowntime: true, }, }, }, @@ -1165,14 +1165,14 @@ func TestExpandFeaturesManagedDisk(t *testing.T) { map[string]interface{}{ "managed_disk": []interface{}{ map[string]interface{}{ - "no_downtime_resize": true, + "expand_without_downtime": true, }, }, }, }, Expected: features.UserFeatures{ ManagedDisk: features.ManagedDiskFeatures{ - NoDowntimeResize: true, + ExpandWithoutDowntime: true, }, }, }, @@ -1182,14 +1182,14 @@ func TestExpandFeaturesManagedDisk(t *testing.T) { map[string]interface{}{ "managed_disk": []interface{}{ map[string]interface{}{ - "no_downtime_resize": false, + "expand_without_downtime": false, }, }, }, }, Expected: features.UserFeatures{ ManagedDisk: features.ManagedDiskFeatures{ - NoDowntimeResize: false, + ExpandWithoutDowntime: false, }, }, }, diff --git a/internal/services/compute/client/client.go b/internal/services/compute/client/client.go index 3cc102f09ce5..063ac6cf7afa 100644 --- a/internal/services/compute/client/client.go +++ b/internal/services/compute/client/client.go @@ -3,11 +3,13 @@ package client import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute" "github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/sshpublickeys" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -29,9 +31,11 @@ type Client struct { ImagesClient *compute.ImagesClient MarketplaceAgreementsClient *marketplaceordering.MarketplaceAgreementsClient ProximityPlacementGroupsClient *proximityplacementgroups.ProximityPlacementGroupsClient + SkusClient *skus.SkusClient SSHPublicKeysClient *sshpublickeys.SshPublicKeysClient SnapshotsClient *compute.SnapshotsClient UsageClient *compute.UsageClient + VirtualMachinesClient *virtualmachines.VirtualMachinesClient VMExtensionImageClient *compute.VirtualMachineExtensionImagesClient VMExtensionClient *compute.VirtualMachineExtensionsClient VMScaleSetClient *compute.VirtualMachineScaleSetsClient @@ -91,6 +95,9 @@ func NewClient(o *common.ClientOptions) *Client { proximityPlacementGroupsClient := proximityplacementgroups.NewProximityPlacementGroupsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&proximityPlacementGroupsClient.Client, o.ResourceManagerAuthorizer) + skusClient := skus.NewSkusClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&skusClient.Client, o.ResourceManagerAuthorizer) + snapshotsClient := compute.NewSnapshotsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&snapshotsClient.Client, o.ResourceManagerAuthorizer) @@ -100,6 +107,9 @@ func NewClient(o *common.ClientOptions) *Client { usageClient := compute.NewUsageClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&usageClient.Client, o.ResourceManagerAuthorizer) + virtualMachinesClient := virtualmachines.NewVirtualMachinesClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&virtualMachinesClient.Client, o.ResourceManagerAuthorizer) + vmExtensionImageClient := compute.NewVirtualMachineExtensionImagesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&vmExtensionImageClient.Client, o.ResourceManagerAuthorizer) @@ -141,9 +151,11 @@ func NewClient(o *common.ClientOptions) *Client { ImagesClient: &imagesClient, MarketplaceAgreementsClient: &marketplaceAgreementsClient, ProximityPlacementGroupsClient: &proximityPlacementGroupsClient, + SkusClient: &skusClient, SSHPublicKeysClient: &sshPublicKeysClient, SnapshotsClient: &snapshotsClient, UsageClient: &usageClient, + VirtualMachinesClient: &virtualMachinesClient, VMExtensionImageClient: &vmExtensionImageClient, VMExtensionClient: &vmExtensionClient, VMScaleSetClient: &vmScaleSetClient, diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index b74978591bf4..83cdf30387bf 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -561,6 +561,8 @@ func resourceManagedDiskCreate(d *pluginsdk.ResourceData, meta interface{}) erro func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) error { client := meta.(*clients.Client).Compute.DisksClient + virtualMachinesClient := meta.(*clients.Client).Compute.VirtualMachinesClient + skusClient := meta.(*clients.Client).Compute.SkusClient ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -672,11 +674,26 @@ func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) erro } if d.HasChange("disk_size_gb") { - if old, new := d.GetChange("disk_size_gb"); new.(int) > old.(int) { - if !meta.(*clients.Client).Features.ManagedDisk.NoDowntimeResize || shutDownOnResize(disk.Model, old.(int), new.(int)) { + if oldSize, newSize := d.GetChange("disk_size_gb"); newSize.(int) > oldSize.(int) { + canBeResizedWithoutDowntime := false + if meta.(*clients.Client).Features.ManagedDisk.ExpandWithoutDowntime { + diskSupportsNoDowntimeResize, err := determineIfDataDiskSupportsNoDowntimeResize(disk.Model, oldSize.(int), newSize.(int)) + if err != nil { + return fmt.Errorf("determining if the Disk supports no-downtime-resize: %+v", err) + } + + vmSkuSupportsNoDowntimeResize, err := determineIfVirtualMachineSkuSupportsNoDowntimeResize(ctx, disk.Model.ManagedBy, virtualMachinesClient, skusClient) + if err != nil { + return fmt.Errorf("determining if the Virtual Machine the Disk is attached to supports no-downtime-resize: %+v", err) + } + + canBeResizedWithoutDowntime = *vmSkuSupportsNoDowntimeResize && *diskSupportsNoDowntimeResize + } + if !canBeResizedWithoutDowntime { + log.Printf("[INFO] The %s, or the Virtual Machine that it's attached to, doesn't support no-downtime-resizing - requiring that the VM should be shutdown", *id) shouldShutDown = true } - diskUpdate.Properties.DiskSizeGB = utils.Int64(int64(new.(int))) + diskUpdate.Properties.DiskSizeGB = utils.Int64(int64(newSize.(int))) } else { return fmt.Errorf("- New size must be greater than original size. Shrinking disks is not supported on Azure") } @@ -1002,27 +1019,3 @@ func resourceManagedDiskDelete(d *pluginsdk.ResourceData, meta interface{}) erro return nil } - -// shutDownOnResize implements live resize restrictions according to https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#expand-without-downtime -func shutDownOnResize(disk *disks.Disk, oldSizeGB, newSizeGB int) bool { - // OS disks can't be expanded without downtime. - if *disk.Properties.OsType != "" { - return true - } - // Disks smaller than 4 TiB can't be expanded to 4 TiB or larger without downtime. - if oldSizeGB < 4096 && newSizeGB >= 4096 { - return true - } - // Only Premium SSD v1 and Standard SSD disks support live resize - for _, diskType := range []disks.DiskStorageAccountTypes{ - disks.DiskStorageAccountTypesPremiumLRS, - disks.DiskStorageAccountTypesPremiumZRS, - disks.DiskStorageAccountTypesStandardSSDLRS, - disks.DiskStorageAccountTypesStandardSSDZRS, - } { - if *disk.Sku.Name == diskType { - return false - } - } - return true -} diff --git a/internal/services/compute/managed_disk_resource_test.go b/internal/services/compute/managed_disk_resource_test.go index 5ffcf18e6748..e42bc57a457f 100644 --- a/internal/services/compute/managed_disk_resource_test.go +++ b/internal/services/compute/managed_disk_resource_test.go @@ -3,7 +3,10 @@ package compute_test import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "strings" "testing" + "time" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -672,6 +675,29 @@ func TestAccManagedDisk_storageAccountType(t *testing.T) { }) } +func TestAccManagedDisk_onlineLiveResize(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_managed_disk", "test") + r := ManagedDiskResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.onlineLiveResizing(data, 10), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.onlineLiveResizing(data, 20), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + data.CheckWithClientForResource(r.checkLinuxVirtualMachineWasNotRestarted, "azurerm_linux_virtual_machine.test"), + ), + }, + data.ImportStep(), + }) +} + func (ManagedDiskResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { id, err := disks.ParseDiskID(state.ID) if err != nil { @@ -2300,3 +2326,123 @@ resource "azurerm_managed_disk" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } + +func (ManagedDiskResource) onlineLiveResizing(data acceptance.TestData, diskSizeGB int) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +locals { + random_integer = %[1]d + primary_location = %[2]q + first_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-${local.random_integer}" + location = local.primary_location +} + +resource "azurerm_virtual_network" "test" { + name = "acctestnw-${local.random_integer}" + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_subnet" "test" { + name = "internal" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.0.2.0/24"] +} + +resource "azurerm_network_interface" "test" { + name = "acctestnic-${local.random_integer}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.test.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-${local.random_integer}" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_D2s_v3" + admin_username = "adminuser" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = local.first_public_key + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "16.04-LTS" + version = "latest" + } +} + +resource "azurerm_managed_disk" "test" { + name = "acctestd-${local.random_integer}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + storage_account_type = "Premium_LRS" + create_option = "Empty" + disk_size_gb = %[3]d +} + +resource "azurerm_virtual_machine_data_disk_attachment" "test" { + managed_disk_id = azurerm_managed_disk.test.id + virtual_machine_id = azurerm_linux_virtual_machine.test.id + lun = "10" + caching = "ReadWrite" +} +`, data.RandomInteger, data.Locations.Primary, diskSizeGB) +} + +func (ManagedDiskResource) checkLinuxVirtualMachineWasNotRestarted(ctx context.Context, client *clients.Client, state *terraform.InstanceState) error { + activityLogsClient := client.Monitor.ActivityLogsClient + filter := fmt.Sprintf("eventTimestamp ge '%s' and resourceUri eq '%s'", time.Now().Add(-1*time.Hour).Format(time.RFC3339), state.ID) + logs, err := activityLogsClient.ListComplete(ctx, filter, "") + if err != nil { + return fmt.Errorf("retrieving activity logs for Virtual Machine %q: %+v", state.ID, err) + } + + wasShutDown := false + for logs.NotDone() { + val := logs.Value() + if val.Authorization == nil || val.Authorization.Action == nil { + return fmt.Errorf("parsing activity log for Virtual Machine %q: `model.Authorization` or `model.Authorization.Action` was nil", state.ID) + } + if strings.EqualFold(*val.Authorization.Action, "Microsoft.Compute/virtualMachines/stop/action") { + wasShutDown = true + break + } + + if err := logs.NextWithContext(ctx); err != nil { + return fmt.Errorf("listing the next page of results: %+v", err) + } + } + + if wasShutDown { + return fmt.Errorf("the Virtual Machine %q was shut down when resizing the Data Disk when it shouldn't have been", state.ID) + } + + return nil +} diff --git a/internal/services/compute/no_downtime_resize.go b/internal/services/compute/no_downtime_resize.go new file mode 100644 index 000000000000..797104c82c61 --- /dev/null +++ b/internal/services/compute/no_downtime_resize.go @@ -0,0 +1,127 @@ +package compute + +import ( + "context" + "fmt" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "log" + "strings" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines" +) + +// The logic on this file is based on: +// Linux: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks?tabs=azure-cli%2Cubuntu#expand-without-downtime +// Windows: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/expand-os-disk#expand-without-downtime +// NOTE: whilst the Windows URI says "expand OS disk" it's not supported on OS disks, this is an old document that's not been renamed + +// @tombuildsstuff: this is intentionally split out into it's own file since this'll need to be reused + +func determineIfDataDiskSupportsNoDowntimeResize(disk *disks.Disk, oldSizeGb, newSizeGb int) (*bool, error) { + if disk == nil || disk.Properties == nil || disk.Sku == nil { + return pointer.To(false), nil + } + + // Only supported for data disks. + isDataDisk := disk.Properties.OsType != nil && string(*disk.Properties.OsType) != "" + if isDataDisk { + return pointer.To(false), nil + } + + // Not supported for shared disks. + isSharedDisk := disk.Properties.MaxShares != nil && *disk.Properties.MaxShares >= 0 + if isSharedDisk { + log.Printf("[DEBUG] Disk is shared so does not support no-downtime-resize") + return pointer.To(false), nil + } + + // If a disk is 4 TiB or less, you can't expand it beyond 4 TiB without deallocating the VM. + // If a disk is already greater than 4 TiB, you can expand it without deallocating the VM. + if oldSizeGb < 4096 && newSizeGb >= 4096 { + return pointer.To(false), nil + } + + // Not supported for Ultra disks or Premium SSD v2 disks. + diskTypeIsSupported := false + if disk.Sku.Name != nil { + for _, supportedDiskType := range []disks.DiskStorageAccountTypes{ + disks.DiskStorageAccountTypesPremiumLRS, + disks.DiskStorageAccountTypesPremiumZRS, + disks.DiskStorageAccountTypesStandardSSDLRS, + disks.DiskStorageAccountTypesStandardSSDZRS, + } { + + if strings.EqualFold(string(*disk.Sku.Name), string(supportedDiskType)) { + diskTypeIsSupported = true + } + } + } + return pointer.To(diskTypeIsSupported), nil +} + +func determineIfVirtualMachineSkuSupportsNoDowntimeResize(ctx context.Context, virtualMachineIdRaw *string, virtualMachinesClient *virtualmachines.VirtualMachinesClient, skusClient *skus.SkusClient) (*bool, error) { + if virtualMachineIdRaw == nil { + return pointer.To(false), nil + } + + virtualMachineId, err := virtualmachines.ParseVirtualMachineIDInsensitively(*virtualMachineIdRaw) + if err != nil { + log.Printf("[DEBUG] unable to parse Virtual Machine ID %q that the Managed Disk is attached too - skipping no-downtime-resize since we can't guarantee that's available", *virtualMachineIdRaw) + return pointer.To(false), nil + } + + log.Printf("[DEBUG] Retrieving %s..", *virtualMachineId) + virtualMachine, err := virtualMachinesClient.Get(ctx, *virtualMachineId, virtualmachines.DefaultGetOperationOptions()) + if err != nil { + return nil, fmt.Errorf("retrieving %s: %+v", *virtualMachineId, err) + } + + vmSku := "" + if model := virtualMachine.Model; model != nil && model.Properties != nil && model.Properties.HardwareProfile != nil && model.Properties.HardwareProfile.VmSize != nil { + vmSku = string(*model.Properties.HardwareProfile.VmSize) + } + if vmSku == "" { + return pointer.To(false), nil + } + + subscriptionId := commonids.NewSubscriptionID(virtualMachineId.SubscriptionId) + skusResponse, err := skusClient.ResourceSkusListComplete(ctx, subscriptionId, skus.DefaultResourceSkusListOperationOptions()) + if err != nil { + return nil, fmt.Errorf("retrieving information about the Resource SKUs to check if the Virtual Machine/Disk combination supports no-downtime-resizing: %+v", err) + } + + supportsEphemeralOSDisks := false + supportsHyperVGen2 := false + supportsPremiumIO := false + for _, sku := range skusResponse.Items { + if sku.ResourceType == nil || !strings.EqualFold(*sku.ResourceType, "virtualMachines") { + continue + } + if sku.Capabilities == nil { + continue + } + + for _, capability := range *sku.Capabilities { + if capability.Name == nil || capability.Value == nil { + continue + } + + // this logic is based on: + // if (($capability.Name -eq "EphemeralOSDiskSupported" -and $capability.Value -eq "True") -or ($capability.Name -eq "PremiumIO" -and $capability.Value -eq "True") -or ($capability.Name -eq "HyperVGenerations" -and $capability.Value -match "V2")) + if strings.EqualFold(*capability.Name, "EphemeralOSDiskSupported") && strings.EqualFold(*capability.Value, "True") { + supportsEphemeralOSDisks = true + } + if strings.EqualFold(*capability.Name, "HyperVGenerations") && strings.Contains(strings.ToLower(*capability.Value), "v2") { + supportsHyperVGen2 = true + } + if strings.EqualFold(*capability.Name, "PremiumIO") && strings.EqualFold(*capability.Value, "True") { + supportsPremiumIO = true + } + } + } + result := supportsEphemeralOSDisks || supportsPremiumIO || supportsHyperVGen2 + return pointer.To(result), nil +} diff --git a/internal/services/monitor/client/client.go b/internal/services/monitor/client/client.go index bd3e9545714d..1653ad619ff0 100644 --- a/internal/services/monitor/client/client.go +++ b/internal/services/monitor/client/client.go @@ -30,6 +30,7 @@ type Client struct { // Monitor ActionGroupsClient *newActionGroupClient.ActionGroupsClient + ActivityLogsClient *classic.ActivityLogsClient ActivityLogAlertsClient *insights.ActivityLogAlertsClient AlertRulesClient *classic.AlertRulesClient DataCollectionEndpointsClient *datacollectionendpoints.DataCollectionEndpointsClient @@ -64,6 +65,9 @@ func NewClient(o *common.ClientOptions) *Client { ActionGroupsClient := newActionGroupClient.NewActionGroupsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&ActionGroupsClient.Client, o.ResourceManagerAuthorizer) + activityLogsClient := classic.NewActivityLogsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&activityLogsClient.Client, o.ResourceManagerAuthorizer) + ActivityLogAlertsClient := insights.NewActivityLogAlertsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&ActivityLogAlertsClient.Client, o.ResourceManagerAuthorizer) @@ -109,6 +113,7 @@ func NewClient(o *common.ClientOptions) *Client { ActionRulesClient: &ActionRulesClient, SmartDetectorAlertRulesClient: &SmartDetectorAlertRulesClient, ActionGroupsClient: &ActionGroupsClient, + ActivityLogsClient: &activityLogsClient, ActivityLogAlertsClient: &ActivityLogAlertsClient, AlertRulesClient: &AlertRulesClient, AlertProcessingRulesClient: &AlertProcessingRulesClient, diff --git a/website/docs/guides/features-block.html.markdown b/website/docs/guides/features-block.html.markdown index 8c4a61634612..e32ca7ef0d80 100644 --- a/website/docs/guides/features-block.html.markdown +++ b/website/docs/guides/features-block.html.markdown @@ -55,7 +55,7 @@ provider "azurerm" { } managed_disk { - no_downtime_resize = true + expand_without_downtime = true } resource_group { @@ -173,7 +173,9 @@ The `log_analytics_workspace` block supports the following: The `managed_disk` block supports the following: -* `no_downtime_resize` (Optional) Specifies if no-downtime resizes are enabled for the managed disk resources. Defaults to `true`. +* `expand_without_downtime` - (Optional) Specifies whether Managed Disks which can be Expanded without Downtime (on either [a Linux VM](https://learn.microsoft.com/azure/virtual-machines/linux/expand-disks?tabs=azure-cli%2Cubuntu#expand-without-downtime) [or a Windows VM](https://learn.microsoft.com/azure/virtual-machines/windows/expand-os-disk#expand-without-downtime)) should be expanded without restarting the associated Virtual Machine. Defaults to `true`. + +~> **Note:** Expand Without Downtime requires a specific configuration for the Managed Disk and Virtual Machine - Terraform will use Expand Without Downtime when the Managed Disk and Virtual Machine meet these requirements, and shut the Virtual Machine down as needed if this is inapplicable. More information on when Expand Without Downtime is applicable can be found in the [Linux VM](https://learn.microsoft.com/azure/virtual-machines/linux/expand-disks?tabs=azure-cli%2Cubuntu#expand-without-downtime) [or Windows VM](https://learn.microsoft.com/azure/virtual-machines/windows/expand-os-disk#expand-without-downtime) documentation. --- diff --git a/website/docs/r/managed_disk.html.markdown b/website/docs/r/managed_disk.html.markdown index 67c967123f84..a8e4e2eb344e 100644 --- a/website/docs/r/managed_disk.html.markdown +++ b/website/docs/r/managed_disk.html.markdown @@ -107,7 +107,9 @@ The following arguments are supported: * `disk_size_gb` - (Optional, Required for a new managed disk) Specifies the size of the managed disk to create in gigabytes. If `create_option` is `Copy` or `FromImage`, then the value must be equal to or greater than the source's size. The size can only be increased. -~> **NOTE:** Changing this value is disruptive if the disk is attached to a Virtual Machine. The VM will be shut down and de-allocated as required by Azure to action the change. Terraform will attempt to start the machine again after the update if it was in a `running` state when the apply was started. +-> **NOTE:** In certain conditions the Data Disk size can be updated without shutting down the Virtual Machine, however only a subset of Virtual Machine SKUs/Disk combinations support this. More information can be found [for Linux Virtual Machines](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks?tabs=azure-cli%2Cubuntu#expand-without-downtime) and [Windows Virtual Machines](https://learn.microsoft.com/azure/virtual-machines/windows/expand-os-disk#expand-without-downtime) respectively. + +~> **NOTE:** If No Downtime Resizing is not available, be aware that changing this value is disruptive if the disk is attached to a Virtual Machine. The VM will be shut down and de-allocated as required by Azure to action the change. Terraform will attempt to start the machine again after the update if it was in a `running` state when the apply was started. * `edge_zone` - (Optional) Specifies the Edge Zone within the Azure Region where this Managed Disk should exist. Changing this forces a new Managed Disk to be created. From db79bfc454a8189daec603fa4f1b490e6c125893 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Mon, 7 Nov 2022 15:59:30 +0100 Subject: [PATCH 13/15] go mod tidy/vendor --- .../compute/2021-07-01/skus/README.md | 37 + .../compute/2021-07-01/skus/client.go | 18 + .../compute/2021-07-01/skus/constants.go | 118 ++ .../skus/method_resourceskuslist_autorest.go | 221 +++ .../2021-07-01/skus/model_resourcesku.go | 20 + .../skus/model_resourceskucapabilities.go | 9 + .../skus/model_resourceskucapacity.go | 11 + .../2021-07-01/skus/model_resourceskucosts.go | 10 + .../skus/model_resourceskulocationinfo.go | 12 + .../skus/model_resourceskurestrictioninfo.go | 9 + .../skus/model_resourceskurestrictions.go | 11 + .../skus/model_resourceskuzonedetails.go | 9 + .../compute/2021-07-01/skus/predicates.go | 39 + .../compute/2021-07-01/skus/version.go | 12 + .../2021-11-01/virtualmachines/README.md | 389 ++++ .../2021-11-01/virtualmachines/client.go | 18 + .../2021-11-01/virtualmachines/constants.go | 1671 +++++++++++++++++ .../2021-11-01/virtualmachines/id_location.go | 111 ++ .../virtualmachines/id_virtualmachine.go | 124 ++ .../method_assesspatches_autorest.go | 78 + .../method_capture_autorest.go | 79 + .../method_converttomanageddisks_autorest.go | 78 + .../method_createorupdate_autorest.go | 79 + .../method_deallocate_autorest.go | 107 ++ .../virtualmachines/method_delete_autorest.go | 107 ++ .../method_generalize_autorest.go | 67 + .../virtualmachines/method_get_autorest.go | 97 + .../method_installpatches_autorest.go | 79 + .../method_instanceview_autorest.go | 69 + .../virtualmachines/method_list_autorest.go | 216 +++ .../method_listall_autorest.go | 221 +++ .../method_listavailablesizes_autorest.go | 69 + .../method_listbylocation_autorest.go | 186 ++ .../method_performmaintenance_autorest.go | 78 + .../method_poweroff_autorest.go | 107 ++ .../method_reapply_autorest.go | 78 + .../method_redeploy_autorest.go | 78 + .../method_reimage_autorest.go | 79 + .../method_restart_autorest.go | 78 + ...od_retrievebootdiagnosticsdata_autorest.go | 98 + .../method_runcommand_autorest.go | 79 + .../method_simulateeviction_autorest.go | 67 + .../virtualmachines/method_start_autorest.go | 78 + .../virtualmachines/method_update_autorest.go | 79 + .../model_additionalcapabilities.go | 9 + .../model_additionalunattendcontent.go | 11 + .../virtualmachines/model_apierror.go | 12 + .../virtualmachines/model_apierrorbase.go | 10 + .../model_applicationprofile.go | 8 + .../model_availablepatchsummary.go | 45 + .../virtualmachines/model_billingprofile.go | 8 + .../virtualmachines/model_bootdiagnostics.go | 9 + .../model_bootdiagnosticsinstanceview.go | 10 + .../model_capacityreservationprofile.go | 8 + .../virtualmachines/model_datadisk.go | 21 + .../model_diagnosticsprofile.go | 8 + .../virtualmachines/model_diffdisksettings.go | 9 + .../model_diskencryptionsettings.go | 10 + .../virtualmachines/model_diskinstanceview.go | 10 + .../virtualmachines/model_hardwareprofile.go | 9 + .../virtualmachines/model_imagereference.go | 15 + .../virtualmachines/model_innererror.go | 9 + .../model_instanceviewstatus.go | 30 + .../model_keyvaultkeyreference.go | 9 + .../model_keyvaultsecretreference.go | 9 + .../model_lastpatchinstallationsummary.go | 48 + .../model_linuxconfiguration.go | 11 + .../virtualmachines/model_linuxparameters.go | 11 + .../model_linuxpatchsettings.go | 9 + .../model_maintenanceredeploystatus.go | 68 + .../model_manageddiskparameters.go | 11 + .../model_networkinterfacereference.go | 9 + ...del_networkinterfacereferenceproperties.go | 9 + .../virtualmachines/model_networkprofile.go | 10 + .../virtualmachines/model_osdisk.go | 19 + .../virtualmachines/model_osprofile.go | 16 + .../model_patchinstallationdetail.go | 13 + .../virtualmachines/model_patchsettings.go | 10 + .../2021-11-01/virtualmachines/model_plan.go | 11 + .../model_publicipaddresssku.go | 9 + ...model_retrievebootdiagnosticsdataresult.go | 9 + .../virtualmachines/model_runcommandinput.go | 10 + .../model_runcommandinputparameter.go | 9 + .../virtualmachines/model_runcommandresult.go | 8 + .../model_scheduledeventsprofile.go | 8 + .../virtualmachines/model_securityprofile.go | 10 + .../virtualmachines/model_sshconfiguration.go | 8 + .../virtualmachines/model_sshpublickey.go | 9 + .../virtualmachines/model_storageprofile.go | 10 + .../virtualmachines/model_subresource.go | 8 + .../model_terminatenotificationprofile.go | 9 + .../virtualmachines/model_uefisettings.go | 9 + .../virtualmachines/model_vaultcertificate.go | 9 + .../virtualmachines/model_vaultsecretgroup.go | 9 + .../virtualmachines/model_virtualharddisk.go | 8 + .../virtualmachines/model_virtualmachine.go | 23 + .../model_virtualmachineagentinstanceview.go | 10 + ...model_virtualmachineassesspatchesresult.go | 33 + .../model_virtualmachinecaptureparameters.go | 10 + .../model_virtualmachinecaptureresult.go | 12 + .../model_virtualmachineextension.go | 13 + ...tualmachineextensionhandlerinstanceview.go | 10 + ...del_virtualmachineextensioninstanceview.go | 12 + ...model_virtualmachineextensionproperties.go | 19 + .../model_virtualmachinehealthstatus.go | 8 + ..._virtualmachineinstallpatchesparameters.go | 11 + ...odel_virtualmachineinstallpatchesresult.go | 37 + .../model_virtualmachineinstanceview.go | 23 + .../model_virtualmachineiptag.go | 9 + ...ualmachinenetworkinterfaceconfiguration.go | 9 + ...networkinterfaceconfigurationproperties.go | 16 + ...etworkinterfacednssettingsconfiguration.go | 8 + ...lmachinenetworkinterfaceipconfiguration.go | 9 + ...tworkinterfaceipconfigurationproperties.go | 14 + .../model_virtualmachinepatchstatus.go | 10 + .../model_virtualmachineproperties.go | 51 + ...tualmachinepublicipaddressconfiguration.go | 10 + ...epublicipaddressconfigurationproperties.go | 14 + ...publicipaddressdnssettingsconfiguration.go | 8 + .../model_virtualmachinereimageparameters.go | 8 + .../model_virtualmachinesize.go | 13 + .../model_virtualmachinesizelistresult.go | 8 + ...l_virtualmachinesoftwarepatchproperties.go | 47 + .../model_virtualmachineupdate.go | 16 + .../model_vmdisksecurityprofile.go | 9 + .../model_vmgalleryapplication.go | 11 + .../virtualmachines/model_vmsizeproperties.go | 9 + .../model_windowsconfiguration.go | 13 + .../model_windowsparameters.go | 30 + .../model_winrmconfiguration.go | 8 + .../virtualmachines/model_winrmlistener.go | 9 + .../2021-11-01/virtualmachines/predicates.go | 29 + .../2021-11-01/virtualmachines/version.go | 12 + vendor/modules.txt | 2 + 134 files changed, 6549 insertions(+) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/method_resourceskuslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourcesku.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapabilities.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapacity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucosts.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskulocationinfo.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictioninfo.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskuzonedetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_location.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_virtualmachine.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_assesspatches_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_capture_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_converttomanageddisks_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_createorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_deallocate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_generalize_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_installpatches_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_instanceview_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_list_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listall_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listavailablesizes_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listbylocation_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_performmaintenance_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_poweroff_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reapply_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_redeploy_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reimage_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_restart_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_retrievebootdiagnosticsdata_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_runcommand_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_simulateeviction_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_start_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_update_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalcapabilities.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalunattendcontent.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierror.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierrorbase.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_applicationprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_availablepatchsummary.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_billingprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnostics.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnosticsinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_capacityreservationprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_datadisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diagnosticsprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diffdisksettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskencryptionsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_hardwareprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_imagereference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_innererror.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_instanceviewstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultkeyreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultsecretreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_lastpatchinstallationsummary.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxpatchsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_maintenanceredeploystatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_manageddiskparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereferenceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osdisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchinstallationdetail.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_plan.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_publicipaddresssku.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_retrievebootdiagnosticsdataresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinput.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinputparameter.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_scheduledeventsprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_securityprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshpublickey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_storageprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_subresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_terminatenotificationprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_uefisettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultcertificate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultsecretgroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualharddisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachine.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineagentinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineassesspatchesresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextension.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionhandlerinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensioninstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinehealthstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineiptag.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfigurationproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfacednssettingsconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfigurationproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepatchstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfigurationproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressdnssettingsconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinereimageparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesize.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesizelistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesoftwarepatchproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmdisksecurityprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmgalleryapplication.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmsizeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmlistener.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/version.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/README.md new file mode 100644 index 000000000000..436263548f7f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus` Documentation + +The `skus` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2021-07-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus" +``` + + +### Client Initialization + +```go +client := skus.NewSkusClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SkusClient.ResourceSkusList` + +```go +ctx := context.TODO() +id := skus.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ResourceSkusList(ctx, id, skus.DefaultResourceSkusListOperationOptions())` can be used to do batched pagination +items, err := client.ResourceSkusListComplete(ctx, id, skus.DefaultResourceSkusListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/client.go new file mode 100644 index 000000000000..bb4f84090069 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/client.go @@ -0,0 +1,18 @@ +package skus + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SkusClient struct { + Client autorest.Client + baseUri string +} + +func NewSkusClientWithBaseURI(endpoint string) SkusClient { + return SkusClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/constants.go new file mode 100644 index 000000000000..ddb7a3794196 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/constants.go @@ -0,0 +1,118 @@ +package skus + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocationType string + +const ( + ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone" +) + +func PossibleValuesForExtendedLocationType() []string { + return []string{ + string(ExtendedLocationTypeEdgeZone), + } +} + +func parseExtendedLocationType(input string) (*ExtendedLocationType, error) { + vals := map[string]ExtendedLocationType{ + "edgezone": ExtendedLocationTypeEdgeZone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExtendedLocationType(input) + return &out, nil +} + +type ResourceSkuCapacityScaleType string + +const ( + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +func PossibleValuesForResourceSkuCapacityScaleType() []string { + return []string{ + string(ResourceSkuCapacityScaleTypeAutomatic), + string(ResourceSkuCapacityScaleTypeManual), + string(ResourceSkuCapacityScaleTypeNone), + } +} + +func parseResourceSkuCapacityScaleType(input string) (*ResourceSkuCapacityScaleType, error) { + vals := map[string]ResourceSkuCapacityScaleType{ + "automatic": ResourceSkuCapacityScaleTypeAutomatic, + "manual": ResourceSkuCapacityScaleTypeManual, + "none": ResourceSkuCapacityScaleTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuCapacityScaleType(input) + return &out, nil +} + +type ResourceSkuRestrictionsReasonCode string + +const ( + ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + ResourceSkuRestrictionsReasonCodeQuotaId ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +func PossibleValuesForResourceSkuRestrictionsReasonCode() []string { + return []string{ + string(ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription), + string(ResourceSkuRestrictionsReasonCodeQuotaId), + } +} + +func parseResourceSkuRestrictionsReasonCode(input string) (*ResourceSkuRestrictionsReasonCode, error) { + vals := map[string]ResourceSkuRestrictionsReasonCode{ + "notavailableforsubscription": ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription, + "quotaid": ResourceSkuRestrictionsReasonCodeQuotaId, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuRestrictionsReasonCode(input) + return &out, nil +} + +type ResourceSkuRestrictionsType string + +const ( + ResourceSkuRestrictionsTypeLocation ResourceSkuRestrictionsType = "Location" + ResourceSkuRestrictionsTypeZone ResourceSkuRestrictionsType = "Zone" +) + +func PossibleValuesForResourceSkuRestrictionsType() []string { + return []string{ + string(ResourceSkuRestrictionsTypeLocation), + string(ResourceSkuRestrictionsTypeZone), + } +} + +func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsType, error) { + vals := map[string]ResourceSkuRestrictionsType{ + "location": ResourceSkuRestrictionsTypeLocation, + "zone": ResourceSkuRestrictionsTypeZone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuRestrictionsType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/method_resourceskuslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/method_resourceskuslist_autorest.go new file mode 100644 index 000000000000..fda0396135c1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/method_resourceskuslist_autorest.go @@ -0,0 +1,221 @@ +package skus + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkusListOperationResponse struct { + HttpResponse *http.Response + Model *[]ResourceSku + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ResourceSkusListOperationResponse, error) +} + +type ResourceSkusListCompleteResult struct { + Items []ResourceSku +} + +func (r ResourceSkusListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ResourceSkusListOperationResponse) LoadMore(ctx context.Context) (resp ResourceSkusListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ResourceSkusListOperationOptions struct { + Filter *string + IncludeExtendedLocations *string +} + +func DefaultResourceSkusListOperationOptions() ResourceSkusListOperationOptions { + return ResourceSkusListOperationOptions{} +} + +func (o ResourceSkusListOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ResourceSkusListOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + if o.IncludeExtendedLocations != nil { + out["includeExtendedLocations"] = *o.IncludeExtendedLocations + } + + return out +} + +// ResourceSkusList ... +func (c SkusClient) ResourceSkusList(ctx context.Context, id commonids.SubscriptionId, options ResourceSkusListOperationOptions) (resp ResourceSkusListOperationResponse, err error) { + req, err := c.preparerForResourceSkusList(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "skus.SkusClient", "ResourceSkusList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "skus.SkusClient", "ResourceSkusList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForResourceSkusList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "skus.SkusClient", "ResourceSkusList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForResourceSkusList prepares the ResourceSkusList request. +func (c SkusClient) preparerForResourceSkusList(ctx context.Context, id commonids.SubscriptionId, options ResourceSkusListOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.Compute/skus", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForResourceSkusListWithNextLink prepares the ResourceSkusList request with the given nextLink token. +func (c SkusClient) preparerForResourceSkusListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForResourceSkusList handles the response to the ResourceSkusList request. The method always +// closes the http.Response Body. +func (c SkusClient) responderForResourceSkusList(resp *http.Response) (result ResourceSkusListOperationResponse, err error) { + type page struct { + Values []ResourceSku `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ResourceSkusListOperationResponse, err error) { + req, err := c.preparerForResourceSkusListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "skus.SkusClient", "ResourceSkusList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "skus.SkusClient", "ResourceSkusList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForResourceSkusList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "skus.SkusClient", "ResourceSkusList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ResourceSkusListComplete retrieves all of the results into a single object +func (c SkusClient) ResourceSkusListComplete(ctx context.Context, id commonids.SubscriptionId, options ResourceSkusListOperationOptions) (ResourceSkusListCompleteResult, error) { + return c.ResourceSkusListCompleteMatchingPredicate(ctx, id, options, ResourceSkuOperationPredicate{}) +} + +// ResourceSkusListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c SkusClient) ResourceSkusListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ResourceSkusListOperationOptions, predicate ResourceSkuOperationPredicate) (resp ResourceSkusListCompleteResult, err error) { + items := make([]ResourceSku, 0) + + page, err := c.ResourceSkusList(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ResourceSkusListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourcesku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourcesku.go new file mode 100644 index 000000000000..0d554a9cca04 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourcesku.go @@ -0,0 +1,20 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSku struct { + ApiVersions *[]string `json:"apiVersions,omitempty"` + Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` + Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` + Costs *[]ResourceSkuCosts `json:"costs,omitempty"` + Family *string `json:"family,omitempty"` + Kind *string `json:"kind,omitempty"` + LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` + Locations *[]string `json:"locations,omitempty"` + Name *string `json:"name,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` + Size *string `json:"size,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapabilities.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapabilities.go new file mode 100644 index 000000000000..6dc852fca30b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapabilities.go @@ -0,0 +1,9 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkuCapabilities struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapacity.go new file mode 100644 index 000000000000..8c2c43735cb4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucapacity.go @@ -0,0 +1,11 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkuCapacity struct { + Default *int64 `json:"default,omitempty"` + Maximum *int64 `json:"maximum,omitempty"` + Minimum *int64 `json:"minimum,omitempty"` + ScaleType *ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucosts.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucosts.go new file mode 100644 index 000000000000..25d01fc00d2a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskucosts.go @@ -0,0 +1,10 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkuCosts struct { + ExtendedUnit *string `json:"extendedUnit,omitempty"` + MeterID *string `json:"meterID,omitempty"` + Quantity *int64 `json:"quantity,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskulocationinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskulocationinfo.go new file mode 100644 index 000000000000..ba24458052df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskulocationinfo.go @@ -0,0 +1,12 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkuLocationInfo struct { + ExtendedLocations *[]string `json:"extendedLocations,omitempty"` + Location *string `json:"location,omitempty"` + Type *ExtendedLocationType `json:"type,omitempty"` + ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` + Zones *[]string `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictioninfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictioninfo.go new file mode 100644 index 000000000000..ce75f7838f2f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictioninfo.go @@ -0,0 +1,9 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkuRestrictionInfo struct { + Locations *[]string `json:"locations,omitempty"` + Zones *[]string `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictions.go new file mode 100644 index 000000000000..dab4792223d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskurestrictions.go @@ -0,0 +1,11 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkuRestrictions struct { + ReasonCode *ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` + RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` + Type *ResourceSkuRestrictionsType `json:"type,omitempty"` + Values *[]string `json:"values,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskuzonedetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskuzonedetails.go new file mode 100644 index 000000000000..ceda52745244 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/model_resourceskuzonedetails.go @@ -0,0 +1,9 @@ +package skus + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceSkuZoneDetails struct { + Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` + Name *[]string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/predicates.go new file mode 100644 index 000000000000..e2faf7ea47c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/predicates.go @@ -0,0 +1,39 @@ +package skus + +type ResourceSkuOperationPredicate struct { + Family *string + Kind *string + Name *string + ResourceType *string + Size *string + Tier *string +} + +func (p ResourceSkuOperationPredicate) Matches(input ResourceSku) bool { + + if p.Family != nil && (input.Family == nil && *p.Family != *input.Family) { + return false + } + + if p.Kind != nil && (input.Kind == nil && *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.ResourceType != nil && (input.ResourceType == nil && *p.ResourceType != *input.ResourceType) { + return false + } + + if p.Size != nil && (input.Size == nil && *p.Size != *input.Size) { + return false + } + + if p.Tier != nil && (input.Tier == nil && *p.Tier != *input.Tier) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/version.go new file mode 100644 index 000000000000..d524fc47acc5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus/version.go @@ -0,0 +1,12 @@ +package skus + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/skus/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/README.md new file mode 100644 index 000000000000..db94ec199c40 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/README.md @@ -0,0 +1,389 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines` Documentation + +The `virtualmachines` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2021-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines" +``` + + +### Client Initialization + +```go +client := virtualmachines.NewVirtualMachinesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualMachinesClient.AssessPatches` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.AssessPatchesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Capture` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +payload := virtualmachines.VirtualMachineCaptureParameters{ + // ... +} + + +if err := client.CaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.ConvertToManagedDisks` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.ConvertToManagedDisksThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +payload := virtualmachines.VirtualMachine{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Deallocate` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.DeallocateThenPoll(ctx, id, virtualmachines.DefaultDeallocateOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Delete` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.DeleteThenPoll(ctx, id, virtualmachines.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Generalize` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +read, err := client.Generalize(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualMachinesClient.Get` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +read, err := client.Get(ctx, id, virtualmachines.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualMachinesClient.InstallPatches` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +payload := virtualmachines.VirtualMachineInstallPatchesParameters{ + // ... +} + + +if err := client.InstallPatchesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.InstanceView` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +read, err := client.InstanceView(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualMachinesClient.List` + +```go +ctx := context.TODO() +id := virtualmachines.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.List(ctx, id, virtualmachines.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, virtualmachines.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualMachinesClient.ListAll` + +```go +ctx := context.TODO() +id := virtualmachines.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id, virtualmachines.DefaultListAllOperationOptions())` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id, virtualmachines.DefaultListAllOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualMachinesClient.ListAvailableSizes` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +read, err := client.ListAvailableSizes(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualMachinesClient.ListByLocation` + +```go +ctx := context.TODO() +id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualMachinesClient.PerformMaintenance` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.PerformMaintenanceThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.PowerOff` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.PowerOffThenPoll(ctx, id, virtualmachines.DefaultPowerOffOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Reapply` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.ReapplyThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Redeploy` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.RedeployThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Reimage` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +payload := virtualmachines.VirtualMachineReimageParameters{ + // ... +} + + +if err := client.ReimageThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Restart` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.RestartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.RetrieveBootDiagnosticsData` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +read, err := client.RetrieveBootDiagnosticsData(ctx, id, virtualmachines.DefaultRetrieveBootDiagnosticsDataOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualMachinesClient.RunCommand` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +payload := virtualmachines.RunCommandInput{ + // ... +} + + +if err := client.RunCommandThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.SimulateEviction` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +read, err := client.SimulateEviction(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualMachinesClient.Start` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +if err := client.StartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachinesClient.Update` + +```go +ctx := context.TODO() +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue") + +payload := virtualmachines.VirtualMachineUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/client.go new file mode 100644 index 000000000000..2ddc768cf5d0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/client.go @@ -0,0 +1,18 @@ +package virtualmachines + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachinesClient struct { + Client autorest.Client + baseUri string +} + +func NewVirtualMachinesClientWithBaseURI(endpoint string) VirtualMachinesClient { + return VirtualMachinesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/constants.go new file mode 100644 index 000000000000..f03089b34936 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/constants.go @@ -0,0 +1,1671 @@ +package virtualmachines + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CachingTypes string + +const ( + CachingTypesNone CachingTypes = "None" + CachingTypesReadOnly CachingTypes = "ReadOnly" + CachingTypesReadWrite CachingTypes = "ReadWrite" +) + +func PossibleValuesForCachingTypes() []string { + return []string{ + string(CachingTypesNone), + string(CachingTypesReadOnly), + string(CachingTypesReadWrite), + } +} + +func parseCachingTypes(input string) (*CachingTypes, error) { + vals := map[string]CachingTypes{ + "none": CachingTypesNone, + "readonly": CachingTypesReadOnly, + "readwrite": CachingTypesReadWrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CachingTypes(input) + return &out, nil +} + +type ComponentNames string + +const ( + ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup ComponentNames = "Microsoft-Windows-Shell-Setup" +) + +func PossibleValuesForComponentNames() []string { + return []string{ + string(ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup), + } +} + +func parseComponentNames(input string) (*ComponentNames, error) { + vals := map[string]ComponentNames{ + "microsoft-windows-shell-setup": ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComponentNames(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type DiffDiskOptions string + +const ( + DiffDiskOptionsLocal DiffDiskOptions = "Local" +) + +func PossibleValuesForDiffDiskOptions() []string { + return []string{ + string(DiffDiskOptionsLocal), + } +} + +func parseDiffDiskOptions(input string) (*DiffDiskOptions, error) { + vals := map[string]DiffDiskOptions{ + "local": DiffDiskOptionsLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiffDiskOptions(input) + return &out, nil +} + +type DiffDiskPlacement string + +const ( + DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" + DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" +) + +func PossibleValuesForDiffDiskPlacement() []string { + return []string{ + string(DiffDiskPlacementCacheDisk), + string(DiffDiskPlacementResourceDisk), + } +} + +func parseDiffDiskPlacement(input string) (*DiffDiskPlacement, error) { + vals := map[string]DiffDiskPlacement{ + "cachedisk": DiffDiskPlacementCacheDisk, + "resourcedisk": DiffDiskPlacementResourceDisk, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiffDiskPlacement(input) + return &out, nil +} + +type DiskCreateOptionTypes string + +const ( + DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" + DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" + DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" +) + +func PossibleValuesForDiskCreateOptionTypes() []string { + return []string{ + string(DiskCreateOptionTypesAttach), + string(DiskCreateOptionTypesEmpty), + string(DiskCreateOptionTypesFromImage), + } +} + +func parseDiskCreateOptionTypes(input string) (*DiskCreateOptionTypes, error) { + vals := map[string]DiskCreateOptionTypes{ + "attach": DiskCreateOptionTypesAttach, + "empty": DiskCreateOptionTypesEmpty, + "fromimage": DiskCreateOptionTypesFromImage, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskCreateOptionTypes(input) + return &out, nil +} + +type DiskDeleteOptionTypes string + +const ( + DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" + DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" +) + +func PossibleValuesForDiskDeleteOptionTypes() []string { + return []string{ + string(DiskDeleteOptionTypesDelete), + string(DiskDeleteOptionTypesDetach), + } +} + +func parseDiskDeleteOptionTypes(input string) (*DiskDeleteOptionTypes, error) { + vals := map[string]DiskDeleteOptionTypes{ + "delete": DiskDeleteOptionTypesDelete, + "detach": DiskDeleteOptionTypesDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskDeleteOptionTypes(input) + return &out, nil +} + +type DiskDetachOptionTypes string + +const ( + DiskDetachOptionTypesForceDetach DiskDetachOptionTypes = "ForceDetach" +) + +func PossibleValuesForDiskDetachOptionTypes() []string { + return []string{ + string(DiskDetachOptionTypesForceDetach), + } +} + +func parseDiskDetachOptionTypes(input string) (*DiskDetachOptionTypes, error) { + vals := map[string]DiskDetachOptionTypes{ + "forcedetach": DiskDetachOptionTypesForceDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskDetachOptionTypes(input) + return &out, nil +} + +type HyperVGenerationType string + +const ( + HyperVGenerationTypeVOne HyperVGenerationType = "V1" + HyperVGenerationTypeVTwo HyperVGenerationType = "V2" +) + +func PossibleValuesForHyperVGenerationType() []string { + return []string{ + string(HyperVGenerationTypeVOne), + string(HyperVGenerationTypeVTwo), + } +} + +func parseHyperVGenerationType(input string) (*HyperVGenerationType, error) { + vals := map[string]HyperVGenerationType{ + "v1": HyperVGenerationTypeVOne, + "v2": HyperVGenerationTypeVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HyperVGenerationType(input) + return &out, nil +} + +type IPVersions string + +const ( + IPVersionsIPvFour IPVersions = "IPv4" + IPVersionsIPvSix IPVersions = "IPv6" +) + +func PossibleValuesForIPVersions() []string { + return []string{ + string(IPVersionsIPvFour), + string(IPVersionsIPvSix), + } +} + +func parseIPVersions(input string) (*IPVersions, error) { + vals := map[string]IPVersions{ + "ipv4": IPVersionsIPvFour, + "ipv6": IPVersionsIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersions(input) + return &out, nil +} + +type InstanceViewTypes string + +const ( + InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" + InstanceViewTypesUserData InstanceViewTypes = "userData" +) + +func PossibleValuesForInstanceViewTypes() []string { + return []string{ + string(InstanceViewTypesInstanceView), + string(InstanceViewTypesUserData), + } +} + +func parseInstanceViewTypes(input string) (*InstanceViewTypes, error) { + vals := map[string]InstanceViewTypes{ + "instanceview": InstanceViewTypesInstanceView, + "userdata": InstanceViewTypesUserData, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := InstanceViewTypes(input) + return &out, nil +} + +type LinuxPatchAssessmentMode string + +const ( + LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" + LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" +) + +func PossibleValuesForLinuxPatchAssessmentMode() []string { + return []string{ + string(LinuxPatchAssessmentModeAutomaticByPlatform), + string(LinuxPatchAssessmentModeImageDefault), + } +} + +func parseLinuxPatchAssessmentMode(input string) (*LinuxPatchAssessmentMode, error) { + vals := map[string]LinuxPatchAssessmentMode{ + "automaticbyplatform": LinuxPatchAssessmentModeAutomaticByPlatform, + "imagedefault": LinuxPatchAssessmentModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxPatchAssessmentMode(input) + return &out, nil +} + +type LinuxVMGuestPatchMode string + +const ( + LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" + LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" +) + +func PossibleValuesForLinuxVMGuestPatchMode() []string { + return []string{ + string(LinuxVMGuestPatchModeAutomaticByPlatform), + string(LinuxVMGuestPatchModeImageDefault), + } +} + +func parseLinuxVMGuestPatchMode(input string) (*LinuxVMGuestPatchMode, error) { + vals := map[string]LinuxVMGuestPatchMode{ + "automaticbyplatform": LinuxVMGuestPatchModeAutomaticByPlatform, + "imagedefault": LinuxVMGuestPatchModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxVMGuestPatchMode(input) + return &out, nil +} + +type MaintenanceOperationResultCodeTypes string + +const ( + MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" + MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" + MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" + MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" +) + +func PossibleValuesForMaintenanceOperationResultCodeTypes() []string { + return []string{ + string(MaintenanceOperationResultCodeTypesMaintenanceAborted), + string(MaintenanceOperationResultCodeTypesMaintenanceCompleted), + string(MaintenanceOperationResultCodeTypesNone), + string(MaintenanceOperationResultCodeTypesRetryLater), + } +} + +func parseMaintenanceOperationResultCodeTypes(input string) (*MaintenanceOperationResultCodeTypes, error) { + vals := map[string]MaintenanceOperationResultCodeTypes{ + "maintenanceaborted": MaintenanceOperationResultCodeTypesMaintenanceAborted, + "maintenancecompleted": MaintenanceOperationResultCodeTypesMaintenanceCompleted, + "none": MaintenanceOperationResultCodeTypesNone, + "retrylater": MaintenanceOperationResultCodeTypesRetryLater, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MaintenanceOperationResultCodeTypes(input) + return &out, nil +} + +type NetworkApiVersion string + +const ( + NetworkApiVersionTwoZeroTwoZeroNegativeOneOneNegativeZeroOne NetworkApiVersion = "2020-11-01" +) + +func PossibleValuesForNetworkApiVersion() []string { + return []string{ + string(NetworkApiVersionTwoZeroTwoZeroNegativeOneOneNegativeZeroOne), + } +} + +func parseNetworkApiVersion(input string) (*NetworkApiVersion, error) { + vals := map[string]NetworkApiVersion{ + "2020-11-01": NetworkApiVersionTwoZeroTwoZeroNegativeOneOneNegativeZeroOne, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkApiVersion(input) + return &out, nil +} + +type OperatingSystemTypes string + +const ( + OperatingSystemTypesLinux OperatingSystemTypes = "Linux" + OperatingSystemTypesWindows OperatingSystemTypes = "Windows" +) + +func PossibleValuesForOperatingSystemTypes() []string { + return []string{ + string(OperatingSystemTypesLinux), + string(OperatingSystemTypesWindows), + } +} + +func parseOperatingSystemTypes(input string) (*OperatingSystemTypes, error) { + vals := map[string]OperatingSystemTypes{ + "linux": OperatingSystemTypesLinux, + "windows": OperatingSystemTypesWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperatingSystemTypes(input) + return &out, nil +} + +type PassNames string + +const ( + PassNamesOobeSystem PassNames = "OobeSystem" +) + +func PossibleValuesForPassNames() []string { + return []string{ + string(PassNamesOobeSystem), + } +} + +func parsePassNames(input string) (*PassNames, error) { + vals := map[string]PassNames{ + "oobesystem": PassNamesOobeSystem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PassNames(input) + return &out, nil +} + +type PatchAssessmentState string + +const ( + PatchAssessmentStateAvailable PatchAssessmentState = "Available" + PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" +) + +func PossibleValuesForPatchAssessmentState() []string { + return []string{ + string(PatchAssessmentStateAvailable), + string(PatchAssessmentStateUnknown), + } +} + +func parsePatchAssessmentState(input string) (*PatchAssessmentState, error) { + vals := map[string]PatchAssessmentState{ + "available": PatchAssessmentStateAvailable, + "unknown": PatchAssessmentStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PatchAssessmentState(input) + return &out, nil +} + +type PatchInstallationState string + +const ( + PatchInstallationStateExcluded PatchInstallationState = "Excluded" + PatchInstallationStateFailed PatchInstallationState = "Failed" + PatchInstallationStateInstalled PatchInstallationState = "Installed" + PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" + PatchInstallationStatePending PatchInstallationState = "Pending" + PatchInstallationStateUnknown PatchInstallationState = "Unknown" +) + +func PossibleValuesForPatchInstallationState() []string { + return []string{ + string(PatchInstallationStateExcluded), + string(PatchInstallationStateFailed), + string(PatchInstallationStateInstalled), + string(PatchInstallationStateNotSelected), + string(PatchInstallationStatePending), + string(PatchInstallationStateUnknown), + } +} + +func parsePatchInstallationState(input string) (*PatchInstallationState, error) { + vals := map[string]PatchInstallationState{ + "excluded": PatchInstallationStateExcluded, + "failed": PatchInstallationStateFailed, + "installed": PatchInstallationStateInstalled, + "notselected": PatchInstallationStateNotSelected, + "pending": PatchInstallationStatePending, + "unknown": PatchInstallationStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PatchInstallationState(input) + return &out, nil +} + +type PatchOperationStatus string + +const ( + PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" + PatchOperationStatusFailed PatchOperationStatus = "Failed" + PatchOperationStatusInProgress PatchOperationStatus = "InProgress" + PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" + PatchOperationStatusUnknown PatchOperationStatus = "Unknown" +) + +func PossibleValuesForPatchOperationStatus() []string { + return []string{ + string(PatchOperationStatusCompletedWithWarnings), + string(PatchOperationStatusFailed), + string(PatchOperationStatusInProgress), + string(PatchOperationStatusSucceeded), + string(PatchOperationStatusUnknown), + } +} + +func parsePatchOperationStatus(input string) (*PatchOperationStatus, error) { + vals := map[string]PatchOperationStatus{ + "completedwithwarnings": PatchOperationStatusCompletedWithWarnings, + "failed": PatchOperationStatusFailed, + "inprogress": PatchOperationStatusInProgress, + "succeeded": PatchOperationStatusSucceeded, + "unknown": PatchOperationStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PatchOperationStatus(input) + return &out, nil +} + +type ProtocolTypes string + +const ( + ProtocolTypesHTTP ProtocolTypes = "Http" + ProtocolTypesHTTPS ProtocolTypes = "Https" +) + +func PossibleValuesForProtocolTypes() []string { + return []string{ + string(ProtocolTypesHTTP), + string(ProtocolTypesHTTPS), + } +} + +func parseProtocolTypes(input string) (*ProtocolTypes, error) { + vals := map[string]ProtocolTypes{ + "http": ProtocolTypesHTTP, + "https": ProtocolTypesHTTPS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProtocolTypes(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type PublicIPAllocationMethod string + +const ( + PublicIPAllocationMethodDynamic PublicIPAllocationMethod = "Dynamic" + PublicIPAllocationMethodStatic PublicIPAllocationMethod = "Static" +) + +func PossibleValuesForPublicIPAllocationMethod() []string { + return []string{ + string(PublicIPAllocationMethodDynamic), + string(PublicIPAllocationMethodStatic), + } +} + +func parsePublicIPAllocationMethod(input string) (*PublicIPAllocationMethod, error) { + vals := map[string]PublicIPAllocationMethod{ + "dynamic": PublicIPAllocationMethodDynamic, + "static": PublicIPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAllocationMethod(input) + return &out, nil +} + +type SecurityEncryptionTypes string + +const ( + SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" + SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" +) + +func PossibleValuesForSecurityEncryptionTypes() []string { + return []string{ + string(SecurityEncryptionTypesDiskWithVMGuestState), + string(SecurityEncryptionTypesVMGuestStateOnly), + } +} + +func parseSecurityEncryptionTypes(input string) (*SecurityEncryptionTypes, error) { + vals := map[string]SecurityEncryptionTypes{ + "diskwithvmgueststate": SecurityEncryptionTypesDiskWithVMGuestState, + "vmgueststateonly": SecurityEncryptionTypesVMGuestStateOnly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityEncryptionTypes(input) + return &out, nil +} + +type SecurityTypes string + +const ( + SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" + SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" +) + +func PossibleValuesForSecurityTypes() []string { + return []string{ + string(SecurityTypesConfidentialVM), + string(SecurityTypesTrustedLaunch), + } +} + +func parseSecurityTypes(input string) (*SecurityTypes, error) { + vals := map[string]SecurityTypes{ + "confidentialvm": SecurityTypesConfidentialVM, + "trustedlaunch": SecurityTypesTrustedLaunch, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityTypes(input) + return &out, nil +} + +type SettingNames string + +const ( + SettingNamesAutoLogon SettingNames = "AutoLogon" + SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" +) + +func PossibleValuesForSettingNames() []string { + return []string{ + string(SettingNamesAutoLogon), + string(SettingNamesFirstLogonCommands), + } +} + +func parseSettingNames(input string) (*SettingNames, error) { + vals := map[string]SettingNames{ + "autologon": SettingNamesAutoLogon, + "firstlogoncommands": SettingNamesFirstLogonCommands, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SettingNames(input) + return &out, nil +} + +type StatusLevelTypes string + +const ( + StatusLevelTypesError StatusLevelTypes = "Error" + StatusLevelTypesInfo StatusLevelTypes = "Info" + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +func PossibleValuesForStatusLevelTypes() []string { + return []string{ + string(StatusLevelTypesError), + string(StatusLevelTypesInfo), + string(StatusLevelTypesWarning), + } +} + +func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { + vals := map[string]StatusLevelTypes{ + "error": StatusLevelTypesError, + "info": StatusLevelTypesInfo, + "warning": StatusLevelTypesWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StatusLevelTypes(input) + return &out, nil +} + +type StorageAccountTypes string + +const ( + StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" + StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" + StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" + StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" + StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" + StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" +) + +func PossibleValuesForStorageAccountTypes() []string { + return []string{ + string(StorageAccountTypesPremiumLRS), + string(StorageAccountTypesPremiumZRS), + string(StorageAccountTypesStandardLRS), + string(StorageAccountTypesStandardSSDLRS), + string(StorageAccountTypesStandardSSDZRS), + string(StorageAccountTypesUltraSSDLRS), + } +} + +func parseStorageAccountTypes(input string) (*StorageAccountTypes, error) { + vals := map[string]StorageAccountTypes{ + "premium_lrs": StorageAccountTypesPremiumLRS, + "premium_zrs": StorageAccountTypesPremiumZRS, + "standard_lrs": StorageAccountTypesStandardLRS, + "standardssd_lrs": StorageAccountTypesStandardSSDLRS, + "standardssd_zrs": StorageAccountTypesStandardSSDZRS, + "ultrassd_lrs": StorageAccountTypesUltraSSDLRS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StorageAccountTypes(input) + return &out, nil +} + +type VMGuestPatchClassificationLinux string + +const ( + VMGuestPatchClassificationLinuxCritical VMGuestPatchClassificationLinux = "Critical" + VMGuestPatchClassificationLinuxOther VMGuestPatchClassificationLinux = "Other" + VMGuestPatchClassificationLinuxSecurity VMGuestPatchClassificationLinux = "Security" +) + +func PossibleValuesForVMGuestPatchClassificationLinux() []string { + return []string{ + string(VMGuestPatchClassificationLinuxCritical), + string(VMGuestPatchClassificationLinuxOther), + string(VMGuestPatchClassificationLinuxSecurity), + } +} + +func parseVMGuestPatchClassificationLinux(input string) (*VMGuestPatchClassificationLinux, error) { + vals := map[string]VMGuestPatchClassificationLinux{ + "critical": VMGuestPatchClassificationLinuxCritical, + "other": VMGuestPatchClassificationLinuxOther, + "security": VMGuestPatchClassificationLinuxSecurity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VMGuestPatchClassificationLinux(input) + return &out, nil +} + +type VMGuestPatchClassificationWindows string + +const ( + VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" + VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" + VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" + VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" + VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" + VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" + VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" + VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" +) + +func PossibleValuesForVMGuestPatchClassificationWindows() []string { + return []string{ + string(VMGuestPatchClassificationWindowsCritical), + string(VMGuestPatchClassificationWindowsDefinition), + string(VMGuestPatchClassificationWindowsFeaturePack), + string(VMGuestPatchClassificationWindowsSecurity), + string(VMGuestPatchClassificationWindowsServicePack), + string(VMGuestPatchClassificationWindowsTools), + string(VMGuestPatchClassificationWindowsUpdateRollUp), + string(VMGuestPatchClassificationWindowsUpdates), + } +} + +func parseVMGuestPatchClassificationWindows(input string) (*VMGuestPatchClassificationWindows, error) { + vals := map[string]VMGuestPatchClassificationWindows{ + "critical": VMGuestPatchClassificationWindowsCritical, + "definition": VMGuestPatchClassificationWindowsDefinition, + "featurepack": VMGuestPatchClassificationWindowsFeaturePack, + "security": VMGuestPatchClassificationWindowsSecurity, + "servicepack": VMGuestPatchClassificationWindowsServicePack, + "tools": VMGuestPatchClassificationWindowsTools, + "updaterollup": VMGuestPatchClassificationWindowsUpdateRollUp, + "updates": VMGuestPatchClassificationWindowsUpdates, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VMGuestPatchClassificationWindows(input) + return &out, nil +} + +type VMGuestPatchRebootBehavior string + +const ( + VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" + VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" + VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" + VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" +) + +func PossibleValuesForVMGuestPatchRebootBehavior() []string { + return []string{ + string(VMGuestPatchRebootBehaviorAlwaysRequiresReboot), + string(VMGuestPatchRebootBehaviorCanRequestReboot), + string(VMGuestPatchRebootBehaviorNeverReboots), + string(VMGuestPatchRebootBehaviorUnknown), + } +} + +func parseVMGuestPatchRebootBehavior(input string) (*VMGuestPatchRebootBehavior, error) { + vals := map[string]VMGuestPatchRebootBehavior{ + "alwaysrequiresreboot": VMGuestPatchRebootBehaviorAlwaysRequiresReboot, + "canrequestreboot": VMGuestPatchRebootBehaviorCanRequestReboot, + "neverreboots": VMGuestPatchRebootBehaviorNeverReboots, + "unknown": VMGuestPatchRebootBehaviorUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VMGuestPatchRebootBehavior(input) + return &out, nil +} + +type VMGuestPatchRebootSetting string + +const ( + VMGuestPatchRebootSettingAlways VMGuestPatchRebootSetting = "Always" + VMGuestPatchRebootSettingIfRequired VMGuestPatchRebootSetting = "IfRequired" + VMGuestPatchRebootSettingNever VMGuestPatchRebootSetting = "Never" +) + +func PossibleValuesForVMGuestPatchRebootSetting() []string { + return []string{ + string(VMGuestPatchRebootSettingAlways), + string(VMGuestPatchRebootSettingIfRequired), + string(VMGuestPatchRebootSettingNever), + } +} + +func parseVMGuestPatchRebootSetting(input string) (*VMGuestPatchRebootSetting, error) { + vals := map[string]VMGuestPatchRebootSetting{ + "always": VMGuestPatchRebootSettingAlways, + "ifrequired": VMGuestPatchRebootSettingIfRequired, + "never": VMGuestPatchRebootSettingNever, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VMGuestPatchRebootSetting(input) + return &out, nil +} + +type VMGuestPatchRebootStatus string + +const ( + VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" + VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" + VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" + VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" + VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" + VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" +) + +func PossibleValuesForVMGuestPatchRebootStatus() []string { + return []string{ + string(VMGuestPatchRebootStatusCompleted), + string(VMGuestPatchRebootStatusFailed), + string(VMGuestPatchRebootStatusNotNeeded), + string(VMGuestPatchRebootStatusRequired), + string(VMGuestPatchRebootStatusStarted), + string(VMGuestPatchRebootStatusUnknown), + } +} + +func parseVMGuestPatchRebootStatus(input string) (*VMGuestPatchRebootStatus, error) { + vals := map[string]VMGuestPatchRebootStatus{ + "completed": VMGuestPatchRebootStatusCompleted, + "failed": VMGuestPatchRebootStatusFailed, + "notneeded": VMGuestPatchRebootStatusNotNeeded, + "required": VMGuestPatchRebootStatusRequired, + "started": VMGuestPatchRebootStatusStarted, + "unknown": VMGuestPatchRebootStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VMGuestPatchRebootStatus(input) + return &out, nil +} + +type VirtualMachineEvictionPolicyTypes string + +const ( + VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" + VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" +) + +func PossibleValuesForVirtualMachineEvictionPolicyTypes() []string { + return []string{ + string(VirtualMachineEvictionPolicyTypesDeallocate), + string(VirtualMachineEvictionPolicyTypesDelete), + } +} + +func parseVirtualMachineEvictionPolicyTypes(input string) (*VirtualMachineEvictionPolicyTypes, error) { + vals := map[string]VirtualMachineEvictionPolicyTypes{ + "deallocate": VirtualMachineEvictionPolicyTypesDeallocate, + "delete": VirtualMachineEvictionPolicyTypesDelete, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualMachineEvictionPolicyTypes(input) + return &out, nil +} + +type VirtualMachinePriorityTypes string + +const ( + VirtualMachinePriorityTypesLow VirtualMachinePriorityTypes = "Low" + VirtualMachinePriorityTypesRegular VirtualMachinePriorityTypes = "Regular" + VirtualMachinePriorityTypesSpot VirtualMachinePriorityTypes = "Spot" +) + +func PossibleValuesForVirtualMachinePriorityTypes() []string { + return []string{ + string(VirtualMachinePriorityTypesLow), + string(VirtualMachinePriorityTypesRegular), + string(VirtualMachinePriorityTypesSpot), + } +} + +func parseVirtualMachinePriorityTypes(input string) (*VirtualMachinePriorityTypes, error) { + vals := map[string]VirtualMachinePriorityTypes{ + "low": VirtualMachinePriorityTypesLow, + "regular": VirtualMachinePriorityTypesRegular, + "spot": VirtualMachinePriorityTypesSpot, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualMachinePriorityTypes(input) + return &out, nil +} + +type VirtualMachineSizeTypes string + +const ( + VirtualMachineSizeTypesBasicAFour VirtualMachineSizeTypes = "Basic_A4" + VirtualMachineSizeTypesBasicAOne VirtualMachineSizeTypes = "Basic_A1" + VirtualMachineSizeTypesBasicAThree VirtualMachineSizeTypes = "Basic_A3" + VirtualMachineSizeTypesBasicATwo VirtualMachineSizeTypes = "Basic_A2" + VirtualMachineSizeTypesBasicAZero VirtualMachineSizeTypes = "Basic_A0" + VirtualMachineSizeTypesStandardAEight VirtualMachineSizeTypes = "Standard_A8" + VirtualMachineSizeTypesStandardAEightVTwo VirtualMachineSizeTypes = "Standard_A8_v2" + VirtualMachineSizeTypesStandardAEightmVTwo VirtualMachineSizeTypes = "Standard_A8m_v2" + VirtualMachineSizeTypesStandardAFive VirtualMachineSizeTypes = "Standard_A5" + VirtualMachineSizeTypesStandardAFour VirtualMachineSizeTypes = "Standard_A4" + VirtualMachineSizeTypesStandardAFourVTwo VirtualMachineSizeTypes = "Standard_A4_v2" + VirtualMachineSizeTypesStandardAFourmVTwo VirtualMachineSizeTypes = "Standard_A4m_v2" + VirtualMachineSizeTypesStandardANine VirtualMachineSizeTypes = "Standard_A9" + VirtualMachineSizeTypesStandardAOne VirtualMachineSizeTypes = "Standard_A1" + VirtualMachineSizeTypesStandardAOneOne VirtualMachineSizeTypes = "Standard_A11" + VirtualMachineSizeTypesStandardAOneVTwo VirtualMachineSizeTypes = "Standard_A1_v2" + VirtualMachineSizeTypesStandardAOneZero VirtualMachineSizeTypes = "Standard_A10" + VirtualMachineSizeTypesStandardASeven VirtualMachineSizeTypes = "Standard_A7" + VirtualMachineSizeTypesStandardASix VirtualMachineSizeTypes = "Standard_A6" + VirtualMachineSizeTypesStandardAThree VirtualMachineSizeTypes = "Standard_A3" + VirtualMachineSizeTypesStandardATwo VirtualMachineSizeTypes = "Standard_A2" + VirtualMachineSizeTypesStandardATwoVTwo VirtualMachineSizeTypes = "Standard_A2_v2" + VirtualMachineSizeTypesStandardATwomVTwo VirtualMachineSizeTypes = "Standard_A2m_v2" + VirtualMachineSizeTypesStandardAZero VirtualMachineSizeTypes = "Standard_A0" + VirtualMachineSizeTypesStandardBEightms VirtualMachineSizeTypes = "Standard_B8ms" + VirtualMachineSizeTypesStandardBFourms VirtualMachineSizeTypes = "Standard_B4ms" + VirtualMachineSizeTypesStandardBOnems VirtualMachineSizeTypes = "Standard_B1ms" + VirtualMachineSizeTypesStandardBOnes VirtualMachineSizeTypes = "Standard_B1s" + VirtualMachineSizeTypesStandardBTwoms VirtualMachineSizeTypes = "Standard_B2ms" + VirtualMachineSizeTypesStandardBTwos VirtualMachineSizeTypes = "Standard_B2s" + VirtualMachineSizeTypesStandardDEightVThree VirtualMachineSizeTypes = "Standard_D8_v3" + VirtualMachineSizeTypesStandardDEightsVThree VirtualMachineSizeTypes = "Standard_D8s_v3" + VirtualMachineSizeTypesStandardDFiveVTwo VirtualMachineSizeTypes = "Standard_D5_v2" + VirtualMachineSizeTypesStandardDFour VirtualMachineSizeTypes = "Standard_D4" + VirtualMachineSizeTypesStandardDFourVThree VirtualMachineSizeTypes = "Standard_D4_v3" + VirtualMachineSizeTypesStandardDFourVTwo VirtualMachineSizeTypes = "Standard_D4_v2" + VirtualMachineSizeTypesStandardDFoursVThree VirtualMachineSizeTypes = "Standard_D4s_v3" + VirtualMachineSizeTypesStandardDOne VirtualMachineSizeTypes = "Standard_D1" + VirtualMachineSizeTypesStandardDOneFiveVTwo VirtualMachineSizeTypes = "Standard_D15_v2" + VirtualMachineSizeTypesStandardDOneFour VirtualMachineSizeTypes = "Standard_D14" + VirtualMachineSizeTypesStandardDOneFourVTwo VirtualMachineSizeTypes = "Standard_D14_v2" + VirtualMachineSizeTypesStandardDOneOne VirtualMachineSizeTypes = "Standard_D11" + VirtualMachineSizeTypesStandardDOneOneVTwo VirtualMachineSizeTypes = "Standard_D11_v2" + VirtualMachineSizeTypesStandardDOneSixVThree VirtualMachineSizeTypes = "Standard_D16_v3" + VirtualMachineSizeTypesStandardDOneSixsVThree VirtualMachineSizeTypes = "Standard_D16s_v3" + VirtualMachineSizeTypesStandardDOneThree VirtualMachineSizeTypes = "Standard_D13" + VirtualMachineSizeTypesStandardDOneThreeVTwo VirtualMachineSizeTypes = "Standard_D13_v2" + VirtualMachineSizeTypesStandardDOneTwo VirtualMachineSizeTypes = "Standard_D12" + VirtualMachineSizeTypesStandardDOneTwoVTwo VirtualMachineSizeTypes = "Standard_D12_v2" + VirtualMachineSizeTypesStandardDOneVTwo VirtualMachineSizeTypes = "Standard_D1_v2" + VirtualMachineSizeTypesStandardDSFiveVTwo VirtualMachineSizeTypes = "Standard_DS5_v2" + VirtualMachineSizeTypesStandardDSFour VirtualMachineSizeTypes = "Standard_DS4" + VirtualMachineSizeTypesStandardDSFourVTwo VirtualMachineSizeTypes = "Standard_DS4_v2" + VirtualMachineSizeTypesStandardDSOne VirtualMachineSizeTypes = "Standard_DS1" + VirtualMachineSizeTypesStandardDSOneFiveVTwo VirtualMachineSizeTypes = "Standard_DS15_v2" + VirtualMachineSizeTypesStandardDSOneFour VirtualMachineSizeTypes = "Standard_DS14" + VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo VirtualMachineSizeTypes = "Standard_DS14-8_v2" + VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo VirtualMachineSizeTypes = "Standard_DS14-4_v2" + VirtualMachineSizeTypesStandardDSOneFourVTwo VirtualMachineSizeTypes = "Standard_DS14_v2" + VirtualMachineSizeTypesStandardDSOneOne VirtualMachineSizeTypes = "Standard_DS11" + VirtualMachineSizeTypesStandardDSOneOneVTwo VirtualMachineSizeTypes = "Standard_DS11_v2" + VirtualMachineSizeTypesStandardDSOneThree VirtualMachineSizeTypes = "Standard_DS13" + VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo VirtualMachineSizeTypes = "Standard_DS13-4_v2" + VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo VirtualMachineSizeTypes = "Standard_DS13-2_v2" + VirtualMachineSizeTypesStandardDSOneThreeVTwo VirtualMachineSizeTypes = "Standard_DS13_v2" + VirtualMachineSizeTypesStandardDSOneTwo VirtualMachineSizeTypes = "Standard_DS12" + VirtualMachineSizeTypesStandardDSOneTwoVTwo VirtualMachineSizeTypes = "Standard_DS12_v2" + VirtualMachineSizeTypesStandardDSOneVTwo VirtualMachineSizeTypes = "Standard_DS1_v2" + VirtualMachineSizeTypesStandardDSThree VirtualMachineSizeTypes = "Standard_DS3" + VirtualMachineSizeTypesStandardDSThreeVTwo VirtualMachineSizeTypes = "Standard_DS3_v2" + VirtualMachineSizeTypesStandardDSTwo VirtualMachineSizeTypes = "Standard_DS2" + VirtualMachineSizeTypesStandardDSTwoVTwo VirtualMachineSizeTypes = "Standard_DS2_v2" + VirtualMachineSizeTypesStandardDSixFourVThree VirtualMachineSizeTypes = "Standard_D64_v3" + VirtualMachineSizeTypesStandardDSixFoursVThree VirtualMachineSizeTypes = "Standard_D64s_v3" + VirtualMachineSizeTypesStandardDThree VirtualMachineSizeTypes = "Standard_D3" + VirtualMachineSizeTypesStandardDThreeTwoVThree VirtualMachineSizeTypes = "Standard_D32_v3" + VirtualMachineSizeTypesStandardDThreeTwosVThree VirtualMachineSizeTypes = "Standard_D32s_v3" + VirtualMachineSizeTypesStandardDThreeVTwo VirtualMachineSizeTypes = "Standard_D3_v2" + VirtualMachineSizeTypesStandardDTwo VirtualMachineSizeTypes = "Standard_D2" + VirtualMachineSizeTypesStandardDTwoVThree VirtualMachineSizeTypes = "Standard_D2_v3" + VirtualMachineSizeTypesStandardDTwoVTwo VirtualMachineSizeTypes = "Standard_D2_v2" + VirtualMachineSizeTypesStandardDTwosVThree VirtualMachineSizeTypes = "Standard_D2s_v3" + VirtualMachineSizeTypesStandardEEightVThree VirtualMachineSizeTypes = "Standard_E8_v3" + VirtualMachineSizeTypesStandardEEightsVThree VirtualMachineSizeTypes = "Standard_E8s_v3" + VirtualMachineSizeTypesStandardEFourVThree VirtualMachineSizeTypes = "Standard_E4_v3" + VirtualMachineSizeTypesStandardEFoursVThree VirtualMachineSizeTypes = "Standard_E4s_v3" + VirtualMachineSizeTypesStandardEOneSixVThree VirtualMachineSizeTypes = "Standard_E16_v3" + VirtualMachineSizeTypesStandardEOneSixsVThree VirtualMachineSizeTypes = "Standard_E16s_v3" + VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree VirtualMachineSizeTypes = "Standard_E64-16s_v3" + VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree VirtualMachineSizeTypes = "Standard_E64-32s_v3" + VirtualMachineSizeTypesStandardESixFourVThree VirtualMachineSizeTypes = "Standard_E64_v3" + VirtualMachineSizeTypesStandardESixFoursVThree VirtualMachineSizeTypes = "Standard_E64s_v3" + VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree VirtualMachineSizeTypes = "Standard_E32-8s_v3" + VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree VirtualMachineSizeTypes = "Standard_E32-16_v3" + VirtualMachineSizeTypesStandardEThreeTwoVThree VirtualMachineSizeTypes = "Standard_E32_v3" + VirtualMachineSizeTypesStandardEThreeTwosVThree VirtualMachineSizeTypes = "Standard_E32s_v3" + VirtualMachineSizeTypesStandardETwoVThree VirtualMachineSizeTypes = "Standard_E2_v3" + VirtualMachineSizeTypesStandardETwosVThree VirtualMachineSizeTypes = "Standard_E2s_v3" + VirtualMachineSizeTypesStandardFEight VirtualMachineSizeTypes = "Standard_F8" + VirtualMachineSizeTypesStandardFEights VirtualMachineSizeTypes = "Standard_F8s" + VirtualMachineSizeTypesStandardFEightsVTwo VirtualMachineSizeTypes = "Standard_F8s_v2" + VirtualMachineSizeTypesStandardFFour VirtualMachineSizeTypes = "Standard_F4" + VirtualMachineSizeTypesStandardFFours VirtualMachineSizeTypes = "Standard_F4s" + VirtualMachineSizeTypesStandardFFoursVTwo VirtualMachineSizeTypes = "Standard_F4s_v2" + VirtualMachineSizeTypesStandardFOne VirtualMachineSizeTypes = "Standard_F1" + VirtualMachineSizeTypesStandardFOneSix VirtualMachineSizeTypes = "Standard_F16" + VirtualMachineSizeTypesStandardFOneSixs VirtualMachineSizeTypes = "Standard_F16s" + VirtualMachineSizeTypesStandardFOneSixsVTwo VirtualMachineSizeTypes = "Standard_F16s_v2" + VirtualMachineSizeTypesStandardFOnes VirtualMachineSizeTypes = "Standard_F1s" + VirtualMachineSizeTypesStandardFSevenTwosVTwo VirtualMachineSizeTypes = "Standard_F72s_v2" + VirtualMachineSizeTypesStandardFSixFoursVTwo VirtualMachineSizeTypes = "Standard_F64s_v2" + VirtualMachineSizeTypesStandardFThreeTwosVTwo VirtualMachineSizeTypes = "Standard_F32s_v2" + VirtualMachineSizeTypesStandardFTwo VirtualMachineSizeTypes = "Standard_F2" + VirtualMachineSizeTypesStandardFTwos VirtualMachineSizeTypes = "Standard_F2s" + VirtualMachineSizeTypesStandardFTwosVTwo VirtualMachineSizeTypes = "Standard_F2s_v2" + VirtualMachineSizeTypesStandardGFive VirtualMachineSizeTypes = "Standard_G5" + VirtualMachineSizeTypesStandardGFour VirtualMachineSizeTypes = "Standard_G4" + VirtualMachineSizeTypesStandardGOne VirtualMachineSizeTypes = "Standard_G1" + VirtualMachineSizeTypesStandardGSFive VirtualMachineSizeTypes = "Standard_GS5" + VirtualMachineSizeTypesStandardGSFiveNegativeEight VirtualMachineSizeTypes = "Standard_GS5-8" + VirtualMachineSizeTypesStandardGSFiveNegativeOneSix VirtualMachineSizeTypes = "Standard_GS5-16" + VirtualMachineSizeTypesStandardGSFour VirtualMachineSizeTypes = "Standard_GS4" + VirtualMachineSizeTypesStandardGSFourNegativeEight VirtualMachineSizeTypes = "Standard_GS4-8" + VirtualMachineSizeTypesStandardGSFourNegativeFour VirtualMachineSizeTypes = "Standard_GS4-4" + VirtualMachineSizeTypesStandardGSOne VirtualMachineSizeTypes = "Standard_GS1" + VirtualMachineSizeTypesStandardGSThree VirtualMachineSizeTypes = "Standard_GS3" + VirtualMachineSizeTypesStandardGSTwo VirtualMachineSizeTypes = "Standard_GS2" + VirtualMachineSizeTypesStandardGThree VirtualMachineSizeTypes = "Standard_G3" + VirtualMachineSizeTypesStandardGTwo VirtualMachineSizeTypes = "Standard_G2" + VirtualMachineSizeTypesStandardHEight VirtualMachineSizeTypes = "Standard_H8" + VirtualMachineSizeTypesStandardHEightm VirtualMachineSizeTypes = "Standard_H8m" + VirtualMachineSizeTypesStandardHOneSix VirtualMachineSizeTypes = "Standard_H16" + VirtualMachineSizeTypesStandardHOneSixm VirtualMachineSizeTypes = "Standard_H16m" + VirtualMachineSizeTypesStandardHOneSixmr VirtualMachineSizeTypes = "Standard_H16mr" + VirtualMachineSizeTypesStandardHOneSixr VirtualMachineSizeTypes = "Standard_H16r" + VirtualMachineSizeTypesStandardLEights VirtualMachineSizeTypes = "Standard_L8s" + VirtualMachineSizeTypesStandardLFours VirtualMachineSizeTypes = "Standard_L4s" + VirtualMachineSizeTypesStandardLOneSixs VirtualMachineSizeTypes = "Standard_L16s" + VirtualMachineSizeTypesStandardLThreeTwos VirtualMachineSizeTypes = "Standard_L32s" + VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms VirtualMachineSizeTypes = "Standard_M128-64ms" + VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms VirtualMachineSizeTypes = "Standard_M128-32ms" + VirtualMachineSizeTypesStandardMOneTwoEightms VirtualMachineSizeTypes = "Standard_M128ms" + VirtualMachineSizeTypesStandardMOneTwoEights VirtualMachineSizeTypes = "Standard_M128s" + VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms VirtualMachineSizeTypes = "Standard_M64-16ms" + VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms VirtualMachineSizeTypes = "Standard_M64-32ms" + VirtualMachineSizeTypesStandardMSixFourms VirtualMachineSizeTypes = "Standard_M64ms" + VirtualMachineSizeTypesStandardMSixFours VirtualMachineSizeTypes = "Standard_M64s" + VirtualMachineSizeTypesStandardNCOneTwo VirtualMachineSizeTypes = "Standard_NC12" + VirtualMachineSizeTypesStandardNCOneTwosVThree VirtualMachineSizeTypes = "Standard_NC12s_v3" + VirtualMachineSizeTypesStandardNCOneTwosVTwo VirtualMachineSizeTypes = "Standard_NC12s_v2" + VirtualMachineSizeTypesStandardNCSix VirtualMachineSizeTypes = "Standard_NC6" + VirtualMachineSizeTypesStandardNCSixsVThree VirtualMachineSizeTypes = "Standard_NC6s_v3" + VirtualMachineSizeTypesStandardNCSixsVTwo VirtualMachineSizeTypes = "Standard_NC6s_v2" + VirtualMachineSizeTypesStandardNCTwoFour VirtualMachineSizeTypes = "Standard_NC24" + VirtualMachineSizeTypesStandardNCTwoFourr VirtualMachineSizeTypes = "Standard_NC24r" + VirtualMachineSizeTypesStandardNCTwoFourrsVThree VirtualMachineSizeTypes = "Standard_NC24rs_v3" + VirtualMachineSizeTypesStandardNCTwoFourrsVTwo VirtualMachineSizeTypes = "Standard_NC24rs_v2" + VirtualMachineSizeTypesStandardNCTwoFoursVThree VirtualMachineSizeTypes = "Standard_NC24s_v3" + VirtualMachineSizeTypesStandardNCTwoFoursVTwo VirtualMachineSizeTypes = "Standard_NC24s_v2" + VirtualMachineSizeTypesStandardNDOneTwos VirtualMachineSizeTypes = "Standard_ND12s" + VirtualMachineSizeTypesStandardNDSixs VirtualMachineSizeTypes = "Standard_ND6s" + VirtualMachineSizeTypesStandardNDTwoFourrs VirtualMachineSizeTypes = "Standard_ND24rs" + VirtualMachineSizeTypesStandardNDTwoFours VirtualMachineSizeTypes = "Standard_ND24s" + VirtualMachineSizeTypesStandardNVOneTwo VirtualMachineSizeTypes = "Standard_NV12" + VirtualMachineSizeTypesStandardNVSix VirtualMachineSizeTypes = "Standard_NV6" + VirtualMachineSizeTypesStandardNVTwoFour VirtualMachineSizeTypes = "Standard_NV24" +) + +func PossibleValuesForVirtualMachineSizeTypes() []string { + return []string{ + string(VirtualMachineSizeTypesBasicAFour), + string(VirtualMachineSizeTypesBasicAOne), + string(VirtualMachineSizeTypesBasicAThree), + string(VirtualMachineSizeTypesBasicATwo), + string(VirtualMachineSizeTypesBasicAZero), + string(VirtualMachineSizeTypesStandardAEight), + string(VirtualMachineSizeTypesStandardAEightVTwo), + string(VirtualMachineSizeTypesStandardAEightmVTwo), + string(VirtualMachineSizeTypesStandardAFive), + string(VirtualMachineSizeTypesStandardAFour), + string(VirtualMachineSizeTypesStandardAFourVTwo), + string(VirtualMachineSizeTypesStandardAFourmVTwo), + string(VirtualMachineSizeTypesStandardANine), + string(VirtualMachineSizeTypesStandardAOne), + string(VirtualMachineSizeTypesStandardAOneOne), + string(VirtualMachineSizeTypesStandardAOneVTwo), + string(VirtualMachineSizeTypesStandardAOneZero), + string(VirtualMachineSizeTypesStandardASeven), + string(VirtualMachineSizeTypesStandardASix), + string(VirtualMachineSizeTypesStandardAThree), + string(VirtualMachineSizeTypesStandardATwo), + string(VirtualMachineSizeTypesStandardATwoVTwo), + string(VirtualMachineSizeTypesStandardATwomVTwo), + string(VirtualMachineSizeTypesStandardAZero), + string(VirtualMachineSizeTypesStandardBEightms), + string(VirtualMachineSizeTypesStandardBFourms), + string(VirtualMachineSizeTypesStandardBOnems), + string(VirtualMachineSizeTypesStandardBOnes), + string(VirtualMachineSizeTypesStandardBTwoms), + string(VirtualMachineSizeTypesStandardBTwos), + string(VirtualMachineSizeTypesStandardDEightVThree), + string(VirtualMachineSizeTypesStandardDEightsVThree), + string(VirtualMachineSizeTypesStandardDFiveVTwo), + string(VirtualMachineSizeTypesStandardDFour), + string(VirtualMachineSizeTypesStandardDFourVThree), + string(VirtualMachineSizeTypesStandardDFourVTwo), + string(VirtualMachineSizeTypesStandardDFoursVThree), + string(VirtualMachineSizeTypesStandardDOne), + string(VirtualMachineSizeTypesStandardDOneFiveVTwo), + string(VirtualMachineSizeTypesStandardDOneFour), + string(VirtualMachineSizeTypesStandardDOneFourVTwo), + string(VirtualMachineSizeTypesStandardDOneOne), + string(VirtualMachineSizeTypesStandardDOneOneVTwo), + string(VirtualMachineSizeTypesStandardDOneSixVThree), + string(VirtualMachineSizeTypesStandardDOneSixsVThree), + string(VirtualMachineSizeTypesStandardDOneThree), + string(VirtualMachineSizeTypesStandardDOneThreeVTwo), + string(VirtualMachineSizeTypesStandardDOneTwo), + string(VirtualMachineSizeTypesStandardDOneTwoVTwo), + string(VirtualMachineSizeTypesStandardDOneVTwo), + string(VirtualMachineSizeTypesStandardDSFiveVTwo), + string(VirtualMachineSizeTypesStandardDSFour), + string(VirtualMachineSizeTypesStandardDSFourVTwo), + string(VirtualMachineSizeTypesStandardDSOne), + string(VirtualMachineSizeTypesStandardDSOneFiveVTwo), + string(VirtualMachineSizeTypesStandardDSOneFour), + string(VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo), + string(VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneOne), + string(VirtualMachineSizeTypesStandardDSOneOneVTwo), + string(VirtualMachineSizeTypesStandardDSOneThree), + string(VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo), + string(VirtualMachineSizeTypesStandardDSOneThreeVTwo), + string(VirtualMachineSizeTypesStandardDSOneTwo), + string(VirtualMachineSizeTypesStandardDSOneTwoVTwo), + string(VirtualMachineSizeTypesStandardDSOneVTwo), + string(VirtualMachineSizeTypesStandardDSThree), + string(VirtualMachineSizeTypesStandardDSThreeVTwo), + string(VirtualMachineSizeTypesStandardDSTwo), + string(VirtualMachineSizeTypesStandardDSTwoVTwo), + string(VirtualMachineSizeTypesStandardDSixFourVThree), + string(VirtualMachineSizeTypesStandardDSixFoursVThree), + string(VirtualMachineSizeTypesStandardDThree), + string(VirtualMachineSizeTypesStandardDThreeTwoVThree), + string(VirtualMachineSizeTypesStandardDThreeTwosVThree), + string(VirtualMachineSizeTypesStandardDThreeVTwo), + string(VirtualMachineSizeTypesStandardDTwo), + string(VirtualMachineSizeTypesStandardDTwoVThree), + string(VirtualMachineSizeTypesStandardDTwoVTwo), + string(VirtualMachineSizeTypesStandardDTwosVThree), + string(VirtualMachineSizeTypesStandardEEightVThree), + string(VirtualMachineSizeTypesStandardEEightsVThree), + string(VirtualMachineSizeTypesStandardEFourVThree), + string(VirtualMachineSizeTypesStandardEFoursVThree), + string(VirtualMachineSizeTypesStandardEOneSixVThree), + string(VirtualMachineSizeTypesStandardEOneSixsVThree), + string(VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree), + string(VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree), + string(VirtualMachineSizeTypesStandardESixFourVThree), + string(VirtualMachineSizeTypesStandardESixFoursVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoVThree), + string(VirtualMachineSizeTypesStandardEThreeTwosVThree), + string(VirtualMachineSizeTypesStandardETwoVThree), + string(VirtualMachineSizeTypesStandardETwosVThree), + string(VirtualMachineSizeTypesStandardFEight), + string(VirtualMachineSizeTypesStandardFEights), + string(VirtualMachineSizeTypesStandardFEightsVTwo), + string(VirtualMachineSizeTypesStandardFFour), + string(VirtualMachineSizeTypesStandardFFours), + string(VirtualMachineSizeTypesStandardFFoursVTwo), + string(VirtualMachineSizeTypesStandardFOne), + string(VirtualMachineSizeTypesStandardFOneSix), + string(VirtualMachineSizeTypesStandardFOneSixs), + string(VirtualMachineSizeTypesStandardFOneSixsVTwo), + string(VirtualMachineSizeTypesStandardFOnes), + string(VirtualMachineSizeTypesStandardFSevenTwosVTwo), + string(VirtualMachineSizeTypesStandardFSixFoursVTwo), + string(VirtualMachineSizeTypesStandardFThreeTwosVTwo), + string(VirtualMachineSizeTypesStandardFTwo), + string(VirtualMachineSizeTypesStandardFTwos), + string(VirtualMachineSizeTypesStandardFTwosVTwo), + string(VirtualMachineSizeTypesStandardGFive), + string(VirtualMachineSizeTypesStandardGFour), + string(VirtualMachineSizeTypesStandardGOne), + string(VirtualMachineSizeTypesStandardGSFive), + string(VirtualMachineSizeTypesStandardGSFiveNegativeEight), + string(VirtualMachineSizeTypesStandardGSFiveNegativeOneSix), + string(VirtualMachineSizeTypesStandardGSFour), + string(VirtualMachineSizeTypesStandardGSFourNegativeEight), + string(VirtualMachineSizeTypesStandardGSFourNegativeFour), + string(VirtualMachineSizeTypesStandardGSOne), + string(VirtualMachineSizeTypesStandardGSThree), + string(VirtualMachineSizeTypesStandardGSTwo), + string(VirtualMachineSizeTypesStandardGThree), + string(VirtualMachineSizeTypesStandardGTwo), + string(VirtualMachineSizeTypesStandardHEight), + string(VirtualMachineSizeTypesStandardHEightm), + string(VirtualMachineSizeTypesStandardHOneSix), + string(VirtualMachineSizeTypesStandardHOneSixm), + string(VirtualMachineSizeTypesStandardHOneSixmr), + string(VirtualMachineSizeTypesStandardHOneSixr), + string(VirtualMachineSizeTypesStandardLEights), + string(VirtualMachineSizeTypesStandardLFours), + string(VirtualMachineSizeTypesStandardLOneSixs), + string(VirtualMachineSizeTypesStandardLThreeTwos), + string(VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms), + string(VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms), + string(VirtualMachineSizeTypesStandardMOneTwoEightms), + string(VirtualMachineSizeTypesStandardMOneTwoEights), + string(VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms), + string(VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms), + string(VirtualMachineSizeTypesStandardMSixFourms), + string(VirtualMachineSizeTypesStandardMSixFours), + string(VirtualMachineSizeTypesStandardNCOneTwo), + string(VirtualMachineSizeTypesStandardNCOneTwosVThree), + string(VirtualMachineSizeTypesStandardNCOneTwosVTwo), + string(VirtualMachineSizeTypesStandardNCSix), + string(VirtualMachineSizeTypesStandardNCSixsVThree), + string(VirtualMachineSizeTypesStandardNCSixsVTwo), + string(VirtualMachineSizeTypesStandardNCTwoFour), + string(VirtualMachineSizeTypesStandardNCTwoFourr), + string(VirtualMachineSizeTypesStandardNCTwoFourrsVThree), + string(VirtualMachineSizeTypesStandardNCTwoFourrsVTwo), + string(VirtualMachineSizeTypesStandardNCTwoFoursVThree), + string(VirtualMachineSizeTypesStandardNCTwoFoursVTwo), + string(VirtualMachineSizeTypesStandardNDOneTwos), + string(VirtualMachineSizeTypesStandardNDSixs), + string(VirtualMachineSizeTypesStandardNDTwoFourrs), + string(VirtualMachineSizeTypesStandardNDTwoFours), + string(VirtualMachineSizeTypesStandardNVOneTwo), + string(VirtualMachineSizeTypesStandardNVSix), + string(VirtualMachineSizeTypesStandardNVTwoFour), + } +} + +func parseVirtualMachineSizeTypes(input string) (*VirtualMachineSizeTypes, error) { + vals := map[string]VirtualMachineSizeTypes{ + "basic_a4": VirtualMachineSizeTypesBasicAFour, + "basic_a1": VirtualMachineSizeTypesBasicAOne, + "basic_a3": VirtualMachineSizeTypesBasicAThree, + "basic_a2": VirtualMachineSizeTypesBasicATwo, + "basic_a0": VirtualMachineSizeTypesBasicAZero, + "standard_a8": VirtualMachineSizeTypesStandardAEight, + "standard_a8_v2": VirtualMachineSizeTypesStandardAEightVTwo, + "standard_a8m_v2": VirtualMachineSizeTypesStandardAEightmVTwo, + "standard_a5": VirtualMachineSizeTypesStandardAFive, + "standard_a4": VirtualMachineSizeTypesStandardAFour, + "standard_a4_v2": VirtualMachineSizeTypesStandardAFourVTwo, + "standard_a4m_v2": VirtualMachineSizeTypesStandardAFourmVTwo, + "standard_a9": VirtualMachineSizeTypesStandardANine, + "standard_a1": VirtualMachineSizeTypesStandardAOne, + "standard_a11": VirtualMachineSizeTypesStandardAOneOne, + "standard_a1_v2": VirtualMachineSizeTypesStandardAOneVTwo, + "standard_a10": VirtualMachineSizeTypesStandardAOneZero, + "standard_a7": VirtualMachineSizeTypesStandardASeven, + "standard_a6": VirtualMachineSizeTypesStandardASix, + "standard_a3": VirtualMachineSizeTypesStandardAThree, + "standard_a2": VirtualMachineSizeTypesStandardATwo, + "standard_a2_v2": VirtualMachineSizeTypesStandardATwoVTwo, + "standard_a2m_v2": VirtualMachineSizeTypesStandardATwomVTwo, + "standard_a0": VirtualMachineSizeTypesStandardAZero, + "standard_b8ms": VirtualMachineSizeTypesStandardBEightms, + "standard_b4ms": VirtualMachineSizeTypesStandardBFourms, + "standard_b1ms": VirtualMachineSizeTypesStandardBOnems, + "standard_b1s": VirtualMachineSizeTypesStandardBOnes, + "standard_b2ms": VirtualMachineSizeTypesStandardBTwoms, + "standard_b2s": VirtualMachineSizeTypesStandardBTwos, + "standard_d8_v3": VirtualMachineSizeTypesStandardDEightVThree, + "standard_d8s_v3": VirtualMachineSizeTypesStandardDEightsVThree, + "standard_d5_v2": VirtualMachineSizeTypesStandardDFiveVTwo, + "standard_d4": VirtualMachineSizeTypesStandardDFour, + "standard_d4_v3": VirtualMachineSizeTypesStandardDFourVThree, + "standard_d4_v2": VirtualMachineSizeTypesStandardDFourVTwo, + "standard_d4s_v3": VirtualMachineSizeTypesStandardDFoursVThree, + "standard_d1": VirtualMachineSizeTypesStandardDOne, + "standard_d15_v2": VirtualMachineSizeTypesStandardDOneFiveVTwo, + "standard_d14": VirtualMachineSizeTypesStandardDOneFour, + "standard_d14_v2": VirtualMachineSizeTypesStandardDOneFourVTwo, + "standard_d11": VirtualMachineSizeTypesStandardDOneOne, + "standard_d11_v2": VirtualMachineSizeTypesStandardDOneOneVTwo, + "standard_d16_v3": VirtualMachineSizeTypesStandardDOneSixVThree, + "standard_d16s_v3": VirtualMachineSizeTypesStandardDOneSixsVThree, + "standard_d13": VirtualMachineSizeTypesStandardDOneThree, + "standard_d13_v2": VirtualMachineSizeTypesStandardDOneThreeVTwo, + "standard_d12": VirtualMachineSizeTypesStandardDOneTwo, + "standard_d12_v2": VirtualMachineSizeTypesStandardDOneTwoVTwo, + "standard_d1_v2": VirtualMachineSizeTypesStandardDOneVTwo, + "standard_ds5_v2": VirtualMachineSizeTypesStandardDSFiveVTwo, + "standard_ds4": VirtualMachineSizeTypesStandardDSFour, + "standard_ds4_v2": VirtualMachineSizeTypesStandardDSFourVTwo, + "standard_ds1": VirtualMachineSizeTypesStandardDSOne, + "standard_ds15_v2": VirtualMachineSizeTypesStandardDSOneFiveVTwo, + "standard_ds14": VirtualMachineSizeTypesStandardDSOneFour, + "standard_ds14-8_v2": VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo, + "standard_ds14-4_v2": VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo, + "standard_ds14_v2": VirtualMachineSizeTypesStandardDSOneFourVTwo, + "standard_ds11": VirtualMachineSizeTypesStandardDSOneOne, + "standard_ds11_v2": VirtualMachineSizeTypesStandardDSOneOneVTwo, + "standard_ds13": VirtualMachineSizeTypesStandardDSOneThree, + "standard_ds13-4_v2": VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo, + "standard_ds13-2_v2": VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo, + "standard_ds13_v2": VirtualMachineSizeTypesStandardDSOneThreeVTwo, + "standard_ds12": VirtualMachineSizeTypesStandardDSOneTwo, + "standard_ds12_v2": VirtualMachineSizeTypesStandardDSOneTwoVTwo, + "standard_ds1_v2": VirtualMachineSizeTypesStandardDSOneVTwo, + "standard_ds3": VirtualMachineSizeTypesStandardDSThree, + "standard_ds3_v2": VirtualMachineSizeTypesStandardDSThreeVTwo, + "standard_ds2": VirtualMachineSizeTypesStandardDSTwo, + "standard_ds2_v2": VirtualMachineSizeTypesStandardDSTwoVTwo, + "standard_d64_v3": VirtualMachineSizeTypesStandardDSixFourVThree, + "standard_d64s_v3": VirtualMachineSizeTypesStandardDSixFoursVThree, + "standard_d3": VirtualMachineSizeTypesStandardDThree, + "standard_d32_v3": VirtualMachineSizeTypesStandardDThreeTwoVThree, + "standard_d32s_v3": VirtualMachineSizeTypesStandardDThreeTwosVThree, + "standard_d3_v2": VirtualMachineSizeTypesStandardDThreeVTwo, + "standard_d2": VirtualMachineSizeTypesStandardDTwo, + "standard_d2_v3": VirtualMachineSizeTypesStandardDTwoVThree, + "standard_d2_v2": VirtualMachineSizeTypesStandardDTwoVTwo, + "standard_d2s_v3": VirtualMachineSizeTypesStandardDTwosVThree, + "standard_e8_v3": VirtualMachineSizeTypesStandardEEightVThree, + "standard_e8s_v3": VirtualMachineSizeTypesStandardEEightsVThree, + "standard_e4_v3": VirtualMachineSizeTypesStandardEFourVThree, + "standard_e4s_v3": VirtualMachineSizeTypesStandardEFoursVThree, + "standard_e16_v3": VirtualMachineSizeTypesStandardEOneSixVThree, + "standard_e16s_v3": VirtualMachineSizeTypesStandardEOneSixsVThree, + "standard_e64-16s_v3": VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree, + "standard_e64-32s_v3": VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree, + "standard_e64_v3": VirtualMachineSizeTypesStandardESixFourVThree, + "standard_e64s_v3": VirtualMachineSizeTypesStandardESixFoursVThree, + "standard_e32-8s_v3": VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree, + "standard_e32-16_v3": VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree, + "standard_e32_v3": VirtualMachineSizeTypesStandardEThreeTwoVThree, + "standard_e32s_v3": VirtualMachineSizeTypesStandardEThreeTwosVThree, + "standard_e2_v3": VirtualMachineSizeTypesStandardETwoVThree, + "standard_e2s_v3": VirtualMachineSizeTypesStandardETwosVThree, + "standard_f8": VirtualMachineSizeTypesStandardFEight, + "standard_f8s": VirtualMachineSizeTypesStandardFEights, + "standard_f8s_v2": VirtualMachineSizeTypesStandardFEightsVTwo, + "standard_f4": VirtualMachineSizeTypesStandardFFour, + "standard_f4s": VirtualMachineSizeTypesStandardFFours, + "standard_f4s_v2": VirtualMachineSizeTypesStandardFFoursVTwo, + "standard_f1": VirtualMachineSizeTypesStandardFOne, + "standard_f16": VirtualMachineSizeTypesStandardFOneSix, + "standard_f16s": VirtualMachineSizeTypesStandardFOneSixs, + "standard_f16s_v2": VirtualMachineSizeTypesStandardFOneSixsVTwo, + "standard_f1s": VirtualMachineSizeTypesStandardFOnes, + "standard_f72s_v2": VirtualMachineSizeTypesStandardFSevenTwosVTwo, + "standard_f64s_v2": VirtualMachineSizeTypesStandardFSixFoursVTwo, + "standard_f32s_v2": VirtualMachineSizeTypesStandardFThreeTwosVTwo, + "standard_f2": VirtualMachineSizeTypesStandardFTwo, + "standard_f2s": VirtualMachineSizeTypesStandardFTwos, + "standard_f2s_v2": VirtualMachineSizeTypesStandardFTwosVTwo, + "standard_g5": VirtualMachineSizeTypesStandardGFive, + "standard_g4": VirtualMachineSizeTypesStandardGFour, + "standard_g1": VirtualMachineSizeTypesStandardGOne, + "standard_gs5": VirtualMachineSizeTypesStandardGSFive, + "standard_gs5-8": VirtualMachineSizeTypesStandardGSFiveNegativeEight, + "standard_gs5-16": VirtualMachineSizeTypesStandardGSFiveNegativeOneSix, + "standard_gs4": VirtualMachineSizeTypesStandardGSFour, + "standard_gs4-8": VirtualMachineSizeTypesStandardGSFourNegativeEight, + "standard_gs4-4": VirtualMachineSizeTypesStandardGSFourNegativeFour, + "standard_gs1": VirtualMachineSizeTypesStandardGSOne, + "standard_gs3": VirtualMachineSizeTypesStandardGSThree, + "standard_gs2": VirtualMachineSizeTypesStandardGSTwo, + "standard_g3": VirtualMachineSizeTypesStandardGThree, + "standard_g2": VirtualMachineSizeTypesStandardGTwo, + "standard_h8": VirtualMachineSizeTypesStandardHEight, + "standard_h8m": VirtualMachineSizeTypesStandardHEightm, + "standard_h16": VirtualMachineSizeTypesStandardHOneSix, + "standard_h16m": VirtualMachineSizeTypesStandardHOneSixm, + "standard_h16mr": VirtualMachineSizeTypesStandardHOneSixmr, + "standard_h16r": VirtualMachineSizeTypesStandardHOneSixr, + "standard_l8s": VirtualMachineSizeTypesStandardLEights, + "standard_l4s": VirtualMachineSizeTypesStandardLFours, + "standard_l16s": VirtualMachineSizeTypesStandardLOneSixs, + "standard_l32s": VirtualMachineSizeTypesStandardLThreeTwos, + "standard_m128-64ms": VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms, + "standard_m128-32ms": VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms, + "standard_m128ms": VirtualMachineSizeTypesStandardMOneTwoEightms, + "standard_m128s": VirtualMachineSizeTypesStandardMOneTwoEights, + "standard_m64-16ms": VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms, + "standard_m64-32ms": VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms, + "standard_m64ms": VirtualMachineSizeTypesStandardMSixFourms, + "standard_m64s": VirtualMachineSizeTypesStandardMSixFours, + "standard_nc12": VirtualMachineSizeTypesStandardNCOneTwo, + "standard_nc12s_v3": VirtualMachineSizeTypesStandardNCOneTwosVThree, + "standard_nc12s_v2": VirtualMachineSizeTypesStandardNCOneTwosVTwo, + "standard_nc6": VirtualMachineSizeTypesStandardNCSix, + "standard_nc6s_v3": VirtualMachineSizeTypesStandardNCSixsVThree, + "standard_nc6s_v2": VirtualMachineSizeTypesStandardNCSixsVTwo, + "standard_nc24": VirtualMachineSizeTypesStandardNCTwoFour, + "standard_nc24r": VirtualMachineSizeTypesStandardNCTwoFourr, + "standard_nc24rs_v3": VirtualMachineSizeTypesStandardNCTwoFourrsVThree, + "standard_nc24rs_v2": VirtualMachineSizeTypesStandardNCTwoFourrsVTwo, + "standard_nc24s_v3": VirtualMachineSizeTypesStandardNCTwoFoursVThree, + "standard_nc24s_v2": VirtualMachineSizeTypesStandardNCTwoFoursVTwo, + "standard_nd12s": VirtualMachineSizeTypesStandardNDOneTwos, + "standard_nd6s": VirtualMachineSizeTypesStandardNDSixs, + "standard_nd24rs": VirtualMachineSizeTypesStandardNDTwoFourrs, + "standard_nd24s": VirtualMachineSizeTypesStandardNDTwoFours, + "standard_nv12": VirtualMachineSizeTypesStandardNVOneTwo, + "standard_nv6": VirtualMachineSizeTypesStandardNVSix, + "standard_nv24": VirtualMachineSizeTypesStandardNVTwoFour, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualMachineSizeTypes(input) + return &out, nil +} + +type WindowsPatchAssessmentMode string + +const ( + WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" + WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" +) + +func PossibleValuesForWindowsPatchAssessmentMode() []string { + return []string{ + string(WindowsPatchAssessmentModeAutomaticByPlatform), + string(WindowsPatchAssessmentModeImageDefault), + } +} + +func parseWindowsPatchAssessmentMode(input string) (*WindowsPatchAssessmentMode, error) { + vals := map[string]WindowsPatchAssessmentMode{ + "automaticbyplatform": WindowsPatchAssessmentModeAutomaticByPlatform, + "imagedefault": WindowsPatchAssessmentModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsPatchAssessmentMode(input) + return &out, nil +} + +type WindowsVMGuestPatchMode string + +const ( + WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" + WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" + WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" +) + +func PossibleValuesForWindowsVMGuestPatchMode() []string { + return []string{ + string(WindowsVMGuestPatchModeAutomaticByOS), + string(WindowsVMGuestPatchModeAutomaticByPlatform), + string(WindowsVMGuestPatchModeManual), + } +} + +func parseWindowsVMGuestPatchMode(input string) (*WindowsVMGuestPatchMode, error) { + vals := map[string]WindowsVMGuestPatchMode{ + "automaticbyos": WindowsVMGuestPatchModeAutomaticByOS, + "automaticbyplatform": WindowsVMGuestPatchModeAutomaticByPlatform, + "manual": WindowsVMGuestPatchModeManual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsVMGuestPatchMode(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_location.go new file mode 100644 index 000000000000..ba3de5184716 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_location.go @@ -0,0 +1,111 @@ +package virtualmachines + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + Location string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, location string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + Location: location, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := LocationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.Location, ok = parsed.Parsed["location"]; !ok { + return nil, fmt.Errorf("the segment 'location' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := LocationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.Location, ok = parsed.Parsed["location"]; !ok { + return nil, fmt.Errorf("the segment 'location' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.Compute/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.Location) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("location", "locationValue"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location: %q", id.Location), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_virtualmachine.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_virtualmachine.go new file mode 100644 index 000000000000..307c23e685c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/id_virtualmachine.go @@ -0,0 +1,124 @@ +package virtualmachines + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualMachineId{} + +// VirtualMachineId is a struct representing the Resource ID for a Virtual Machine +type VirtualMachineId struct { + SubscriptionId string + ResourceGroupName string + VirtualMachineName string +} + +// NewVirtualMachineID returns a new VirtualMachineId struct +func NewVirtualMachineID(subscriptionId string, resourceGroupName string, virtualMachineName string) VirtualMachineId { + return VirtualMachineId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VirtualMachineName: virtualMachineName, + } +} + +// ParseVirtualMachineID parses 'input' into a VirtualMachineId +func ParseVirtualMachineID(input string) (*VirtualMachineId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VirtualMachineName, ok = parsed.Parsed["virtualMachineName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualMachineIDInsensitively parses 'input' case-insensitively into a VirtualMachineId +// note: this method should only be used for API response data and not user input +func ParseVirtualMachineIDInsensitively(input string) (*VirtualMachineId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.VirtualMachineName, ok = parsed.Parsed["virtualMachineName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualMachineID checks that 'input' can be parsed as a Virtual Machine ID +func ValidateVirtualMachineID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualMachineID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Machine ID +func (id VirtualMachineId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachines/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine ID +func (id VirtualMachineId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineValue"), + } +} + +// String returns a human-readable description of this Virtual Machine ID +func (id VirtualMachineId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Virtual Machine Name: %q", id.VirtualMachineName), + } + return fmt.Sprintf("Virtual Machine (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_assesspatches_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_assesspatches_autorest.go new file mode 100644 index 000000000000..229af11ace37 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_assesspatches_autorest.go @@ -0,0 +1,78 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AssessPatchesOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AssessPatches ... +func (c VirtualMachinesClient) AssessPatches(ctx context.Context, id VirtualMachineId) (result AssessPatchesOperationResponse, err error) { + req, err := c.preparerForAssessPatches(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "AssessPatches", nil, "Failure preparing request") + return + } + + result, err = c.senderForAssessPatches(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "AssessPatches", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AssessPatchesThenPoll performs AssessPatches then polls until it's completed +func (c VirtualMachinesClient) AssessPatchesThenPoll(ctx context.Context, id VirtualMachineId) error { + result, err := c.AssessPatches(ctx, id) + if err != nil { + return fmt.Errorf("performing AssessPatches: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AssessPatches: %+v", err) + } + + return nil +} + +// preparerForAssessPatches prepares the AssessPatches request. +func (c VirtualMachinesClient) preparerForAssessPatches(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/assessPatches", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAssessPatches sends the AssessPatches request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForAssessPatches(ctx context.Context, req *http.Request) (future AssessPatchesOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_capture_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_capture_autorest.go new file mode 100644 index 000000000000..406820a2998e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_capture_autorest.go @@ -0,0 +1,79 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CaptureOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Capture ... +func (c VirtualMachinesClient) Capture(ctx context.Context, id VirtualMachineId, input VirtualMachineCaptureParameters) (result CaptureOperationResponse, err error) { + req, err := c.preparerForCapture(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Capture", nil, "Failure preparing request") + return + } + + result, err = c.senderForCapture(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Capture", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CaptureThenPoll performs Capture then polls until it's completed +func (c VirtualMachinesClient) CaptureThenPoll(ctx context.Context, id VirtualMachineId, input VirtualMachineCaptureParameters) error { + result, err := c.Capture(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Capture: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Capture: %+v", err) + } + + return nil +} + +// preparerForCapture prepares the Capture request. +func (c VirtualMachinesClient) preparerForCapture(ctx context.Context, id VirtualMachineId, input VirtualMachineCaptureParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/capture", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCapture sends the Capture request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForCapture(ctx context.Context, req *http.Request) (future CaptureOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_converttomanageddisks_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_converttomanageddisks_autorest.go new file mode 100644 index 000000000000..2edacc7d800c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_converttomanageddisks_autorest.go @@ -0,0 +1,78 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConvertToManagedDisksOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ConvertToManagedDisks ... +func (c VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, id VirtualMachineId) (result ConvertToManagedDisksOperationResponse, err error) { + req, err := c.preparerForConvertToManagedDisks(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure preparing request") + return + } + + result, err = c.senderForConvertToManagedDisks(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ConvertToManagedDisks", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ConvertToManagedDisksThenPoll performs ConvertToManagedDisks then polls until it's completed +func (c VirtualMachinesClient) ConvertToManagedDisksThenPoll(ctx context.Context, id VirtualMachineId) error { + result, err := c.ConvertToManagedDisks(ctx, id) + if err != nil { + return fmt.Errorf("performing ConvertToManagedDisks: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ConvertToManagedDisks: %+v", err) + } + + return nil +} + +// preparerForConvertToManagedDisks prepares the ConvertToManagedDisks request. +func (c VirtualMachinesClient) preparerForConvertToManagedDisks(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/convertToManagedDisks", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForConvertToManagedDisks sends the ConvertToManagedDisks request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForConvertToManagedDisks(ctx context.Context, req *http.Request) (future ConvertToManagedDisksOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_createorupdate_autorest.go new file mode 100644 index 000000000000..1440136c5176 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c VirtualMachinesClient) CreateOrUpdate(ctx context.Context, id VirtualMachineId, input VirtualMachine) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VirtualMachinesClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualMachineId, input VirtualMachine) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c VirtualMachinesClient) preparerForCreateOrUpdate(ctx context.Context, id VirtualMachineId, input VirtualMachine) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_deallocate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_deallocate_autorest.go new file mode 100644 index 000000000000..507dd0526170 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_deallocate_autorest.go @@ -0,0 +1,107 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeallocateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +type DeallocateOperationOptions struct { + Hibernate *bool +} + +func DefaultDeallocateOperationOptions() DeallocateOperationOptions { + return DeallocateOperationOptions{} +} + +func (o DeallocateOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DeallocateOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Hibernate != nil { + out["hibernate"] = *o.Hibernate + } + + return out +} + +// Deallocate ... +func (c VirtualMachinesClient) Deallocate(ctx context.Context, id VirtualMachineId, options DeallocateOperationOptions) (result DeallocateOperationResponse, err error) { + req, err := c.preparerForDeallocate(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request") + return + } + + result, err = c.senderForDeallocate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Deallocate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeallocateThenPoll performs Deallocate then polls until it's completed +func (c VirtualMachinesClient) DeallocateThenPoll(ctx context.Context, id VirtualMachineId, options DeallocateOperationOptions) error { + result, err := c.Deallocate(ctx, id, options) + if err != nil { + return fmt.Errorf("performing Deallocate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Deallocate: %+v", err) + } + + return nil +} + +// preparerForDeallocate prepares the Deallocate request. +func (c VirtualMachinesClient) preparerForDeallocate(ctx context.Context, id VirtualMachineId, options DeallocateOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/deallocate", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDeallocate sends the Deallocate request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForDeallocate(ctx context.Context, req *http.Request) (future DeallocateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_delete_autorest.go new file mode 100644 index 000000000000..ba52f09a1567 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_delete_autorest.go @@ -0,0 +1,107 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +type DeleteOperationOptions struct { + ForceDeletion *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DeleteOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.ForceDeletion != nil { + out["forceDeletion"] = *o.ForceDeletion + } + + return out +} + +// Delete ... +func (c VirtualMachinesClient) Delete(ctx context.Context, id VirtualMachineId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c VirtualMachinesClient) DeleteThenPoll(ctx context.Context, id VirtualMachineId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c VirtualMachinesClient) preparerForDelete(ctx context.Context, id VirtualMachineId, options DeleteOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_generalize_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_generalize_autorest.go new file mode 100644 index 000000000000..ae884805a052 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_generalize_autorest.go @@ -0,0 +1,67 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeneralizeOperationResponse struct { + HttpResponse *http.Response +} + +// Generalize ... +func (c VirtualMachinesClient) Generalize(ctx context.Context, id VirtualMachineId) (result GeneralizeOperationResponse, err error) { + req, err := c.preparerForGeneralize(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Generalize", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Generalize", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGeneralize(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Generalize", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGeneralize prepares the Generalize request. +func (c VirtualMachinesClient) preparerForGeneralize(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/generalize", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGeneralize handles the response to the Generalize request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForGeneralize(resp *http.Response) (result GeneralizeOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_get_autorest.go new file mode 100644 index 000000000000..bc725f1c7b68 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_get_autorest.go @@ -0,0 +1,97 @@ +package virtualmachines + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *VirtualMachine +} + +type GetOperationOptions struct { + Expand *InstanceViewTypes +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o GetOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Expand != nil { + out["$expand"] = *o.Expand + } + + return out +} + +// Get ... +func (c VirtualMachinesClient) Get(ctx context.Context, id VirtualMachineId, options GetOperationOptions) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c VirtualMachinesClient) preparerForGet(ctx context.Context, id VirtualMachineId, options GetOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_installpatches_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_installpatches_autorest.go new file mode 100644 index 000000000000..7dedc1399ce8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_installpatches_autorest.go @@ -0,0 +1,79 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstallPatchesOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// InstallPatches ... +func (c VirtualMachinesClient) InstallPatches(ctx context.Context, id VirtualMachineId, input VirtualMachineInstallPatchesParameters) (result InstallPatchesOperationResponse, err error) { + req, err := c.preparerForInstallPatches(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "InstallPatches", nil, "Failure preparing request") + return + } + + result, err = c.senderForInstallPatches(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "InstallPatches", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// InstallPatchesThenPoll performs InstallPatches then polls until it's completed +func (c VirtualMachinesClient) InstallPatchesThenPoll(ctx context.Context, id VirtualMachineId, input VirtualMachineInstallPatchesParameters) error { + result, err := c.InstallPatches(ctx, id, input) + if err != nil { + return fmt.Errorf("performing InstallPatches: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after InstallPatches: %+v", err) + } + + return nil +} + +// preparerForInstallPatches prepares the InstallPatches request. +func (c VirtualMachinesClient) preparerForInstallPatches(ctx context.Context, id VirtualMachineId, input VirtualMachineInstallPatchesParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/installPatches", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForInstallPatches sends the InstallPatches request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForInstallPatches(ctx context.Context, req *http.Request) (future InstallPatchesOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_instanceview_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_instanceview_autorest.go new file mode 100644 index 000000000000..7c81c8e4935b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_instanceview_autorest.go @@ -0,0 +1,69 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewOperationResponse struct { + HttpResponse *http.Response + Model *VirtualMachineInstanceView +} + +// InstanceView ... +func (c VirtualMachinesClient) InstanceView(ctx context.Context, id VirtualMachineId) (result InstanceViewOperationResponse, err error) { + req, err := c.preparerForInstanceView(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "InstanceView", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForInstanceView(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "InstanceView", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForInstanceView prepares the InstanceView request. +func (c VirtualMachinesClient) preparerForInstanceView(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/instanceView", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForInstanceView handles the response to the InstanceView request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForInstanceView(resp *http.Response) (result InstanceViewOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_list_autorest.go new file mode 100644 index 000000000000..f4b0f11b4e1a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_list_autorest.go @@ -0,0 +1,216 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *[]VirtualMachine + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) +} + +type ListCompleteResult struct { + Items []VirtualMachine +} + +func (r ListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ListOperationOptions struct { + Filter *string +} + +func DefaultListOperationOptions() ListOperationOptions { + return ListOperationOptions{} +} + +func (o ListOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + return out +} + +// List ... +func (c VirtualMachinesClient) List(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (resp ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "List", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "List", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "List", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForList prepares the List request. +func (c VirtualMachinesClient) preparerForList(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.Compute/virtualMachines", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListWithNextLink prepares the List request with the given nextLink token. +func (c VirtualMachinesClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + type page struct { + Values []VirtualMachine `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { + req, err := c.preparerForListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListComplete retrieves all of the results into a single object +func (c VirtualMachinesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, options, VirtualMachineOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c VirtualMachinesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions, predicate VirtualMachineOperationPredicate) (resp ListCompleteResult, err error) { + items := make([]VirtualMachine, 0) + + page, err := c.List(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listall_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listall_autorest.go new file mode 100644 index 000000000000..179108f15182 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listall_autorest.go @@ -0,0 +1,221 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListAllOperationResponse struct { + HttpResponse *http.Response + Model *[]VirtualMachine + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListAllOperationResponse, error) +} + +type ListAllCompleteResult struct { + Items []VirtualMachine +} + +func (r ListAllOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListAllOperationResponse) LoadMore(ctx context.Context) (resp ListAllOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ListAllOperationOptions struct { + Filter *string + StatusOnly *string +} + +func DefaultListAllOperationOptions() ListAllOperationOptions { + return ListAllOperationOptions{} +} + +func (o ListAllOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListAllOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Filter != nil { + out["$filter"] = *o.Filter + } + + if o.StatusOnly != nil { + out["statusOnly"] = *o.StatusOnly + } + + return out +} + +// ListAll ... +func (c VirtualMachinesClient) ListAll(ctx context.Context, id commonids.SubscriptionId, options ListAllOperationOptions) (resp ListAllOperationResponse, err error) { + req, err := c.preparerForListAll(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAll", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListAll(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAll", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListAll prepares the ListAll request. +func (c VirtualMachinesClient) preparerForListAll(ctx context.Context, id commonids.SubscriptionId, options ListAllOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.Compute/virtualMachines", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListAllWithNextLink prepares the ListAll request with the given nextLink token. +func (c VirtualMachinesClient) preparerForListAllWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListAll handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForListAll(resp *http.Response) (result ListAllOperationResponse, err error) { + type page struct { + Values []VirtualMachine `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListAllOperationResponse, err error) { + req, err := c.preparerForListAllWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAll", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListAll(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAll", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListAllComplete retrieves all of the results into a single object +func (c VirtualMachinesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId, options ListAllOperationOptions) (ListAllCompleteResult, error) { + return c.ListAllCompleteMatchingPredicate(ctx, id, options, VirtualMachineOperationPredicate{}) +} + +// ListAllCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c VirtualMachinesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListAllOperationOptions, predicate VirtualMachineOperationPredicate) (resp ListAllCompleteResult, err error) { + items := make([]VirtualMachine, 0) + + page, err := c.ListAll(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListAllCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listavailablesizes_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listavailablesizes_autorest.go new file mode 100644 index 000000000000..5001e1c686fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listavailablesizes_autorest.go @@ -0,0 +1,69 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListAvailableSizesOperationResponse struct { + HttpResponse *http.Response + Model *VirtualMachineSizeListResult +} + +// ListAvailableSizes ... +func (c VirtualMachinesClient) ListAvailableSizes(ctx context.Context, id VirtualMachineId) (result ListAvailableSizesOperationResponse, err error) { + req, err := c.preparerForListAvailableSizes(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAvailableSizes", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListAvailableSizes(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListAvailableSizes", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForListAvailableSizes prepares the ListAvailableSizes request. +func (c VirtualMachinesClient) preparerForListAvailableSizes(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/vmSizes", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListAvailableSizes handles the response to the ListAvailableSizes request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForListAvailableSizes(resp *http.Response) (result ListAvailableSizesOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listbylocation_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listbylocation_autorest.go new file mode 100644 index 000000000000..206dcc4e93c3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_listbylocation_autorest.go @@ -0,0 +1,186 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByLocationOperationResponse struct { + HttpResponse *http.Response + Model *[]VirtualMachine + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListByLocationOperationResponse, error) +} + +type ListByLocationCompleteResult struct { + Items []VirtualMachine +} + +func (r ListByLocationOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListByLocationOperationResponse) LoadMore(ctx context.Context) (resp ListByLocationOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// ListByLocation ... +func (c VirtualMachinesClient) ListByLocation(ctx context.Context, id LocationId) (resp ListByLocationOperationResponse, err error) { + req, err := c.preparerForListByLocation(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListByLocation", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListByLocation(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListByLocation", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListByLocation prepares the ListByLocation request. +func (c VirtualMachinesClient) preparerForListByLocation(ctx context.Context, id LocationId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/virtualMachines", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListByLocationWithNextLink prepares the ListByLocation request with the given nextLink token. +func (c VirtualMachinesClient) preparerForListByLocationWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByLocation handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForListByLocation(resp *http.Response) (result ListByLocationOperationResponse, err error) { + type page struct { + Values []VirtualMachine `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByLocationOperationResponse, err error) { + req, err := c.preparerForListByLocationWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListByLocation", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByLocation(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "ListByLocation", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListByLocationComplete retrieves all of the results into a single object +func (c VirtualMachinesClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, VirtualMachineOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c VirtualMachinesClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate VirtualMachineOperationPredicate) (resp ListByLocationCompleteResult, err error) { + items := make([]VirtualMachine, 0) + + page, err := c.ListByLocation(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListByLocationCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_performmaintenance_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_performmaintenance_autorest.go new file mode 100644 index 000000000000..891d514ac408 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_performmaintenance_autorest.go @@ -0,0 +1,78 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PerformMaintenanceOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// PerformMaintenance ... +func (c VirtualMachinesClient) PerformMaintenance(ctx context.Context, id VirtualMachineId) (result PerformMaintenanceOperationResponse, err error) { + req, err := c.preparerForPerformMaintenance(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request") + return + } + + result, err = c.senderForPerformMaintenance(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "PerformMaintenance", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PerformMaintenanceThenPoll performs PerformMaintenance then polls until it's completed +func (c VirtualMachinesClient) PerformMaintenanceThenPoll(ctx context.Context, id VirtualMachineId) error { + result, err := c.PerformMaintenance(ctx, id) + if err != nil { + return fmt.Errorf("performing PerformMaintenance: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PerformMaintenance: %+v", err) + } + + return nil +} + +// preparerForPerformMaintenance prepares the PerformMaintenance request. +func (c VirtualMachinesClient) preparerForPerformMaintenance(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/performMaintenance", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPerformMaintenance sends the PerformMaintenance request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForPerformMaintenance(ctx context.Context, req *http.Request) (future PerformMaintenanceOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_poweroff_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_poweroff_autorest.go new file mode 100644 index 000000000000..f04e15bf56b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_poweroff_autorest.go @@ -0,0 +1,107 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PowerOffOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +type PowerOffOperationOptions struct { + SkipShutdown *bool +} + +func DefaultPowerOffOperationOptions() PowerOffOperationOptions { + return PowerOffOperationOptions{} +} + +func (o PowerOffOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o PowerOffOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.SkipShutdown != nil { + out["skipShutdown"] = *o.SkipShutdown + } + + return out +} + +// PowerOff ... +func (c VirtualMachinesClient) PowerOff(ctx context.Context, id VirtualMachineId, options PowerOffOperationOptions) (result PowerOffOperationResponse, err error) { + req, err := c.preparerForPowerOff(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request") + return + } + + result, err = c.senderForPowerOff(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "PowerOff", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PowerOffThenPoll performs PowerOff then polls until it's completed +func (c VirtualMachinesClient) PowerOffThenPoll(ctx context.Context, id VirtualMachineId, options PowerOffOperationOptions) error { + result, err := c.PowerOff(ctx, id, options) + if err != nil { + return fmt.Errorf("performing PowerOff: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PowerOff: %+v", err) + } + + return nil +} + +// preparerForPowerOff prepares the PowerOff request. +func (c VirtualMachinesClient) preparerForPowerOff(ctx context.Context, id VirtualMachineId, options PowerOffOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/powerOff", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPowerOff sends the PowerOff request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForPowerOff(ctx context.Context, req *http.Request) (future PowerOffOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reapply_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reapply_autorest.go new file mode 100644 index 000000000000..824e5e0158b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reapply_autorest.go @@ -0,0 +1,78 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReapplyOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Reapply ... +func (c VirtualMachinesClient) Reapply(ctx context.Context, id VirtualMachineId) (result ReapplyOperationResponse, err error) { + req, err := c.preparerForReapply(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Reapply", nil, "Failure preparing request") + return + } + + result, err = c.senderForReapply(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Reapply", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ReapplyThenPoll performs Reapply then polls until it's completed +func (c VirtualMachinesClient) ReapplyThenPoll(ctx context.Context, id VirtualMachineId) error { + result, err := c.Reapply(ctx, id) + if err != nil { + return fmt.Errorf("performing Reapply: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Reapply: %+v", err) + } + + return nil +} + +// preparerForReapply prepares the Reapply request. +func (c VirtualMachinesClient) preparerForReapply(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/reapply", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForReapply sends the Reapply request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForReapply(ctx context.Context, req *http.Request) (future ReapplyOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_redeploy_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_redeploy_autorest.go new file mode 100644 index 000000000000..e9b4f65613d2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_redeploy_autorest.go @@ -0,0 +1,78 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RedeployOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Redeploy ... +func (c VirtualMachinesClient) Redeploy(ctx context.Context, id VirtualMachineId) (result RedeployOperationResponse, err error) { + req, err := c.preparerForRedeploy(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") + return + } + + result, err = c.senderForRedeploy(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Redeploy", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// RedeployThenPoll performs Redeploy then polls until it's completed +func (c VirtualMachinesClient) RedeployThenPoll(ctx context.Context, id VirtualMachineId) error { + result, err := c.Redeploy(ctx, id) + if err != nil { + return fmt.Errorf("performing Redeploy: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Redeploy: %+v", err) + } + + return nil +} + +// preparerForRedeploy prepares the Redeploy request. +func (c VirtualMachinesClient) preparerForRedeploy(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/redeploy", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForRedeploy sends the Redeploy request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForRedeploy(ctx context.Context, req *http.Request) (future RedeployOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reimage_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reimage_autorest.go new file mode 100644 index 000000000000..895da13f5d3a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_reimage_autorest.go @@ -0,0 +1,79 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReimageOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Reimage ... +func (c VirtualMachinesClient) Reimage(ctx context.Context, id VirtualMachineId, input VirtualMachineReimageParameters) (result ReimageOperationResponse, err error) { + req, err := c.preparerForReimage(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = c.senderForReimage(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Reimage", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ReimageThenPoll performs Reimage then polls until it's completed +func (c VirtualMachinesClient) ReimageThenPoll(ctx context.Context, id VirtualMachineId, input VirtualMachineReimageParameters) error { + result, err := c.Reimage(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Reimage: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Reimage: %+v", err) + } + + return nil +} + +// preparerForReimage prepares the Reimage request. +func (c VirtualMachinesClient) preparerForReimage(ctx context.Context, id VirtualMachineId, input VirtualMachineReimageParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/reimage", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForReimage sends the Reimage request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForReimage(ctx context.Context, req *http.Request) (future ReimageOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_restart_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_restart_autorest.go new file mode 100644 index 000000000000..7079cdb212f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_restart_autorest.go @@ -0,0 +1,78 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestartOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Restart ... +func (c VirtualMachinesClient) Restart(ctx context.Context, id VirtualMachineId) (result RestartOperationResponse, err error) { + req, err := c.preparerForRestart(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = c.senderForRestart(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Restart", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// RestartThenPoll performs Restart then polls until it's completed +func (c VirtualMachinesClient) RestartThenPoll(ctx context.Context, id VirtualMachineId) error { + result, err := c.Restart(ctx, id) + if err != nil { + return fmt.Errorf("performing Restart: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Restart: %+v", err) + } + + return nil +} + +// preparerForRestart prepares the Restart request. +func (c VirtualMachinesClient) preparerForRestart(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/restart", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForRestart sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForRestart(ctx context.Context, req *http.Request) (future RestartOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_retrievebootdiagnosticsdata_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_retrievebootdiagnosticsdata_autorest.go new file mode 100644 index 000000000000..50c4f0ce019a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_retrievebootdiagnosticsdata_autorest.go @@ -0,0 +1,98 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RetrieveBootDiagnosticsDataOperationResponse struct { + HttpResponse *http.Response + Model *RetrieveBootDiagnosticsDataResult +} + +type RetrieveBootDiagnosticsDataOperationOptions struct { + SasUriExpirationTimeInMinutes *int64 +} + +func DefaultRetrieveBootDiagnosticsDataOperationOptions() RetrieveBootDiagnosticsDataOperationOptions { + return RetrieveBootDiagnosticsDataOperationOptions{} +} + +func (o RetrieveBootDiagnosticsDataOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o RetrieveBootDiagnosticsDataOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.SasUriExpirationTimeInMinutes != nil { + out["sasUriExpirationTimeInMinutes"] = *o.SasUriExpirationTimeInMinutes + } + + return out +} + +// RetrieveBootDiagnosticsData ... +func (c VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, id VirtualMachineId, options RetrieveBootDiagnosticsDataOperationOptions) (result RetrieveBootDiagnosticsDataOperationResponse, err error) { + req, err := c.preparerForRetrieveBootDiagnosticsData(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "RetrieveBootDiagnosticsData", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "RetrieveBootDiagnosticsData", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForRetrieveBootDiagnosticsData(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "RetrieveBootDiagnosticsData", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForRetrieveBootDiagnosticsData prepares the RetrieveBootDiagnosticsData request. +func (c VirtualMachinesClient) preparerForRetrieveBootDiagnosticsData(ctx context.Context, id VirtualMachineId, options RetrieveBootDiagnosticsDataOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/retrieveBootDiagnosticsData", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForRetrieveBootDiagnosticsData handles the response to the RetrieveBootDiagnosticsData request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForRetrieveBootDiagnosticsData(resp *http.Response) (result RetrieveBootDiagnosticsDataOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_runcommand_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_runcommand_autorest.go new file mode 100644 index 000000000000..3978fc82a2ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_runcommand_autorest.go @@ -0,0 +1,79 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunCommandOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// RunCommand ... +func (c VirtualMachinesClient) RunCommand(ctx context.Context, id VirtualMachineId, input RunCommandInput) (result RunCommandOperationResponse, err error) { + req, err := c.preparerForRunCommand(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request") + return + } + + result, err = c.senderForRunCommand(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "RunCommand", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// RunCommandThenPoll performs RunCommand then polls until it's completed +func (c VirtualMachinesClient) RunCommandThenPoll(ctx context.Context, id VirtualMachineId, input RunCommandInput) error { + result, err := c.RunCommand(ctx, id, input) + if err != nil { + return fmt.Errorf("performing RunCommand: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after RunCommand: %+v", err) + } + + return nil +} + +// preparerForRunCommand prepares the RunCommand request. +func (c VirtualMachinesClient) preparerForRunCommand(ctx context.Context, id VirtualMachineId, input RunCommandInput) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/runCommand", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForRunCommand sends the RunCommand request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForRunCommand(ctx context.Context, req *http.Request) (future RunCommandOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_simulateeviction_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_simulateeviction_autorest.go new file mode 100644 index 000000000000..76ed35b0e0f3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_simulateeviction_autorest.go @@ -0,0 +1,67 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SimulateEvictionOperationResponse struct { + HttpResponse *http.Response +} + +// SimulateEviction ... +func (c VirtualMachinesClient) SimulateEviction(ctx context.Context, id VirtualMachineId) (result SimulateEvictionOperationResponse, err error) { + req, err := c.preparerForSimulateEviction(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "SimulateEviction", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "SimulateEviction", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSimulateEviction(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "SimulateEviction", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSimulateEviction prepares the SimulateEviction request. +func (c VirtualMachinesClient) preparerForSimulateEviction(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/simulateEviction", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSimulateEviction handles the response to the SimulateEviction request. The method always +// closes the http.Response Body. +func (c VirtualMachinesClient) responderForSimulateEviction(resp *http.Response) (result SimulateEvictionOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_start_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_start_autorest.go new file mode 100644 index 000000000000..51a690e51fe5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_start_autorest.go @@ -0,0 +1,78 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Start ... +func (c VirtualMachinesClient) Start(ctx context.Context, id VirtualMachineId) (result StartOperationResponse, err error) { + req, err := c.preparerForStart(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = c.senderForStart(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Start", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// StartThenPoll performs Start then polls until it's completed +func (c VirtualMachinesClient) StartThenPoll(ctx context.Context, id VirtualMachineId) error { + result, err := c.Start(ctx, id) + if err != nil { + return fmt.Errorf("performing Start: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Start: %+v", err) + } + + return nil +} + +// preparerForStart prepares the Start request. +func (c VirtualMachinesClient) preparerForStart(ctx context.Context, id VirtualMachineId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/start", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForStart sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForStart(ctx context.Context, req *http.Request) (future StartOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_update_autorest.go new file mode 100644 index 000000000000..4e92c8a9ed5f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/method_update_autorest.go @@ -0,0 +1,79 @@ +package virtualmachines + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c VirtualMachinesClient) Update(ctx context.Context, id VirtualMachineId, input VirtualMachineUpdate) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualmachines.VirtualMachinesClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c VirtualMachinesClient) UpdateThenPoll(ctx context.Context, id VirtualMachineId, input VirtualMachineUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c VirtualMachinesClient) preparerForUpdate(ctx context.Context, id VirtualMachineId, input VirtualMachineUpdate) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualMachinesClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalcapabilities.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalcapabilities.go new file mode 100644 index 000000000000..c1f4ea722693 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalcapabilities.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdditionalCapabilities struct { + HibernationEnabled *bool `json:"hibernationEnabled,omitempty"` + UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalunattendcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalunattendcontent.go new file mode 100644 index 000000000000..8cbd6bbbc9d5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_additionalunattendcontent.go @@ -0,0 +1,11 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdditionalUnattendContent struct { + ComponentName *ComponentNames `json:"componentName,omitempty"` + Content *string `json:"content,omitempty"` + PassName *PassNames `json:"passName,omitempty"` + SettingName *SettingNames `json:"settingName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierror.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierror.go new file mode 100644 index 000000000000..eb45b58287c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierror.go @@ -0,0 +1,12 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApiError struct { + Code *string `json:"code,omitempty"` + Details *[]ApiErrorBase `json:"details,omitempty"` + Innererror *InnerError `json:"innererror,omitempty"` + Message *string `json:"message,omitempty"` + Target *string `json:"target,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierrorbase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierrorbase.go new file mode 100644 index 000000000000..d065d8c08293 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_apierrorbase.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApiErrorBase struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Target *string `json:"target,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_applicationprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_applicationprofile.go new file mode 100644 index 000000000000..f40a5d2be922 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_applicationprofile.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationProfile struct { + GalleryApplications *[]VMGalleryApplication `json:"galleryApplications,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_availablepatchsummary.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_availablepatchsummary.go new file mode 100644 index 000000000000..da7f29507df6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_availablepatchsummary.go @@ -0,0 +1,45 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailablePatchSummary struct { + AssessmentActivityId *string `json:"assessmentActivityId,omitempty"` + CriticalAndSecurityPatchCount *int64 `json:"criticalAndSecurityPatchCount,omitempty"` + Error *ApiError `json:"error,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + OtherPatchCount *int64 `json:"otherPatchCount,omitempty"` + RebootPending *bool `json:"rebootPending,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status *PatchOperationStatus `json:"status,omitempty"` +} + +func (o *AvailablePatchSummary) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *AvailablePatchSummary) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} + +func (o *AvailablePatchSummary) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *AvailablePatchSummary) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_billingprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_billingprofile.go new file mode 100644 index 000000000000..430748093f8d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_billingprofile.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BillingProfile struct { + MaxPrice *float64 `json:"maxPrice,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnostics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnostics.go new file mode 100644 index 000000000000..973026ef552a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnostics.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BootDiagnostics struct { + Enabled *bool `json:"enabled,omitempty"` + StorageUri *string `json:"storageUri,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnosticsinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnosticsinstanceview.go new file mode 100644 index 000000000000..22f9de0401e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_bootdiagnosticsinstanceview.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BootDiagnosticsInstanceView struct { + ConsoleScreenshotBlobUri *string `json:"consoleScreenshotBlobUri,omitempty"` + SerialConsoleLogBlobUri *string `json:"serialConsoleLogBlobUri,omitempty"` + Status *InstanceViewStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_capacityreservationprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_capacityreservationprofile.go new file mode 100644 index 000000000000..24f03ca37372 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_capacityreservationprofile.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityReservationProfile struct { + CapacityReservationGroup *SubResource `json:"capacityReservationGroup,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_datadisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_datadisk.go new file mode 100644 index 000000000000..5805f9815088 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_datadisk.go @@ -0,0 +1,21 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataDisk struct { + Caching *CachingTypes `json:"caching,omitempty"` + CreateOption DiskCreateOptionTypes `json:"createOption"` + DeleteOption *DiskDeleteOptionTypes `json:"deleteOption,omitempty"` + DetachOption *DiskDetachOptionTypes `json:"detachOption,omitempty"` + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + Image *VirtualHardDisk `json:"image,omitempty"` + Lun int64 `json:"lun"` + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + Name *string `json:"name,omitempty"` + ToBeDetached *bool `json:"toBeDetached,omitempty"` + Vhd *VirtualHardDisk `json:"vhd,omitempty"` + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diagnosticsprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diagnosticsprofile.go new file mode 100644 index 000000000000..03ff4c6f82a5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diagnosticsprofile.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnosticsProfile struct { + BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diffdisksettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diffdisksettings.go new file mode 100644 index 000000000000..cf3958588b8d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diffdisksettings.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiffDiskSettings struct { + Option *DiffDiskOptions `json:"option,omitempty"` + Placement *DiffDiskPlacement `json:"placement,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskencryptionsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskencryptionsettings.go new file mode 100644 index 000000000000..f043b50178b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskencryptionsettings.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskEncryptionSettings struct { + DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskinstanceview.go new file mode 100644 index 000000000000..df99a2820069 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_diskinstanceview.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskInstanceView struct { + EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + Name *string `json:"name,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_hardwareprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_hardwareprofile.go new file mode 100644 index 000000000000..cfa03f67a53c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_hardwareprofile.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HardwareProfile struct { + VmSize *VirtualMachineSizeTypes `json:"vmSize,omitempty"` + VmSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_imagereference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_imagereference.go new file mode 100644 index 000000000000..64a1fc045b56 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_imagereference.go @@ -0,0 +1,15 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImageReference struct { + CommunityGalleryImageId *string `json:"communityGalleryImageId,omitempty"` + ExactVersion *string `json:"exactVersion,omitempty"` + Id *string `json:"id,omitempty"` + Offer *string `json:"offer,omitempty"` + Publisher *string `json:"publisher,omitempty"` + SharedGalleryImageId *string `json:"sharedGalleryImageId,omitempty"` + Sku *string `json:"sku,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_innererror.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_innererror.go new file mode 100644 index 000000000000..1b0445d0ac89 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_innererror.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InnerError struct { + Errordetail *string `json:"errordetail,omitempty"` + Exceptiontype *string `json:"exceptiontype,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_instanceviewstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_instanceviewstatus.go new file mode 100644 index 000000000000..9c5cb3e75d80 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_instanceviewstatus.go @@ -0,0 +1,30 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewStatus struct { + Code *string `json:"code,omitempty"` + DisplayStatus *string `json:"displayStatus,omitempty"` + Level *StatusLevelTypes `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *InstanceViewStatus) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultkeyreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultkeyreference.go new file mode 100644 index 000000000000..438a0aef731a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultkeyreference.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultKeyReference struct { + KeyUrl string `json:"keyUrl"` + SourceVault SubResource `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultsecretreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultsecretreference.go new file mode 100644 index 000000000000..c9fcd8ae2b80 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_keyvaultsecretreference.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultSecretReference struct { + SecretUrl string `json:"secretUrl"` + SourceVault SubResource `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_lastpatchinstallationsummary.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_lastpatchinstallationsummary.go new file mode 100644 index 000000000000..987c11896cf9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_lastpatchinstallationsummary.go @@ -0,0 +1,48 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LastPatchInstallationSummary struct { + Error *ApiError `json:"error,omitempty"` + ExcludedPatchCount *int64 `json:"excludedPatchCount,omitempty"` + FailedPatchCount *int64 `json:"failedPatchCount,omitempty"` + InstallationActivityId *string `json:"installationActivityId,omitempty"` + InstalledPatchCount *int64 `json:"installedPatchCount,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` + NotSelectedPatchCount *int64 `json:"notSelectedPatchCount,omitempty"` + PendingPatchCount *int64 `json:"pendingPatchCount,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status *PatchOperationStatus `json:"status,omitempty"` +} + +func (o *LastPatchInstallationSummary) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *LastPatchInstallationSummary) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} + +func (o *LastPatchInstallationSummary) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *LastPatchInstallationSummary) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxconfiguration.go new file mode 100644 index 000000000000..9e52b6000889 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxconfiguration.go @@ -0,0 +1,11 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxConfiguration struct { + DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` + PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + Ssh *SshConfiguration `json:"ssh,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxparameters.go new file mode 100644 index 000000000000..0a4cb464f03b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxparameters.go @@ -0,0 +1,11 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxParameters struct { + ClassificationsToInclude *[]VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` + MaintenanceRunId *string `json:"maintenanceRunId,omitempty"` + PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` + PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxpatchsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxpatchsettings.go new file mode 100644 index 000000000000..322c8595188d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_linuxpatchsettings.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxPatchSettings struct { + AssessmentMode *LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` + PatchMode *LinuxVMGuestPatchMode `json:"patchMode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_maintenanceredeploystatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_maintenanceredeploystatus.go new file mode 100644 index 000000000000..daebcaa340ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_maintenanceredeploystatus.go @@ -0,0 +1,68 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MaintenanceRedeployStatus struct { + IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` + LastOperationMessage *string `json:"lastOperationMessage,omitempty"` + LastOperationResultCode *MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` + MaintenanceWindowEndTime *string `json:"maintenanceWindowEndTime,omitempty"` + MaintenanceWindowStartTime *string `json:"maintenanceWindowStartTime,omitempty"` + PreMaintenanceWindowEndTime *string `json:"preMaintenanceWindowEndTime,omitempty"` + PreMaintenanceWindowStartTime *string `json:"preMaintenanceWindowStartTime,omitempty"` +} + +func (o *MaintenanceRedeployStatus) GetMaintenanceWindowEndTimeAsTime() (*time.Time, error) { + if o.MaintenanceWindowEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.MaintenanceWindowEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MaintenanceRedeployStatus) SetMaintenanceWindowEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.MaintenanceWindowEndTime = &formatted +} + +func (o *MaintenanceRedeployStatus) GetMaintenanceWindowStartTimeAsTime() (*time.Time, error) { + if o.MaintenanceWindowStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.MaintenanceWindowStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MaintenanceRedeployStatus) SetMaintenanceWindowStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.MaintenanceWindowStartTime = &formatted +} + +func (o *MaintenanceRedeployStatus) GetPreMaintenanceWindowEndTimeAsTime() (*time.Time, error) { + if o.PreMaintenanceWindowEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.PreMaintenanceWindowEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MaintenanceRedeployStatus) SetPreMaintenanceWindowEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.PreMaintenanceWindowEndTime = &formatted +} + +func (o *MaintenanceRedeployStatus) GetPreMaintenanceWindowStartTimeAsTime() (*time.Time, error) { + if o.PreMaintenanceWindowStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.PreMaintenanceWindowStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MaintenanceRedeployStatus) SetPreMaintenanceWindowStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.PreMaintenanceWindowStartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_manageddiskparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_manageddiskparameters.go new file mode 100644 index 000000000000..e405c361b60f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_manageddiskparameters.go @@ -0,0 +1,11 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedDiskParameters struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + Id *string `json:"id,omitempty"` + SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` + StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereference.go new file mode 100644 index 000000000000..a2111db0c570 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereference.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceReference struct { + Id *string `json:"id,omitempty"` + Properties *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereferenceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereferenceproperties.go new file mode 100644 index 000000000000..67a2785687f4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkinterfacereferenceproperties.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceReferenceProperties struct { + DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` + Primary *bool `json:"primary,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkprofile.go new file mode 100644 index 000000000000..0a5744ae56d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_networkprofile.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfile struct { + NetworkApiVersion *NetworkApiVersion `json:"networkApiVersion,omitempty"` + NetworkInterfaceConfigurations *[]VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` + NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osdisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osdisk.go new file mode 100644 index 000000000000..dc4a229b6223 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osdisk.go @@ -0,0 +1,19 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OSDisk struct { + Caching *CachingTypes `json:"caching,omitempty"` + CreateOption DiskCreateOptionTypes `json:"createOption"` + DeleteOption *DiskDeleteOptionTypes `json:"deleteOption,omitempty"` + DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + Image *VirtualHardDisk `json:"image,omitempty"` + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + Name *string `json:"name,omitempty"` + OsType *OperatingSystemTypes `json:"osType,omitempty"` + Vhd *VirtualHardDisk `json:"vhd,omitempty"` + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osprofile.go new file mode 100644 index 000000000000..513bcc594725 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_osprofile.go @@ -0,0 +1,16 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OSProfile struct { + AdminPassword *string `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + CustomData *string `json:"customData,omitempty"` + LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` + RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` + Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchinstallationdetail.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchinstallationdetail.go new file mode 100644 index 000000000000..b17aa46e9f1c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchinstallationdetail.go @@ -0,0 +1,13 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PatchInstallationDetail struct { + Classifications *[]string `json:"classifications,omitempty"` + InstallationState *PatchInstallationState `json:"installationState,omitempty"` + KbId *string `json:"kbId,omitempty"` + Name *string `json:"name,omitempty"` + PatchId *string `json:"patchId,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchsettings.go new file mode 100644 index 000000000000..7fe20c4042bb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_patchsettings.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PatchSettings struct { + AssessmentMode *WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` + EnableHotpatching *bool `json:"enableHotpatching,omitempty"` + PatchMode *WindowsVMGuestPatchMode `json:"patchMode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_plan.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_plan.go new file mode 100644 index 000000000000..d99f0a00ba49 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_plan.go @@ -0,0 +1,11 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Plan struct { + Name *string `json:"name,omitempty"` + Product *string `json:"product,omitempty"` + PromotionCode *string `json:"promotionCode,omitempty"` + Publisher *string `json:"publisher,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_publicipaddresssku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_publicipaddresssku.go new file mode 100644 index 000000000000..4783908fdd22 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_publicipaddresssku.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressSku struct { + Name *PublicIPAddressSkuName `json:"name,omitempty"` + Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_retrievebootdiagnosticsdataresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_retrievebootdiagnosticsdataresult.go new file mode 100644 index 000000000000..936c3eb1c646 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_retrievebootdiagnosticsdataresult.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RetrieveBootDiagnosticsDataResult struct { + ConsoleScreenshotBlobUri *string `json:"consoleScreenshotBlobUri,omitempty"` + SerialConsoleLogBlobUri *string `json:"serialConsoleLogBlobUri,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinput.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinput.go new file mode 100644 index 000000000000..de283a9604a0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinput.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunCommandInput struct { + CommandId string `json:"commandId"` + Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` + Script *[]string `json:"script,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinputparameter.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinputparameter.go new file mode 100644 index 000000000000..647469c97b3e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandinputparameter.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunCommandInputParameter struct { + Name string `json:"name"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandresult.go new file mode 100644 index 000000000000..deeeb12253f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_runcommandresult.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunCommandResult struct { + Value *[]InstanceViewStatus `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_scheduledeventsprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_scheduledeventsprofile.go new file mode 100644 index 000000000000..c232e419affd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_scheduledeventsprofile.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScheduledEventsProfile struct { + TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_securityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_securityprofile.go new file mode 100644 index 000000000000..8db3491781e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_securityprofile.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityProfile struct { + EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` + SecurityType *SecurityTypes `json:"securityType,omitempty"` + UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshconfiguration.go new file mode 100644 index 000000000000..415a68d11315 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshconfiguration.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshConfiguration struct { + PublicKeys *[]SshPublicKey `json:"publicKeys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshpublickey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshpublickey.go new file mode 100644 index 000000000000..7b37d0ed9982 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_sshpublickey.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshPublicKey struct { + KeyData *string `json:"keyData,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_storageprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_storageprofile.go new file mode 100644 index 000000000000..6ab74854ee4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_storageprofile.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfile struct { + DataDisks *[]DataDisk `json:"dataDisks,omitempty"` + ImageReference *ImageReference `json:"imageReference,omitempty"` + OsDisk *OSDisk `json:"osDisk,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_subresource.go new file mode 100644 index 000000000000..d63b96f27e30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_subresource.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_terminatenotificationprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_terminatenotificationprofile.go new file mode 100644 index 000000000000..ff62463069c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_terminatenotificationprofile.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TerminateNotificationProfile struct { + Enable *bool `json:"enable,omitempty"` + NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_uefisettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_uefisettings.go new file mode 100644 index 000000000000..dad471d9f352 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_uefisettings.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UefiSettings struct { + SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` + VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultcertificate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultcertificate.go new file mode 100644 index 000000000000..5331305fb8f5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultcertificate.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VaultCertificate struct { + CertificateStore *string `json:"certificateStore,omitempty"` + CertificateUrl *string `json:"certificateUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultsecretgroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultsecretgroup.go new file mode 100644 index 000000000000..f7c88cb420c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vaultsecretgroup.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VaultSecretGroup struct { + SourceVault *SubResource `json:"sourceVault,omitempty"` + VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualharddisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualharddisk.go new file mode 100644 index 000000000000..c8d3cd52669b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualharddisk.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualHardDisk struct { + Uri *string `json:"uri,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachine.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachine.go new file mode 100644 index 000000000000..75cfd5d75aa7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachine.go @@ -0,0 +1,23 @@ +package virtualmachines + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachine struct { + ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Properties *VirtualMachineProperties `json:"properties,omitempty"` + Resources *[]VirtualMachineExtension `json:"resources,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *[]string `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineagentinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineagentinstanceview.go new file mode 100644 index 000000000000..e4e47f357c5a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineagentinstanceview.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineAgentInstanceView struct { + ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + VmAgentVersion *string `json:"vmAgentVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineassesspatchesresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineassesspatchesresult.go new file mode 100644 index 000000000000..aac8e0a30db3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineassesspatchesresult.go @@ -0,0 +1,33 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineAssessPatchesResult struct { + AssessmentActivityId *string `json:"assessmentActivityId,omitempty"` + AvailablePatches *[]VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty"` + CriticalAndSecurityPatchCount *int64 `json:"criticalAndSecurityPatchCount,omitempty"` + Error *ApiError `json:"error,omitempty"` + OtherPatchCount *int64 `json:"otherPatchCount,omitempty"` + RebootPending *bool `json:"rebootPending,omitempty"` + StartDateTime *string `json:"startDateTime,omitempty"` + Status *PatchOperationStatus `json:"status,omitempty"` +} + +func (o *VirtualMachineAssessPatchesResult) GetStartDateTimeAsTime() (*time.Time, error) { + if o.StartDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualMachineAssessPatchesResult) SetStartDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartDateTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureparameters.go new file mode 100644 index 000000000000..078286c327c1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureparameters.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineCaptureParameters struct { + DestinationContainerName string `json:"destinationContainerName"` + OverwriteVhds bool `json:"overwriteVhds"` + VhdPrefix string `json:"vhdPrefix"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureresult.go new file mode 100644 index 000000000000..daaf5617a33f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinecaptureresult.go @@ -0,0 +1,12 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineCaptureResult struct { + ContentVersion *string `json:"contentVersion,omitempty"` + Id *string `json:"id,omitempty"` + Parameters *interface{} `json:"parameters,omitempty"` + Resources *[]interface{} `json:"resources,omitempty"` + Schema *string `json:"$schema,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextension.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextension.go new file mode 100644 index 000000000000..53e2eac67e0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextension.go @@ -0,0 +1,13 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineExtension struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *VirtualMachineExtensionProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionhandlerinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionhandlerinstanceview.go new file mode 100644 index 000000000000..6895f8092d0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionhandlerinstanceview.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineExtensionHandlerInstanceView struct { + Status *InstanceViewStatus `json:"status,omitempty"` + Type *string `json:"type,omitempty"` + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensioninstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensioninstanceview.go new file mode 100644 index 000000000000..1f474e8bed28 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensioninstanceview.go @@ -0,0 +1,12 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineExtensionInstanceView struct { + Name *string `json:"name,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` + Type *string `json:"type,omitempty"` + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionproperties.go new file mode 100644 index 000000000000..0f489d6c99fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineextensionproperties.go @@ -0,0 +1,19 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineExtensionProperties struct { + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` + ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettingsFromKeyVault *interface{} `json:"protectedSettingsFromKeyVault,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Publisher *string `json:"publisher,omitempty"` + Settings *interface{} `json:"settings,omitempty"` + SuppressFailures *bool `json:"suppressFailures,omitempty"` + Type *string `json:"type,omitempty"` + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinehealthstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinehealthstatus.go new file mode 100644 index 000000000000..021c0337a8b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinehealthstatus.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineHealthStatus struct { + Status *InstanceViewStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesparameters.go new file mode 100644 index 000000000000..b1810258e64d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesparameters.go @@ -0,0 +1,11 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstallPatchesParameters struct { + LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` + MaximumDuration *string `json:"maximumDuration,omitempty"` + RebootSetting VMGuestPatchRebootSetting `json:"rebootSetting"` + WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesresult.go new file mode 100644 index 000000000000..52e875ae035a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstallpatchesresult.go @@ -0,0 +1,37 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstallPatchesResult struct { + Error *ApiError `json:"error,omitempty"` + ExcludedPatchCount *int64 `json:"excludedPatchCount,omitempty"` + FailedPatchCount *int64 `json:"failedPatchCount,omitempty"` + InstallationActivityId *string `json:"installationActivityId,omitempty"` + InstalledPatchCount *int64 `json:"installedPatchCount,omitempty"` + MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` + NotSelectedPatchCount *int64 `json:"notSelectedPatchCount,omitempty"` + Patches *[]PatchInstallationDetail `json:"patches,omitempty"` + PendingPatchCount *int64 `json:"pendingPatchCount,omitempty"` + RebootStatus *VMGuestPatchRebootStatus `json:"rebootStatus,omitempty"` + StartDateTime *string `json:"startDateTime,omitempty"` + Status *PatchOperationStatus `json:"status,omitempty"` +} + +func (o *VirtualMachineInstallPatchesResult) GetStartDateTimeAsTime() (*time.Time, error) { + if o.StartDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualMachineInstallPatchesResult) SetStartDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartDateTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstanceview.go new file mode 100644 index 000000000000..0d87fbe18b18 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineinstanceview.go @@ -0,0 +1,23 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceView struct { + AssignedHost *string `json:"assignedHost,omitempty"` + BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + Disks *[]DiskInstanceView `json:"disks,omitempty"` + Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` + HyperVGeneration *HyperVGenerationType `json:"hyperVGeneration,omitempty"` + MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` + OsName *string `json:"osName,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` + PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` + PlatformFaultDomain *int64 `json:"platformFaultDomain,omitempty"` + PlatformUpdateDomain *int64 `json:"platformUpdateDomain,omitempty"` + RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + VmAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` + VmHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineiptag.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineiptag.go new file mode 100644 index 000000000000..9b7778110d22 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineiptag.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineIPTag struct { + IPTagType *string `json:"ipTagType,omitempty"` + Tag *string `json:"tag,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfiguration.go new file mode 100644 index 000000000000..2a50153e1952 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfiguration.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineNetworkInterfaceConfiguration struct { + Name string `json:"name"` + Properties *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfigurationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfigurationproperties.go new file mode 100644 index 000000000000..44b8e6c963b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceconfigurationproperties.go @@ -0,0 +1,16 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineNetworkInterfaceConfigurationProperties struct { + DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` + DnsSettings *VirtualMachineNetworkInterfaceDnsSettingsConfiguration `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableFpga *bool `json:"enableFpga,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + IPConfigurations []VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations"` + NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` + Primary *bool `json:"primary,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfacednssettingsconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfacednssettingsconfiguration.go new file mode 100644 index 000000000000..d0610637be37 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfacednssettingsconfiguration.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineNetworkInterfaceDnsSettingsConfiguration struct { + DnsServers *[]string `json:"dnsServers,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfiguration.go new file mode 100644 index 000000000000..d84aa7ee7c9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfiguration.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineNetworkInterfaceIPConfiguration struct { + Name string `json:"name"` + Properties *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfigurationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfigurationproperties.go new file mode 100644 index 000000000000..ac1a9f67ae9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinenetworkinterfaceipconfigurationproperties.go @@ -0,0 +1,14 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { + ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` + ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` + LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateIPAddressVersion *IPVersions `json:"privateIPAddressVersion,omitempty"` + PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` + Subnet *SubResource `json:"subnet,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepatchstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepatchstatus.go new file mode 100644 index 000000000000..563ee2e62379 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepatchstatus.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachinePatchStatus struct { + AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` + ConfigurationStatuses *[]InstanceViewStatus `json:"configurationStatuses,omitempty"` + LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineproperties.go new file mode 100644 index 000000000000..73ef23a3725d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineproperties.go @@ -0,0 +1,51 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineProperties struct { + AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` + AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` + BillingProfile *BillingProfile `json:"billingProfile,omitempty"` + CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + EvictionPolicy *VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` + ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + Host *SubResource `json:"host,omitempty"` + HostGroup *SubResource `json:"hostGroup,omitempty"` + InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + OsProfile *OSProfile `json:"osProfile,omitempty"` + PlatformFaultDomain *int64 `json:"platformFaultDomain,omitempty"` + Priority *VirtualMachinePriorityTypes `json:"priority,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` + ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + UserData *string `json:"userData,omitempty"` + VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` + VmId *string `json:"vmId,omitempty"` +} + +func (o *VirtualMachineProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualMachineProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfiguration.go new file mode 100644 index 000000000000..6caa9f72846c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfiguration.go @@ -0,0 +1,10 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachinePublicIPAddressConfiguration struct { + Name string `json:"name"` + Properties *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` + Sku *PublicIPAddressSku `json:"sku,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfigurationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfigurationproperties.go new file mode 100644 index 000000000000..6352be21b5c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressconfigurationproperties.go @@ -0,0 +1,14 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachinePublicIPAddressConfigurationProperties struct { + DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` + DnsSettings *VirtualMachinePublicIPAddressDnsSettingsConfiguration `json:"dnsSettings,omitempty"` + IPTags *[]VirtualMachineIPTag `json:"ipTags,omitempty"` + IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` + PublicIPAddressVersion *IPVersions `json:"publicIPAddressVersion,omitempty"` + PublicIPAllocationMethod *PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` + PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressdnssettingsconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressdnssettingsconfiguration.go new file mode 100644 index 000000000000..3a3c4e4cf2c3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinepublicipaddressdnssettingsconfiguration.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachinePublicIPAddressDnsSettingsConfiguration struct { + DomainNameLabel string `json:"domainNameLabel"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinereimageparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinereimageparameters.go new file mode 100644 index 000000000000..e44265024012 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinereimageparameters.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineReimageParameters struct { + TempDisk *bool `json:"tempDisk,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesize.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesize.go new file mode 100644 index 000000000000..5de05c343a93 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesize.go @@ -0,0 +1,13 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineSize struct { + MaxDataDiskCount *int64 `json:"maxDataDiskCount,omitempty"` + MemoryInMB *int64 `json:"memoryInMB,omitempty"` + Name *string `json:"name,omitempty"` + NumberOfCores *int64 `json:"numberOfCores,omitempty"` + OsDiskSizeInMB *int64 `json:"osDiskSizeInMB,omitempty"` + ResourceDiskSizeInMB *int64 `json:"resourceDiskSizeInMB,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesizelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesizelistresult.go new file mode 100644 index 000000000000..f4680d16c8f4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesizelistresult.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineSizeListResult struct { + Value *[]VirtualMachineSize `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesoftwarepatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesoftwarepatchproperties.go new file mode 100644 index 000000000000..8d12f134ef18 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachinesoftwarepatchproperties.go @@ -0,0 +1,47 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineSoftwarePatchProperties struct { + ActivityId *string `json:"activityId,omitempty"` + AssessmentState *PatchAssessmentState `json:"assessmentState,omitempty"` + Classifications *[]string `json:"classifications,omitempty"` + KbId *string `json:"kbId,omitempty"` + LastModifiedDateTime *string `json:"lastModifiedDateTime,omitempty"` + Name *string `json:"name,omitempty"` + PatchId *string `json:"patchId,omitempty"` + PublishedDate *string `json:"publishedDate,omitempty"` + RebootBehavior *VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty"` + Version *string `json:"version,omitempty"` +} + +func (o *VirtualMachineSoftwarePatchProperties) GetLastModifiedDateTimeAsTime() (*time.Time, error) { + if o.LastModifiedDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualMachineSoftwarePatchProperties) SetLastModifiedDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedDateTime = &formatted +} + +func (o *VirtualMachineSoftwarePatchProperties) GetPublishedDateAsTime() (*time.Time, error) { + if o.PublishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.PublishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualMachineSoftwarePatchProperties) SetPublishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.PublishedDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineupdate.go new file mode 100644 index 000000000000..c7a5b2525993 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_virtualmachineupdate.go @@ -0,0 +1,16 @@ +package virtualmachines + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineUpdate struct { + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Properties *VirtualMachineProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Zones *[]string `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmdisksecurityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmdisksecurityprofile.go new file mode 100644 index 000000000000..ad81ec1c12c3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmdisksecurityprofile.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMDiskSecurityProfile struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + SecurityEncryptionType *SecurityEncryptionTypes `json:"securityEncryptionType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmgalleryapplication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmgalleryapplication.go new file mode 100644 index 000000000000..6ef9ea26cdfd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmgalleryapplication.go @@ -0,0 +1,11 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMGalleryApplication struct { + ConfigurationReference *string `json:"configurationReference,omitempty"` + Order *int64 `json:"order,omitempty"` + PackageReferenceId string `json:"packageReferenceId"` + Tags *string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmsizeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmsizeproperties.go new file mode 100644 index 000000000000..f4e57fddd1b4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_vmsizeproperties.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSizeProperties struct { + VCPUsAvailable *int64 `json:"vCPUsAvailable,omitempty"` + VCPUsPerCore *int64 `json:"vCPUsPerCore,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsconfiguration.go new file mode 100644 index 000000000000..689677f4038f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsconfiguration.go @@ -0,0 +1,13 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsConfiguration struct { + AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` + PatchSettings *PatchSettings `json:"patchSettings,omitempty"` + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + TimeZone *string `json:"timeZone,omitempty"` + WinRM *WinRMConfiguration `json:"winRM,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsparameters.go new file mode 100644 index 000000000000..3e07917b60a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_windowsparameters.go @@ -0,0 +1,30 @@ +package virtualmachines + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsParameters struct { + ClassificationsToInclude *[]VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` + ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` + KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` + KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` + MaxPatchPublishDate *string `json:"maxPatchPublishDate,omitempty"` +} + +func (o *WindowsParameters) GetMaxPatchPublishDateAsTime() (*time.Time, error) { + if o.MaxPatchPublishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.MaxPatchPublishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *WindowsParameters) SetMaxPatchPublishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.MaxPatchPublishDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmconfiguration.go new file mode 100644 index 000000000000..2afec23e6ff1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmconfiguration.go @@ -0,0 +1,8 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WinRMConfiguration struct { + Listeners *[]WinRMListener `json:"listeners,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmlistener.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmlistener.go new file mode 100644 index 000000000000..e2a07b49f368 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/model_winrmlistener.go @@ -0,0 +1,9 @@ +package virtualmachines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WinRMListener struct { + CertificateUrl *string `json:"certificateUrl,omitempty"` + Protocol *ProtocolTypes `json:"protocol,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/predicates.go new file mode 100644 index 000000000000..5c6a8448a7a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/predicates.go @@ -0,0 +1,29 @@ +package virtualmachines + +type VirtualMachineOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p VirtualMachineOperationPredicate) Matches(input VirtualMachine) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/version.go new file mode 100644 index 000000000000..5f2cc5ca0554 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines/version.go @@ -0,0 +1,12 @@ +package virtualmachines + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachines/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 646e90af5f27..757323df8874 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -200,11 +200,13 @@ github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridr github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2022-09-01/clusters github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2021-04-30/cognitiveservicesaccounts github.com/hashicorp/go-azure-sdk/resource-manager/communication/2020-08-20/communicationservice +github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/sshpublickeys +github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks github.com/hashicorp/go-azure-sdk/resource-manager/confidentialledger/2022-05-13/confidentialledger github.com/hashicorp/go-azure-sdk/resource-manager/consumption/2019-10-01/budgets From 4f423ea73e64d5395e1eb74024eac90a9e245062 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Wed, 9 Nov 2022 22:06:13 +0000 Subject: [PATCH 14/15] Rename feature flag --- internal/provider/features.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/features.go b/internal/provider/features.go index 12e6e54d33de..2757e5c3b135 100644 --- a/internal/provider/features.go +++ b/internal/provider/features.go @@ -271,7 +271,7 @@ func schemaFeatures(supportLegacyTestSuite bool) *pluginsdk.Schema { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - "no_downtime_resize": { + "expand_without_downtime": { Type: pluginsdk.TypeBool, Optional: true, Default: true, From 0c8c96aae747410573e1de62ffe1bf66558644a0 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Wed, 9 Nov 2022 22:29:29 +0000 Subject: [PATCH 15/15] goimports --- internal/services/compute/no_downtime_resize.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/compute/no_downtime_resize.go b/internal/services/compute/no_downtime_resize.go index 797104c82c61..8fd32a7f3d4b 100644 --- a/internal/services/compute/no_downtime_resize.go +++ b/internal/services/compute/no_downtime_resize.go @@ -3,7 +3,6 @@ package compute import ( "context" "fmt" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "log" "strings" @@ -11,6 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" ) // The logic on this file is based on: