This repository has been archived by the owner on Jul 18, 2019. It is now read-only.
/
services.go
2820 lines (2817 loc) · 355 KB
/
services.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package apis
// Code generated by fetch-apis; DO NOT EDIT
import "github.com/taskcluster/taskcluster-cli/apis/definitions"
var services = map[string]definitions.Service{
"Auth": definitions.Service{
BaseURL: "https://auth.taskcluster.net/v1",
Title: "Authentication API",
Description: "Authentication related API end-points for TaskCluster and related\nservices. These API end-points are of interest if you wish to:\n * Authorize a request signed with TaskCluster credentials,\n * Manage clients and roles,\n * Inspect or audit clients and roles,\n * Gain access to various services guarded by this API.\n\nNote that in this service \"authentication\" refers to validating the\ncorrectness of the supplied credentials (that the caller posesses the\nappropriate access token). This service does not provide any kind of user\nauthentication (identifying a particular person).\n\n### Clients\nThe authentication service manages _clients_, at a high-level each client\nconsists of a `clientId`, an `accessToken`, scopes, and some metadata.\nThe `clientId` and `accessToken` can be used for authentication when\ncalling TaskCluster APIs.\n\nThe client's scopes control the client's access to TaskCluster resources.\nThe scopes are *expanded* by substituting roles, as defined below.\n\n### Roles\nA _role_ consists of a `roleId`, a set of scopes and a description.\nEach role constitutes a simple _expansion rule_ that says if you have\nthe scope: `assume:<roleId>` you get the set of scopes the role has.\nThink of the `assume:<roleId>` as a scope that allows a client to assume\na role.\n\nAs in scopes the `*` kleene star also have special meaning if it is\nlocated at the end of a `roleId`. If you have a role with the following\n`roleId`: `my-prefix*`, then any client which has a scope staring with\n`assume:my-prefix` will be allowed to assume the role.\n\n### Guarded Services\nThe authentication service also has API end-points for delegating access\nto some guarded service such as AWS S3, or Azure Table Storage.\nGenerally, we add API end-points to this server when we wish to use\nTaskCluster credentials to grant access to a third-party service used\nby many TaskCluster components.",
Entries: []definitions.Entry{
definitions.Entry{
Type: "function",
Name: "listClients",
Title: "List Clients",
Description: "Get a list of all clients. With `prefix`, only clients for which\nit is a prefix of the clientId are returned.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/clients/",
Args: []string{},
Query: []string{
"prefix",
},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/list-clients-response.json#",
},
definitions.Entry{
Type: "function",
Name: "client",
Title: "Get Client",
Description: "Get information about a single client.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/clients/<clientId>",
Args: []string{
"clientId",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/get-client-response.json#",
},
definitions.Entry{
Type: "function",
Name: "createClient",
Title: "Create Client",
Description: "Create a new client and get the `accessToken` for this client.\nYou should store the `accessToken` from this API call as there is no\nother way to retrieve it.\n\nIf you loose the `accessToken` you can call `resetAccessToken` to reset\nit, and a new `accessToken` will be returned, but you cannot retrieve the\ncurrent `accessToken`.\n\nIf a client with the same `clientId` already exists this operation will\nfail. Use `updateClient` if you wish to update an existing client.\n\nThe caller's scopes must satisfy `scopes`.",
Scopes: [][]string{
[]string{
"auth:create-client:<clientId>",
},
},
Stability: "stable",
Method: "put",
Route: "/clients/<clientId>",
Args: []string{
"clientId",
},
Query: []string{},
Input: "http://schemas.taskcluster.net/auth/v1/create-client-request.json#",
Output: "http://schemas.taskcluster.net/auth/v1/create-client-response.json#",
},
definitions.Entry{
Type: "function",
Name: "resetAccessToken",
Title: "Reset `accessToken`",
Description: "Reset a clients `accessToken`, this will revoke the existing\n`accessToken`, generate a new `accessToken` and return it from this\ncall.\n\nThere is no way to retrieve an existing `accessToken`, so if you loose it\nyou must reset the accessToken to acquire it again.",
Scopes: [][]string{
[]string{
"auth:reset-access-token:<clientId>",
},
},
Stability: "stable",
Method: "post",
Route: "/clients/<clientId>/reset",
Args: []string{
"clientId",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/create-client-response.json#",
},
definitions.Entry{
Type: "function",
Name: "updateClient",
Title: "Update Client",
Description: "Update an exisiting client. The `clientId` and `accessToken` cannot be\nupdated, but `scopes` can be modified. The caller's scopes must\nsatisfy all scopes being added to the client in the update operation.\nIf no scopes are given in the request, the client's scopes remain\nunchanged",
Scopes: [][]string{
[]string{
"auth:update-client:<clientId>",
},
},
Stability: "stable",
Method: "post",
Route: "/clients/<clientId>",
Args: []string{
"clientId",
},
Query: []string{},
Input: "http://schemas.taskcluster.net/auth/v1/create-client-request.json#",
Output: "http://schemas.taskcluster.net/auth/v1/get-client-response.json#",
},
definitions.Entry{
Type: "function",
Name: "enableClient",
Title: "Enable Client",
Description: "Enable a client that was disabled with `disableClient`. If the client\nis already enabled, this does nothing.\n\nThis is typically used by identity providers to re-enable clients that\nhad been disabled when the corresponding identity's scopes changed.",
Scopes: [][]string{
[]string{
"auth:enable-client:<clientId>",
},
},
Stability: "stable",
Method: "post",
Route: "/clients/<clientId>/enable",
Args: []string{
"clientId",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/get-client-response.json#",
},
definitions.Entry{
Type: "function",
Name: "disableClient",
Title: "Disable Client",
Description: "Disable a client. If the client is already disabled, this does nothing.\n\nThis is typically used by identity providers to disable clients when the\ncorresponding identity's scopes no longer satisfy the client's scopes.",
Scopes: [][]string{
[]string{
"auth:disable-client:<clientId>",
},
},
Stability: "stable",
Method: "post",
Route: "/clients/<clientId>/disable",
Args: []string{
"clientId",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/get-client-response.json#",
},
definitions.Entry{
Type: "function",
Name: "deleteClient",
Title: "Delete Client",
Description: "Delete a client, please note that any roles related to this client must\nbe deleted independently.",
Scopes: [][]string{
[]string{
"auth:delete-client:<clientId>",
},
},
Stability: "stable",
Method: "delete",
Route: "/clients/<clientId>",
Args: []string{
"clientId",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "listRoles",
Title: "List Roles",
Description: "Get a list of all roles, each role object also includes the list of\nscopes it expands to.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/roles/",
Args: []string{},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/list-roles-response.json#",
},
definitions.Entry{
Type: "function",
Name: "role",
Title: "Get Role",
Description: "Get information about a single role, including the set of scopes that the\nrole expands to.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/roles/<roleId>",
Args: []string{
"roleId",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/get-role-response.json#",
},
definitions.Entry{
Type: "function",
Name: "createRole",
Title: "Create Role",
Description: "Create a new role.\n\nThe caller's scopes must satisfy the new role's scopes.\n\nIf there already exists a role with the same `roleId` this operation\nwill fail. Use `updateRole` to modify an existing role.",
Scopes: [][]string{
[]string{
"auth:create-role:<roleId>",
},
},
Stability: "stable",
Method: "put",
Route: "/roles/<roleId>",
Args: []string{
"roleId",
},
Query: []string{},
Input: "http://schemas.taskcluster.net/auth/v1/create-role-request.json#",
Output: "http://schemas.taskcluster.net/auth/v1/get-role-response.json#",
},
definitions.Entry{
Type: "function",
Name: "updateRole",
Title: "Update Role",
Description: "Update an existing role.\n\nThe caller's scopes must satisfy all of the new scopes being added, but\nneed not satisfy all of the client's existing scopes.",
Scopes: [][]string{
[]string{
"auth:update-role:<roleId>",
},
},
Stability: "stable",
Method: "post",
Route: "/roles/<roleId>",
Args: []string{
"roleId",
},
Query: []string{},
Input: "http://schemas.taskcluster.net/auth/v1/create-role-request.json#",
Output: "http://schemas.taskcluster.net/auth/v1/get-role-response.json#",
},
definitions.Entry{
Type: "function",
Name: "deleteRole",
Title: "Delete Role",
Description: "Delete a role. This operation will succeed regardless of whether or not\nthe role exists.",
Scopes: [][]string{
[]string{
"auth:delete-role:<roleId>",
},
},
Stability: "stable",
Method: "delete",
Route: "/roles/<roleId>",
Args: []string{
"roleId",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "expandScopes",
Title: "Expand Scopes",
Description: "Return an expanded copy of the given scopeset, with scopes implied by any\nroles included.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/scopes/expand",
Args: []string{},
Query: []string{},
Input: "http://schemas.taskcluster.net/auth/v1/scopeset.json#",
Output: "http://schemas.taskcluster.net/auth/v1/scopeset.json#",
},
definitions.Entry{
Type: "function",
Name: "currentScopes",
Title: "Get Current Scopes",
Description: "Return the expanded scopes available in the request, taking into account all sources\nof scopes and scope restrictions (temporary credentials, assumeScopes, client scopes,\nand roles).",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/scopes/current",
Args: []string{},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/scopeset.json#",
},
definitions.Entry{
Type: "function",
Name: "awsS3Credentials",
Title: "Get Temporary Read/Write Credentials S3",
Description: "Get temporary AWS credentials for `read-write` or `read-only` access to\na given `bucket` and `prefix` within that bucket.\nThe `level` parameter can be `read-write` or `read-only` and determines\nwhich type of credentials are returned. Please note that the `level`\nparameter is required in the scope guarding access. The bucket name must\nnot contain `.`, as recommended by Amazon.\n\nThis method can only allow access to a whitelisted set of buckets. To add\na bucket to that whitelist, contact the TaskCluster team, who will add it to\nthe appropriate IAM policy. If the bucket is in a different AWS account, you\nwill also need to add a bucket policy allowing access from the TaskCluster\naccount. That policy should look like this:\n\n```js\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"allow-taskcluster-auth-to-delegate-access\",\n \"Effect\": \"Allow\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::692406183521:root\"\n },\n \"Action\": [\n \"s3:ListBucket\",\n \"s3:GetObject\",\n \"s3:PutObject\",\n \"s3:DeleteObject\",\n \"s3:GetBucketLocation\"\n ],\n \"Resource\": [\n \"arn:aws:s3:::<bucket>\",\n \"arn:aws:s3:::<bucket>/*\"\n ]\n }\n ]\n}\n```\n\nThe credentials are set to expire after an hour, but this behavior is\nsubject to change. Hence, you should always read the `expires` property\nfrom the response, if you intend to maintain active credentials in your\napplication.\n\nPlease note that your `prefix` may not start with slash `/`. Such a prefix\nis allowed on S3, but we forbid it here to discourage bad behavior.\n\nAlso note that if your `prefix` doesn't end in a slash `/`, the STS\ncredentials may allow access to unexpected keys, as S3 does not treat\nslashes specially. For example, a prefix of `my-folder` will allow\naccess to `my-folder/file.txt` as expected, but also to `my-folder.txt`,\nwhich may not be intended.\n\nFinally, note that the `PutObjectAcl` call is not allowed. Passing a canned\nACL other than `private` to `PutObject` is treated as a `PutObjectAcl` call, and\nwill result in an access-denied error from AWS. This limitation is due to a\nsecurity flaw in Amazon S3 which might otherwise allow indefinite access to\nuploaded objects.\n\n**EC2 metadata compatibility**, if the querystring parameter\n`?format=iam-role-compat` is given, the response will be compatible\nwith the JSON exposed by the EC2 metadata service. This aims to ease\ncompatibility for libraries and tools built to auto-refresh credentials.\nFor details on the format returned by EC2 metadata service see:\n[EC2 User Guide](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#instance-metadata-security-credentials).",
Scopes: [][]string{
[]string{
"auth:aws-s3:<level>:<bucket>/<prefix>",
},
},
Stability: "stable",
Method: "get",
Route: "/aws/s3/<level>/<bucket>/<prefix>",
Args: []string{
"level",
"bucket",
"prefix",
},
Query: []string{
"format",
},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/aws-s3-credentials-response.json#",
},
definitions.Entry{
Type: "function",
Name: "azureAccounts",
Title: "List Accounts Managed by Auth",
Description: "Retrieve a list of all Azure accounts managed by Taskcluster Auth.",
Scopes: [][]string{
[]string{
"auth:azure-table:list-accounts",
},
},
Stability: "stable",
Method: "get",
Route: "/azure/accounts",
Args: []string{},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/azure-account-list-response.json#",
},
definitions.Entry{
Type: "function",
Name: "azureTables",
Title: "List Tables in an Account Managed by Auth",
Description: "Retrieve a list of all tables in an account.",
Scopes: [][]string{
[]string{
"auth:azure-table:list-tables:<account>",
},
},
Stability: "stable",
Method: "get",
Route: "/azure/<account>/tables",
Args: []string{
"account",
},
Query: []string{
"continuationToken",
},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/azure-table-list-response.json#",
},
definitions.Entry{
Type: "function",
Name: "azureTableSAS",
Title: "Get Shared-Access-Signature for Azure Table",
Description: "Get a shared access signature (SAS) string for use with a specific Azure\nTable Storage table.\n\nThe `level` parameter can be `read-write` or `read-only` and determines\nwhich type of credentials are returned. If level is read-write, it will create the\ntable if it doesn't already exist.",
Scopes: [][]string{
[]string{
"auth:azure-table:<level>:<account>/<table>",
},
},
Stability: "stable",
Method: "get",
Route: "/azure/<account>/table/<table>/<level>",
Args: []string{
"account",
"table",
"level",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/azure-table-access-response.json#",
},
definitions.Entry{
Type: "function",
Name: "azureBlobSAS",
Title: "Get Shared-Access-Signature for Azure Blob",
Description: "Get a shared access signature (SAS) string for use with a specific Azure\nBlob Storage container.\n\nThe `level` parameter can be `read-write` or `read-only` and determines\nwhich type of credentials are returned. If level is read-write, it will create the\ncontainer if it doesn't already exist.",
Scopes: [][]string{
[]string{
"auth:azure-blob:<level>:<account>/<container>",
},
},
Stability: "stable",
Method: "get",
Route: "/azure/<account>/containers/<container>/<level>",
Args: []string{
"account",
"container",
"level",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/azure-blob-response.json#",
},
definitions.Entry{
Type: "function",
Name: "sentryDSN",
Title: "Get DSN for Sentry Project",
Description: "Get temporary DSN (access credentials) for a sentry project.\nThe credentials returned can be used with any Sentry client for up to\n24 hours, after which the credentials will be automatically disabled.\n\nIf the project doesn't exist it will be created, and assigned to the\ninitial team configured for this component. Contact a Sentry admin\nto have the project transferred to a team you have access to if needed",
Scopes: [][]string{
[]string{
"auth:sentry:<project>",
},
},
Stability: "stable",
Method: "get",
Route: "/sentry/<project>/dsn",
Args: []string{
"project",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/sentry-dsn-response.json#",
},
definitions.Entry{
Type: "function",
Name: "statsumToken",
Title: "Get Token for Statsum Project",
Description: "Get temporary `token` and `baseUrl` for sending metrics to statsum.\n\nThe token is valid for 24 hours, clients should refresh after expiration.",
Scopes: [][]string{
[]string{
"auth:statsum:<project>",
},
},
Stability: "stable",
Method: "get",
Route: "/statsum/<project>/token",
Args: []string{
"project",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/statsum-token-response.json#",
},
definitions.Entry{
Type: "function",
Name: "authenticateHawk",
Title: "Authenticate Hawk Request",
Description: "Validate the request signature given on input and return list of scopes\nthat the authenticating client has.\n\nThis method is used by other services that wish rely on TaskCluster\ncredentials for authentication. This way we can use Hawk without having\nthe secret credentials leave this service.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "post",
Route: "/authenticate-hawk",
Args: []string{},
Query: []string{},
Input: "http://schemas.taskcluster.net/auth/v1/authenticate-hawk-request.json#",
Output: "http://schemas.taskcluster.net/auth/v1/authenticate-hawk-response.json#",
},
definitions.Entry{
Type: "function",
Name: "testAuthenticate",
Title: "Test Authentication",
Description: "Utility method to test client implementations of TaskCluster\nauthentication.\n\nRather than using real credentials, this endpoint accepts requests with\nclientId `tester` and accessToken `no-secret`. That client's scopes are\nbased on `clientScopes` in the request body.\n\nThe request is validated, with any certificate, authorizedScopes, etc.\napplied, and the resulting scopes are checked against `requiredScopes`\nfrom the request body. On success, the response contains the clientId\nand scopes as seen by the API method.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "post",
Route: "/test-authenticate",
Args: []string{},
Query: []string{},
Input: "http://schemas.taskcluster.net/auth/v1/test-authenticate-request.json#",
Output: "http://schemas.taskcluster.net/auth/v1/test-authenticate-response.json#",
},
definitions.Entry{
Type: "function",
Name: "testAuthenticateGet",
Title: "Test Authentication (GET)",
Description: "Utility method similar to `testAuthenticate`, but with the GET method,\nso it can be used with signed URLs (bewits).\n\nRather than using real credentials, this endpoint accepts requests with\nclientId `tester` and accessToken `no-secret`. That client's scopes are\n`['test:*', 'auth:create-client:test:*']`. The call fails if the \n`test:authenticate-get` scope is not available.\n\nThe request is validated, with any certificate, authorizedScopes, etc.\napplied, and the resulting scopes are checked, just like any API call.\nOn success, the response contains the clientId and scopes as seen by\nthe API method.\n\nThis method may later be extended to allow specification of client and\nrequired scopes via query arguments.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/test-authenticate-get/",
Args: []string{},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/auth/v1/test-authenticate-response.json#",
},
definitions.Entry{
Type: "function",
Name: "ping",
Title: "Ping Server",
Description: "Respond without doing anything.\nThis endpoint is used to check that the service is up.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/ping",
Args: []string{},
Query: []string{},
Input: "",
Output: "",
},
},
},
"AuthEvents": definitions.Service{
BaseURL: "",
Title: "Auth Pulse Exchanges",
Description: "The auth service, typically available at `auth.taskcluster.net`\nis responsible for storing credentials, managing assignment of scopes,\nand validation of request signatures from other services.\n\nThese exchanges provides notifications when credentials or roles are\nupdated. This is mostly so that multiple instances of the auth service\ncan purge their caches and synchronize state. But you are of course\nwelcome to use these for other purposes, monitoring changes for example.",
Entries: []definitions.Entry{
definitions.Entry{
Type: "topic-exchange",
Name: "clientCreated",
Title: "Client Created Messages",
Description: "Message that a new client has been created.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
definitions.Entry{
Type: "topic-exchange",
Name: "clientUpdated",
Title: "Client Updated Messages",
Description: "Message that a new client has been updated.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
definitions.Entry{
Type: "topic-exchange",
Name: "clientDeleted",
Title: "Client Deleted Messages",
Description: "Message that a new client has been deleted.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
definitions.Entry{
Type: "topic-exchange",
Name: "roleCreated",
Title: "Role Created Messages",
Description: "Message that a new role has been created.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
definitions.Entry{
Type: "topic-exchange",
Name: "roleUpdated",
Title: "Role Updated Messages",
Description: "Message that a new role has been updated.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
definitions.Entry{
Type: "topic-exchange",
Name: "roleDeleted",
Title: "Role Deleted Messages",
Description: "Message that a new role has been deleted.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
},
},
"AwsProvisioner": definitions.Service{
BaseURL: "https://aws-provisioner.taskcluster.net/v1",
Title: "AWS Provisioner API Documentation",
Description: "The AWS Provisioner is responsible for provisioning instances on EC2 for use in\nTaskCluster. The provisioner maintains a set of worker configurations which\ncan be managed with an API that is typically available at\naws-provisioner.taskcluster.net/v1. This API can also perform basic instance\nmanagement tasks in addition to maintaining the internal state of worker type\nconfiguration information.\n\nThe Provisioner runs at a configurable interval. Each iteration of the\nprovisioner fetches a current copy the state that the AWS EC2 api reports. In\neach iteration, we ask the Queue how many tasks are pending for that worker\ntype. Based on the number of tasks pending and the scaling ratio, we may\nsubmit requests for new instances. We use pricing information, capacity and\nutility factor information to decide which instance type in which region would\nbe the optimal configuration.\n\nEach EC2 instance type will declare a capacity and utility factor. Capacity is\nthe number of tasks that a given machine is capable of running concurrently.\nUtility factor is a relative measure of performance between two instance types.\nWe multiply the utility factor by the spot price to compare instance types and\nregions when making the bidding choices.\n\nWhen a new EC2 instance is instantiated, its user data contains a token in\n`securityToken` that can be used with the `getSecret` method to retrieve\nthe worker's credentials and any needed passwords or other restricted\ninformation. The worker is responsible for deleting the secret after\nretrieving it, to prevent dissemination of the secret to other proceses\nwhich can read the instance user data.\n",
Entries: []definitions.Entry{
definitions.Entry{
Type: "function",
Name: "listWorkerTypeSummaries",
Title: "List worker types with details",
Description: "Return a list of worker types, including some summary information about\ncurrent capacity for each. While this list includes all defined worker types,\nthere may be running EC2 instances for deleted worker types that are not\nincluded here. The list is unordered.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/list-worker-type-summaries",
Args: []string{},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/list-worker-types-summaries-response.json#",
},
definitions.Entry{
Type: "function",
Name: "createWorkerType",
Title: "Create new Worker Type",
Description: "Create a worker type. A worker type contains all the configuration\nneeded for the provisioner to manage the instances. Each worker type\nknows which regions and which instance types are allowed for that\nworker type. Remember that Capacity is the number of concurrent tasks\nthat can be run on a given EC2 resource and that Utility is the relative\nperformance rate between different instance types. There is no way to\nconfigure different regions to have different sets of instance types\nso ensure that all instance types are available in all regions.\nThis function is idempotent.\n\nOnce a worker type is in the provisioner, a back ground process will\nbegin creating instances for it based on its capacity bounds and its\npending task count from the Queue. It is the worker's responsibility\nto shut itself down. The provisioner has a limit (currently 96hours)\nfor all instances to prevent zombie instances from running indefinitely.\n\nThe provisioner will ensure that all instances created are tagged with\naws resource tags containing the provisioner id and the worker type.\n\nIf provided, the secrets in the global, region and instance type sections\nare available using the secrets api. If specified, the scopes provided\nwill be used to generate a set of temporary credentials available with\nthe other secrets.",
Scopes: [][]string{
[]string{
"aws-provisioner:manage-worker-type:<workerType>",
},
},
Stability: "stable",
Method: "put",
Route: "/worker-type/<workerType>",
Args: []string{
"workerType",
},
Query: []string{},
Input: "http://schemas.taskcluster.net/aws-provisioner/v1/create-worker-type-request.json#",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/get-worker-type-response.json#",
},
definitions.Entry{
Type: "function",
Name: "updateWorkerType",
Title: "Update Worker Type",
Description: "Provide a new copy of a worker type to replace the existing one.\nThis will overwrite the existing worker type definition if there\nis already a worker type of that name. This method will return a\n200 response along with a copy of the worker type definition created\nNote that if you are using the result of a GET on the worker-type\nend point that you will need to delete the lastModified and workerType\nkeys from the object returned, since those fields are not allowed\nthe request body for this method\n\nOtherwise, all input requirements and actions are the same as the\ncreate method.",
Scopes: [][]string{
[]string{
"aws-provisioner:manage-worker-type:<workerType>",
},
},
Stability: "stable",
Method: "post",
Route: "/worker-type/<workerType>/update",
Args: []string{
"workerType",
},
Query: []string{},
Input: "http://schemas.taskcluster.net/aws-provisioner/v1/create-worker-type-request.json#",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/get-worker-type-response.json#",
},
definitions.Entry{
Type: "function",
Name: "workerTypeLastModified",
Title: "Get Worker Type Last Modified Time",
Description: "This method is provided to allow workers to see when they were\nlast modified. The value provided through UserData can be\ncompared against this value to see if changes have been made\nIf the worker type definition has not been changed, the date\nshould be identical as it is the same stored value.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/worker-type-last-modified/<workerType>",
Args: []string{
"workerType",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/get-worker-type-last-modified.json#",
},
definitions.Entry{
Type: "function",
Name: "workerType",
Title: "Get Worker Type",
Description: "Retrieve a copy of the requested worker type definition.\nThis copy contains a lastModified field as well as the worker\ntype name. As such, it will require manipulation to be able to\nuse the results of this method to submit date to the update\nmethod.",
Scopes: [][]string{
[]string{
"aws-provisioner:view-worker-type:<workerType>",
},
[]string{
"aws-provisioner:manage-worker-type:<workerType>",
},
},
Stability: "stable",
Method: "get",
Route: "/worker-type/<workerType>",
Args: []string{
"workerType",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/get-worker-type-response.json#",
},
definitions.Entry{
Type: "function",
Name: "removeWorkerType",
Title: "Delete Worker Type",
Description: "Delete a worker type definition. This method will only delete\nthe worker type definition from the storage table. The actual\ndeletion will be handled by a background worker. As soon as this\nmethod is called for a worker type, the background worker will\nimmediately submit requests to cancel all spot requests for this\nworker type as well as killing all instances regardless of their\nstate. If you want to gracefully remove a worker type, you must\neither ensure that no tasks are created with that worker type name\nor you could theoretically set maxCapacity to 0, though, this is\nnot a supported or tested action",
Scopes: [][]string{
[]string{
"aws-provisioner:manage-worker-type:<workerType>",
},
},
Stability: "stable",
Method: "delete",
Route: "/worker-type/<workerType>",
Args: []string{
"workerType",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "listWorkerTypes",
Title: "List Worker Types",
Description: "Return a list of string worker type names. These are the names\nof all managed worker types known to the provisioner. This does\nnot include worker types which are left overs from a deleted worker\ntype definition but are still running in AWS.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/list-worker-types",
Args: []string{},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/list-worker-types-response.json#",
},
definitions.Entry{
Type: "function",
Name: "createSecret",
Title: "Create new Secret",
Description: "Insert a secret into the secret storage. The supplied secrets will\nbe provided verbatime via `getSecret`, while the supplied scopes will\nbe converted into credentials by `getSecret`.\n\nThis method is not ordinarily used in production; instead, the provisioner\ncreates a new secret directly for each spot bid.",
Scopes: [][]string{
[]string{
"aws-provisioner:create-secret",
},
},
Stability: "stable",
Method: "put",
Route: "/secret/<token>",
Args: []string{
"token",
},
Query: []string{},
Input: "http://schemas.taskcluster.net/aws-provisioner/v1/create-secret-request.json#",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "getSecret",
Title: "Get a Secret",
Description: "Retrieve a secret from storage. The result contains any passwords or\nother restricted information verbatim as well as a temporary credential\nbased on the scopes specified when the secret was created.\n\nIt is important that this secret is deleted by the consumer (`removeSecret`),\nor else the secrets will be visible to any process which can access the\nuser data associated with the instance.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/secret/<token>",
Args: []string{
"token",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/get-secret-response.json#",
},
definitions.Entry{
Type: "function",
Name: "instanceStarted",
Title: "Report an instance starting",
Description: "An instance will report in by giving its instance id as well\nas its security token. The token is given and checked to ensure\nthat it matches a real token that exists to ensure that random\nmachines do not check in. We could generate a different token\nbut that seems like overkill",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/instance-started/<instanceId>/<token>",
Args: []string{
"instanceId",
"token",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "removeSecret",
Title: "Remove a Secret",
Description: "Remove a secret. After this call, a call to `getSecret` with the given\ntoken will return no information.\n\nIt is very important that the consumer of a \nsecret delete the secret from storage before handing over control\nto untrusted processes to prevent credential and/or secret leakage.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "delete",
Route: "/secret/<token>",
Args: []string{
"token",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "getLaunchSpecs",
Title: "Get All Launch Specifications for WorkerType",
Description: "This method returns a preview of all possible launch specifications\nthat this worker type definition could submit to EC2. It is used to\ntest worker types, nothing more\n\n**This API end-point is experimental and may be subject to change without warning.**",
Scopes: [][]string{
[]string{
"aws-provisioner:view-worker-type:<workerType>",
},
[]string{
"aws-provisioner:manage-worker-type:<workerType>",
},
},
Stability: "experimental",
Method: "get",
Route: "/worker-type/<workerType>/launch-specifications",
Args: []string{
"workerType",
},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/get-launch-specs-response.json#",
},
definitions.Entry{
Type: "function",
Name: "state",
Title: "Get AWS State for a worker type",
Description: "Return the state of a given workertype as stored by the provisioner. \nThis state is stored as three lists: 1 for running instances, 1 for\npending requests. The `summary` property contains an updated summary\nsimilar to that returned from `listWorkerTypeSummaries`.",
Scopes: [][]string{
[]string{
"aws-provisioner:view-worker-type:<workerType>",
},
[]string{
"aws-provisioner:manage-worker-type:<workerType>",
},
},
Stability: "stable",
Method: "get",
Route: "/state/<workerType>",
Args: []string{
"workerType",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "newState",
Title: "Get AWS State for a worker type",
Description: "Return the state of a given workertype as stored by the provisioner. \nThis state is stored as three lists: 1 for running instances, 1 for\npending requests. The `summary` property contains an updated summary\nsimilar to that returned from `listWorkerTypeSummaries`.",
Scopes: [][]string{
[]string{
"aws-provisioner:view-worker-type:<workerType>",
},
[]string{
"aws-provisioner:manage-worker-type:<workerType>",
},
},
Stability: "stable",
Method: "get",
Route: "/new-state/<workerType>",
Args: []string{
"workerType",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "backendStatus",
Title: "Backend Status",
Description: "This endpoint is used to show when the last time the provisioner\nhas checked in. A check in is done through the deadman's snitch\napi. It is done at the conclusion of a provisioning iteration\nand used to tell if the background provisioning process is still\nrunning.\n\n**Warning** this api end-point is **not stable**.",
Scopes: [][]string(nil),
Stability: "experimental",
Method: "get",
Route: "/backend-status",
Args: []string{},
Query: []string{},
Input: "",
Output: "http://schemas.taskcluster.net/aws-provisioner/v1/backend-status-response.json#",
},
definitions.Entry{
Type: "function",
Name: "terminateAllInstancesOfWorkerType",
Title: "Shutdown Every Ec2 Instance of this Worker Type",
Description: "WARNING: YOU ALMOST CERTAINLY DO NOT WANT TO USE THIS \nShut down every single EC2 instance associated with this workerType. \nThis means every single last one. You probably don't want to use \nthis method, which is why it has an obnoxious name. Don't even try \nto claim you didn't know what this method does!\n\n**This API end-point is experimental and may be subject to change without warning.**",
Scopes: [][]string{
[]string{
"aws-provisioner:terminate-all-worker-type:<workerType>",
},
},
Stability: "experimental",
Method: "post",
Route: "/worker-type/<workerType>/terminate-all-instances",
Args: []string{
"workerType",
},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "shutdownEverySingleEc2InstanceManagedByThisProvisioner",
Title: "Shutdown Every Single Ec2 Instance Managed By This Provisioner",
Description: "WARNING: YOU ALMOST CERTAINLY DO NOT WANT TO USE THIS \nShut down every single EC2 instance managed by this provisioner. \nThis means every single last one. You probably don't want to use \nthis method, which is why it has an obnoxious name. Don't even try \nto claim you didn't know what this method does!\n\n**This API end-point is experimental and may be subject to change without warning.**",
Scopes: [][]string{
[]string{
"aws-provisioner:terminate-all-worker-type:*",
},
},
Stability: "experimental",
Method: "post",
Route: "/shutdown/every/single/ec2/instance/managed/by/this/provisioner",
Args: []string{},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "ping",
Title: "Ping Server",
Description: "Respond without doing anything.\nThis endpoint is used to check that the service is up.",
Scopes: [][]string(nil),
Stability: "stable",
Method: "get",
Route: "/ping",
Args: []string{},
Query: []string{},
Input: "",
Output: "",
},
},
},
"AwsProvisionerEvents": definitions.Service{
BaseURL: "",
Title: "AWS Provisioner Pulse Exchanges",
Description: "Exchanges from the provisioner... more docs later",
Entries: []definitions.Entry{
definitions.Entry{
Type: "topic-exchange",
Name: "workerTypeCreated",
Title: "WorkerType Created Message",
Description: "When a new `workerType` is created a message will be published to this\nexchange.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
definitions.Entry{
Type: "topic-exchange",
Name: "workerTypeUpdated",
Title: "WorkerType Updated Message",
Description: "When a `workerType` is updated a message will be published to this\nexchange.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
definitions.Entry{
Type: "topic-exchange",
Name: "workerTypeRemoved",
Title: "WorkerType Removed Message",
Description: "When a `workerType` is removed a message will be published to this\nexchange.",
Scopes: [][]string(nil),
Stability: "",
Method: "",
Route: "",
Args: []string(nil),
Query: []string(nil),
Input: "",
Output: "",
},
},
},
"Github": definitions.Service{
BaseURL: "https://github.taskcluster.net/v1",
Title: "TaskCluster GitHub API Documentation",
Description: "The github service, typically available at\n`github.taskcluster.net`, is responsible for publishing pulse\nmessages in response to GitHub events.\n\nThis document describes the API end-point for consuming GitHub\nweb hooks",
Entries: []definitions.Entry{
definitions.Entry{
Type: "function",
Name: "githubWebHookConsumer",
Title: "Consume GitHub WebHook",
Description: "Capture a GitHub event and publish it via pulse, if it's a push,\nrelease or pull request.",
Scopes: [][]string(nil),
Stability: "experimental",
Method: "post",
Route: "/github",
Args: []string{},
Query: []string{},
Input: "",
Output: "",
},
definitions.Entry{
Type: "function",
Name: "builds",
Title: "List of Builds",
Description: "A paginated list of builds that have been run in\nTaskcluster. Can be filtered on various git-specific\nfields.",
Scopes: [][]string(nil),
Stability: "experimental",
Method: "get",
Route: "/builds",
Args: []string{},
Query: []string{
"continuationToken",
"limit",
"organization",
"repository",