@spinnaker/azure 0.0.0-2025.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/CHANGELOG.md +873 -0
  2. package/LICENSE.txt +203 -0
  3. package/dist/azure.module.d.ts +3 -0
  4. package/dist/azure.settings.d.ts +8 -0
  5. package/dist/common/AzureModalFooter.d.ts +18 -0
  6. package/dist/help/azure.help.d.ts +1 -0
  7. package/dist/image/image.reader.d.ts +2 -0
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +6778 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/instance/azureInstanceType.service.d.ts +2 -0
  12. package/dist/instance/details/instance.details.controller.d.ts +2 -0
  13. package/dist/loadBalancer/configure/AzureLoadBalancerChoiceModal.d.ts +16 -0
  14. package/dist/loadBalancer/configure/createLoadBalancer.controller.d.ts +2 -0
  15. package/dist/loadBalancer/details/loadBalancerDetail.controller.d.ts +2 -0
  16. package/dist/loadBalancer/loadBalancer.transformer.d.ts +2 -0
  17. package/dist/pipeline/stages/bake/azureBakeStage.d.ts +2 -0
  18. package/dist/pipeline/stages/bake/bakeExecutionDetails.controller.d.ts +2 -0
  19. package/dist/pipeline/stages/destroyAsg/azureDestroyAsgStage.d.ts +2 -0
  20. package/dist/pipeline/stages/disableAsg/azureDisableAsgStage.d.ts +2 -0
  21. package/dist/pipeline/stages/enableAsg/azureEnableAsgStage.d.ts +2 -0
  22. package/dist/securityGroup/clone/cloneSecurityGroup.controller.d.ts +2 -0
  23. package/dist/securityGroup/configure/CreateSecurityGroupCtrl.d.ts +2 -0
  24. package/dist/securityGroup/configure/EditSecurityGroupCtrl.d.ts +2 -0
  25. package/dist/securityGroup/details/securityGroupDetail.controller.d.ts +2 -0
  26. package/dist/securityGroup/securityGroup.reader.d.ts +2 -0
  27. package/dist/securityGroup/securityGroup.transformer.d.ts +2 -0
  28. package/dist/securityGroup/securityGroup.write.service.d.ts +2 -0
  29. package/dist/serverGroup/configure/serverGroup.configure.azure.module.d.ts +2 -0
  30. package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +2 -0
  31. package/dist/serverGroup/configure/serverGroupConfiguration.service.d.ts +2 -0
  32. package/dist/serverGroup/configure/wizard/CloneServerGroup.azure.controller.d.ts +2 -0
  33. package/dist/serverGroup/configure/wizard/ServerGroupInstanceArchetype.controller.d.ts +2 -0
  34. package/dist/serverGroup/configure/wizard/ServerGroupInstanceType.controller.d.ts +2 -0
  35. package/dist/serverGroup/configure/wizard/advancedSettings/ServerGroupAdvancedSettings.controller.d.ts +2 -0
  36. package/dist/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.d.ts +2 -0
  37. package/dist/serverGroup/configure/wizard/basicSettings/ServerGroupBasicSettings.controller.d.ts +2 -0
  38. package/dist/serverGroup/configure/wizard/basicSettings/image.regional.filter.d.ts +2 -0
  39. package/dist/serverGroup/configure/wizard/capacity/capacitySelector.directive.d.ts +2 -0
  40. package/dist/serverGroup/configure/wizard/healthSettings/ServerGroupHealthSettings.controller.d.ts +2 -0
  41. package/dist/serverGroup/configure/wizard/healthSettings/healthSettingsSelector.directive.d.ts +2 -0
  42. package/dist/serverGroup/configure/wizard/image/ServerGroupImageSettings.controller.d.ts +2 -0
  43. package/dist/serverGroup/configure/wizard/image/imageSettingsSelector.directive.d.ts +2 -0
  44. package/dist/serverGroup/configure/wizard/loadBalancers/ServerGroupLoadBalancers.controller.d.ts +2 -0
  45. package/dist/serverGroup/configure/wizard/loadBalancers/serverGroupLoadBalancersSelector.directive.d.ts +2 -0
  46. package/dist/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettings.controller.d.ts +2 -0
  47. package/dist/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettingsSelector.directive.d.ts +2 -0
  48. package/dist/serverGroup/configure/wizard/securityGroup/ServerGroupSecurityGroups.controller.d.ts +2 -0
  49. package/dist/serverGroup/configure/wizard/securityGroup/serverGroupSecurityGroupsSelector.directive.d.ts +2 -0
  50. package/dist/serverGroup/configure/wizard/tags/tagsSelector.directive.d.ts +2 -0
  51. package/dist/serverGroup/configure/wizard/zones/zoneSelector.directive.d.ts +2 -0
  52. package/dist/serverGroup/details/rollback/RollbackServerGroupModal.d.ts +25 -0
  53. package/dist/serverGroup/details/serverGroup.details.module.d.ts +2 -0
  54. package/dist/serverGroup/details/serverGroupDetails.azure.controller.d.ts +2 -0
  55. package/dist/serverGroup/serverGroup.transformer.d.ts +2 -0
  56. package/dist/utility.d.ts +28 -0
  57. package/dist/validation/applicationName.validator.d.ts +2 -0
  58. package/package.json +43 -0
  59. package/src/azure.module.ts +95 -0
  60. package/src/azure.settings.ts +16 -0
  61. package/src/common/AzureModalFooter.tsx +43 -0
  62. package/src/help/azure.help.ts +60 -0
  63. package/src/image/image.reader.js +43 -0
  64. package/src/image/image.reader.spec.js +108 -0
  65. package/src/index.ts +1 -0
  66. package/src/instance/azureInstanceType.service.js +831 -0
  67. package/src/instance/azureInstanceType.service.spec.js +17 -0
  68. package/src/instance/details/instance.details.controller.js +371 -0
  69. package/src/instance/details/instance.details.controller.spec.js +129 -0
  70. package/src/instance/details/instanceDetails.html +43 -0
  71. package/src/loadBalancer/configure/AzureLoadBalancerChoiceModal.tsx +101 -0
  72. package/src/loadBalancer/configure/advancedSettings.html +95 -0
  73. package/src/loadBalancer/configure/createLoadBalancer.controller.js +275 -0
  74. package/src/loadBalancer/configure/createLoadBalancer.controller.spec.js +39 -0
  75. package/src/loadBalancer/configure/createLoadBalancer.html +25 -0
  76. package/src/loadBalancer/configure/createLoadBalancerProperties.html +128 -0
  77. package/src/loadBalancer/configure/editLoadBalancer.html +26 -0
  78. package/src/loadBalancer/configure/healthCheck.html +74 -0
  79. package/src/loadBalancer/configure/listeners.html +50 -0
  80. package/src/loadBalancer/details/loadBalancerDetail.controller.js +181 -0
  81. package/src/loadBalancer/details/loadBalancerDetail.controller.spec.js +39 -0
  82. package/src/loadBalancer/details/loadBalancerDetail.html +128 -0
  83. package/src/loadBalancer/loadBalancer.transformer.js +109 -0
  84. package/src/logo/azure.icon.svg +196 -0
  85. package/src/logo/azure.logo.less +6 -0
  86. package/src/logo/logo_azure.png +0 -0
  87. package/src/pipeline/stages/bake/azureBakeStage.js +276 -0
  88. package/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +40 -0
  89. package/src/pipeline/stages/bake/bakeExecutionDetails.html +50 -0
  90. package/src/pipeline/stages/bake/bakeStage.html +187 -0
  91. package/src/pipeline/stages/destroyAsg/azureDestroyAsgStage.js +73 -0
  92. package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +9 -0
  93. package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +1 -0
  94. package/src/pipeline/stages/disableAsg/azureDisableAsgStage.js +65 -0
  95. package/src/pipeline/stages/disableAsg/disableAsgStage.html +11 -0
  96. package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +1 -0
  97. package/src/pipeline/stages/enableAsg/azureEnableAsgStage.js +70 -0
  98. package/src/pipeline/stages/enableAsg/enableAsgStage.html +11 -0
  99. package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +1 -0
  100. package/src/securityGroup/clone/cloneSecurityGroup.controller.js +162 -0
  101. package/src/securityGroup/clone/cloneSecurityGroup.html +8 -0
  102. package/src/securityGroup/configure/CreateSecurityGroup.controller.spec.js +78 -0
  103. package/src/securityGroup/configure/CreateSecurityGroupCtrl.js +265 -0
  104. package/src/securityGroup/configure/EditSecurityGroupCtrl.js +222 -0
  105. package/src/securityGroup/configure/configSecurityGroup.mixin.controller.js +262 -0
  106. package/src/securityGroup/configure/createSecurityGroup.html +20 -0
  107. package/src/securityGroup/configure/createSecurityGroupIngress.html +75 -0
  108. package/src/securityGroup/configure/createSecurityGroupProperties.html +88 -0
  109. package/src/securityGroup/configure/editSecurityGroup.html +19 -0
  110. package/src/securityGroup/details/securityGroupDetail.controller.js +142 -0
  111. package/src/securityGroup/details/securityGroupDetail.html +78 -0
  112. package/src/securityGroup/securityGroup.reader.js +17 -0
  113. package/src/securityGroup/securityGroup.transformer.js +13 -0
  114. package/src/securityGroup/securityGroup.write.service.js +57 -0
  115. package/src/serverGroup/configure/serverGroup.configure.azure.module.js +47 -0
  116. package/src/serverGroup/configure/serverGroupCommandBuilder.service.js +175 -0
  117. package/src/serverGroup/configure/serverGroupConfiguration.service.js +357 -0
  118. package/src/serverGroup/configure/serverGroupConfiguration.service.spec.js +209 -0
  119. package/src/serverGroup/configure/wizard/CloneServerGroup.azure.controller.js +247 -0
  120. package/src/serverGroup/configure/wizard/ServerGroupInstanceArchetype.controller.js +35 -0
  121. package/src/serverGroup/configure/wizard/ServerGroupInstanceType.controller.js +15 -0
  122. package/src/serverGroup/configure/wizard/advancedSettings/ServerGroupAdvancedSettings.controller.js +25 -0
  123. package/src/serverGroup/configure/wizard/advancedSettings/advancedSettings.html +5 -0
  124. package/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.html +138 -0
  125. package/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.js +43 -0
  126. package/src/serverGroup/configure/wizard/basicSettings/ServerGroupBasicSettings.controller.js +71 -0
  127. package/src/serverGroup/configure/wizard/basicSettings/basicSettings.html +131 -0
  128. package/src/serverGroup/configure/wizard/basicSettings/image.regional.filter.js +15 -0
  129. package/src/serverGroup/configure/wizard/basicSettings/image.regional.filter.spec.js +42 -0
  130. package/src/serverGroup/configure/wizard/capacity/capacity.html +5 -0
  131. package/src/serverGroup/configure/wizard/capacity/capacitySelector.directive.html +20 -0
  132. package/src/serverGroup/configure/wizard/capacity/capacitySelector.directive.js +21 -0
  133. package/src/serverGroup/configure/wizard/capacity/zones.html +5 -0
  134. package/src/serverGroup/configure/wizard/healthSettings/ServerGroupHealthSettings.controller.js +38 -0
  135. package/src/serverGroup/configure/wizard/healthSettings/healthSettings.html +5 -0
  136. package/src/serverGroup/configure/wizard/healthSettings/healthSettingsSelector.directive.html +32 -0
  137. package/src/serverGroup/configure/wizard/healthSettings/healthSettingsSelector.directive.js +22 -0
  138. package/src/serverGroup/configure/wizard/image/ServerGroupImageSettings.controller.js +34 -0
  139. package/src/serverGroup/configure/wizard/image/imageSettings.html +5 -0
  140. package/src/serverGroup/configure/wizard/image/imageSettingsSelector.directive.html +33 -0
  141. package/src/serverGroup/configure/wizard/image/imageSettingsSelector.directive.js +22 -0
  142. package/src/serverGroup/configure/wizard/instanceArchetype.html +33 -0
  143. package/src/serverGroup/configure/wizard/instanceType/instanceType.html +10 -0
  144. package/src/serverGroup/configure/wizard/instanceType.html +33 -0
  145. package/src/serverGroup/configure/wizard/loadBalancers/ServerGroupLoadBalancers.controller.js +137 -0
  146. package/src/serverGroup/configure/wizard/loadBalancers/loadBalancers.html +3 -0
  147. package/src/serverGroup/configure/wizard/loadBalancers/serverGroupLoadBalancersSelector.directive.html +41 -0
  148. package/src/serverGroup/configure/wizard/loadBalancers/serverGroupLoadBalancersSelector.directive.js +22 -0
  149. package/src/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettings.controller.js +44 -0
  150. package/src/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettingsSelector.directive.html +54 -0
  151. package/src/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettingsSelector.directive.js +19 -0
  152. package/src/serverGroup/configure/wizard/networkSettings/networkSettings.html +3 -0
  153. package/src/serverGroup/configure/wizard/securityGroup/ServerGroupSecurityGroups.controller.js +28 -0
  154. package/src/serverGroup/configure/wizard/securityGroup/securityGroups.html +3 -0
  155. package/src/serverGroup/configure/wizard/securityGroup/serverGroupSecurityGroupsSelector.directive.html +40 -0
  156. package/src/serverGroup/configure/wizard/securityGroup/serverGroupSecurityGroupsSelector.directive.js +38 -0
  157. package/src/serverGroup/configure/wizard/serverGroupWizard.html +61 -0
  158. package/src/serverGroup/configure/wizard/tags/tags.html +5 -0
  159. package/src/serverGroup/configure/wizard/tags/tagsSelector.directive.html +16 -0
  160. package/src/serverGroup/configure/wizard/tags/tagsSelector.directive.js +30 -0
  161. package/src/serverGroup/configure/wizard/templateSelection.html +9 -0
  162. package/src/serverGroup/configure/wizard/zones/zoneSelector.directive.html +21 -0
  163. package/src/serverGroup/configure/wizard/zones/zoneSelector.directive.js +28 -0
  164. package/src/serverGroup/details/rollback/RollbackServerGroupModal.tsx +158 -0
  165. package/src/serverGroup/details/serverGroup.details.module.js +11 -0
  166. package/src/serverGroup/details/serverGroupDetails.azure.controller.js +260 -0
  167. package/src/serverGroup/details/serverGroupDetails.html +98 -0
  168. package/src/serverGroup/serverGroup.transformer.js +150 -0
  169. package/src/serverGroup/serverGroup.transformer.spec.js +256 -0
  170. package/src/subnet/subnetSelectField.directive.html +28 -0
  171. package/src/subnet/subnetSelectField.directive.js +35 -0
  172. package/src/utility.spec.ts +61 -0
  173. package/src/utility.ts +95 -0
  174. package/src/validation/applicationName.validator.js +44 -0
