@@ -4,126 +4,212 @@ private import bicep
4
4
* A resource of type Microsoft.Compute/virtualMachines
5
5
*/
6
6
module Compute {
7
+ /**
8
+ * Represents a generic Microsoft.Compute resource.
9
+ * Matches any resource of type Microsoft.Compute/*.
10
+ */
7
11
class ComputeResource extends Resource {
12
+ /**
13
+ * Constructs a ComputeResource for any Microsoft.Compute resource type.
14
+ */
8
15
ComputeResource ( ) { this .getResourceType ( ) .regexpMatch ( "^Microsoft.Compute/.*" ) }
9
16
}
10
17
11
18
/**
12
- * A resource of type Microsoft.Compute/virtualMachines
13
- * https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/virtualmachines
19
+ * Represents a Microsoft.Compute/virtualMachines resource.
20
+ * See: https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/virtualmachines
14
21
*/
15
22
class VirtualMachines extends ComputeResource {
23
+ /**
24
+ * Constructs a VirtualMachines resource.
25
+ */
16
26
VirtualMachines ( ) {
17
27
this .getResourceType ( ) .regexpMatch ( "^Microsoft.Compute/virtualMachines@.*" )
18
28
}
19
29
30
+ /**
31
+ * Returns a string representation of the VirtualMachines resource.
32
+ */
20
33
override string toString ( ) { result = "VirtualMachines Resource" }
21
34
35
+ /**
36
+ * Returns the properties object for this virtual machine.
37
+ */
22
38
VirtualMachinesProperties:: Properties getProperties ( ) {
23
39
result = this .getProperty ( "properties" )
24
40
}
25
41
26
42
/**
27
- * The the hardware network interfaces of the virtual machine
43
+ * Returns the hardware network interfaces of the virtual machine.
28
44
*/
29
45
Network:: NetworkInterfaces getNetworkInterfaces ( ) {
30
46
result = this .getProperties ( ) .getNetworkProfile ( ) .getNetworkInterfaces ( )
31
47
}
32
48
}
33
49
34
50
/**
35
- * The properties module for Microsoft.Compute/virtualMachines
51
+ * The properties module for Microsoft.Compute/virtualMachines resources.
36
52
*/
37
53
module VirtualMachinesProperties {
38
54
/**
39
- * The properties object for the Microsoft.Compute/virtualMachines type
55
+ * The properties object for the Microsoft.Compute/virtualMachines type.
40
56
*/
41
57
class Properties extends Object {
42
58
private VirtualMachines virtualMachines ;
43
59
60
+ /**
61
+ * Constructs a Properties object for the given virtual machine.
62
+ */
44
63
Properties ( ) { this = virtualMachines .getProperty ( "properties" ) }
45
64
65
+ /**
66
+ * Returns the parent VirtualMachines resource.
67
+ */
46
68
VirtualMachines getVirtualMachine ( ) { result = virtualMachines }
47
69
70
+ /**
71
+ * Returns the hardware profile object for the virtual machine.
72
+ */
48
73
HardwareProfile getHardwareProfile ( ) { result = this .getProperty ( "hardwareProfile" ) }
49
74
75
+ /**
76
+ * Returns the network profile object for the virtual machine.
77
+ */
50
78
NetworkProfile getNetworkProfile ( ) { result = this .getProperty ( "networkProfile" ) }
51
79
80
+ /**
81
+ * Returns the OS profile object for the virtual machine.
82
+ */
52
83
OsProfile getOsProfile ( ) { result = this .getProperty ( "osProfile" ) }
53
84
}
54
85
55
86
/**
56
- * The hardwareProfile property object for the Microsoft.Compute/virtualMachines type
87
+ * The hardwareProfile property object for the Microsoft.Compute/virtualMachines type.
57
88
*/
58
89
class HardwareProfile extends Object {
59
90
private Properties properties ;
60
91
92
+ /**
93
+ * Constructs a HardwareProfile object for the given properties.
94
+ */
61
95
HardwareProfile ( ) { this = properties .getProperty ( "hardwareProfile" ) }
62
96
97
+ /**
98
+ * Returns a string representation of the hardware profile.
99
+ */
63
100
string toString ( ) { result = "HardwareProfile" }
64
101
102
+ /**
103
+ * Returns the vmSize property of the hardware profile.
104
+ */
65
105
Expr getVmSize ( ) { result = this .getProperty ( "vmSize" ) }
66
106
}
67
107
68
108
/**
69
- * A NetworkProfile for the Microsoft.Compute/virtualMachines type
109
+ * Represents a network profile for the Microsoft.Compute/virtualMachines type.
70
110
*/
71
111
class NetworkProfile extends Object {
72
112
private Properties properties ;
73
113
114
+ /**
115
+ * Constructs a NetworkProfile object for the given properties.
116
+ */
74
117
NetworkProfile ( ) { this = properties .getProperty ( "networkProfile" ) }
75
118
119
+ /**
120
+ * Returns a string representation of the network profile.
121
+ */
76
122
string toString ( ) { result = "NetworkProfile" }
77
123
124
+ /**
125
+ * Returns the network interfaces for the virtual machine.
126
+ */
78
127
Network:: NetworkInterfaces getNetworkInterfaces ( ) {
79
128
result = resolveResource ( this .getNetworkInterfacesObject ( ) )
80
129
}
81
130
131
+ /**
132
+ * Returns the networkInterfaces property as an object array.
133
+ */
82
134
private Object getNetworkInterfacesObject ( ) {
83
135
result = this .getProperty ( "networkInterfaces" ) .( Array ) .getElements ( )
84
136
}
85
137
}
86
138
87
139
/**
140
+ * Represents the storage profile for the Microsoft.Compute/virtualMachines type.
88
141
*/
89
142
class StorageProfile extends Object {
90
143
private Properties properties ;
91
144
145
+ /**
146
+ * Constructs a StorageProfile object for the given properties.
147
+ */
92
148
StorageProfile ( ) { this = properties .getProperty ( "storageProfile" ) }
93
149
150
+ /**
151
+ * Returns the image reference for the storage profile.
152
+ */
94
153
ImageReference getImageReference ( ) { result = this .getProperty ( "imageReference" ) }
95
154
}
96
155
97
156
/**
98
- * A ImageReference for the Microsoft.Compute/virtualMachines type
99
- * https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/virtualmachines?pivots=deployment-language-bicep#imagereference
157
+ * Represents an image reference for the Microsoft.Compute/virtualMachines type.
158
+ * See: https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/virtualmachines?pivots=deployment-language-bicep#imagereference
100
159
*/
101
160
class ImageReference extends Object {
102
161
private StorageProfile storageProfile ;
103
162
163
+ /**
164
+ * Constructs an ImageReference object for the given storage profile.
165
+ */
104
166
ImageReference ( ) { this = storageProfile .getProperty ( "imageReference" ) }
105
167
168
+ /**
169
+ * Returns the publisher property of the image reference.
170
+ */
106
171
Expr getPublisher ( ) { result = this .getProperty ( "publisher" ) }
107
172
173
+ /**
174
+ * Returns the offer property of the image reference.
175
+ */
108
176
Expr getOffer ( ) { result = this .getProperty ( "offer" ) }
109
177
178
+ /**
179
+ * Returns the sku property of the image reference.
180
+ */
110
181
Expr getSku ( ) { result = this .getProperty ( "sku" ) }
111
182
183
+ /**
184
+ * Returns the version property of the image reference.
185
+ */
112
186
Expr getVersion ( ) { result = this .getProperty ( "version" ) }
113
187
}
114
188
115
189
/**
116
- * The OsProfile object for the Microsoft.Compute/virtualMachines type
190
+ * Represents the OS profile for the Microsoft.Compute/virtualMachines type.
117
191
*/
118
192
class OsProfile extends Object {
119
193
private Properties properties ;
120
194
195
+ /**
196
+ * Constructs an OsProfile object for the given properties.
197
+ */
121
198
OsProfile ( ) { this = properties .getProperty ( "osProfile" ) }
122
199
200
+ /**
201
+ * Returns the computerName property of the OS profile.
202
+ */
123
203
Expr getComputerName ( ) { result = this .getProperty ( "computerName" ) }
124
204
205
+ /**
206
+ * Returns the adminUsername property of the OS profile.
207
+ */
125
208
Expr getAdminUsername ( ) { result = this .getProperty ( "adminUsername" ) }
126
209
210
+ /**
211
+ * Returns the adminPassword property of the OS profile.
212
+ */
127
213
Expr getAdminPassword ( ) { result = this .getProperty ( "adminPassword" ) }
128
214
}
129
215
}
0 commit comments