fiftyone.geolocation 4.2.1 → 4.3.3

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 (109) hide show
  1. package/.gitmodules +3 -0
  2. package/README.md +2 -2
  3. package/ci/README.md +2 -0
  4. package/ci/build-and-test.yml +34 -0
  5. package/ci/common-ci/.github/labels.yml +59 -0
  6. package/ci/common-ci/.github/workflows/sync-labels.yml +49 -0
  7. package/ci/common-ci/CiTips.md +34 -0
  8. package/ci/common-ci/GitVersion.yml +18 -0
  9. package/ci/common-ci/LICENSE +286 -0
  10. package/ci/common-ci/README.md +365 -0
  11. package/ci/common-ci/build-and-test.yml +65 -0
  12. package/ci/common-ci/check-merge-commit-format.yml +50 -0
  13. package/ci/common-ci/cloud-release-config.json +51 -0
  14. package/ci/common-ci/create-tag.yml +41 -0
  15. package/ci/common-ci/deploy.yml +25 -0
  16. package/ci/common-ci/dotnet/shared-code-signing-steps.yml +20 -0
  17. package/ci/common-ci/dotnet/shared-extract-and-publish-packages.yml +29 -0
  18. package/ci/common-ci/go/shared-go-list-stage.yml +64 -0
  19. package/ci/common-ci/java/readme.md +22 -0
  20. package/ci/common-ci/java/shared-code-signing-steps.yml +17 -0
  21. package/ci/common-ci/node/shared-extract-and-publish-packages.yml +26 -0
  22. package/ci/common-ci/php/readme.md +15 -0
  23. package/ci/common-ci/release-config-schema.json +52 -0
  24. package/ci/common-ci/release-config-template.json +310 -0
  25. package/ci/common-ci/release-config.json +128 -0
  26. package/ci/common-ci/release-process.drawio +165 -0
  27. package/ci/common-ci/release-process.png +0 -0
  28. package/ci/common-ci/scripts/azure/checkSlot.ps1 +28 -0
  29. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.Tests.ps1 +1 -0
  30. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.psm1 +16 -0
  31. package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.Tests.ps1 +3 -0
  32. package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.psm1 +200 -0
  33. package/ci/common-ci/scripts/modules/51DDeployModule/51DDeployModule.psm1 +66 -0
  34. package/ci/common-ci/scripts/modules/51DDownloadDataFileModule/51DDownloadDataFileModule.psm1 +58 -0
  35. package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.Tests.ps1 +25 -0
  36. package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.psm1 +22 -0
  37. package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.Tests.ps1 +1 -0
  38. package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.psm1 +41 -0
  39. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.Tests.ps1 +5 -0
  40. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +698 -0
  41. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.Tests.ps1 +842 -0
  42. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.psm1 +926 -0
  43. package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.Tests.ps1 +1 -0
  44. package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.psm1 +87 -0
  45. package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.Tests.ps1 +194 -0
  46. package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.psm1 +653 -0
  47. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.Tests.ps1 +277 -0
  48. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.psm1 +554 -0
  49. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.Tests.ps1 +1141 -0
  50. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psd1 +0 -0
  51. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psm1 +1465 -0
  52. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.Tests.ps1 +318 -0
  53. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.psm1 +344 -0
  54. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.Tests.ps1 +1186 -0
  55. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.psm1 +900 -0
  56. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/SharedVariables.psm1 +139 -0
  57. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/c-test-env-config.json +268 -0
  58. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-deploy-test-env-config.json +700 -0
  59. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-test-env-config.json +533 -0
  60. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-deploy-test-env-config.json +290 -0
  61. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-test-env-config.json +260 -0
  62. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-deploy-test-env-config.json +511 -0
  63. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-test-env-config.json +388 -0
  64. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-deploy-test-env-config.json +419 -0
  65. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-test-env-config.json +329 -0
  66. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/php-test-env-config.json +540 -0
  67. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-deploy-test-env-config.json +411 -0
  68. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-test-env-config.json +321 -0
  69. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/test-env-config.json +457 -0
  70. package/ci/common-ci/scripts/modules/51DRestModule/51DRestModule.psm1 +38 -0
  71. package/ci/common-ci/scripts/modules/AzurePortalModules/51DApplicationInsightsModule/51DApplicationInsightsModule.psm1 +104 -0
  72. package/ci/common-ci/scripts/modules/AzurePortalModules/51DChecksModule/51DChecksModule.psm1 +68 -0
  73. package/ci/common-ci/scripts/modules/AzurePortalModules/51DCloudModule/51DCloudModule.psm1 +155 -0
  74. package/ci/common-ci/scripts/modules/AzurePortalModules/51DConnectAzureModule/51DConnectAzureModule.psm1 +45 -0
  75. package/ci/common-ci/scripts/modules/AzurePortalModules/51DSSLBindingsModule/51DSSLBIndingsModule.psm1 +100 -0
  76. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStagingSlotModule/51DStagingSlotModule.psm1 +50 -0
  77. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStorageAccountModule/51DStorageAccountModule.psm1 +248 -0
  78. package/ci/common-ci/scripts/modules/AzurePortalModules/51DTrafficManagerModule/51DTrafficManagerModule.psm1 +58 -0
  79. package/ci/common-ci/shared-auto-complete-pr-stage.yml +61 -0
  80. package/ci/common-ci/shared-create-tag-job.yml +23 -0
  81. package/ci/common-ci/shared-docker-build-steps.yml +34 -0
  82. package/ci/common-ci/shared-docker-push-steps.yml +32 -0
  83. package/ci/common-ci/shared-docker-test-http-steps.yml +69 -0
  84. package/ci/common-ci/shared-git-tag-job.yml +38 -0
  85. package/ci/common-ci/shared-git-version-job.yml +71 -0
  86. package/ci/common-ci/shared-publish-github-stage.yml +107 -0
  87. package/ci/common-ci/shared-submodule-trigger-stage.yml +110 -0
  88. package/ci/common-ci/shared-variables.yml +3 -0
  89. package/ci/common-ci/trigger-release-apis.yml +39 -0
  90. package/ci/create-packages.yml +109 -0
  91. package/ci/deploy-external.yml +55 -0
  92. package/ci/deploy-internal.yml +50 -0
  93. package/ci/shared-build-and-test-platforms.yml +26 -0
  94. package/ci/shared-build-and-test-stage.yml +128 -0
  95. package/ci/shared-variables.yml +7 -0
  96. package/ci/submodule-trigger.yml +12 -0
  97. package/docs/Doxyfile +3 -3
  98. package/docs/DoxygenLayout.xml +1 -1
  99. package/examples/examples.test.js +3 -3
  100. package/geoLocationPipelineBuilder.js +16 -13
  101. package/package.json +14 -6
  102. package/setup.js +1 -0
  103. package/tests/geoLocationCloud.test.js +192 -0
  104. package/tsconfig.json +21 -0
  105. package/types/geoLocationCloud.d.ts +7 -0
  106. package/types/geoLocationPipelineBuilder.d.ts +17 -0
  107. package/types/index.d.ts +2 -0
  108. package/build-and-test.yml +0 -112
  109. package/publish-packages.yml +0 -87
