-
Notifications
You must be signed in to change notification settings - Fork 12
/
RestorePointCollections_Update_MaximumSet_Gen.go
203 lines (200 loc) · 10.3 KB
/
RestorePointCollections_Update_MaximumSet_Gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/19f98c9f526f8db961f172276dd6d6882a86ed86/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2022-11-01/examples/restorePointExamples/RestorePointCollections_Update_MaximumSet_Gen.json
func ExampleRestorePointCollectionsClient_Update_restorePointCollectionsUpdateMaximumSetGen() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewRestorePointCollectionsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.RestorePointCollectionUpdate{
Tags: map[string]*string{
"key8536": to.Ptr("aaaaaaaaaaaaaaaaaaa"),
},
Properties: &armcompute.RestorePointCollectionProperties{
Source: &armcompute.RestorePointCollectionSourceProperties{
ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RestorePointCollection = armcompute.RestorePointCollection{
// Name: to.Ptr("myRpc"),
// Type: to.Ptr("Microsoft.Compute/restorePointCollections"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"),
// Location: to.Ptr("norwayeast"),
// Tags: map[string]*string{
// },
// Properties: &armcompute.RestorePointCollectionProperties{
// ProvisioningState: to.Ptr("Succeeded"),
// RestorePointCollectionID: to.Ptr("638f052b-a7c2-450c-89e7-6a3b8f1d6a7c"),
// RestorePoints: []*armcompute.RestorePoint{
// {
// Name: to.Ptr("aaaaaaaaaaaaaaaaaa"),
// Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"),
// ID: to.Ptr("aaaaaaaaaaa"),
// Properties: &armcompute.RestorePointProperties{
// ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesCrashConsistent),
// ExcludeDisks: []*armcompute.APIEntityReference{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"),
// }},
// ProvisioningState: to.Ptr("Succeeded"),
// SourceMetadata: &armcompute.RestorePointSourceMetadata{
// DiagnosticsProfile: &armcompute.DiagnosticsProfile{
// BootDiagnostics: &armcompute.BootDiagnostics{
// Enabled: to.Ptr(true),
// StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"),
// },
// },
// HardwareProfile: &armcompute.HardwareProfile{
// VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S),
// VMSizeProperties: &armcompute.VMSizeProperties{
// VCPUsAvailable: to.Ptr[int32](9),
// VCPUsPerCore: to.Ptr[int32](12),
// },
// },
// LicenseType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"),
// Location: to.Ptr("westus"),
// OSProfile: &armcompute.OSProfile{
// AdminUsername: to.Ptr("admin"),
// AllowExtensionOperations: to.Ptr(true),
// ComputerName: to.Ptr("computerName"),
// CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"),
// LinuxConfiguration: &armcompute.LinuxConfiguration{
// DisablePasswordAuthentication: to.Ptr(true),
// PatchSettings: &armcompute.LinuxPatchSettings{
// AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault),
// PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault),
// },
// ProvisionVMAgent: to.Ptr(true),
// SSH: &armcompute.SSHConfiguration{
// PublicKeys: []*armcompute.SSHPublicKey{
// {
// Path: to.Ptr("aaa"),
// KeyData: to.Ptr("aaaaaa"),
// }},
// },
// },
// RequireGuestProvisionSignal: to.Ptr(true),
// Secrets: []*armcompute.VaultSecretGroup{
// {
// SourceVault: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
// },
// VaultCertificates: []*armcompute.VaultCertificate{
// {
// CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"),
// CertificateURL: to.Ptr("aaaaaaa"),
// }},
// }},
// WindowsConfiguration: &armcompute.WindowsConfiguration{
// AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{
// {
// ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"),
// Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"),
// PassName: to.Ptr("OobeSystem"),
// SettingName: to.Ptr(armcompute.SettingNamesAutoLogon),
// }},
// EnableAutomaticUpdates: to.Ptr(true),
// PatchSettings: &armcompute.PatchSettings{
// AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault),
// EnableHotpatching: to.Ptr(true),
// PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual),
// },
// ProvisionVMAgent: to.Ptr(true),
// TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
// WinRM: &armcompute.WinRMConfiguration{
// Listeners: []*armcompute.WinRMListener{
// {
// CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"),
// Protocol: to.Ptr(armcompute.ProtocolTypesHTTP),
// }},
// },
// },
// },
// SecurityProfile: &armcompute.SecurityProfile{
// EncryptionAtHost: to.Ptr(true),
// SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch),
// UefiSettings: &armcompute.UefiSettings{
// SecureBootEnabled: to.Ptr(true),
// VTpmEnabled: to.Ptr(true),
// },
// },
// StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{
// DataDisks: []*armcompute.RestorePointSourceVMDataDisk{
// {
// Name: to.Ptr("testingexcludedisk_DataDisk_1"),
// Caching: to.Ptr(armcompute.CachingTypesNone),
// DiskRestorePoint: &armcompute.APIEntityReference{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"),
// },
// DiskSizeGB: to.Ptr[int32](24),
// Lun: to.Ptr[int32](1),
// ManagedDisk: &armcompute.ManagedDiskParameters{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"),
// DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{
// ID: to.Ptr("aaaaaaaaaaaa"),
// },
// StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS),
// },
// }},
// OSDisk: &armcompute.RestorePointSourceVMOSDisk{
// Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"),
// Caching: to.Ptr(armcompute.CachingTypesReadWrite),
// DiskRestorePoint: &armcompute.APIEntityReference{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"),
// },
// DiskSizeGB: to.Ptr[int32](3),
// EncryptionSettings: &armcompute.DiskEncryptionSettings{
// DiskEncryptionKey: &armcompute.KeyVaultSecretReference{
// SecretURL: to.Ptr("aaaaaaaa"),
// SourceVault: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
// },
// },
// Enabled: to.Ptr(true),
// KeyEncryptionKey: &armcompute.KeyVaultKeyReference{
// KeyURL: to.Ptr("aaaaaaaaaaaaaa"),
// SourceVault: &armcompute.SubResource{
// ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
// },
// },
// },
// ManagedDisk: &armcompute.ManagedDiskParameters{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"),
// DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{
// ID: to.Ptr("aaaaaaaaaaaa"),
// },
// StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS),
// },
// OSType: to.Ptr(armcompute.OperatingSystemTypeWindows),
// },
// },
// VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"),
// },
// TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.593Z"); return t}()),
// },
// }},
// Source: &armcompute.RestorePointCollectionSourceProperties{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"),
// Location: to.Ptr("eastus"),
// },
// },
// }
}