Merge lp:~ralsina/tanuki-agent/fix-product-ref into lp:tanuki-agent
- fix-product-ref
- Merge into trunk
Proposed by
Roberto Alsina
Status: | Merged |
---|---|
Approved by: | Roberto Alsina |
Approved revision: | 203 |
Merged at revision: | 201 |
Proposed branch: | lp:~ralsina/tanuki-agent/fix-product-ref |
Merge into: | lp:tanuki-agent |
Diff against target: |
491 lines (+160/-159) 1 file modified
docs/api-reference-products.md (+160/-159) |
To merge this branch: | bzr merge lp:~ralsina/tanuki-agent/fix-product-ref |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bret Barker (community) | Approve | ||
Review via email: mp+281552@code.launchpad.net |
Commit message
Updated docs for test triggering scenarios and progress/results APIs
Description of the change
Updated docs for test triggering scenarios and progress/results APIs
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'docs/api-reference-products.md' | |||
2 | --- docs/api-reference-products.md 2016-01-04 20:06:45 +0000 | |||
3 | +++ docs/api-reference-products.md 2016-01-04 20:33:35 +0000 | |||
4 | @@ -4,8 +4,7 @@ | |||
5 | 4 | [TOC] | 4 | [TOC] |
6 | 5 | 5 | ||
7 | 6 | 6 | ||
10 | 7 | Definitions | 7 | # Definitions |
9 | 8 | ============ | ||
11 | 9 | 8 | ||
12 | 10 | - **Manifest**: used to define a Product | 9 | - **Manifest**: used to define a Product |
13 | 11 | that is based on Snaps. This is optional for image-based workflows. | 10 | that is based on Snaps. This is optional for image-based workflows. |
14 | @@ -25,8 +24,7 @@ | |||
15 | 25 | tests against a target device. | 24 | tests against a target device. |
16 | 26 | - **Test Result**: metadata about output of a test run. | 25 | - **Test Result**: metadata about output of a test run. |
17 | 27 | 26 | ||
20 | 28 | Authentication | 27 | # Authentication |
19 | 29 | ============ | ||
21 | 30 | 28 | ||
22 | 31 | All API endpoints are authenticated, which ensures private access | 29 | All API endpoints are authenticated, which ensures private access |
23 | 32 | to your product's information. | 30 | to your product's information. |
24 | @@ -114,8 +112,7 @@ | |||
25 | 114 | login process) into a file called conf.ini. Note, this script is meant only as an example and not | 112 | login process) into a file called conf.ini. Note, this script is meant only as an example and not |
26 | 115 | intended for production use. | 113 | intended for production use. |
27 | 116 | 114 | ||
30 | 117 | Errors | 115 | # Errors |
29 | 118 | ============ | ||
31 | 119 | 116 | ||
32 | 120 | The APIs use standard HTTP response codes. Most errors will | 117 | The APIs use standard HTTP response codes. Most errors will |
33 | 121 | contain a human-readable "message" field in the JSON response body. Here | 118 | contain a human-readable "message" field in the JSON response body. Here |
34 | @@ -141,8 +138,7 @@ | |||
35 | 141 | <p>There was an temporary error on the server. The request may be retried after a short wait. If the problem persists please contact support. Scripts should use an exponential backoff to avoid hammering the servers with retries. | 138 | <p>There was an temporary error on the server. The request may be retried after a short wait. If the problem persists please contact support. Scripts should use an exponential backoff to avoid hammering the servers with retries. |
36 | 142 | </table> | 139 | </table> |
37 | 143 | 140 | ||
40 | 144 | API Reference | 141 | # API Reference |
39 | 145 | ============= | ||
41 | 146 | 142 | ||
42 | 147 | Product Management | 143 | Product Management |
43 | 148 | ------------------ | 144 | ------------------ |
44 | @@ -257,7 +253,7 @@ | |||
45 | 257 | "test-snap.foo" | 253 | "test-snap.foo" |
46 | 258 | ], | 254 | ], |
47 | 259 | "release": "15.04-core", | 255 | "release": "15.04-core", |
49 | 260 | "name": "test-product.e2e", | 256 | "name": "test-product.foo", |
50 | 261 | "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", | 257 | "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", |
51 | 262 | "created_at": "2016-01-04T17:34:39.093142" | 258 | "created_at": "2016-01-04T17:34:39.093142" |
52 | 263 | } | 259 | } |
53 | @@ -705,12 +701,6 @@ | |||
54 | 705 | has the following required fields: | 701 | has the following required fields: |
55 | 706 | 702 | ||
56 | 707 | 703 | ||
57 | 708 | - ```image_name```: a unique name within an | ||
58 | 709 | organization that is combined with each | ||
59 | 710 | test case to produce the full set of test | ||
60 | 711 | opportunities. I.e. if you have two test cases with a | ||
61 | 712 | matching image_name, then two test opportunities will be created. | ||
62 | 713 | Maximum length is 200 characters. | ||
63 | 714 | - ```image_reference```: is opaque to the | 704 | - ```image_reference```: is opaque to the |
64 | 715 | system; it is for your Provisioning Kit in your lab | 705 | system; it is for your Provisioning Kit in your lab |
65 | 716 | to interpret and use. It can be any JSON | 706 | to interpret and use. It can be any JSON |
66 | @@ -727,51 +717,50 @@ | |||
67 | 727 | image\_reference is not a URL to a binary. Currently | 717 | image\_reference is not a URL to a binary. Currently |
68 | 728 | this ID is used for querying test results. Maximum length is 36 | 718 | this ID is used for querying test results. Maximum length is 36 |
69 | 729 | characters. | 719 | characters. |
71 | 730 | - ```upgrade\_snaps```: NOT IMPLEMENTED YET. | 720 | - ```channel```: **FIXME DESCRIBE** |
72 | 721 | - ```extra_snaps```: **FIXME DESCRIBE** | ||
73 | 731 | 722 | ||
74 | 732 | 723 | ||
75 | 733 | <table class="table"> | 724 | <table class="table"> |
76 | 734 | <tr> | 725 | <tr> |
78 | 735 | <th>Action <th>Image Reference Creation | 726 | <th>Action <th>Image Advertising |
79 | 736 | <tr> | 727 | <tr> |
81 | 737 | <td>URL <td>https://spi.canonical.com/orgs/<org-id>/images | 728 | <td>URL <td>https://spi.canonical.com/products/<product-id>/images |
82 | 738 | <tr> | 729 | <tr> |
83 | 739 | <td>Method <td>POST | 730 | <td>Method <td>POST |
84 | 740 | <tr> | 731 | <tr> |
85 | 741 | <td>Data <td> | 732 | <td>Data <td> |
86 | 742 | <pre> | 733 | <pre> |
87 | 743 | { | 734 | { |
105 | 744 | image_reference: "http://foo.bar", | 735 | "image_unique_id": "DEADBEEF_83451039", |
106 | 745 | image_unique_id: some unique_id, | 736 | "extra_snaps": [], |
107 | 746 | image_name: my_image, | 737 | "channel": "edge", |
108 | 747 | upgrade_snaps: [] | 738 | "image_reference": "http://foo.com/bar" |
109 | 748 | } | 739 | } |
110 | 749 | </pre> | 740 | </pre> |
111 | 750 | <tr> | 741 | <tr> |
112 | 751 | <td>Response <td><code>201 CREATED</code> with a list of test opportunity IDs | 742 | <td>Response <td><code>201 CREATED</code> with a list of test opportunity IDs and image unique IDs. |
96 | 752 | <tr> | ||
97 | 753 | <td>Response <td><code>404 NOT FOUND</code> if there is no test spec for this image_name | ||
98 | 754 | <pre> | ||
99 | 755 | { | ||
100 | 756 | "id": "resource-not-found", | ||
101 | 757 | "message": "Couldn't find a Spec for image name 'my_image'", | ||
102 | 758 | "url": null | ||
103 | 759 | } | ||
104 | 760 | </pre> | ||
113 | 761 | <tr> | 743 | <tr> |
114 | 762 | <td>Example <td> | 744 | <td>Example <td> |
115 | 763 | <pre> | 745 | <pre> |
123 | 764 | $ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/orgs/docs-org/images --data \ | 746 | $ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/images --data \ |
124 | 765 | '{ | 747 | ' |
125 | 766 | "image_reference": "http://foo.bar", | 748 | { |
126 | 767 | "image_unique_id": "fooo", | 749 | "image_unique_id": "DEADBEEF_83451039", |
127 | 768 | "image_name": "imgname", | 750 | "extra_snaps": [], |
128 | 769 | "upgrade_snaps": [] | 751 | "channel": "edge", |
129 | 770 | }' | 752 | "image_reference": "http://foo.com/bar" |
130 | 753 | } | ||
131 | 754 | ' | ||
132 | 771 | 755 | ||
133 | 772 | HTTP 201 | 756 | HTTP 201 |
134 | 773 | { | 757 | { |
136 | 774 | 'ids': ['99787105-911f-4e23-bded-b0b8253aee11'] | 758 | "ids": [ |
137 | 759 | { | ||
138 | 760 | "image_unique_id": "DEADBEEF_83451039", | ||
139 | 761 | "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
140 | 762 | } | ||
141 | 763 | ] | ||
142 | 775 | } | 764 | } |
143 | 776 | </pre> | 765 | </pre> |
144 | 777 | </table> | 766 | </table> |
145 | @@ -785,43 +774,24 @@ | |||
146 | 785 | advertised to the system, however they can be re-advertised manually | 774 | advertised to the system, however they can be re-advertised manually |
147 | 786 | afterwards, re-triggering tests with their original context. | 775 | afterwards, re-triggering tests with their original context. |
148 | 787 | 776 | ||
150 | 788 | The new revision advertised will be matched with all **Manifests** within the context **Organization** | 777 | The new revision advertised will be matched with all **Products** |
151 | 789 | referencing the given **Snap**, and **Test Opportunities** will be created for all **Test Specs** linked to those | 778 | referencing the given **Snap**, and **Test Opportunities** will be created for all **Test Specs** linked to those |
153 | 790 | **Manifests**. | 779 | **Products**. |
154 | 791 | 780 | ||
155 | 792 | ![](images/image03.png) | 781 | ![](images/image03.png) |
156 | 793 | 782 | ||
157 | 794 | 783 | ||
181 | 795 | By modelling new / specific **Manifests** (Products) under the same | 784 | By modelling new / specific **Products** customers define the testing context they care about: |
182 | 796 | **Organization** customers define the testing context they care about: | 785 | |
183 | 797 | 786 | ||
184 | 798 | 787 | **FIXME Describe the new world test triggering scenarios** | |
162 | 799 | |||
163 | 800 | 1. **Update from a Gold Master (GM) image**: | ||
164 | 801 | |||
165 | 802 | Product "base\_image\_reference" contains specific versions of | ||
166 | 803 | product-specific snaps reflecting one generation / portion of the | ||
167 | 804 | installed base. In this case, tests represent the act of updating | ||
168 | 805 | products of an specific generation to the advertised snap. | ||
169 | 806 | |||
170 | 807 | |||
171 | 808 | 2. **Fresh Install (special case of above where GM == Ubuntu-Core)**: | ||
172 | 809 | |||
173 | 810 | Product "base\_image\_reference" does not include | ||
174 | 811 | product-specific snaps and tests represent, for instance, the act of | ||
175 | 812 | installing the advertised snap on top of a vanilla ubuntu-core | ||
176 | 813 | image. | ||
177 | 814 | |||
178 | 815 | |||
179 | 816 | From the [Agent & Provisioning Kit](#agent-operation) point of view, testing contexts will | ||
180 | 817 | be homogeneously defined via Test Opportunity base\_image\_reference and extra\_snaps. | ||
185 | 818 | 788 | ||
186 | 819 | Snap revision advertisement request requires the following | 789 | Snap revision advertisement request requires the following |
187 | 820 | fields: | 790 | fields: |
188 | 821 | 791 | ||
189 | 822 | - **name** The name of the snap package. Maximum length is 200 characters. | 792 | - **name** The name of the snap package. Maximum length is 200 characters. |
190 | 823 | - **revision** The new snap's revision. An integer number. | 793 | - **revision** The new snap's revision. An integer number. |
192 | 824 | 794 | - **channel** On which channel is the new snap revision advertised. | |
193 | 825 | 795 | ||
194 | 826 | 796 | ||
195 | 827 | Snap revision advertisement will return a list of test opportunity IDs and image unique IDs that can be used to [query for results](#querying-test-results) later. | 797 | Snap revision advertisement will return a list of test opportunity IDs and image unique IDs that can be used to [query for results](#querying-test-results) later. |
196 | @@ -830,42 +800,101 @@ | |||
197 | 830 | <tr> | 800 | <tr> |
198 | 831 | <th>Action <th>Snap Revision Triggering | 801 | <th>Action <th>Snap Revision Triggering |
199 | 832 | <tr> | 802 | <tr> |
236 | 833 | <td>URL <td>https://spi.canonical.com/orgs/<org-id>/snap-revisions | 803 | <td>URL <td>https://spi.canonical.com/products/<product-id>/snaps |
237 | 834 | <tr> | 804 | <tr> |
238 | 835 | <td>Method <td>POST | 805 | <td>Method <td>POST |
239 | 836 | <tr> | 806 | <tr> |
240 | 837 | <td>Data <td> | 807 | <td>Data <td> |
241 | 838 | <pre> | 808 | <pre> |
242 | 839 | { | 809 | { |
243 | 840 | "name": name of snap package | 810 | "name": "test-snap.foo", |
244 | 841 | "revision": revision number in the Store (integer) | 811 | "revision": 2, |
245 | 842 | } | 812 | "channel": "edge" |
246 | 843 | </pre> | 813 | } |
247 | 844 | <tr> | 814 | </pre> |
248 | 845 | <td>Response <td><code>201 CREATED</code> with a list of test opportunity IDs and image unique IDs | 815 | <tr> |
249 | 846 | <tr> | 816 | <td>Response <td><code>201 CREATED</code> with a list of test opportunity IDs and image unique IDs |
250 | 847 | <td>Response <td><code>404 NOT FOUND</code> if there is no matched Manifests | 817 | <tr> |
251 | 848 | <pre> | 818 | <td>Example <td> |
252 | 849 | { | 819 | <pre> |
253 | 850 | "id": "resource-not-found", | 820 | $ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/snaps \ |
254 | 851 | "message": "", | 821 | --data ' |
255 | 852 | "url": null | 822 | { |
256 | 853 | } | 823 | "name": "test-snap.foo", |
257 | 854 | </pre> | 824 | "revision": 2, |
258 | 855 | <tr> | 825 | "channel": "edge" |
259 | 856 | <td>Example <td> | 826 | }' |
260 | 857 | <pre> | 827 | |
261 | 858 | $ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/orgs/docs-org/snap-revisions \ | 828 | HTTP 201 |
262 | 859 | --data ' | 829 | { |
263 | 860 | > { | 830 | "ids": [ |
264 | 861 | > "name": "hello.world", | 831 | { |
265 | 862 | > "revision": 123 | 832 | "image_unique_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", |
266 | 863 | > }' | 833 | "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
267 | 864 | 834 | } | |
268 | 865 | HTTP 201 | 835 | ] |
269 | 866 | { | 836 | } |
270 | 867 | 'ids': [{'test_opportunity_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', | 837 | </pre> |
271 | 868 | 'image_unique_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'}]} | 838 | </table> |
272 | 839 | |||
273 | 840 | ### Gold Master | ||
274 | 841 | |||
275 | 842 | Gold Master advertisement requires the following fields: | ||
276 | 843 | |||
277 | 844 | - **snaps** A list of snaps that form the gold master image. | ||
278 | 845 | - **channel** On what channel is the gold master advertised. | ||
279 | 846 | |||
280 | 847 | Gold master advertisement will return a list of test opportunity IDs and image unique IDs that can be used to [query for results](#querying-test-results) later. | ||
281 | 848 | |||
282 | 849 | <table class="table"> | ||
283 | 850 | <tr> | ||
284 | 851 | <th>Action <th>Gold Master Triggering | ||
285 | 852 | <tr> | ||
286 | 853 | <td>URL <td>https://spi.canonical.com/products/<product-id>/gold-masters | ||
287 | 854 | <tr> | ||
288 | 855 | <td>Method <td>POST | ||
289 | 856 | <tr> | ||
290 | 857 | <td>Data <td> | ||
291 | 858 | <pre> | ||
292 | 859 | { | ||
293 | 860 | "snaps": A list of snaps/revisions, | ||
294 | 861 | "channel": a channel name | ||
295 | 862 | } | ||
296 | 863 | </pre> | ||
297 | 864 | <tr> | ||
298 | 865 | <td>Response <td><code>201 CREATED</code> with a list of test opportunity IDs and image unique IDs | ||
299 | 866 | <tr> | ||
300 | 867 | <td>Example <td> | ||
301 | 868 | <pre> | ||
302 | 869 | $ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/snaps \ | ||
303 | 870 | --data ' | ||
304 | 871 | { | ||
305 | 872 | "snaps": [ | ||
306 | 873 | { | ||
307 | 874 | "name": "pi2.canonical", | ||
308 | 875 | "revision": 1 | ||
309 | 876 | }, | ||
310 | 877 | { | ||
311 | 878 | "name": "webdm.canonical", | ||
312 | 879 | "revision": 1 | ||
313 | 880 | }, | ||
314 | 881 | { | ||
315 | 882 | "name": "test-snap.foo", | ||
316 | 883 | "revision": 1 | ||
317 | 884 | } | ||
318 | 885 | ], | ||
319 | 886 | "channel": "stable" | ||
320 | 887 | }' | ||
321 | 888 | |||
322 | 889 | HTTP 201 | ||
323 | 890 | { | ||
324 | 891 | "ids": [ | ||
325 | 892 | { | ||
326 | 893 | "image_unique_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | ||
327 | 894 | "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
328 | 895 | } | ||
329 | 896 | ] | ||
330 | 897 | } | ||
331 | 869 | </pre> | 898 | </pre> |
332 | 870 | </table> | 899 | </table> |
333 | 871 | 900 | ||
334 | @@ -873,8 +902,6 @@ | |||
335 | 873 | Querying Test Progress | 902 | Querying Test Progress |
336 | 874 | ---------------------- | 903 | ---------------------- |
337 | 875 | 904 | ||
338 | 876 | |||
339 | 877 | |||
340 | 878 | As a test opportunity progresses from being triggered to deliver a | 905 | As a test opportunity progresses from being triggered to deliver a |
341 | 879 | result it flows through a series of expected events. This is the normal | 906 | result it flows through a series of expected events. This is the normal |
342 | 880 | expected event flow for a test opportunity: | 907 | expected event flow for a test opportunity: |
343 | @@ -898,7 +925,7 @@ | |||
344 | 898 | <tr> | 925 | <tr> |
345 | 899 | <th>Action <th>Result Query | 926 | <th>Action <th>Result Query |
346 | 900 | <tr> | 927 | <tr> |
348 | 901 | <td>URL <td>https://spi.canonical.com/orgs/<org_id>/tests/events | 928 | <td>URL <td>https://spi.canonical.com/products/<prod_id>/tests/events |
349 | 902 | <tr> | 929 | <tr> |
350 | 903 | <td>Method <td>GET | 930 | <td>Method <td>GET |
351 | 904 | <tr> | 931 | <tr> |
352 | @@ -926,54 +953,43 @@ | |||
353 | 926 | <td>Example <td> | 953 | <td>Example <td> |
354 | 927 | <pre> | 954 | <pre> |
355 | 928 | $ ./scripts/api_example.py conf.ini \ | 955 | $ ./scripts/api_example.py conf.ini \ |
357 | 929 | http://spi.canonical.com/orgs/e2e-org/tests/events?test_opportunity_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | 956 | http://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/tests/events?test_opportunity_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
358 | 930 | HTTP 200 | 957 | HTTP 200 |
359 | 931 | { | 958 | { |
360 | 932 | "event_logs": [ | 959 | "event_logs": [ |
361 | 933 | { | 960 | { |
362 | 934 | "organization_id": "e2e-org", | ||
363 | 935 | "image_name": "e2e-imgf151a8cd9081404db54ed1d8dab1e140", | ||
364 | 936 | "queued_at": "2015-09-17T12:13:03.288000+00:00", | ||
365 | 937 | "updated_at": "2015-09-17T12:13:06.799000+00:00", | ||
366 | 938 | "image_unique_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | ||
367 | 939 | "events_seen": [ | ||
368 | 940 | "QUEUED_FOR_AGENTS", | ||
369 | 941 | "PICKED_BY_AGENT", | ||
370 | 942 | "RESULT_POSTED", | ||
371 | 943 | "RESULT_STORED" | ||
372 | 944 | ], | ||
373 | 945 | "events": [ | 961 | "events": [ |
374 | 946 | { | 962 | { |
375 | 947 | "event_type": "QUEUED_FOR_AGENTS", | 963 | "event_type": "QUEUED_FOR_AGENTS", |
377 | 948 | "timestamp": "2015-09-17T12:13:03.288000+00:00" | 964 | "timestamp": "2016-01-04T16:58:28.805000+00:00" |
378 | 949 | }, | 965 | }, |
379 | 950 | { | 966 | { |
380 | 967 | "timestamp": "2016-01-04T16:58:33.185000+00:00", | ||
381 | 951 | "event_type": "PICKED_BY_AGENT", | 968 | "event_type": "PICKED_BY_AGENT", |
386 | 952 | "agent_group": "e2e-group", | 969 | "agent_id": "foo-agent-id", |
387 | 953 | "agent_id": "e2e-id", | 970 | "platform": null, |
388 | 954 | "timestamp": "2015-09-17T12:13:06.291000+00:00", | 971 | "agent_group": null |
385 | 955 | "platform": "amd64" | ||
389 | 956 | }, | 972 | }, |
390 | 957 | { | 973 | { |
391 | 958 | "result_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | 974 | "result_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", |
392 | 959 | "test_status": "PASSED", | 975 | "test_status": "PASSED", |
393 | 960 | "agent_group": "e2e-group", | ||
394 | 961 | "event_type": "RESULT_POSTED", | 976 | "event_type": "RESULT_POSTED", |
398 | 962 | "timestamp": "2015-09-17T12:13:06.734000+00:00", | 977 | "agent_id": "foo-agent-id", |
399 | 963 | "agent_id": "e2e-id", | 978 | "platform": null, |
400 | 964 | "platform": "amd64" | 979 | "agent_group": null, |
401 | 980 | "timestamp": "2016-01-04T16:58:33.734000+00:00" | ||
402 | 965 | }, | 981 | }, |
403 | 966 | { | 982 | { |
404 | 983 | "result_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | ||
405 | 984 | "test_status": "PASSED", | ||
406 | 967 | "event_type": "RESULT_STORED", | 985 | "event_type": "RESULT_STORED", |
410 | 968 | "result_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | 986 | "timestamp": "2016-01-04T16:58:33.764000+00:00" |
408 | 969 | "test_status": "PASSED", | ||
409 | 970 | "timestamp": "2015-09-17T12:13:06.745000+00:00" | ||
411 | 971 | } | 987 | } |
412 | 972 | ], | 988 | ], |
413 | 989 | "updated_at": "2016-01-04T16:58:33.825000+00:00", | ||
414 | 990 | "product_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | ||
415 | 991 | "queued_at": "2016-01-04T16:58:28.805000+00:00", | ||
416 | 973 | "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | 992 | "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", |
417 | 974 | "spec_name": "e2e-spec_13691451", | ||
418 | 975 | "test_opportunity": { | ||
419 | 976 | |||
420 | 977 | (...) | 993 | (...) |
421 | 978 | </pre> | 994 | </pre> |
422 | 979 | </table> | 995 | </table> |
423 | @@ -1028,7 +1044,7 @@ | |||
424 | 1028 | <tr> | 1044 | <tr> |
425 | 1029 | <th>Action <th>Result Query | 1045 | <th>Action <th>Result Query |
426 | 1030 | <tr> | 1046 | <tr> |
428 | 1031 | <td>URL <td>https://spi.canonical.com/orgs/<org_id>/results | 1047 | <td>URL <td>https://spi.canonical.com/products/<productd_id>/tests/results |
429 | 1032 | <tr> | 1048 | <tr> |
430 | 1033 | <td>Method <td>GET | 1049 | <td>Method <td>GET |
431 | 1034 | <tr> | 1050 | <tr> |
432 | @@ -1049,30 +1065,19 @@ | |||
433 | 1049 | <td>Example <td> | 1065 | <td>Example <td> |
434 | 1050 | <pre> | 1066 | <pre> |
435 | 1051 | ./scripts/api_example.py conf.ini \ | 1067 | ./scripts/api_example.py conf.ini \ |
437 | 1052 | 'https://spi.canonical.com/orgs/docs-org/results?start_date=20150826T00%3A00%3A00&end_date=20150826T04%3A00%3A00' | 1068 | 'https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/results?start_date=20150826T00%3A00%3A00&end_date=20150826T04%3A00%3A00' |
438 | 1053 | 1069 | ||
439 | 1054 | HTTP 200 | 1070 | HTTP 200 |
440 | 1055 | { | 1071 | { |
441 | 1056 | "test_results": [ | 1072 | "test_results": [ |
442 | 1057 | { | 1073 | { |
443 | 1058 | "test_spec": { | ||
444 | 1059 | "name": "e2e-spec_70600150", | ||
445 | 1060 | "platform": "amd64", | ||
446 | 1061 | "image_name": "e2e-img", | ||
447 | 1062 | "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | ||
448 | 1063 | "created_at": "2015-08-26T00:00:20.297477", | ||
449 | 1064 | "test_payload": "{'foo': 'bar'}" | ||
450 | 1065 | }, | ||
451 | 1066 | "test_status": "PASSED", | 1074 | "test_status": "PASSED", |
461 | 1067 | "platform": "amd64", | 1075 | "agent_revno": "197", |
462 | 1068 | "organization_id": "docs-org", | 1076 | "image_reference": null, |
463 | 1069 | "image_name": "e2e-img", | 1077 | "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", |
464 | 1070 | "extra_snaps": [], | 1078 | "primary_snap_name": "test-snap.foo", |
465 | 1071 | "image_reference": "http://foo.com/bar", | 1079 | "base_channel": "stable", |
466 | 1072 | "agent": { | 1080 | "update_channel": null, |
458 | 1073 | "timing": { | ||
459 | 1074 | "setup_start": "2015-08-26T00:00:22.651078", | ||
460 | 1075 | |||
467 | 1076 | [...] | 1081 | [...] |
468 | 1077 | </pre> | 1082 | </pre> |
469 | 1078 | </table> | 1083 | </table> |
470 | @@ -1093,12 +1098,8 @@ | |||
471 | 1093 | - 20150914 17:51:31 | 1098 | - 20150914 17:51:31 |
472 | 1094 | - 20150914 175131 Z | 1099 | - 20150914 175131 Z |
473 | 1095 | 1100 | ||
474 | 1096 | |||
475 | 1097 | |||
476 | 1098 | ### Test Result Data | 1101 | ### Test Result Data |
477 | 1099 | 1102 | ||
478 | 1100 | |||
479 | 1101 | |||
480 | 1102 | There are a few key fields in the test result JSON of note: | 1103 | There are a few key fields in the test result JSON of note: |
481 | 1103 | 1104 | ||
482 | 1104 | <!-- FIX link to actors-and-results --> | 1105 | <!-- FIX link to actors-and-results --> |
483 | @@ -1141,7 +1142,7 @@ | |||
484 | 1141 | { | 1142 | { |
485 | 1142 | "image_unique_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | 1143 | "image_unique_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", |
486 | 1143 | "test_status": "PASSED", | 1144 | "test_status": "PASSED", |
488 | 1144 | "agent-id": "e2e-id", | 1145 | "agent-id": "foo-agent-id", |
489 | 1145 | "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | 1146 | "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", |
490 | 1146 | "result_payload": { | 1147 | "result_payload": { |
491 | 1147 | "foo": "bar" | 1148 | "foo": "bar" |
+1'ing with known FIXMEs remaining.