@@ -0,0 +1,457 @@
1
+ {
2
+ "name": "APIs Test Environment Configuration",
3
+ "repositories": {
4
+ "javascript": {},
5
+ "device-detection-data": {},
6
+ "common-ci": {
7
+ "tags": [
8
+ "4.3.1"
9
+ ],
10
+ "definitions": [
11
+ {
12
+ "name": "common-ci-test",
13
+ "defaultBranch": "main",
14
+ "yamlFileName": "build-and-test.yml"
15
+ },
16
+ {
17
+ "name": "common-ci-tag-repository",
18
+ "defaultBranch": "main",
19
+ "yamlFileName": "create-tag.yml"
20
+ },
21
+ {
22
+ "name": "common-ci-trigger-release",
23
+ "defaultBranch": "main",
24
+ "yamlFileName": "trigger-release-apis.yml"
25
+ }
26
+ ],
27
+ "policies": [
28
+ {
29
+ "definition": "common-ci-test",
30
+ "type": "Build",
31
+ "refName": "refs/heads/main",
32
+ "matchKind": "Exact"
33
+ }
34
+ ],
35
+ "pullRequests": [
36
+ {
37
+ "source": "feature/complete-pr-dependencies",
38
+ "target": "hotfix/v4.3.2"
39
+ },
40
+ {
41
+ "source": "feature/common-ci-create-tag",
42
+ "target": "hotfix/v4.3.2"
43
+ },
44
+ {
45
+ "source": "feature/release-test-env-creation",
46
+ "target": "hotfix/v4.3.2"
47
+ }
48
+ ]
49
+ },
50
+ "common-cxx": {
51
+ "definitions": [
52
+ {
53
+ "name": "common-cxx-test",
54
+ "defaultBranch": "master",
55
+ "yamlFileName": "ci/build-and-test.yml"
56
+ },
57
+ {
58
+ "name": "common-cxx-tag-repository",
59
+ "defaultBranch": "master",
60
+ "yamlFileName": "ci/create-tag.yml"
61
+ },
62
+ {
63
+ "name": "common-cxx-submodule-trigger",
64
+ "defaultBranch": "hotfix/v4.3.1",
65
+ "yamlFileName": "ci/submodule-trigger.yml",
66
+ "triggers": [
67
+ {
68
+ "definitionName": "common-ci-tag-repository",
69
+ "requiresSuccessfulBuild": true,
70
+ "branchFilters": [
71
+ "+refs/heads/main"
72
+ ],
73
+ "triggerType": "buildCompletion"
74
+ }
75
+ ]
76
+ }
77
+ ],
78
+ "policies": [
79
+ {
80
+ "definition": "common-cxx-test",
81
+ "type": "Build",
82
+ "refName": "refs/heads/master",
83
+ "matchKind": "Exact"
84
+ }
85
+ ],
86
+ "pullRequests": [
87
+ {
88
+ "source": "feature/auto-release",
89
+ "target": "hotfix/v4.3.1"
90
+ }
91
+ ],
92
+ "submodules": [
93
+ "common-ci"
94
+ ]
95
+ },
96
+ "device-detection-cxx": {
97
+ "definitions": [
98
+ {
99
+ "name": "device-detection-cxx-test",
100
+ "defaultBranch": "master",
101
+ "yamlFileName": "ci/build-and-test.yml"
102
+ },
103
+ {
104
+ "name": "device-detection-cxx-tag-repository",
105
+ "defaultBranch": "master",
106
+ "yamlFileName": "ci/create-tag.yml"
107
+ },
108
+ {
109
+ "name": "device-detection-cxx-submodule-trigger",
110
+ "defaultBranch": "hotfix/v4.3.2",
111
+ "yamlFileName": "ci/submodule-trigger.yml",
112
+ "triggers": [
113
+ {
114
+ "definitionName": "common-ci-tag-repository",
115
+ "requiresSuccessfulBuild": true,
116
+ "branchFilters": [
117
+ "+refs/heads/main"
118
+ ],
119
+ "triggerType": "buildCompletion"
120
+ },
121
+ {
122
+ "definitionName": "common-cxx-tag-repository",
123
+ "requiresSuccessfulBuild": true,
124
+ "branchFilters": [
125
+ "+refs/heads/master"
126
+ ],
127
+ "triggerType": "buildCompletion"
128
+ }
129
+ ]
130
+ }
131
+ ],
132
+ "policies": [
133
+ {
134
+ "definition": "device-detection-cxx-test",
135
+ "type": "Build",
136
+ "refName": "refs/heads/master",
137
+ "matchKind": "Exact"
138
+ }
139
+ ],
140
+ "pullRequests": [
141
+ {
142
+ "source": "feature/auto-release",
143
+ "target": "hotfix/v4.3.2"
144
+ }
145
+ ],
146
+ "submodules": [
147
+ "common-ci",
148
+ "common-cxx",
149
+ "device-detection-data"
150
+ ]
151
+ },
152
+ "common-dotnet": {
153
+ "tags": [
154
+ "4.3.0"
155
+ ],
156
+ "definitions": [
157
+ {
158
+ "name": "common-dotnet-test",
159
+ "defaultBranch": "master",
160
+ "yamlFileName": "ci/build-and-test.yml"
161
+ },
162
+ {
163
+ "name": "common-dotnet-create-packages",
164
+ "defaultBranch": "master",
165
+ "yamlFileName": "ci/create-packages.yml"
166
+ },
167
+ {
168
+ "name": "common-dotnet-submodule-trigger",
169
+ "defaultBranch": "hotfix/v4.3.1",
170
+ "yamlFileName": "ci/submodule-trigger.yml",
171
+ "triggers": [
172
+ {
173
+ "definitionName": "common-ci-tag-repository",
174
+ "requiresSuccessfulBuild": true,
175
+ "branchFilters": [
176
+ "+refs/heads/main"
177
+ ],
178
+ "triggerType": "buildCompletion"
179
+ }
180
+ ]
181
+ }
182
+ ],
183
+ "policies": [
184
+ {
185
+ "definition": "common-dotnet-test",
186
+ "type": "Build",
187
+ "refName": "refs/heads/master",
188
+ "matchKind": "Exact"
189
+ }
190
+ ],
191
+ "pullRequests": [
192
+ {
193
+ "source": "feature/auto-release",
194
+ "target": "hotfix/v4.3.1"
195
+ }
196
+ ],
197
+ "submodules": [
198
+ "common-ci"
199
+ ]
200
+ },
201
+ "caching-dotnet": {
202
+ "definitions": [
203
+ {
204
+ "name": "caching-dotnet-test",
205
+ "defaultBranch": "master",
206
+ "yamlFileName": "ci/build-and-test.yml"
207
+ },
208
+ {
209
+ "name": "caching-dotnet-create-packages",
210
+ "defaultBranch": "master",
211
+ "yamlFileName": "ci/create-packages.yml"
212
+ },
213
+ {
214
+ "name": "caching-dotnet-submodule-trigger",
215
+ "defaultBranch": "hotfix/v4.3.1",
216
+ "yamlFileName": "ci/submodule-trigger.yml",
217
+ "triggers": [
218
+ {
219
+ "definitionName": "common-ci-tag-repository",
220
+ "requiresSuccessfulBuild": true,
221
+ "branchFilters": [
222
+ "+refs/heads/main"
223
+ ],
224
+ "triggerType": "buildCompletion"
225
+ }
226
+ ]
227
+ }
228
+ ],
229
+ "policies": [
230
+ {
231
+ "definition": "caching-dotnet-test",
232
+ "type": "Build",
233
+ "refName": "refs/heads/master",
234
+ "matchKind": "Exact"
235
+ }
236
+ ],
237
+ "pullRequests": [
238
+ {
239
+ "source": "feature/auto-release",
240
+ "target": "hotfix/v4.3.1"
241
+ }
242
+ ],
243
+ "submodules": [
244
+ "common-ci"
245
+ ]
246
+ },
247
+ "pipeline-dotnet": {
248
+ "definitions": [
249
+ {
250
+ "name": "pipeline-dotnet-test",
251
+ "defaultBranch": "master",
252
+ "yamlFileName": "ci/build-and-test.yml"
253
+ },
254
+ {
255
+ "name": "pipeline-dotnet-create-packages",
256
+ "defaultBranch": "master",
257
+ "yamlFileName": "ci/create-packages.yml"
258
+ },
259
+ {
260
+ "name": "pipeline-dotnet-submodule-trigger",
261
+ "defaultBranch": "hotfix/v4.3.1",
262
+ "yamlFileName": "ci/submodule-trigger.yml",
263
+ "triggers": [
264
+ {
265
+ "definitionName": "common-ci-tag-repository",
266
+ "requiresSuccessfulBuild": true,
267
+ "branchFilters": [
268
+ "+refs/heads/main"
269
+ ],
270
+ "triggerType": "buildCompletion"
271
+ },
272
+ {
273
+ "definitionName": "common-dotnet-create-packages",
274
+ "requiresSuccessfulBuild": true,
275
+ "branchFilters": [
276
+ "+refs/heads/master"
277
+ ],
278
+ "triggerType": "buildCompletion"
279
+ },
280
+ {
281
+ "definitionName": "caching-dotnet-create-packages",
282
+ "requiresSuccessfulBuild": true,
283
+ "branchFilters": [
284
+ "+refs/heads/master"
285
+ ],
286
+ "triggerType": "buildCompletion"
287
+ }
288
+ ]
289
+ }
290
+ ],
291
+ "policies": [
292
+ {
293
+ "definition": "pipeline-dotnet-test",
294
+ "type": "Build",
295
+ "refName": "refs/heads/master",
296
+ "matchKind": "Exact"
297
+ }
298
+ ],
299
+ "pullRequests": [
300
+ {
301
+ "source": "feature/auto-release",
302
+ "target": "hotfix/v4.3.1"
303
+ }
304
+ ],
305
+ "submodules": [
306
+ "common-ci"
307
+ ]
308
+ },
309
+ "device-detection-dotnet": {
310
+ "definitions": [
311
+ {
312
+ "name": "device-detection-dotnet-test",
313
+ "defaultBranch": "master",
314
+ "yamlFileName": "ci/build-and-test.yml"
315
+ },
316
+ {
317
+ "name": "device-detection-dotnet-create-packages",
318
+ "defaultBranch": "master",
319
+ "yamlFileName": "ci/create-packages.yml"
320
+ },
321
+ {
322
+ "name": "device-detection-dotnet-submodule-trigger",
323
+ "defaultBranch": "hotfix/v4.3.2",
324
+ "yamlFileName": "ci/submodule-trigger.yml",
325
+ "triggers": [
326
+ {
327
+ "definitionName": "common-ci-tag-repository",
328
+ "requiresSuccessfulBuild": true,
329
+ "branchFilters": [
330
+ "+refs/heads/main"
331
+ ],
332
+ "triggerType": "buildCompletion"
333
+ },
334
+ {
335
+ "definitionName": "device-detection-cxx-tag-repository",
336
+ "requiresSuccessfulBuild": true,
337
+ "branchFilters": [
338
+ "+refs/heads/master"
339
+ ],
340
+ "triggerType": "buildCompletion"
341
+ },
342
+ {
343
+ "definitionName": "pipeline-dotnet-create-packages",
344
+ "requiresSuccessfulBuild": true,
345
+ "branchFilters": [
346
+ "+refs/heads/master"
347
+ ],
348
+ "triggerType": "buildCompletion"
349
+ },
350
+ {
351
+ "definitionName": "common-dotnet-create-packages",
352
+ "requiresSuccessfulBuild": true,
353
+ "branchFilters": [
354
+ "+refs/heads/master"
355
+ ],
356
+ "triggerType": "buildCompletion"
357
+ }
358
+ ]
359
+ }
360
+ ],
361
+ "policies": [
362
+ {
363
+ "definition": "device-detection-dotnet-test",
364
+ "type": "Build",
365
+ "refName": "refs/heads/master",
366
+ "matchKind": "Exact"
367
+ }
368
+ ],
369
+ "pullRequests": [
370
+ {
371
+ "source": "feature/auto-release",
372
+ "target": "hotfix/v4.3.2"
373
+ }
374
+ ],
375
+ "submodules": [
376
+ "common-ci",
377
+ "device-detection-cxx",
378
+ "javascript"
379
+ ]
380
+ },
381
+ "location-dotnet": {
382
+ "definitions": [
383
+ {
384
+ "name": "location-dotnet-test",
385
+ "defaultBranch": "master",
386
+ "yamlFileName": "ci/build-and-test.yml"
387
+ },
388
+ {
389
+ "name": "location-dotnet-create-packages",
390
+ "defaultBranch": "master",
391
+ "yamlFileName": "ci/create-packages.yml"
392
+ },
393
+ {
394
+ "name": "location-dotnet-submodule-trigger",
395
+ "defaultBranch": "hotfix/v4.3.2",
396
+ "yamlFileName": "ci/submodule-trigger.yml",
397
+ "triggers": [
398
+ {
399
+ "definitionName": "common-ci-tag-repository",
400
+ "requiresSuccessfulBuild": true,
401
+ "branchFilters": [
402
+ "+refs/heads/main"
403
+ ],
404
+ "triggerType": "buildCompletion"
405
+ },
406
+ {
407
+ "definitionName": "pipeline-dotnet-create-packages",
408
+ "requiresSuccessfulBuild": true,
409
+ "branchFilters": [
410
+ "+refs/heads/master"
411
+ ],
412
+ "triggerType": "buildCompletion"
413
+ },
414
+ {
415
+ "definitionName": "device-detection-dotnet-create-packages",
416
+ "requiresSuccessfulBuild": true,
417
+ "branchFilters": [
418
+ "+refs/heads/master"
419
+ ],
420
+ "triggerType": "buildCompletion"
421
+ },
422
+ {
423
+ "definitionName": "common-dotnet-create-packages",
424
+ "requiresSuccessfulBuild": true,
425
+ "branchFilters": [
426
+ "+refs/heads/master"
427
+ ],
428
+ "triggerType": "buildCompletion"
429
+ }
430
+ ]
431
+ }
432
+ ],
433
+ "policies": [
434
+ {
435
+ "definition": "location-dotnet-test",
436
+ "type": "Build",
437
+ "refName": "refs/heads/master",
438
+ "matchKind": "Exact"
439
+ }
440
+ ],
441
+ "pullRequests": [
442
+ {
443
+ "source": "feature/auto-release",
444
+ "target": "hotfix/v4.3.2"
445
+ }
446
+ ],
447
+ "submodules": [
448
+ "common-ci"
449
+ ]
450
+ }
451
+ },
452
+ "policies": [
453
+ {
454
+ "type": "Required reviewers"
455
+ }
456
+ ]
457
+ }
@@ -0,0 +1,38 @@
1
+ <#
2
+ ===================== Rest =====================
3
+ .Description
4
+ This module contains functions that are related to
5
+ REST requests.
6
+ For more information, please read description of
7
+ each function.
8
+ #>
9
+
10
+ # Global constants for Rest APIs.
11
+ # Maximum retry count if rest api call fail with code between 400 and 599
12
+ $script:maximumRetryCount = 3
13
+ # Interval in seconds between retry if rest api call fail with code between 400 and 599
14
+ $script:retryIntervalSec = 1
15
+
16
+ <#
17
+ .Description
18
+ Get max number of retrys.
19
+
20
+ .Outputs
21
+ Number of retrys.
22
+ #>
23
+ function Get-MaxRetrys {
24
+ return $script:maximumRetryCount
25
+ }
26
+
27
+ <#
28
+ .Description
29
+ Get retry interval in seconds.
30
+
31
+ .Outputs
32
+ Retry interval in seconds.
33
+ #>
34
+ function Get-RetryInterval {
35
+ return $script:retryIntervalSec
36
+ }
37
+
38
+ Export-ModuleMember -Function *
@@ -0,0 +1,104 @@
1
+ <#
2
+ ==================== ApplicationInsights =====================
3
+ .Description
4
+ This module contains a function to add application insights extension to an
5
+ Azure App Service
6
+ #>
7
+
8
+ function Add-ApplicationInsightsExt {
9
+
10
+ param(
11
+ # The web app instance retreived using Get-AzWebApp
12
+ [Parameter(Mandatory=$true)]
13
+ [Object]$Webapp,
14
+
15
+ # The name of the application insights resouce
16
+ [Parameter(Mandatory=$true)]
17
+ [string]$AppInsightsName,
18
+
19
+ # The name of the application insights resource group
20
+ [Parameter(Mandatory=$true)]
21
+ [string]$AppInsightsResourceGroup
22
+ )
23
+
24
+ # Create the site extension needed for Application Insights.
25
+ $resourceNameString = $Webapp.Name + "/Microsoft.ApplicationInsights.AzureWebSites"
26
+ New-AzResource `
27
+ -ResourceType "Microsoft.Web/sites/siteextensions" `
28
+ -ResourceGroupName $Webapp.ResourceGroup `
29
+ -Name $resourceNameString `
30
+ -ApiVersion "2018-02-01" `
31
+ -Force `
32
+ -ErrorAction Stop
33
+
34
+ # Get instrumentation key from ENV application insights resource.
35
+ $appInsightsInstrumentationKey = (Get-AzApplicationInsights `
36
+ -Name $AppInsightsName `
37
+ -ResourceGroupName $AppInsightsResourceGroup).InstrumentationKey
38
+
39
+ # Set the appseting to send telemetry to common applicaiton insights.
40
+ $webAppSettings = $Webapp.SiteConfig.AppSettings
41
+ $hash = @{ }
42
+ Write-Host "Clearing hash table"
43
+ foreach ($setting in $webAppSettings) {
44
+ $hash[$setting.Name] = $setting.Value
45
+ }
46
+
47
+ # Its important to include the syntax around the variable eg. "$($var)"" if not
48
+ # supplied like this it will change the hash table's object type.
49
+ $hash['APPINSIGHTS_INSTRUMENTATIONKEY'] = "$($appInsightsInstrumentationKey)"
50
+
51
+ # Write back app settings into web app.
52
+ Write-Host "Writing back updated appsettings to app service" $Webapp.Name
53
+ Set-AzWebApp `
54
+ -ResourceGroupName $Webapp.ResourceGroup `
55
+ -Name $Webapp.Name `
56
+ -AppSettings $hash `
57
+ -verbose
58
+
59
+ # Restart the web app to link to application insights.
60
+ Restart-AzWebApp `
61
+ -ResourceGroupName $Webapp.ResourceGroup `
62
+ -Name $Webapp.Name
63
+ }
64
+
65
+ # Create a new Application Insights API Key.
66
+ function New-ApplicationInsightsAPIKey {
67
+
68
+ param (
69
+ [Parameter(Mandatory=$true)]
70
+ [string]$ResourceGroup,
71
+
72
+ [Parameter(Mandatory=$true)]
73
+ [string]$AppInsightsName,
74
+
75
+ [Parameter(Mandatory=$true)]
76
+ [string]$Description
77
+
78
+ )
79
+
80
+ # Get the Application Insights resource.
81
+ $appInsights = Get-AzApplicationInsights `
82
+ -ResourceGroupName $ResourceGroup `
83
+ -Name $AppInsightsName `
84
+ -ErrorAction SilentlyContinue
85
+
86
+ $apiKey = ""
87
+
88
+ if(-not $appInsights) {
89
+ Write-Host "No App Insights found, cannot create an API Key."
90
+ } else {
91
+ # Create a app insights API key.
92
+ $permissions = @("AuthenticateSDKControlChannel")
93
+ $apiKey = New-AzApplicationInsightsApiKey `
94
+ -ApplicationInsightsComponent $appInsights `
95
+ -Description "$($Description) - $(Get-Date)" `
96
+ -Permissions $permissions
97
+ }
98
+
99
+ return $apiKey
100
+ }
101
+
102
+ Export-ModuleMember -Function Add-ApplicationInsightsExt
103
+ Export-ModuleMember -Function New-ApplicationInsightsAPIKey
104
+ Export-ModuleMember -Function New-ApplicationInsightsResource
@@ -0,0 +1,68 @@
1
+ <#
2
+ ==================== Checks =====================
3
+ .Description
4
+ This module contains functions to check various aspects of Azure Resources.
5
+ #>
6
+
7
+
8
+ # Check if a service is available by polling an Uri. Returns the status code
9
+ # recevied after a number of retrys. An interval can be specified to wait
10
+ # between retries.
11
+ function Get-UriHTTPStatus {
12
+ param (
13
+ # The URI of the service to test, e.g. https://51degrees.com
14
+ [Parameter(Mandatory=$true)]
15
+ [string]$Uri,
16
+
17
+ # The number of tries before aborting the test.
18
+ [Parameter(Mandatory=$true)]
19
+ [int]$NumberOfTries,
20
+
21
+ # The delay between tries in seconds.
22
+ [Parameter(Mandatory=$true)]
23
+ [int]$SecondsBetweenTries
24
+ )
25
+
26
+ Write-Host -NoNewline "Waiting for response from $Uri"
27
+
28
+ $Tries = 0
29
+ $HTTP_Status = $null
30
+ While ($HTTP_Status -ne 200 -And $Tries -le $NumberOfTries) {
31
+
32
+ # Wait before querying Uri
33
+ Start-Sleep -Seconds $SecondsBetweenTries
34
+
35
+ # Get HTTP status code from invoking a request for the Uri.
36
+ try{
37
+ $HTTP_Status = (Invoke-WebRequest -Uri $Uri -UseBasicParsing -DisableKeepAlive).StatusCode
38
+ }
39
+ catch [Net.WebException]
40
+ {
41
+ # If there is a Web Exception then get the status code
42
+ $HTTP_Status = [int]$_.Exception.Response.StatusCode
43
+ }
44
+ catch [Exception]
45
+ {
46
+ # If there is a general exception then assume a status of null
47
+ # (no response).
48
+ $HTTP_Status = $null
49
+ }
50
+
51
+ $Tries = $Tries +1
52
+ Write-Host -NoNewLine "."
53
+ }
54
+
55
+ Write-Host ""
56
+
57
+ # Return status code if service is not accepting requests else return 0
58
+ if ($HTTP_Status -ne 200 -or $null -eq $HTTP_Status) {
59
+ Write-Host "Service is not accepting requests for Uri '$($Uri)'"
60
+ return $HTTP_Status
61
+ } else {
62
+ Write-Host "Service is responding for Uri '$($Uri)'"
63
+ return 0
64
+ }
65
+
66
+ }
67
+
68
+ Export-ModuleMember -Function Get-UriHTTPStatus