@taskcluster/client-web 88.0.1

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.
@@ -0,0 +1,129 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+
3
+ import Client from '../Client';
4
+
5
+ export default class QueueEvents extends Client {
6
+ constructor(options = {}) {
7
+ super({
8
+ serviceName: 'queue',
9
+ serviceVersion: 'v1',
10
+ exchangePrefix: 'exchange/taskcluster-queue/v1/',
11
+ ...options,
12
+ });
13
+ }
14
+ /* eslint-disable max-len */
15
+ // When a task is created or just defined a message is posted to this
16
+ // exchange.
17
+ // This message exchange is mainly useful when tasks are created with dependencies
18
+ // on incomplete tasks, as this does not make the task
19
+ // `pending`. Thus, no `taskPending` message is published.
20
+ /* eslint-enable max-len */
21
+ taskDefined(pattern) {
22
+ const entry = {"exchange":"task-defined","name":"taskDefined","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskId","required":true},{"multipleWords":false,"name":"runId","required":false},{"multipleWords":false,"name":"workerGroup","required":false},{"multipleWords":false,"name":"workerId","required":false},{"multipleWords":false,"name":"provisionerId","required":true},{"multipleWords":false,"name":"workerType","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-defined-message.json#","type":"topic-exchange"}; // eslint-disable-line
23
+
24
+ return this.normalizePattern(entry, pattern);
25
+ }
26
+ /* eslint-disable max-len */
27
+ // When a task becomes `pending` a message is posted to this exchange.
28
+ // This is useful for workers who doesn't want to constantly poll the queue
29
+ // for new tasks. The queue will also be authority for task states and
30
+ // claims. But using this exchange workers should be able to distribute work
31
+ // efficiently and they would be able to reduce their polling interval
32
+ // significantly without affecting general responsiveness.
33
+ /* eslint-enable max-len */
34
+ taskPending(pattern) {
35
+ const entry = {"exchange":"task-pending","name":"taskPending","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskId","required":true},{"multipleWords":false,"name":"runId","required":true},{"multipleWords":false,"name":"workerGroup","required":false},{"multipleWords":false,"name":"workerId","required":false},{"multipleWords":false,"name":"provisionerId","required":true},{"multipleWords":false,"name":"workerType","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-pending-message.json#","type":"topic-exchange"}; // eslint-disable-line
36
+
37
+ return this.normalizePattern(entry, pattern);
38
+ }
39
+ /* eslint-disable max-len */
40
+ // Whenever a task is claimed by a worker, a run is started on the worker,
41
+ // and a message is posted on this exchange.
42
+ /* eslint-enable max-len */
43
+ taskRunning(pattern) {
44
+ const entry = {"exchange":"task-running","name":"taskRunning","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskId","required":true},{"multipleWords":false,"name":"runId","required":true},{"multipleWords":false,"name":"workerGroup","required":true},{"multipleWords":false,"name":"workerId","required":true},{"multipleWords":false,"name":"provisionerId","required":true},{"multipleWords":false,"name":"workerType","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-running-message.json#","type":"topic-exchange"}; // eslint-disable-line
45
+
46
+ return this.normalizePattern(entry, pattern);
47
+ }
48
+ /* eslint-disable max-len */
49
+ // Whenever the `createArtifact` end-point is called, the queue will create
50
+ // a record of the artifact and post a message on this exchange. All of this
51
+ // happens before the queue returns a signed URL for the caller to upload
52
+ // the actual artifact with (pending on `storageType`).
53
+ // This means that the actual artifact is rarely available when this message
54
+ // is posted. But it is not unreasonable to assume that the artifact will
55
+ // will become available at some point later. Most signatures will expire in
56
+ // 30 minutes or so, forcing the uploader to call `createArtifact` with
57
+ // the same payload again in-order to continue uploading the artifact.
58
+ // However, in most cases (especially for small artifacts) it's very
59
+ // reasonable assume the artifact will be available within a few minutes.
60
+ // This property means that this exchange is mostly useful for tools
61
+ // monitoring task evaluation. One could also use it count number of
62
+ // artifacts per task, or _index_ artifacts though in most cases it'll be
63
+ // smarter to index artifacts after the task in question have completed
64
+ // successfully.
65
+ // *NOTE*: this message is currently only sent for reference and error
66
+ // artifacts. This will be remedied in a future version of Taskcluster.
67
+ /* eslint-enable max-len */
68
+ artifactCreated(pattern) {
69
+ const entry = {"exchange":"artifact-created","name":"artifactCreated","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskId","required":true},{"multipleWords":false,"name":"runId","required":true},{"multipleWords":false,"name":"workerGroup","required":true},{"multipleWords":false,"name":"workerId","required":true},{"multipleWords":false,"name":"provisionerId","required":true},{"multipleWords":false,"name":"workerType","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/artifact-created-message.json#","type":"topic-exchange"}; // eslint-disable-line
70
+
71
+ return this.normalizePattern(entry, pattern);
72
+ }
73
+ /* eslint-disable max-len */
74
+ // When a task is successfully completed by a worker a message is posted
75
+ // this exchange.
76
+ // This message is routed using the `runId`, `workerGroup` and `workerId`
77
+ // that completed the task. But information about additional runs is also
78
+ // available from the task status structure.
79
+ /* eslint-enable max-len */
80
+ taskCompleted(pattern) {
81
+ const entry = {"exchange":"task-completed","name":"taskCompleted","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskId","required":true},{"multipleWords":false,"name":"runId","required":true},{"multipleWords":false,"name":"workerGroup","required":true},{"multipleWords":false,"name":"workerId","required":true},{"multipleWords":false,"name":"provisionerId","required":true},{"multipleWords":false,"name":"workerType","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-completed-message.json#","type":"topic-exchange"}; // eslint-disable-line
82
+
83
+ return this.normalizePattern(entry, pattern);
84
+ }
85
+ /* eslint-disable max-len */
86
+ // When a task ran, but failed to complete successfully a message is posted
87
+ // to this exchange. This is same as worker ran task-specific code, but the
88
+ // task specific code exited non-zero.
89
+ /* eslint-enable max-len */
90
+ taskFailed(pattern) {
91
+ const entry = {"exchange":"task-failed","name":"taskFailed","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskId","required":true},{"multipleWords":false,"name":"runId","required":false},{"multipleWords":false,"name":"workerGroup","required":false},{"multipleWords":false,"name":"workerId","required":false},{"multipleWords":false,"name":"provisionerId","required":true},{"multipleWords":false,"name":"workerType","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-failed-message.json#","type":"topic-exchange"}; // eslint-disable-line
92
+
93
+ return this.normalizePattern(entry, pattern);
94
+ }
95
+ /* eslint-disable max-len */
96
+ // Whenever Taskcluster fails to run a message is posted to this exchange.
97
+ // This happens if the task isn't completed before its `deadlìne`,
98
+ // all retries failed (i.e. workers stopped responding), the task was
99
+ // canceled by another entity, or the task carried a malformed payload.
100
+ // The specific _reason_ is evident from that task status structure, refer
101
+ // to the `reasonResolved` property for the last run.
102
+ /* eslint-enable max-len */
103
+ taskException(pattern) {
104
+ const entry = {"exchange":"task-exception","name":"taskException","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskId","required":true},{"multipleWords":false,"name":"runId","required":false},{"multipleWords":false,"name":"workerGroup","required":false},{"multipleWords":false,"name":"workerId","required":false},{"multipleWords":false,"name":"provisionerId","required":true},{"multipleWords":false,"name":"workerType","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-exception-message.json#","type":"topic-exchange"}; // eslint-disable-line
105
+
106
+ return this.normalizePattern(entry, pattern);
107
+ }
108
+ /* eslint-disable max-len */
109
+ // A message is published on task-group-resolved whenever all submitted
110
+ // tasks (whether scheduled or unscheduled) for a given task group have
111
+ // been resolved, regardless of whether they resolved as successful or
112
+ // not. A task group may be resolved multiple times, since new tasks may
113
+ // be submitted against an already resolved task group.
114
+ /* eslint-enable max-len */
115
+ taskGroupResolved(pattern) {
116
+ const entry = {"exchange":"task-group-resolved","name":"taskGroupResolved","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-group-changed-message.json#","type":"topic-exchange"}; // eslint-disable-line
117
+
118
+ return this.normalizePattern(entry, pattern);
119
+ }
120
+ /* eslint-disable max-len */
121
+ // A message is published on task-group-sealed whenever task group is sealed.
122
+ // This task group will no longer allow creation of new tasks.
123
+ /* eslint-enable max-len */
124
+ taskGroupSealed(pattern) {
125
+ const entry = {"exchange":"task-group-sealed","name":"taskGroupSealed","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":false,"name":"taskGroupId","required":true},{"multipleWords":false,"name":"schedulerId","required":true},{"multipleWords":true,"name":"reserved","required":false}],"schema":"v1/task-group-changed-message.json#","type":"topic-exchange"}; // eslint-disable-line
126
+
127
+ return this.normalizePattern(entry, pattern);
128
+ }
129
+ }
@@ -0,0 +1,103 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+
3
+ import Client from '../Client';
4
+
5
+ export default class Secrets extends Client {
6
+ constructor(options = {}) {
7
+ super({
8
+ serviceName: 'secrets',
9
+ serviceVersion: 'v1',
10
+ exchangePrefix: '',
11
+ ...options,
12
+ });
13
+ this.ping.entry = {"args":[],"category":"Monitoring","method":"get","name":"ping","query":[],"route":"/ping","stability":"stable","type":"function"}; // eslint-disable-line
14
+ this.lbheartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"lbheartbeat","query":[],"route":"/__lbheartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
15
+ this.version.entry = {"args":[],"category":"Monitoring","method":"get","name":"version","query":[],"route":"/__version__","stability":"stable","type":"function"}; // eslint-disable-line
16
+ this.set.entry = {"args":["name"],"category":"Secrets Service","input":true,"method":"put","name":"set","query":[],"route":"/secret/<name>","scopes":"secrets:set:<name>","stability":"stable","type":"function"}; // eslint-disable-line
17
+ this.remove.entry = {"args":["name"],"category":"Secrets Service","method":"delete","name":"remove","query":[],"route":"/secret/<name>","scopes":"secrets:set:<name>","stability":"stable","type":"function"}; // eslint-disable-line
18
+ this.get.entry = {"args":["name"],"category":"Secrets Service","method":"get","name":"get","output":true,"query":[],"route":"/secret/<name>","scopes":"secrets:get:<name>","stability":"stable","type":"function"}; // eslint-disable-line
19
+ this.list.entry = {"args":[],"category":"Secrets Service","method":"get","name":"list","output":true,"query":["continuationToken","limit"],"route":"/secrets","scopes":"secrets:list-secrets","stability":"stable","type":"function"}; // eslint-disable-line
20
+ this.heartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"heartbeat","query":[],"route":"/__heartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
21
+ }
22
+ /* eslint-disable max-len */
23
+ // Respond without doing anything.
24
+ // This endpoint is used to check that the service is up.
25
+ /* eslint-enable max-len */
26
+ ping(...args) {
27
+ this.validate(this.ping.entry, args);
28
+
29
+ return this.request(this.ping.entry, args);
30
+ }
31
+ /* eslint-disable max-len */
32
+ // Respond without doing anything.
33
+ // This endpoint is used to check that the service is up.
34
+ /* eslint-enable max-len */
35
+ lbheartbeat(...args) {
36
+ this.validate(this.lbheartbeat.entry, args);
37
+
38
+ return this.request(this.lbheartbeat.entry, args);
39
+ }
40
+ /* eslint-disable max-len */
41
+ // Respond with the JSON version object.
42
+ // https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
43
+ /* eslint-enable max-len */
44
+ version(...args) {
45
+ this.validate(this.version.entry, args);
46
+
47
+ return this.request(this.version.entry, args);
48
+ }
49
+ /* eslint-disable max-len */
50
+ // Set the secret associated with some key. If the secret already exists, it is
51
+ // updated instead.
52
+ /* eslint-enable max-len */
53
+ set(...args) {
54
+ this.validate(this.set.entry, args);
55
+
56
+ return this.request(this.set.entry, args);
57
+ }
58
+ /* eslint-disable max-len */
59
+ // Delete the secret associated with some key. It will succeed whether or not the secret exists
60
+ /* eslint-enable max-len */
61
+ remove(...args) {
62
+ this.validate(this.remove.entry, args);
63
+
64
+ return this.request(this.remove.entry, args);
65
+ }
66
+ /* eslint-disable max-len */
67
+ // Read the secret associated with some key. If the secret has recently
68
+ // expired, the response code 410 is returned. If the caller lacks the
69
+ // scope necessary to get the secret, the call will fail with a 403 code
70
+ // regardless of whether the secret exists.
71
+ /* eslint-enable max-len */
72
+ get(...args) {
73
+ this.validate(this.get.entry, args);
74
+
75
+ return this.request(this.get.entry, args);
76
+ }
77
+ /* eslint-disable max-len */
78
+ // List the names of all secrets.
79
+ // By default this end-point will try to return up to 1000 secret names in one
80
+ // request. But it **may return less**, even if more tasks are available.
81
+ // It may also return a `continuationToken` even though there are no more
82
+ // results. However, you can only be sure to have seen all results if you
83
+ // keep calling `listTaskGroup` with the last `continuationToken` until you
84
+ // get a result without a `continuationToken`.
85
+ // If you are not interested in listing all the members at once, you may
86
+ // use the query-string option `limit` to return fewer.
87
+ /* eslint-enable max-len */
88
+ list(...args) {
89
+ this.validate(this.list.entry, args);
90
+
91
+ return this.request(this.list.entry, args);
92
+ }
93
+ /* eslint-disable max-len */
94
+ // Respond with a service heartbeat.
95
+ // This endpoint is used to check on backing services this service
96
+ // depends on.
97
+ /* eslint-enable max-len */
98
+ heartbeat(...args) {
99
+ this.validate(this.heartbeat.entry, args);
100
+
101
+ return this.request(this.heartbeat.entry, args);
102
+ }
103
+ }
@@ -0,0 +1,303 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+
3
+ import Client from '../Client';
4
+
5
+ export default class WorkerManager extends Client {
6
+ constructor(options = {}) {
7
+ super({
8
+ serviceName: 'worker-manager',
9
+ serviceVersion: 'v1',
10
+ exchangePrefix: '',
11
+ ...options,
12
+ });
13
+ this.ping.entry = {"args":[],"category":"Monitoring","method":"get","name":"ping","query":[],"route":"/ping","stability":"stable","type":"function"}; // eslint-disable-line
14
+ this.lbheartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"lbheartbeat","query":[],"route":"/__lbheartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
15
+ this.version.entry = {"args":[],"category":"Monitoring","method":"get","name":"version","query":[],"route":"/__version__","stability":"stable","type":"function"}; // eslint-disable-line
16
+ this.listProviders.entry = {"args":[],"category":"Providers","method":"get","name":"listProviders","output":true,"query":["continuationToken","limit"],"route":"/providers","scopes":"worker-manager:list-providers","stability":"stable","type":"function"}; // eslint-disable-line
17
+ this.createWorkerPool.entry = {"args":["workerPoolId"],"category":"Worker Pools","input":true,"method":"put","name":"createWorkerPool","output":true,"query":[],"route":"/worker-pool/<workerPoolId>","scopes":{"AllOf":["worker-manager:manage-worker-pool:<workerPoolId>","worker-manager:provider:<providerId>"]},"stability":"stable","type":"function"}; // eslint-disable-line
18
+ this.updateWorkerPool.entry = {"args":["workerPoolId"],"category":"Worker Pools","input":true,"method":"post","name":"updateWorkerPool","output":true,"query":[],"route":"/worker-pool/<workerPoolId>","scopes":{"AllOf":["worker-manager:manage-worker-pool:<workerPoolId>","worker-manager:provider:<providerId>"]},"stability":"experimental","type":"function"}; // eslint-disable-line
19
+ this.deleteWorkerPool.entry = {"args":["workerPoolId"],"category":"Worker Pools","method":"delete","name":"deleteWorkerPool","output":true,"query":[],"route":"/worker-pool/<workerPoolId>","scopes":"worker-manager:manage-worker-pool:<workerPoolId>","stability":"stable","type":"function"}; // eslint-disable-line
20
+ this.listWorkerPoolLaunchConfigs.entry = {"args":["workerPoolId"],"category":"Worker Pool Launch Configs","method":"get","name":"listWorkerPoolLaunchConfigs","output":true,"query":["continuationToken","limit","includeArchived"],"route":"/worker-pool/<workerPoolId>/launch-configs","scopes":"worker-manager:get-worker-pool:<workerPoolId>","stability":"experimental","type":"function"}; // eslint-disable-line
21
+ this.workerPoolStats.entry = {"args":["workerPoolId"],"category":"Worker Pools","method":"get","name":"workerPoolStats","output":true,"query":[],"route":"/worker-pool/<workerPoolId>/stats","scopes":"worker-manager:get-worker-pool:<workerPoolId>","stability":"experimental","type":"function"}; // eslint-disable-line
22
+ this.workerPool.entry = {"args":["workerPoolId"],"category":"Worker Pools","method":"get","name":"workerPool","output":true,"query":[],"route":"/worker-pool/<workerPoolId>","scopes":"worker-manager:get-worker-pool:<workerPoolId>","stability":"stable","type":"function"}; // eslint-disable-line
23
+ this.listWorkerPools.entry = {"args":[],"category":"Worker Pools","method":"get","name":"listWorkerPools","output":true,"query":["continuationToken","limit"],"route":"/worker-pools","scopes":"worker-manager:list-worker-pools","stability":"stable","type":"function"}; // eslint-disable-line
24
+ this.listWorkerPoolsStats.entry = {"args":[],"category":"Worker Pools","method":"get","name":"listWorkerPoolsStats","output":true,"query":["continuationToken","limit"],"route":"/worker-pools/stats","scopes":"worker-manager:list-worker-pools","stability":"experimental","type":"function"}; // eslint-disable-line
25
+ this.reportWorkerError.entry = {"args":["workerPoolId"],"category":"Worker Interface","input":true,"method":"post","name":"reportWorkerError","output":true,"query":[],"route":"/worker-pool-errors/<workerPoolId>","scopes":{"AllOf":["assume:worker-pool:<workerPoolId>","assume:worker-id:<workerGroup>/<workerId>"]},"stability":"stable","type":"function"}; // eslint-disable-line
26
+ this.workerPoolErrorStats.entry = {"args":[],"category":"Worker Pools","method":"get","name":"workerPoolErrorStats","output":true,"query":["workerPoolId"],"route":"/worker-pool-errors/stats","scopes":"worker-manager:list-worker-pool-errors:<workerPoolId>","stability":"experimental","type":"function"}; // eslint-disable-line
27
+ this.listWorkerPoolErrors.entry = {"args":["workerPoolId"],"category":"Worker Pools","method":"get","name":"listWorkerPoolErrors","output":true,"query":["continuationToken","limit","launchConfigId","errorId"],"route":"/worker-pool-errors/<workerPoolId>","scopes":"worker-manager:list-worker-pool-errors:<workerPoolId>","stability":"stable","type":"function"}; // eslint-disable-line
28
+ this.listWorkersForWorkerGroup.entry = {"args":["workerPoolId","workerGroup"],"category":"Workers","method":"get","name":"listWorkersForWorkerGroup","output":true,"query":["continuationToken","limit"],"route":"/workers/<workerPoolId>/<workerGroup>","scopes":"worker-manager:list-workers:<workerPoolId>/<workerGroup>","stability":"stable","type":"function"}; // eslint-disable-line
29
+ this.worker.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","method":"get","name":"worker","output":true,"query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>","scopes":"worker-manager:get-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"stable","type":"function"}; // eslint-disable-line
30
+ this.createWorker.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","input":true,"method":"put","name":"createWorker","output":true,"query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>","scopes":"worker-manager:create-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"stable","type":"function"}; // eslint-disable-line
31
+ this.updateWorker.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","input":true,"method":"post","name":"updateWorker","output":true,"query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>","scopes":"worker-manager:update-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"stable","type":"function"}; // eslint-disable-line
32
+ this.removeWorker.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","method":"delete","name":"removeWorker","query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>","scopes":"worker-manager:remove-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"stable","type":"function"}; // eslint-disable-line
33
+ this.listWorkersForWorkerPool.entry = {"args":["workerPoolId"],"category":"Workers","method":"get","name":"listWorkersForWorkerPool","output":true,"query":["continuationToken","limit","launchConfigId","state"],"route":"/workers/<workerPoolId>","scopes":"worker-manager:list-workers:<workerPoolId>","stability":"stable","type":"function"}; // eslint-disable-line
34
+ this.registerWorker.entry = {"args":[],"category":"Worker Interface","input":true,"method":"post","name":"registerWorker","output":true,"query":[],"route":"/worker/register","stability":"stable","type":"function"}; // eslint-disable-line
35
+ this.reregisterWorker.entry = {"args":[],"category":"Worker Interface","input":true,"method":"post","name":"reregisterWorker","output":true,"query":[],"route":"/worker/reregister","scopes":"worker-manager:reregister-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"experimental","type":"function"}; // eslint-disable-line
36
+ this.listWorkers.entry = {"args":["provisionerId","workerType"],"category":"Worker Metadata","method":"get","name":"listWorkers","output":true,"query":["continuationToken","limit","launchConfigId","quarantined","workerState"],"route":"/provisioners/<provisionerId>/worker-types/<workerType>/workers","scopes":"worker-manager:list-workers:<provisionerId>/<workerType>","stability":"experimental","type":"function"}; // eslint-disable-line
37
+ this.getWorker.entry = {"args":["provisionerId","workerType","workerGroup","workerId"],"category":"Worker Metadata","method":"get","name":"getWorker","output":true,"query":[],"route":"/provisioners/<provisionerId>/worker-types/<workerType>/workers/<workerGroup>/<workerId>","scopes":"worker-manager:get-worker:<provisionerId>/<workerType>/<workerGroup>/<workerId>","stability":"experimental","type":"function"}; // eslint-disable-line
38
+ this.heartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"heartbeat","query":[],"route":"/__heartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
39
+ }
40
+ /* eslint-disable max-len */
41
+ // Respond without doing anything.
42
+ // This endpoint is used to check that the service is up.
43
+ /* eslint-enable max-len */
44
+ ping(...args) {
45
+ this.validate(this.ping.entry, args);
46
+
47
+ return this.request(this.ping.entry, args);
48
+ }
49
+ /* eslint-disable max-len */
50
+ // Respond without doing anything.
51
+ // This endpoint is used to check that the service is up.
52
+ /* eslint-enable max-len */
53
+ lbheartbeat(...args) {
54
+ this.validate(this.lbheartbeat.entry, args);
55
+
56
+ return this.request(this.lbheartbeat.entry, args);
57
+ }
58
+ /* eslint-disable max-len */
59
+ // Respond with the JSON version object.
60
+ // https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
61
+ /* eslint-enable max-len */
62
+ version(...args) {
63
+ this.validate(this.version.entry, args);
64
+
65
+ return this.request(this.version.entry, args);
66
+ }
67
+ /* eslint-disable max-len */
68
+ // Retrieve a list of providers that are available for worker pools.
69
+ /* eslint-enable max-len */
70
+ listProviders(...args) {
71
+ this.validate(this.listProviders.entry, args);
72
+
73
+ return this.request(this.listProviders.entry, args);
74
+ }
75
+ /* eslint-disable max-len */
76
+ // Create a new worker pool. If the worker pool already exists, this will throw an error.
77
+ /* eslint-enable max-len */
78
+ createWorkerPool(...args) {
79
+ this.validate(this.createWorkerPool.entry, args);
80
+
81
+ return this.request(this.createWorkerPool.entry, args);
82
+ }
83
+ /* eslint-disable max-len */
84
+ // Given an existing worker pool definition, this will modify it and return
85
+ // the new definition.
86
+ // To delete a worker pool, set its `providerId` to `"null-provider"`.
87
+ // After any existing workers have exited, a cleanup job will remove the
88
+ // worker pool. During that time, the worker pool can be updated again, such
89
+ // as to set its `providerId` to a real provider.
90
+ /* eslint-enable max-len */
91
+ updateWorkerPool(...args) {
92
+ this.validate(this.updateWorkerPool.entry, args);
93
+
94
+ return this.request(this.updateWorkerPool.entry, args);
95
+ }
96
+ /* eslint-disable max-len */
97
+ // Mark a worker pool for deletion. This is the same as updating the pool to
98
+ // set its providerId to `"null-provider"`, but does not require scope
99
+ // `worker-manager:provider:null-provider`.
100
+ // This will also mark all launch configurations as archived.
101
+ /* eslint-enable max-len */
102
+ deleteWorkerPool(...args) {
103
+ this.validate(this.deleteWorkerPool.entry, args);
104
+
105
+ return this.request(this.deleteWorkerPool.entry, args);
106
+ }
107
+ /* eslint-disable max-len */
108
+ // Get the list of launch configurations for a given worker pool.
109
+ // Include archived launch configurations by setting includeArchived=true.
110
+ // By default, only active launch configurations are returned.
111
+ /* eslint-enable max-len */
112
+ listWorkerPoolLaunchConfigs(...args) {
113
+ this.validate(this.listWorkerPoolLaunchConfigs.entry, args);
114
+
115
+ return this.request(this.listWorkerPoolLaunchConfigs.entry, args);
116
+ }
117
+ /* eslint-disable max-len */
118
+ // Fetch statistics for an existing worker pool, broken down by launch configuration.
119
+ // This includes counts and capacities of requested, running, stopping, and stopped workers.
120
+ /* eslint-enable max-len */
121
+ workerPoolStats(...args) {
122
+ this.validate(this.workerPoolStats.entry, args);
123
+
124
+ return this.request(this.workerPoolStats.entry, args);
125
+ }
126
+ /* eslint-disable max-len */
127
+ // Fetch an existing worker pool defition.
128
+ /* eslint-enable max-len */
129
+ workerPool(...args) {
130
+ this.validate(this.workerPool.entry, args);
131
+
132
+ return this.request(this.workerPool.entry, args);
133
+ }
134
+ /* eslint-disable max-len */
135
+ // Get the list of all the existing worker pools.
136
+ /* eslint-enable max-len */
137
+ listWorkerPools(...args) {
138
+ this.validate(this.listWorkerPools.entry, args);
139
+
140
+ return this.request(this.listWorkerPools.entry, args);
141
+ }
142
+ /* eslint-disable max-len */
143
+ // Get the stats for all worker pools - number of requested, running, stopping and stopped capacity
144
+ /* eslint-enable max-len */
145
+ listWorkerPoolsStats(...args) {
146
+ this.validate(this.listWorkerPoolsStats.entry, args);
147
+
148
+ return this.request(this.listWorkerPoolsStats.entry, args);
149
+ }
150
+ /* eslint-disable max-len */
151
+ // Report an error that occurred on a worker. This error will be included
152
+ // with the other errors in `listWorkerPoolErrors(workerPoolId)`.
153
+ // Workers can use this endpoint to report startup or configuration errors
154
+ // that might be associated with the worker pool configuration and thus of
155
+ // interest to a worker-pool administrator.
156
+ // NOTE: errors are publicly visible. Ensure that none of the content
157
+ // contains secrets or other sensitive information.
158
+ /* eslint-enable max-len */
159
+ reportWorkerError(...args) {
160
+ this.validate(this.reportWorkerError.entry, args);
161
+
162
+ return this.request(this.reportWorkerError.entry, args);
163
+ }
164
+ /* eslint-disable max-len */
165
+ // Get the list of worker pool errors count.
166
+ // Contains total count of errors for the past 7 days and 24 hours
167
+ // Also includes total counts grouped by titles of error and error code.
168
+ // If `workerPoolId` is not specified, it will return the count of all errors
169
+ /* eslint-enable max-len */
170
+ workerPoolErrorStats(...args) {
171
+ this.validate(this.workerPoolErrorStats.entry, args);
172
+
173
+ return this.request(this.workerPoolErrorStats.entry, args);
174
+ }
175
+ /* eslint-disable max-len */
176
+ // Get the list of worker pool errors.
177
+ /* eslint-enable max-len */
178
+ listWorkerPoolErrors(...args) {
179
+ this.validate(this.listWorkerPoolErrors.entry, args);
180
+
181
+ return this.request(this.listWorkerPoolErrors.entry, args);
182
+ }
183
+ /* eslint-disable max-len */
184
+ // Get the list of all the existing workers in a given group in a given worker pool.
185
+ /* eslint-enable max-len */
186
+ listWorkersForWorkerGroup(...args) {
187
+ this.validate(this.listWorkersForWorkerGroup.entry, args);
188
+
189
+ return this.request(this.listWorkersForWorkerGroup.entry, args);
190
+ }
191
+ /* eslint-disable max-len */
192
+ // Get a single worker.
193
+ /* eslint-enable max-len */
194
+ worker(...args) {
195
+ this.validate(this.worker.entry, args);
196
+
197
+ return this.request(this.worker.entry, args);
198
+ }
199
+ /* eslint-disable max-len */
200
+ // Create a new worker. This is only useful for worker pools where the provider
201
+ // does not create workers automatically, such as those with a `static` provider
202
+ // type. Providers that do not support creating workers will return a 400 error.
203
+ // See the documentation for the individual providers, and in particular the
204
+ // [static provider](https://docs.taskcluster.net/docs/reference/core/worker-manager/)
205
+ // for more information.
206
+ /* eslint-enable max-len */
207
+ createWorker(...args) {
208
+ this.validate(this.createWorker.entry, args);
209
+
210
+ return this.request(this.createWorker.entry, args);
211
+ }
212
+ /* eslint-disable max-len */
213
+ // Update an existing worker in-place. Like `createWorker`, this is only useful for
214
+ // worker pools where the provider does not create workers automatically.
215
+ // This method allows updating all fields in the schema unless otherwise indicated
216
+ // in the provider documentation.
217
+ // See the documentation for the individual providers, and in particular the
218
+ // [static provider](https://docs.taskcluster.net/docs/reference/core/worker-manager/)
219
+ // for more information.
220
+ /* eslint-enable max-len */
221
+ updateWorker(...args) {
222
+ this.validate(this.updateWorker.entry, args);
223
+
224
+ return this.request(this.updateWorker.entry, args);
225
+ }
226
+ /* eslint-disable max-len */
227
+ // Remove an existing worker. The precise behavior of this method depends
228
+ // on the provider implementing the given worker. Some providers
229
+ // do not support removing workers at all, and will return a 400 error.
230
+ // Others may begin removing the worker, but it may remain available via
231
+ // the API (perhaps even in state RUNNING) afterward.
232
+ /* eslint-enable max-len */
233
+ removeWorker(...args) {
234
+ this.validate(this.removeWorker.entry, args);
235
+
236
+ return this.request(this.removeWorker.entry, args);
237
+ }
238
+ /* eslint-disable max-len */
239
+ // Get the list of all the existing workers in a given worker pool.
240
+ /* eslint-enable max-len */
241
+ listWorkersForWorkerPool(...args) {
242
+ this.validate(this.listWorkersForWorkerPool.entry, args);
243
+
244
+ return this.request(this.listWorkersForWorkerPool.entry, args);
245
+ }
246
+ /* eslint-disable max-len */
247
+ // Register a running worker. Workers call this method on worker start-up.
248
+ // This call both marks the worker as running and returns the credentials
249
+ // the worker will require to perform its work. The worker must provide
250
+ // some proof of its identity, and that proof varies by provider type.
251
+ /* eslint-enable max-len */
252
+ registerWorker(...args) {
253
+ this.validate(this.registerWorker.entry, args);
254
+
255
+ return this.request(this.registerWorker.entry, args);
256
+ }
257
+ /* eslint-disable max-len */
258
+ // Reregister a running worker.
259
+ // This will generate and return new Taskcluster credentials for the worker
260
+ // on that instance to use. The credentials will not live longer the
261
+ // `registrationTimeout` for that worker. The endpoint will update `terminateAfter`
262
+ // for the worker so that worker-manager does not terminate the instance.
263
+ /* eslint-enable max-len */
264
+ reregisterWorker(...args) {
265
+ this.validate(this.reregisterWorker.entry, args);
266
+
267
+ return this.request(this.reregisterWorker.entry, args);
268
+ }
269
+ /* eslint-disable max-len */
270
+ // Get a list of all active workers of a workerType.
271
+ // `listWorkers` allows a response to be filtered by quarantined and non quarantined workers,
272
+ // as well as the current state of the worker.
273
+ // To filter the query, you should call the end-point with one of [`quarantined`, `workerState`]
274
+ // as a query-string option with a true or false value.
275
+ // The response is paged. If this end-point returns a `continuationToken`, you
276
+ // should call the end-point again with the `continuationToken` as a query-string
277
+ // option. By default this end-point will list up to 1000 workers in a single
278
+ // page. You may limit this with the query-string parameter `limit`.
279
+ /* eslint-enable max-len */
280
+ listWorkers(...args) {
281
+ this.validate(this.listWorkers.entry, args);
282
+
283
+ return this.request(this.listWorkers.entry, args);
284
+ }
285
+ /* eslint-disable max-len */
286
+ // Get a worker from a worker-type.
287
+ /* eslint-enable max-len */
288
+ getWorker(...args) {
289
+ this.validate(this.getWorker.entry, args);
290
+
291
+ return this.request(this.getWorker.entry, args);
292
+ }
293
+ /* eslint-disable max-len */
294
+ // Respond with a service heartbeat.
295
+ // This endpoint is used to check on backing services this service
296
+ // depends on.
297
+ /* eslint-enable max-len */
298
+ heartbeat(...args) {
299
+ this.validate(this.heartbeat.entry, args);
300
+
301
+ return this.request(this.heartbeat.entry, args);
302
+ }
303
+ }