@@ -4653,54 +4653,57 @@ Version = '0'
4653
4653
Schema = 'http://schemas.taskcluster.net/base/v1/api-reference.json#'
4654
4654
Title = 'Task Index API Documentation'
4655
4655
Description = 'The task index, typically available at `index.taskcluster.net`, is
4656
- responsible for indexing tasks. In order to ensure that tasks can be
4657
- located by recency and/or arbitrary strings. Common use-cases includes
4656
+ responsible for indexing tasks. The service ensures that tasks can be
4657
+ located by recency and/or arbitrary strings. Common use-cases include:
4658
4658
4659
4659
* Locate tasks by git or mercurial `<revision>`, or
4660
4660
* Locate latest task from given `<branch>`, such as a release.
4661
4661
4662
- **Index hierarchy**, tasks are indexed in a dot `.` separated hierarchy
4663
- called a namespace. For example a task could be indexed in
4664
- `<revision>.linux-64.release-build`. In this case the following
4662
+ **Index hierarchy**, tasks are indexed in a dot ( `.`) separated hierarchy
4663
+ called a namespace. For example a task could be indexed with the index path
4664
+ `some-app. <revision>.linux-64.release-build`. In this case the following
4665
4665
namespaces is created.
4666
4666
4667
- 1. `<revision>`, and,
4668
- 2. `<revision>.linux-64`
4667
+ 1. `some-app`,
4668
+ 1. `some-app.<revision>`, and,
4669
+ 2. `some-app.<revision>.linux-64`
4669
4670
4670
- The inside the namespace `<revision>` you can find the namespace
4671
- `<revision>.linux-64` inside which you can find the indexed task
4672
- `<revision>.linux-64.release-build`. In this example you'll be able to
4673
- find build for a given revision.
4671
+ Inside the namespace `some-app. <revision>` you can find the namespace
4672
+ `some-app. <revision>.linux-64` inside which you can find the indexed task
4673
+ `some-app. <revision>.linux-64.release-build`. This is an example of indexing
4674
+ builds for a given platform and revision.
4674
4675
4675
4676
**Task Rank**, when a task is indexed, it is assigned a `rank` (defaults
4676
4677
to `0`). If another task is already indexed in the same namespace with
4677
- the same lower or equal `rank`, the task will be overwritten. For example
4678
- consider a task indexed as `mozilla-central.linux-64.release-build`, in
4679
- this case on might choose to use a unix timestamp or mercurial revision
4678
+ lower or equal `rank`, the index for that task will be overwritten. For example
4679
+ consider index path `mozilla-central.linux-64.release-build`. In
4680
+ this case one might choose to use a UNIX timestamp or mercurial revision
4680
4681
number as `rank`. This way the latest completed linux 64 bit release
4681
4682
build is always available at `mozilla-central.linux-64.release-build`.
4682
4683
4683
- **Indexed Data**, when a task is located in the index you will get the
4684
- `taskId` and an additional user-defined JSON blob that was indexed with
4685
- task. You can use this to store additional information you would like to
4686
- get additional from the index.
4684
+ Note that this does mean index paths are not immutable: the same path may
4685
+ point to a different task now than it did a moment ago.
4686
+
4687
+ **Indexed Data**, when a task is retrieved from the index the result includes
4688
+ a `taskId` and an additional user-defined JSON blob that was indexed with
4689
+ the task.
4687
4690
4688
4691
**Entry Expiration**, all indexed entries must have an expiration date.
4689
4692
Typically this defaults to one year, if not specified. If you are
4690
4693
indexing tasks to make it easy to find artifacts, consider using the
4691
- expiration date that the artifacts is assigned .
4694
+ artifact's expiration date.
4692
4695
4693
4696
**Valid Characters**, all keys in a namespace `<key1>.<key2>` must be
4694
4697
in the form `/[a-zA-Z0-9_!~*'()%-]+/`. Observe that this is URL-safe and
4695
4698
that if you strictly want to put another character you can URL encode it.
4696
4699
4697
4700
**Indexing Routes**, tasks can be indexed using the API below, but the
4698
- most common way to index tasks is adding a custom route on the following
4699
- form `index.<namespace>`. In- order to add this route to a task you'll
4700
- need the following scope `queue:route:index.<namespace>`. When a task has
4701
- this route, it'll be indexed when the task is **completed successfully**.
4701
+ most common way to index tasks is adding a custom route to `task.routes` of the
4702
+ form `index.<namespace>`. In order to add this route to a task you'll
4703
+ need the scope `queue:route:index.<namespace>`. When a task has
4704
+ this route, it will be indexed when the task is **completed successfully**.
4702
4705
The task will be indexed with `rank`, `data` and `expires` as specified
4703
- in `task.extra.index`, see example below:
4706
+ in `task.extra.index`. See the example below:
4704
4707
4705
4708
```js
4706
4709
{
@@ -4718,7 +4721,7 @@ in `task.extra.index`, see example below:
4718
4721
// rank <= 4000 (defaults to zero)
4719
4722
rank: 4000,
4720
4723
4721
- // Specify when the entries expires (Defaults to 1 year)
4724
+ // Specify when the entries expire (Defaults to 1 year)
4722
4725
expires: new Date().toJSON(),
4723
4726
4724
4727
// A little informal data to store along with taskId
@@ -4736,26 +4739,26 @@ in `task.extra.index`, see example below:
4736
4739
```
4737
4740
4738
4741
**Remark**, when indexing tasks using custom routes, it's also possible
4739
- to listen for messages about these tasks. Which is quite convenient, for
4740
- example one could bind to `route.index.mozilla-central .*.release-build`,
4742
+ to listen for messages about these tasks. For
4743
+ example one could bind to `route.index.some-app .*.release-build`,
4741
4744
and pick up all messages about release builds. Hence, it is a
4742
4745
good idea to document task index hierarchies, as these make up extension
4743
4746
points in their own.'
4744
4747
Base URL = 'https://index.taskcluster.net/v1'
4745
4748
Entry 0 =
4746
4749
Entry Type = 'function'
4747
4750
Entry Method = 'get'
4748
- Entry Route = '/task/<namespace >'
4749
- Entry Args = '[namespace ]'
4751
+ Entry Route = '/task/<indexPath >'
4752
+ Entry Args = '[indexPath ]'
4750
4753
Entry Query = '[]'
4751
4754
Entry Name = 'findTask'
4752
4755
Entry Stability = 'stable'
4753
4756
Entry Scopes = '[]'
4754
4757
Entry Input = ''
4755
4758
Entry Output = 'http://schemas.taskcluster.net/index/v1/indexed-task-response.json#'
4756
4759
Entry Title = 'Find Indexed Task'
4757
- Entry Description = 'Find task by namespace, if no task existing for the given namespace, this
4758
- API end-point respond ` 404` .'
4760
+ Entry Description = 'Find a task by index path, returning the highest-rank task with that path. If no
4761
+ task exists for the given path, this API end-point will respond with a 404 status .'
4759
4762
Entry 1 =
4760
4763
Entry Type = 'function'
4761
4764
Entry Method = 'post'
@@ -4768,14 +4771,13 @@ Entry 1 =
4768
4771
Entry Input = 'http://schemas.taskcluster.net/index/v1/list-namespaces-request.json#'
4769
4772
Entry Output = 'http://schemas.taskcluster.net/index/v1/list-namespaces-response.json#'
4770
4773
Entry Title = 'List Namespaces'
4771
- Entry Description = 'List the namespaces immediately under a given namespace. This end-point
4772
- list up to 1000 namespaces. If more namespaces are present a
4774
+ Entry Description = 'List the namespaces immediately under a given namespace.
4775
+
4776
+ This endpoint
4777
+ lists up to 1000 namespaces. If more namespaces are present, a
4773
4778
`continuationToken` will be returned, which can be given in the next
4774
4779
request. For the initial request, the payload should be an empty JSON
4775
- object.
4776
-
4777
- **Remark**, this end-point is designed for humans browsing for tasks, not
4778
- services, as that makes little sense.'
4780
+ object.'
4779
4781
Entry 2 =
4780
4782
Entry Type = 'function'
4781
4783
Entry Method = 'post'
@@ -4788,8 +4790,10 @@ Entry 2 =
4788
4790
Entry Input = 'http://schemas.taskcluster.net/index/v1/list-tasks-request.json#'
4789
4791
Entry Output = 'http://schemas.taskcluster.net/index/v1/list-tasks-response.json#'
4790
4792
Entry Title = 'List Tasks'
4791
- Entry Description = 'List the tasks immediately under a given namespace. This end-point
4792
- list up to 1000 tasks. If more tasks are present a
4793
+ Entry Description = 'List the tasks immediately under a given namespace.
4794
+
4795
+ This endpoint
4796
+ lists up to 1000 tasks. If more tasks are present, a
4793
4797
`continuationToken` will be returned, which can be given in the next
4794
4798
request. For the initial request, the payload should be an empty JSON
4795
4799
object.
@@ -4808,23 +4812,37 @@ Entry 3 =
4808
4812
Entry Input = 'http://schemas.taskcluster.net/index/v1/insert-task-request.json#'
4809
4813
Entry Output = 'http://schemas.taskcluster.net/index/v1/indexed-task-response.json#'
4810
4814
Entry Title = 'Insert Task into Index'
4811
- Entry Description = 'Insert a task into the index. Please see the introduction above, for how
4812
- to index successfully completed tasks automatically, using custom routes.'
4815
+ Entry Description = 'Insert a task into the index. If the new rank is less than the existing rank
4816
+ at the given index path, the task is not indexed but the response is still 200 OK.
4817
+
4818
+ Please see the introduction above for information
4819
+ about indexing successfully completed tasks automatically using custom routes.'
4813
4820
Entry 4 =
4814
4821
Entry Type = 'function'
4815
4822
Entry Method = 'get'
4816
- Entry Route = '/task/<namespace >/artifacts/<name>'
4817
- Entry Args = '[namespace name]'
4823
+ Entry Route = '/task/<indexPath >/artifacts/<name>'
4824
+ Entry Args = '[indexPath name]'
4818
4825
Entry Query = '[]'
4819
4826
Entry Name = 'findArtifactFromTask'
4820
4827
Entry Stability = 'stable'
4821
4828
Entry Scopes = '[[queue:get-artifact:<name>]]'
4822
4829
Entry Input = ''
4823
4830
Entry Output = ''
4824
4831
Entry Title = 'Get Artifact From Indexed Task'
4825
- Entry Description = 'Find task by namespace and redirect to artifact with given `name`,
4826
- if no task existing for the given namespace, this API end-point respond
4827
- `404`.'
4832
+ Entry Description = 'Find a task by index path and redirect to the artifact on the most recent
4833
+ run with the given `name`.
4834
+
4835
+ Note that multiple calls to this endpoint may return artifacts from differen tasks
4836
+ if a new task is inserted into the index between calls. Avoid using this method as
4837
+ a stable link to multiple, connected files if the index path does not contain a
4838
+ unique identifier. For example, the following two links may return unrelated files:
4839
+ * https://index.taskcluster.net/task/some-app.win64.latest.installer/artifacts/public/installer.exe`
4840
+ * https://index.taskcluster.net/task/some-app.win64.latest.installer/artifacts/public/debug-symbols.zip`
4841
+
4842
+ This problem be remedied by including the revision in the index path or by bundling both
4843
+ installer and debug symbols into a single artifact.
4844
+
4845
+ If no task exists for the given index path, this API end-point responds with 404.'
4828
4846
Entry 5 =
4829
4847
Entry Type = 'function'
4830
4848
Entry Method = 'get'
@@ -5124,8 +5142,7 @@ Properties
5124
5142
TypeName = 'Expiration'
5125
5143
SourceURL = 'http://schemas.taskcluster.net/index/v1/list-tasks-response.json#/properties/tasks/items/properties/expires'
5126
5144
Property 'namespace' =
5127
- Description = 'Namespace of the indexed task, used to find the indexed task in the
5128
- index.
5145
+ Description = 'Index path of the task.
5129
5146
'
5130
5147
MaxLength = '255'
5131
5148
Title = 'Namespace'
@@ -5143,9 +5160,7 @@ Properties
5143
5160
TypeName = 'Rank'
5144
5161
SourceURL = 'http://schemas.taskcluster.net/index/v1/list-tasks-response.json#/properties/tasks/items/properties/rank'
5145
5162
Property 'taskId' =
5146
- Description = 'Unique task identifier, this is UUID encoded as
5147
- [URL-safe base64](http://tools.ietf.org/html/rfc4648#section-5) and
5148
- stripped of `=` padding.
5163
+ Description = 'Unique task identifier for the task currently indexed at `namespace`.
5149
5164
'
5150
5165
Pattern = '^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$'
5151
5166
Title = 'Task Identifier'
0 commit comments