@@ -0,0 +1,831 @@
1
+ 'use strict';
2
+
3
+ import { module } from 'angular';
4
+ import _ from 'lodash';
5
+
6
+ export const AZURE_INSTANCE_AZUREINSTANCETYPE_SERVICE = 'spinnaker.azure.instanceType.service';
7
+ export const name = AZURE_INSTANCE_AZUREINSTANCETYPE_SERVICE; // for backwards compatibility
8
+ module(AZURE_INSTANCE_AZUREINSTANCETYPE_SERVICE, []).factory('azureInstanceTypeService', [
9
+ '$q',
10
+ function ($q) {
11
+ const B = {
12
+ type: 'B-series',
13
+ description:
14
+ 'The B-series burstable VMs are ideal for workloads that do not need the full performance of the CPU continuously, like web servers, small databases and development and test environments.',
15
+ instanceTypes: [
16
+ {
17
+ name: 'Standard_B1ms',
18
+ label: 'Standard_B1ms',
19
+ cpu: 1,
20
+ memory: 2,
21
+ storage: {
22
+ type: 'SSD',
23
+ count: 2,
24
+ size: 4,
25
+ },
26
+ },
27
+ {
28
+ name: 'Standard_B1s',
29
+ label: 'Standard_B1s',
30
+ cpu: 1,
31
+ memory: 1,
32
+ storage: {
33
+ type: 'SSD',
34
+ count: 2,
35
+ size: 2,
36
+ },
37
+ },
38
+ {
39
+ name: 'Standard_B2ms',
40
+ label: 'Standard_B2ms',
41
+ cpu: 2,
42
+ memory: 8,
43
+ storage: {
44
+ type: 'SSD',
45
+ count: 4,
46
+ size: 16,
47
+ },
48
+ },
49
+ {
50
+ name: 'Standard_B2s',
51
+ label: 'Standard_B2s',
52
+ cpu: 2,
53
+ memory: 4,
54
+ storage: {
55
+ type: 'SSD',
56
+ count: 4,
57
+ size: 8,
58
+ },
59
+ },
60
+ {
61
+ name: 'Standard_B4ms',
62
+ label: 'Standard_B4ms',
63
+ cpu: 4,
64
+ memory: 16,
65
+ storage: {
66
+ type: 'SSD',
67
+ count: 8,
68
+ size: 32,
69
+ },
70
+ },
71
+ {
72
+ name: 'Standard_B8ms',
73
+ label: 'Standard_B8ms',
74
+ cpu: 8,
75
+ memory: 32,
76
+ storage: {
77
+ type: 'SSD',
78
+ count: 16,
79
+ size: 64,
80
+ },
81
+ },
82
+ {
83
+ name: 'Standard_B1ls',
84
+ label: 'Standard_B1ls',
85
+ cpu: 1,
86
+ memory: 0.5,
87
+ storage: {
88
+ type: 'SSD',
89
+ count: 2,
90
+ size: 1,
91
+ },
92
+ },
93
+ ],
94
+ };
95
+
96
+ const DSV3 = {
97
+ type: 'Dsv3-series',
98
+ description:
99
+ 'The Dsv3-series sizes offer a combination of vCPU, memory, and temporary storage for most production workloads.',
100
+ instanceTypes: [
101
+ {
102
+ name: 'Standard_D2s_v3',
103
+ label: 'Standard_D2s_v3',
104
+ cpu: 2,
105
+ memory: 8,
106
+ storage: {
107
+ type: 'SSD',
108
+ count: 4,
109
+ size: 16,
110
+ },
111
+ },
112
+ {
113
+ name: 'Standard_D4s_v3',
114
+ label: 'Standard_D4s_v3',
115
+ cpu: 4,
116
+ memory: 16,
117
+ storage: {
118
+ type: 'SSD',
119
+ count: 8,
120
+ size: 32,
121
+ },
122
+ },
123
+ {
124
+ name: 'Standard_D8s_v3',
125
+ label: 'Standard_D8s_v3',
126
+ cpu: 8,
127
+ memory: 32,
128
+ storage: {
129
+ type: 'SSD',
130
+ count: 16,
131
+ size: 64,
132
+ },
133
+ },
134
+ {
135
+ name: 'Standard_D16s_v3',
136
+ label: 'Standard_D16s_v3',
137
+ cpu: 16,
138
+ memory: 64,
139
+ storage: {
140
+ type: 'SSD',
141
+ count: 32,
142
+ size: 128,
143
+ },
144
+ },
145
+ {
146
+ name: 'Standard_D32s_v3',
147
+ label: 'Standard_D32s_v3',
148
+ cpu: 32,
149
+ memory: 128,
150
+ storage: {
151
+ type: 'SSD',
152
+ count: 32,
153
+ size: 256,
154
+ },
155
+ },
156
+ {
157
+ name: 'Standard_D64s_v3',
158
+ label: 'Standard_D64s_v3',
159
+ cpu: 64,
160
+ memory: 256,
161
+ storage: {
162
+ type: 'SSD',
163
+ count: 32,
164
+ size: 512,
165
+ },
166
+ },
167
+ ],
168
+ };
169
+
170
+ const DV3 = {
171
+ type: 'Dv3-series',
172
+ description:
173
+ 'The Dv3-series sizes offer a combination of vCPU, memory, and temporary storage for most production workloads.',
174
+ instanceTypes: [
175
+ {
176
+ name: 'Standard_D2_v3',
177
+ label: 'Standard_D2_v3',
178
+ cpu: 2,
179
+ memory: 8,
180
+ storage: {
181
+ type: 'SSD',
182
+ count: 4,
183
+ size: 50,
184
+ },
185
+ },
186
+ {
187
+ name: 'Standard_D4_v3',
188
+ label: 'Standard_D4_v3',
189
+ cpu: 4,
190
+ memory: 16,
191
+ storage: {
192
+ type: 'SSD',
193
+ count: 8,
194
+ size: 100,
195
+ },
196
+ },
197
+ {
198
+ name: 'Standard_D8_v3',
199
+ label: 'Standard_D8_v3',
200
+ cpu: 8,
201
+ memory: 32,
202
+ storage: {
203
+ type: 'SSD',
204
+ count: 16,
205
+ size: 200,
206
+ },
207
+ },
208
+ {
209
+ name: 'Standard_D16_v3',
210
+ label: 'Standard_D16_v3',
211
+ cpu: 16,
212
+ memory: 64,
213
+ storage: {
214
+ type: 'SSD',
215
+ count: 32,
216
+ size: 400,
217
+ },
218
+ },
219
+ {
220
+ name: 'Standard_D32_v3',
221
+ label: 'Standard_D32_v3',
222
+ cpu: 32,
223
+ memory: 128,
224
+ storage: {
225
+ type: 'SSD',
226
+ count: 32,
227
+ size: 800,
228
+ },
229
+ },
230
+ {
231
+ name: 'Standard_D64_v3',
232
+ label: 'Standard_D64_v3',
233
+ cpu: 64,
234
+ memory: 256,
235
+ storage: {
236
+ type: 'SSD',
237
+ count: 32,
238
+ size: 1600,
239
+ },
240
+ },
241
+ ],
242
+ };
243
+
244
+ const DSV2 = {
245
+ type: 'DSv2-series',
246
+ description: '',
247
+ instanceTypes: [
248
+ {
249
+ name: 'Standard_DS1_v2',
250
+ label: 'Standard_DS1_v2',
251
+ cpu: 1,
252
+ memory: 3.5,
253
+ storage: {
254
+ type: 'SSD',
255
+ count: 4,
256
+ size: 7,
257
+ },
258
+ },
259
+ {
260
+ name: 'Standard_DS2_v2',
261
+ label: 'Standard_DS2_v2',
262
+ cpu: 2,
263
+ memory: 7,
264
+ storage: {
265
+ type: 'SSD',
266
+ count: 8,
267
+ size: 14,
268
+ },
269
+ },
270
+ {
271
+ name: 'Standard_DS3_v2',
272
+ label: 'Standard_DS3_v2',
273
+ cpu: 4,
274
+ memory: 14,
275
+ storage: {
276
+ type: 'SSD',
277
+ count: 16,
278
+ size: 28,
279
+ },
280
+ },
281
+ {
282
+ name: 'Standard_DS4_v2',
283
+ label: 'Standard_DS4_v2',
284
+ cpu: 8,
285
+ memory: 28,
286
+ storage: {
287
+ type: 'SSD',
288
+ count: 32,
289
+ size: 56,
290
+ },
291
+ },
292
+ {
293
+ name: 'Standard_DS5_v2',
294
+ label: 'Standard_DS5_v2',
295
+ cpu: 16,
296
+ memory: 56,
297
+ storage: {
298
+ type: 'SSD',
299
+ count: 64,
300
+ size: 112,
301
+ },
302
+ },
303
+ {
304
+ name: 'Standard_DS11_v2',
305
+ label: 'Standard_DS11_v2',
306
+ cpu: 2,
307
+ memory: 14,
308
+ storage: {
309
+ type: 'SSD',
310
+ count: 8,
311
+ size: 28,
312
+ },
313
+ },
314
+ {
315
+ name: 'Standard_DS12_v2',
316
+ label: 'Standard_DS12_v2',
317
+ cpu: 4,
318
+ memory: 28,
319
+ storage: {
320
+ type: 'SSD',
321
+ count: 16,
322
+ size: 56,
323
+ },
324
+ },
325
+ {
326
+ name: 'Standard_DS13_v2',
327
+ label: 'Standard_DS13_v2',
328
+ cpu: 8,
329
+ memory: 56,
330
+ storage: {
331
+ type: 'SSD',
332
+ count: 32,
333
+ size: 112,
334
+ },
335
+ },
336
+ {
337
+ name: 'Standard_DS14_v2',
338
+ label: 'Standard_DS14_v2',
339
+ cpu: 16,
340
+ memory: 112,
341
+ storage: {
342
+ type: 'SSD',
343
+ count: 64,
344
+ size: 224,
345
+ },
346
+ },
347
+ {
348
+ name: 'Standard_DS15_v2',
349
+ label: 'Standard_DS15_v2',
350
+ cpu: 20,
351
+ memory: 140,
352
+ storage: {
353
+ type: 'SSD',
354
+ count: 64,
355
+ size: 280,
356
+ },
357
+ },
358
+ ],
359
+ };
360
+
361
+ const DV2 = {
362
+ type: 'Dv2-series',
363
+ description: '',
364
+ instanceTypes: [
365
+ {
366
+ name: 'Standard_D1_v2',
367
+ label: 'Standard_D1_v2',
368
+ cpu: 1,
369
+ memory: 3.5,
370
+ storage: {
371
+ type: 'SSD',
372
+ count: 4,
373
+ size: 50,
374
+ },
375
+ },
376
+ {
377
+ name: 'Standard_D2_v2',
378
+ label: 'Standard_D2_v2',
379
+ cpu: 2,
380
+ memory: 7,
381
+ storage: {
382
+ type: 'SSD',
383
+ count: 8,
384
+ size: 100,
385
+ },
386
+ },
387
+ {
388
+ name: 'Standard_D3_v2',
389
+ label: 'Standard_D3_v2',
390
+ cpu: 4,
391
+ memory: 14,
392
+ storage: {
393
+ type: 'SSD',
394
+ count: 16,
395
+ size: 200,
396
+ },
397
+ },
398
+ {
399
+ name: 'Standard_D4_v2',
400
+ label: 'Standard_D4_v2',
401
+ cpu: 8,
402
+ memory: 28,
403
+ storage: {
404
+ type: 'SSD',
405
+ count: 32,
406
+ size: 400,
407
+ },
408
+ },
409
+ {
410
+ name: 'Standard_D5_v2',
411
+ label: 'Standard_D5_v2',
412
+ cpu: 16,
413
+ memory: 56,
414
+ storage: {
415
+ type: 'SSD',
416
+ count: 64,
417
+ size: 800,
418
+ },
419
+ },
420
+ {
421
+ name: 'Standard_D11_v2',
422
+ label: 'Standard_D11_v2',
423
+ cpu: 2,
424
+ memory: 14,
425
+ storage: {
426
+ type: 'SSD',
427
+ count: 8,
428
+ size: 100,
429
+ },
430
+ },
431
+ {
432
+ name: 'Standard_D12_v2',
433
+ label: 'Standard_D12_v2',
434
+ cpu: 4,
435
+ memory: 28,
436
+ storage: {
437
+ type: 'SSD',
438
+ count: 16,
439
+ size: 200,
440
+ },
441
+ },
442
+ {
443
+ name: 'Standard_D13_v2',
444
+ label: 'Standard_D13_v2',
445
+ cpu: 8,
446
+ memory: 56,
447
+ storage: {
448
+ type: 'SSD',
449
+ count: 32,
450
+ size: 400,
451
+ },
452
+ },
453
+ {
454
+ name: 'Standard_D14_v2',
455
+ label: 'Standard_D14_v2',
456
+ cpu: 16,
457
+ memory: 112,
458
+ storage: {
459
+ type: 'SSD',
460
+ count: 64,
461
+ size: 800,
462
+ },
463
+ },
464
+ {
465
+ name: 'Standard_D15_v2',
466
+ label: 'Standard_D15_v2',
467
+ cpu: 20,
468
+ memory: 140,
469
+ storage: {
470
+ type: 'SSD',
471
+ count: 64,
472
+ size: 280,
473
+ },
474
+ },
475
+ ],
476
+ };
477
+
478
+ const AV2 = {
479
+ type: 'Av2-series',
480
+ description: '',
481
+ instanceTypes: [
482
+ {
483
+ name: 'Standard_A1_v2',
484
+ label: 'Standard_A1_v2',
485
+ cpu: 1,
486
+ memory: 2,
487
+ storage: {
488
+ type: 'SSD',
489
+ count: 2,
490
+ size: 10,
491
+ },
492
+ },
493
+ {
494
+ name: 'Standard_A2m_v2',
495
+ label: 'Standard_A2m_v2',
496
+ cpu: 2,
497
+ memory: 16,
498
+ storage: {
499
+ type: 'SSD',
500
+ count: 4,
501
+ size: 20,
502
+ },
503
+ },
504
+ {
505
+ name: 'Standard_A2_v2',
506
+ label: 'Standard_A2_v2',
507
+ cpu: 2,
508
+ memory: 4,
509
+ storage: {
510
+ type: 'SSD',
511
+ count: 4,
512
+ size: 20,
513
+ },
514
+ },
515
+ {
516
+ name: 'Standard_A4m_v2',
517
+ label: 'Standard_A4m_v2',
518
+ cpu: 4,
519
+ memory: 32,
520
+ storage: {
521
+ type: 'SSD',
522
+ count: 8,
523
+ size: 40,
524
+ },
525
+ },
526
+ {
527
+ name: 'Standard_A4_v2',
528
+ label: 'Standard_A4_v2',
529
+ cpu: 4,
530
+ memory: 8,
531
+ storage: {
532
+ type: 'SSD',
533
+ count: 8,
534
+ size: 40,
535
+ },
536
+ },
537
+ {
538
+ name: 'Standard_A8m_v2',
539
+ label: 'Standard_A8m_v2',
540
+ cpu: 8,
541
+ memory: 64,
542
+ storage: {
543
+ type: 'SSD',
544
+ count: 16,
545
+ size: 80,
546
+ },
547
+ },
548
+ {
549
+ name: 'Standard_A8_v2',
550
+ label: 'Standard_A8_v2',
551
+ cpu: 8,
552
+ memory: 16,
553
+ storage: {
554
+ type: 'SSD',
555
+ count: 16,
556
+ size: 80,
557
+ },
558
+ },
559
+ ],
560
+ };
561
+
562
+ const DC = {
563
+ type: 'DC-series',
564
+ description: '',
565
+ instanceTypes: [
566
+ {
567
+ name: 'Standard_DC2s',
568
+ label: 'Standard_DC2s',
569
+ cpu: 2,
570
+ memory: 8,
571
+ storage: {
572
+ type: 'SSD',
573
+ count: 2,
574
+ size: 100,
575
+ },
576
+ },
577
+ {
578
+ name: 'Standard_DC4s',
579
+ label: 'Standard_DC4s',
580
+ cpu: 4,
581
+ memory: 16,
582
+ storage: {
583
+ type: 'SSD',
584
+ count: 4,
585
+ size: 200,
586
+ },
587
+ },
588
+ ],
589
+ };
590
+
591
+ const FSV2 = {
592
+ type: 'Fsv2-series',
593
+ description: '',
594
+ instanceTypes: [
595
+ {
596
+ name: 'Standard_F2s_v2',
597
+ label: 'Standard_F2s_v2',
598
+ cpu: 2,
599
+ memory: 4,
600
+ storage: { type: 'SSD', count: 4, size: 16 },
601
+ },
602
+ {
603
+ name: 'Standard_F4s_v2',
604
+ label: 'Standard_F4s_v2',
605
+ cpu: 4,
606
+ memory: 8,
607
+ storage: { type: 'SSD', count: 8, size: 32 },
608
+ },
609
+ {
610
+ name: 'Standard_F8s_v2',
611
+ label: 'Standard_F8s_v2',
612
+ cpu: 8,
613
+ memory: 16,
614
+ storage: { type: 'SSD', count: 16, size: 64 },
615
+ },
616
+ {
617
+ name: 'Standard_F16s_v2',
618
+ label: 'Standard_F16s_v2',
619
+ cpu: 16,
620
+ memory: 32,
621
+ storage: { type: 'SSD', count: 32, size: 128 },
622
+ },
623
+ {
624
+ name: 'Standard_F32s_v2',
625
+ label: 'Standard_F32s_v2',
626
+ cpu: 32,
627
+ memory: 64,
628
+ storage: { type: 'SSD', count: 32, size: 256 },
629
+ },
630
+ {
631
+ name: 'Standard_F64s_v2',
632
+ label: 'Standard_F64s_v2',
633
+ cpu: 64,
634
+ memory: 128,
635
+ storage: { type: 'SSD', count: 32, size: 512 },
636
+ },
637
+ {
638
+ name: 'Standard_F72s_v2',
639
+ label: 'Standard_F72s_v2',
640
+ cpu: 72,
641
+ memory: 144,
642
+ storage: { type: 'SSD', count: 32, size: 576 },
643
+ },
644
+ ],
645
+ };
646
+
647
+ const FS = {
648
+ type: 'Fs-series',
649
+ description: '',
650
+ instanceTypes: [
651
+ {
652
+ name: 'Standard_F1s',
653
+ label: 'Standard_F1s',
654
+ cpu: 1,
655
+ memory: 2,
656
+ storage: { type: 'SSD', count: 4, size: 4 },
657
+ },
658
+ {
659
+ name: 'Standard_F2s',
660
+ label: 'Standard_F2s',
661
+ cpu: 2,
662
+ memory: 4,
663
+ storage: { type: 'SSD', count: 8, size: 8 },
664
+ },
665
+ {
666
+ name: 'Standard_F4s',
667
+ label: 'Standard_F4s',
668
+ cpu: 4,
669
+ memory: 8,
670
+ storage: { type: 'SSD', count: 16, size: 16 },
671
+ },
672
+ {
673
+ name: 'Standard_F8s',
674
+ label: 'Standard_F8s',
675
+ cpu: 8,
676
+ memory: 16,
677
+ storage: { type: 'SSD', count: 32, size: 32 },
678
+ },
679
+ {
680
+ name: 'Standard_F16s',
681
+ label: 'Standard_F16s',
682
+ cpu: 16,
683
+ memory: 32,
684
+ storage: { type: 'SSD', count: 64, size: 64 },
685
+ },
686
+ ],
687
+ };
688
+
689
+ const F = {
690
+ type: 'F-series',
691
+ description: '',
692
+ instanceTypes: [
693
+ {
694
+ name: 'Standard_F1',
695
+ label: 'Standard_F1',
696
+ cpu: 1,
697
+ memory: 2,
698
+ storage: { type: 'SSD', count: 4, size: 16 },
699
+ },
700
+ {
701
+ name: 'Standard_F2',
702
+ label: 'Standard_F2',
703
+ cpu: 2,
704
+ memory: 4,
705
+ storage: { type: 'SSD', count: 8, size: 32 },
706
+ },
707
+ {
708
+ name: 'Standard_F4',
709
+ label: 'Standard_F4',
710
+ cpu: 4,
711
+ memory: 8,
712
+ storage: { type: 'SSD', count: 16, size: 64 },
713
+ },
714
+ {
715
+ name: 'Standard_F8',
716
+ label: 'Standard_F8',
717
+ cpu: 8,
718
+ memory: 16,
719
+ storage: { type: 'SSD', count: 32, size: 128 },
720
+ },
721
+ {
722
+ name: 'Standard_F16',
723
+ label: 'Standard_F16',
724
+ cpu: 16,
725
+ memory: 32,
726
+ storage: { type: 'SSD', count: 64, size: 256 },
727
+ },
728
+ ],
729
+ };
730
+
731
+ const categories = [
732
+ {
733
+ type: 'general',
734
+ label: 'General Purpose',
735
+ description:
736
+ 'Balanced CPU-to-memory ratio. Ideal for testing and development, small to medium databases, and low to medium traffic web servers.',
737
+ families: [B, DSV3, DV3, DSV2, DV2, AV2, DC],
738
+ icon: 'hdd',
739
+ },
740
+ {
741
+ type: 'compute',
742
+ label: 'Compute Optimized',
743
+ description:
744
+ 'High CPU-to-memory ratio. Good for medium traffic web servers, network appliances, batch processes, and application servers.',
745
+ families: [FSV2, FS, F],
746
+ icon: 'hdd',
747
+ },
748
+ {
749
+ type: 'custom',
750
+ label: 'Custom Type',
751
+ description: 'Select the instance type below.',
752
+ families: [],
753
+ icon: 'asterisk',
754
+ },
755
+ ];
756
+
757
+ function calculateStorage(type) {
758
+ if (!type || !type.storage) {
759
+ return 0;
760
+ }
761
+ return type.storage.count * type.storage.size;
762
+ }
763
+
764
+ function buildStats(category) {
765
+ const stats = {
766
+ cpu: {
767
+ min: Number.MAX_VALUE,
768
+ max: -Number.MAX_VALUE,
769
+ },
770
+ memory: {
771
+ min: Number.MAX_VALUE,
772
+ max: -Number.MAX_VALUE,
773
+ },
774
+ storage: {
775
+ min: Number.MAX_VALUE,
776
+ max: -Number.MAX_VALUE,
777
+ },
778
+ families: [],
779
+ };
780
+
781
+ if (category.families && category.families.length) {
782
+ category.families.forEach(function (family) {
783
+ stats.families.push(family.type);
784
+ const cpuMin = _.minBy(family.instanceTypes, 'cpu').cpu || Number.MAX_VALUE;
785
+ const cpuMax = _.maxBy(family.instanceTypes, 'cpu').cpu || -Number.MAX_VALUE;
786
+ const memoryMin = _.minBy(family.instanceTypes, 'memory').memory || Number.MAX_VALUE;
787
+ const memoryMax = _.maxBy(family.instanceTypes, 'memory').memory || -Number.MAX_VALUE;
788
+ const storageMin = calculateStorage(_.minBy(family.instanceTypes, calculateStorage)) || Number.MAX_VALUE;
789
+ const storageMax = calculateStorage(_.maxBy(family.instanceTypes, calculateStorage)) || -Number.MAX_VALUE;
790
+
791
+ stats.cpu.min = Math.min(stats.cpu.min, cpuMin);
792
+ stats.cpu.max = Math.max(stats.cpu.max, cpuMax);
793
+ stats.memory.min = Math.min(stats.memory.min, memoryMin);
794
+ stats.memory.max = Math.max(stats.memory.max, memoryMax);
795
+ stats.storage.min = Math.min(stats.storage.min, storageMin);
796
+ stats.storage.max = Math.max(stats.storage.max, storageMax);
797
+ });
798
+ }
799
+
800
+ return stats;
801
+ }
802
+
803
+ function getCategories() {
804
+ categories.map(function (category) {
805
+ for (const family of category.families) {
806
+ for (const inst of family.instanceTypes) {
807
+ if (inst.costFactor == undefined) inst.costFactor = 0;
808
+ }
809
+ }
810
+ category.stats = buildStats(category);
811
+ });
812
+ return $q.when(categories);
813
+ }
814
+
815
+ const getAllTypesByRegion = function getAllTypesByRegion() {
816
+ return getCategories();
817
+ };
818
+
819
+ function getAvailableTypesForRegions(locationToInstanceTypesMap, selectedLocations) {
820
+ // This function is only ever called with one location.
821
+ const [location] = selectedLocations;
822
+ return locationToInstanceTypesMap[location];
823
+ }
824
+
825
+ return {
826
+ getCategories: getCategories,
827
+ getAvailableTypesForRegions: getAvailableTypesForRegions,
828
+ getAllTypesByRegion: getAllTypesByRegion,
829
+ };
830
+ },
831
+ ]);