Merge lp:~ralsina/tanuki-agent/fix-product-ref into lp:tanuki-agent

Proposed by Roberto Alsina on 2016-01-04
Status: Merged
Approved by: Roberto Alsina on 2016-01-04
Approved revision: 200
Merged at revision: 199
Proposed branch: lp:~ralsina/tanuki-agent/fix-product-ref
Merge into: lp:tanuki-agent
Diff against target: 757 lines (+303/-179)
1 file modified
docs/api-reference-products.md (+303/-179)
To merge this branch: bzr merge lp:~ralsina/tanuki-agent/fix-product-ref
Reviewer Review Type Date Requested Status
Bret Barker 2016-01-04 Approve on 2016-01-04
Review via email: mp+281536@code.launchpad.net

Commit message

Update doc to the current product-based API (part 1: products/testspecs/baseimages)

Description of the change

Update doc to the current product-based API (part 1: products/testspecs/baseimages)

To post a comment you must log in.
Bret Barker (noise) wrote :

LGTM, I can take a stab at the FIXMEs after.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/api-reference-products.md'
--- docs/api-reference-products.md 2015-11-27 12:34:13 +0000
+++ docs/api-reference-products.md 2016-01-04 19:07:00 +0000
@@ -1,5 +1,5 @@
1Title: Ubuntu Core Product Integration API Guide1Title: Ubuntu Core Product Integration API Guide
2Version: 201511052Version: 20160104
33
4[TOC]4[TOC]
55
@@ -14,6 +14,9 @@
14 the Product. It is free-form with data of your choosing (e.g. a14 the Product. It is free-form with data of your choosing (e.g. a
15 pointer to a binary to be provisioned on the device). Defined either15 pointer to a binary to be provisioned on the device). Defined either
16 via a manifest or advertised to the system on-demand.16 via a manifest or advertised to the system on-demand.
17- **Base Image**: represents a tested configuration,
18 specifically the combination of snaps that form that configuration. It can be
19 marked as "released", meaning it's in use by end users.
17- **Test Spec**: defines Tests to be run on20- **Test Spec**: defines Tests to be run on
18 matching images21 matching images
19- **Test Opportunity**: an instance of a22- **Test Opportunity**: an instance of a
@@ -26,11 +29,11 @@
26============29============
2730
28All API endpoints are authenticated, which ensures private access31All API endpoints are authenticated, which ensures private access
29to your Organization's information.32to your product's information.
3033
31To authenticate properly to the system, you'll first need oauth34To authenticate properly to the system, you'll first need oauth
32credentials that are obtained via the Agent (see next chapter below,35credentials that are obtained via the Agent (see next chapter below,
33“Lab Operation”, under “<span class="c28">[Authentication](#h.u7ke0hug9g6j)”36"Lab Operation", under "<span class="c28">[Authentication](#h.u7ke0hug9g6j)"
34section).37section).
3538
36<!-- LINK TO CORRECT PLACE IN TUTORIAL? -->39<!-- LINK TO CORRECT PLACE IN TUTORIAL? -->
@@ -75,11 +78,9 @@
7578
76Make a signed request to the Manifest Listing endpoint:79Make a signed request to the Manifest Listing endpoint:
7780
78 >>> url = "https://spi.canonical.com/orgs/docs-org/products/manifests"81 >>> url = "https://spi.canonical.com/products"
79 >>> res = authenticated_session.get(url)82 >>> res = authenticated_session.get(url)
8083
81
82
83The authenticated\_session will oauth-sign the request, appending84The authenticated\_session will oauth-sign the request, appending
84an HTTP Authorization header that looks like:85an HTTP Authorization header that looks like:
8586
@@ -93,13 +94,16 @@
93 >>> res.status_code94 >>> res.status_code
94 20095 200
95 >>> res.json()96 >>> res.json()
96 {'manifests': [{'base\_image\_reference': 'http://foo.com/bar',97 {'packages': ['test-snap.foo'],
97 'created_at': '2015-08-25T08:00:10.500533',98 'products': [{'active': True,
98 'id': '71e81dbb-4eb5-45df-a813-6e9efe0851be',99 'created_at': '2016-01-04T16:03:18.721607',
99 'image_name': 'docs-img68f9005f7fdb4c07ae322de432f22f26',100 'id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
100 'release': '15.04',101 'name': 'test-product.foo',
101 'snaps': [{'locked': True, 'name': 'snap-a', 'revision': 1},102 'primary_snap_name': 'test-snap.foo',
102 {'locked': False, 'name': 'snap-b', 'revision': None}]}]}103 'release': '15.04-core',
104 'snaps': ['pi2.canonical',
105 'webdm.canonical',
106 'test-snap.foo']}]}
103107
104In order to simplify the examples given in the API references108In order to simplify the examples given in the API references
105throughout this document, we have provided a helper script as part of109throughout this document, we have provided a helper script as part of
@@ -143,71 +147,43 @@
143Product Management147Product Management
144------------------148------------------
145149
146Note: Product Manifests support products built from150**FIXME ADD EXPLANATIONS**
147Snaps. If you are instead bootstrapping Product Integration with a pre-existing binary151
148image, please skip ahead to the next section - Test Management.152A product contains the following fields:
149153
150A Product is defined by a Manifest that has an image\_name154- ```name```: a unique name for this product that is combined with each
151and either a list of snaps that comprise the image (e.g. as specified in
152a Gadget Snap) or a base\_image\_reference.
153
154The image\_name is used to relate Test Specs (see below) to
155Manifests.
156
157Manifests and Test Specs may be deactivated or deleted
158permanently. Even if deleted, details of the Test Spec and Manifest (if
159any) that led to the Test Opportunity are persisted in the Test Result
160data.
161
162
163
164To modify a Test Spec or Manifest, the user should delete the
165existing one and create a new one with the desired changes. That will
166not automatically trigger new tests, for that see [Test Triggering](#test-triggering).
167
168A manifest contains the following fields:
169
170- ```image_name```: a unique name within an
171 organization that is combined with each
172 test case to produce the full set of test155 test case to produce the full set of test
173 opportunities. I.e. if you have two test cases with a156 opportunities. I.e. if you have two test cases with a
174 matching image\_name, then two test opportunities will be created.157 matching name, then two test opportunities will be created.
175 Maximum length is 200 characters.158 Maximum length is 200 characters.
176- ```release``` snappy release series, e.g.159- ```release``` snappy release series, e.g.
177 “15.04”. Maximum length is 200 characters.160 "15.04". Maximum length is 200 characters.
178- ```base_image_reference``` is opaque to161- ```primary_snap_name``` name of the snap used to control access to this product.
179 the system; it is for your Provisioning Kit in your lab to
180 interpret and use. It can be any JSON
181 value. This allows for URLs to actual image binaries,
182 data for on-the-fly image composition, etc. Maximum length is 1000
183 characters.
184- ```snaps``` list of snaps that make up the162- ```snaps``` list of snaps that make up the
185 product. This list will be used to for snappy based products to163 product. This list will be used to for snappy based products to
186 trigger tests when new Snap revisions are made available.164 trigger tests when new Snap revisions are made available.
187165
188 The format is a list of: ```[snap_name, revision_num, locked]```
189
190 - ```snap_name``` is the name of the Snap in the Store
191 - ```revision``` is the revision number (integer) that was used in the base image creation
192 - ```locked``` is a boolean indicating if that revision should be locked when generating Tests or can float as snaps are updated.
193
194In the current system, interaction is via an HTTP API and detailed below:166In the current system, interaction is via an HTTP API and detailed below:
195167
196<table class="table">168<table class="table">
197<tr>169<tr>
198 <th> Action <th>Manifest Creation170 <th> Action <th>Product Creation
199<tr>171<tr>
200 <td>URL <td>https://spi.canonical.com/orgs/<org-id\>/products/manifests172 <td>URL <td>https://spi.canonical.com/products
201<tr>173<tr>
202 <td>Method <td>POST174 <td>Method <td>POST
203<tr>175<tr>
204 <td>Data <td>176 <td>Data <td>
205<pre>177<pre>
206{178{
207 “image_name”: "test\_image",179 "primary_snap_name": "test-snap.foo",
208 “release”: “15.04”,180 "name": "test-product.foo",
209 “base_image_reference”: "http://foo.bar",181 "release": "15.04-core",
210 “snaps”: [['snap A', 1, true],['snap B', null, false]]182 "snaps": [
183 "pi2.canonical",
184 "webdm.canonical",
185 "test-snap.foo"
186 ]
211}187}
212</pre>188</pre>
213<tr>189<tr>
@@ -217,33 +193,31 @@
217<tr>193<tr>
218 <td>Example <td>194 <td>Example <td>
219<pre>195<pre>
220$ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/orgs/docs-org/products/manifests --data '{196$ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/products --data '{
221 "image_name": "test_image",197 "primary_snap_name": "test-snap.foo",
222 "release": "15.04",198 "name": "test-product.foo",
223 "base_image_reference": "http://foo.bar",199 "release": "15.04-core",
224 "snaps": [["snap A", 1, true],["snap B", null, false]]200 "snaps": [
201 "pi2.canonical",
202 "webdm.canonical",
203 "test-snap.foo"
204 ]
225}'205}'
226206
227HTTP 201207HTTP 201
228{208{
229 "manifest": {209 "product": {
230 "image_name": "test_image",210 "created_at": "2016-01-04T16:58:25.835796",
211 "active": true,
231 "snaps": [212 "snaps": [
232 {213 "pi2.canonical",
233 "locked": true,214 "webdm.canonical",
234 "revision": 1,215 "test-snap.foo"
235 "name": "snap A"
236 },
237 {
238 "locked": false,
239 "revision": null,
240 "name": "snap B"
241 }
242 ],216 ],
243 "base_image_reference": "http://foo.bar",217 "release": "15.04-core",
244 "id": "ae02b198-bfc8-4d26-aa7b-53dbfdd38230",218 "primary_snap_name": "test-snap.foo",
245 "release": "15.04",219 "name": "test-product.foo",
246 "created_at": "2015-08-28T20:15:15.726057"220 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
247 }221 }
248}222}
249</pre>223</pre>
@@ -251,42 +225,39 @@
251225
252<table class="table">226<table class="table">
253<tr>227<tr>
254 <th>Action <th>Manifest Listing228 <th>Action <th>Product Listing
255<tr>229<tr>
256 <td>URL <td>https://spi.canonical.com/orgs/&lt;org-id&gt;/products/manifests230 <td>URL <td>https://spi.canonical.com/products
257<tr>231<tr>
258 <td>Method <td>GET232 <td>Method <td>GET
259<tr>233<tr>
260 <td>Data <td>N/A234 <td>Data <td>N/A
261<tr>235<tr>
262 <td>Response <td><code>200</code> a JSON list of manifests236 <td>Response <td><code>200</code> a JSON list of products and packages for the user.
263<tr>237<tr>
264 <td>Example <td>238 <td>Example <td>
265<pre>239<pre>
266$ ./scripts/api_example.py conf.ini https://spi.canonical.com/orgs/docs-org/products/manifests240$ ./scripts/api_example.py conf.ini https://spi.canonical.com/products
267241
268HTTP 200242HTTP 200
269{243{
270 "manifests": [244 "products": [
271 {245 {
272 "image_name": "e2e-img8c80b8b271814262add99ccf4d3deba6",246 "primary_snap_name": "test-snap.foo",
273 "base_image_reference": "http://foo.com/bar",247 "active": true,
274 "snaps": [248 "snaps": [
275 {249 "pi2.canonical",
276 "revision": 1,250 "webdm.canonical",
277 "name": "snap-a",251 "test-snap.foo"
278 "locked": true
279 },
280 {
281 "revision": null,
282 "name": "snap-b",
283 "locked": false
284 }
285 ],252 ],
286 "id": "9b2ff50c-5fab-4039-a5e5-1a9672d71223",253 "release": "15.04-core",
287 "release": "15.04",254 "name": "test-product.e2e",
288 "created_at": "2015-08-28T20:00:11.058236"255 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
256 "created_at": "2016-01-04T17:34:39.093142"
289 }257 }
258 ],
259 "packages": [
260 "test-snap.foo"
290 ]261 ]
291}262}
292</pre>263</pre>
@@ -294,9 +265,9 @@
294265
295<table class="table">266<table class="table">
296<tr>267<tr>
297 <th>Action <th>Manifest View268 <th>Action <th>Product View
298<tr>269<tr>
299 <td>URL <td>https://spi.canonical.com/orgs/&lt;org-id&gt;/products/manifests/&lt;manifest-id&gt;270 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;
300<tr>271<tr>
301 <td>Method <td>GET272 <td>Method <td>GET
302<tr>273<tr>
@@ -306,28 +277,22 @@
306<tr>277<tr>
307 <td>Example <td>278 <td>Example <td>
308<pre>279<pre>
309$ ./scripts/api_example.py conf.ini https://spi.canonical.com/orgs/docs-org/products/manifests/9b2ff50c-5fab-4039-a5e5-1a9672d71223280$ ./scripts/api_example.py conf.ini https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
310281
311HTTP 200282HTTP 200
312{283{
313 "manifest": {284 "product": {
314 "release": "15.04",285 "release": "15.04-core",
315 "base_image_reference": "http://foo.com/bar",
316 "id": "9b2ff50c-5fab-4039-a5e5-1a9672d71223",
317 "image_name": "e2e-img8c80b8b271814262add99ccf4d3deba6",
318 "snaps": [286 "snaps": [
319 {287 "pi2.canonical",
320 "locked": true,288 "webdm.canonical",
321 "name": "snap-a",289 "test-snap.foo"
322 "revision": 1
323 },
324 {
325 "locked": false,
326 "name": "snap-b",
327 "revision": null
328 }
329 ],290 ],
330 "created_at": "2015-08-28T20:00:11.058236"291 "primary_snap_name": "test-snap.foo",
292 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
293 "created_at": "2016-01-04T17:34:39.093142",
294 "name": "test-product.foo",
295 "active": true
331 }296 }
332}297}
333</pre>298</pre>
@@ -336,16 +301,16 @@
336301
337<table class="table">302<table class="table">
338<tr>303<tr>
339 <th>Action <th>Manifest Deactivation/Reactivation304 <th>Action <th>Product Deactivation/Reactivation
340<tr>305<tr>
341 <td>URL <td>https://spi.canonical.com/orgs/&lt;org-id&gt;/products/manifests/&lt;manifest-id&gt;306 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;
342<tr>307<tr>
343 <td>Method <td>PUT308 <td>Method <td>PUT
344<tr>309<tr>
345 <td>Data <td>310 <td>Data <td>
346<pre>311<pre>
347{312{
348 “active”: "false", # or “true” to reactivate313 "active": "false", # or "true" to reactivate
349}314}
350</pre>315</pre>
351<tr>316<tr>
@@ -354,7 +319,9 @@
354 <td>Example <td>319 <td>Example <td>
355<pre>320<pre>
356$ ./scripts/api_example.py -X PUT conf.ini \321$ ./scripts/api_example.py -X PUT conf.ini \
357https://spi.canonical.com/orgs/docs-org/products/manifests/9b2ff50c-5fab-4039-a5e5-1a9672d71223322https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -data '{
323 "active": "true"
324}'
358325
359HTTP 200326HTTP 200
360{327{
@@ -364,9 +331,9 @@
364331
365<table class="table">332<table class="table">
366<tr>333<tr>
367 <th>Action <th>Manifest Deletion334 <th>Action <th>Product Deletion
368<tr>335<tr>
369 <td>URL <td>https://spi.canonical.com/orgs/&lt;org-id&gt;/products/manifests/&lt;manifest-id&gt;336 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;
370<tr>337<tr>
371 <td>Method <td>DELETE338 <td>Method <td>DELETE
372<tr>339<tr>
@@ -377,36 +344,154 @@
377 <td>Example <td>344 <td>Example <td>
378<pre>345<pre>
379$ ./scripts/api_example.py -X DELETE conf.ini \346$ ./scripts/api_example.py -X DELETE conf.ini \
380https://spi.canonical.com/orgs/docs-org/products/manifests/9b2ff50c-5fab-4039-a5e5-1a9672d71223347https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
381348
382HTTP 200349HTTP 200
383{350{
384 "ok": true351 "ok": true
385}352}
386</table>353</table>
354
355Base Image Management
356---------------------
357
358Base Images are automatically created. The user can mark them as released, to indicate that
359the specific combination of snaps is representative of a product release, or as active/inactive
360to mark them as not useful anymore.
361
362<table class="table">
363<tr>
364 <th>Action <th>Base Image Listing
365<tr>
366 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/baseimages
367<tr>
368 <td>Method <td>GET
369<tr>
370 <td>Data <td>N/A
371<tr>
372 <td>Response <td><code>200 OK</code> and a JSON representation of the available baseimages
373<tr>
374 <td>Example <td>
375<pre>
376$ ./scripts/api_example.py conf.ini \
377https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/baseimages
378
379HTTP 200
380{
381 "baseimages": [
382 {
383 "released_at": null,
384 "product_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
385 "snaps": [
386 {
387 "name": "test-snap.foo",
388 "revision": 1
389 },
390 {
391 "name": "webdm.canonical",
392 "revision": 1
393 },
394 {
395 "name": "pi2.canonical",
396 "revision": 1
397 }
398 ],
399 "channel": "stable",
400 "created_at": "2016-01-04T18:45:48.853476",
401 "active": true,
402 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
403 }
404 ]
405}
406</table>
407
408<table class="table">
409<tr>
410 <th>Action <th>Base Image Viewing
411<tr>
412 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/baseimages/&lt;image-id&gt;
413<tr>
414 <td>Method <td>GET
415<tr>
416 <td>Data <td>N/A
417<tr>
418 <td>Response <td><code>200 OK</code> and a JSON representation of the base image.
419<tr>
420 <td>Example <td>
421<pre>
422$ ./scripts/api_example.py conf.ini https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/baseimages/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
423
424HTTP 200
425{
426 "baseimage": {
427 "created_at": "2016-01-04T18:45:48.853476",
428 "channel": "stable",
429 "active": true,
430 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
431 "snaps": [
432 {
433 "name": "test-snap.foo",
434 "revision": 1
435 },
436 {
437 "name": "webdm.canonical",
438 "revision": 1
439 },
440 {
441 "name": "pi2.canonical",
442 "revision": 1
443 }
444 ],
445 "product_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
446 "released_at": null
447 }
448}
449</table>
450
451<table class="table">
452<tr>
453 <th>Action <th>Base Image Updating
454<tr>
455 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/baseimages/&lt;image-id&gt;
456<tr>
457 <td>Method <td>PUT
458<tr>
459 <td>Data <td>
460<pre>
461{
462 "active": "false", # or "true" to reactivate
463 "released": "true", # or "false"
464}
465</pre>
466<tr>
467 <td>Response <td><code>200 OK</code>
468<tr>
469 <td>Example <td>
470<pre>
471$ ./scripts/api_example.py -X PUT conf.ini \
472https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/baseimages/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -data '{
473 "released": "true"
474}'
475
476HTTP 200
477{
478 "ok": true
479}
480</table>
481
482
387483
388Test Management484Test Management
389---------------485---------------
390486
391Tests are defined with Test Specs. There may be multiple487Tests are defined with Test Specs. There may be multiple
392Test Specs per product and they are related via the image\_name field.488Test Specs per product and they form the basis for TestOpportunity creation.
393TestSpecs are required for both Image and Snappy based workflows as they
394form the basis for TestOpportunity creation.
395
396Test Specs are immutable but may be deleted or deactivated to be
397hidden from view. The details of the Test Spec that led to a Test
398Opportunity is always persisted in the Test Result data.
399
400To modify a Test Spec, the user should delete the existing one and
401create a new one with the desired changes. That will not automatically
402trigger new tests, for that see [Test
403Triggering](#test-triggering).
404489
405<table class="table">490<table class="table">
406<tr>491<tr>
407 <th>Action <th>Test Spec Creation492 <th>Action <th>Test Spec Creation
408<tr>493<tr>
409 <td>URL <td>https://spi.canonical.com/orgs/&lt;org-id&gt;/tests/specs494 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/tests/specs
410<tr>495<tr>
411 <td>Method <td>POST496 <td>Method <td>POST
412<tr>497<tr>
@@ -414,10 +499,10 @@
414<pre>499<pre>
415{500{
416 "platform": platform of the product501 "platform": platform of the product
417 "name": unique (within an org) name of the Test502 "name": unique (within the product) name of the Test
418 "image_name": name that ties this test to the product/manifest
419 "test_payload": an arbitrary JSON value with all the information needed to run the test503 "test_payload": an arbitrary JSON value with all the information needed to run the test
420 (maximum size 4000 bytes), optional defaulting to null504 (maximum size 4000 bytes), optional defaulting to null
505 "channel_combos": **FIXME DESCRIBE**
421}506}
422</pre>507</pre>
423<tr>508<tr>
@@ -428,21 +513,43 @@
428$ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/orgs/docs-org/tests/specs \513$ ./scripts/api_example.py -X POST conf.ini https://spi.canonical.com/orgs/docs-org/tests/specs \
429--data '514--data '
430{515{
516 "name": "foo-spec_bar",
431 "platform": "amd64",517 "platform": "amd64",
432 "image_name": "imgname",518 "channel_combos": [
433 "name": "specname32"519 {
520 "update": "edge",
521 "base": "stable"
522 }
523 ],
524 "test_payload": "{'foo': 'bar'}"
434}'525}'
435526
436HTTP 201527HTTP 201
528Location: https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/tests/specs/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
437{529{
438 "spec": {530 "spec": {
439 "image_name": "imgname",531 "product_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
440 "id": "cd98a77f-f7da-4388-b007-0a8a3604b676",532 "created_at": "2016-01-04T16:58:26.357538",
441 "name": "specname32",533 "active": true,
442 "platform": "amd64",534 "platform": "amd64",
443 "created_at": "2015-08-28T20:28:46.334756",535 "test_payload": "{'foo': 'bar'}",
444 "test_payload": null536 "name": "foo-spec_bar",
445 }537 "channel_combos": [
538 {
539 "update": "edge",
540 "base": "stable"
541 }
542 ],
543 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
544 },
545 "test_ids": [
546 [
547 {
548 "image_unique_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
549 "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
550 }
551 ]
552 ]
446}553}
447</pre>554</pre>
448</table>555</table>
@@ -451,7 +558,7 @@
451<tr>558<tr>
452 <th>Action <th>Test Spec List559 <th>Action <th>Test Spec List
453<tr>560<tr>
454 <td>URL <td>https://spi.canonical.com/orgs/&lt;org-id&gt;/tests/specs561 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/tests/specs
455<tr>562<tr>
456 <td>Method <td>GET563 <td>Method <td>GET
457<tr>564<tr>
@@ -461,18 +568,25 @@
461<tr>568<tr>
462 <td>Example <td>569 <td>Example <td>
463<pre>570<pre>
464$ ./scripts/api_example.py conf.ini https://spi.canonical.com/orgs/docs-org/tests/specs571$ ./scripts/api_example.py conf.ini https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/tests/specs
465572
466HTTP 200573HTTP 200
467{574{
468 "specs": [575 "specs": [
469 {576 {
470 "created_at": "2015-08-28T20:28:46.334756",577 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
471 "id": "cd98a77f-f7da-4388-b007-0a8a3604b676",578 "active": true,
472 "test_payload": null,579 "created_at": "2016-01-04T17:34:39.626802",
473 "image_name": "imgname",580 "product_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
581 "test_payload": "{'foo': 'bar'}",
582 "name": "foo-spec_bar",
474 "platform": "amd64",583 "platform": "amd64",
475 "name": "specname32"584 "channel_combos": [
585 {
586 "update": "edge",
587 "base": "stable"
588 }
589 ]
476 }590 }
477 ]591 ]
478}592}
@@ -483,7 +597,7 @@
483<tr>597<tr>
484 <th>Action <th>Test Spec View598 <th>Action <th>Test Spec View
485<tr>599<tr>
486 <td>URL <td>https://spi.canonical.com/orgs/<org-id>/tests/specs/<spec-id>600 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/tests/specs/&lt;spec-id&gt;
487<tr>601<tr>
488 <td>Method <td>GET602 <td>Method <td>GET
489<tr>603<tr>
@@ -493,17 +607,24 @@
493<tr>607<tr>
494 <td>Example <td>608 <td>Example <td>
495<pre>609<pre>
496$ ./scripts/api_example.py conf.ini https://spi.canonical.com/orgs/docs-org/tests/specs/cd98a77f-f7da-4388-b007-0a8a3604b676610$ ./scripts/api_example.py conf.ini https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/tests/specs/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
497611
498HTTP 200612HTTP 200
499{613{
500 "spec": {614 "spec": {
501 "id": "cd98a77f-f7da-4388-b007-0a8a3604b676",615 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
502 "name": "specname32",616 "active": true,
503 "platform": "amd64",617 "created_at": "2016-01-04T17:34:39.626802",
504 "created_at": "2015-08-28T20:28:46.334756",618 "product_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
505 "test_payload": null,619 "test_payload": "{'foo': 'bar'}",
506 "image_name": "imgname"620 "name": "foo-spec_bar",
621 "platform": "amd64",
622 "channel_combos": [
623 {
624 "update": "edge",
625 "base": "stable"
626 }
627 ]
507 }628 }
508}629}
509630
@@ -514,14 +635,14 @@
514<tr>635<tr>
515 <th>Action <th>Test Spec Deactivation/Reactivation636 <th>Action <th>Test Spec Deactivation/Reactivation
516<tr>637<tr>
517 <td>URL <td>https://spi.canonical.com/orgs/<org-id>/tests/specs/<spec-id>638 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/tests/specs/&lt;spec-id&gt;
518<tr>639<tr>
519 <td>Method <td>PUT640 <td>Method <td>PUT
520<tr>641<tr>
521 <td>Data <td>642 <td>Data <td>
522<pre>643<pre>
523{644{
524 “active”: "false", # or “true” to reactivate645 "active": "false", # or "true" to reactivate
525}646}
526</pre>647</pre>
527<tr>648<tr>
@@ -530,7 +651,10 @@
530 <td>Example <td>651 <td>Example <td>
531<pre>652<pre>
532$ ./scripts/api_example.py -X PUT conf.ini \653$ ./scripts/api_example.py -X PUT conf.ini \
533https://spi.canonical.com/orgs/docs-org/tests/specs/cd98a77f-f7da-4388-b007-0a8a3604b676654https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/tests/specs/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --data '
655{
656 "active": "false"
657}'
534658
535HTTP 200659HTTP 200
536{660{
@@ -543,7 +667,7 @@
543<tr>667<tr>
544 <th>Action <th>Test Spec Deletion668 <th>Action <th>Test Spec Deletion
545<tr>669<tr>
546 <td>URL <td>https://spi.canonical.com/orgs/<org-id>/tests/specs/<spec-id>670 <td>URL <td>https://spi.canonical.com/products/&lt;product-id&gt;/tests/specs/&lt;spec-id&gt;
547<tr>671<tr>
548 <td>Method <td>DELETE672 <td>Method <td>DELETE
549<tr>673<tr>
@@ -554,7 +678,7 @@
554 <td>Example <td>678 <td>Example <td>
555<pre>679<pre>
556$ ./scripts/api_example.py -X DELETE conf.ini \680$ ./scripts/api_example.py -X DELETE conf.ini \
557https://spi.canonical.com/orgs/docs-org/tests/specs/cd98a77f-f7da-4388-b007-0a8a3604b676681https://spi.canonical.com/products/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/tests/specs/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
558682
559HTTP 200683HTTP 200
560{684{
@@ -562,6 +686,7 @@
562}</pre>686}</pre>
563</table>687</table>
564688
689
565Test Triggering690Test Triggering
566---------------691---------------
567692
@@ -572,7 +697,6 @@
572has the following required fields:697has the following required fields:
573698
574699
575
576- ```image_name```: a unique name within an700- ```image_name```: a unique name within an
577 organization that is combined with each701 organization that is combined with each
578 test case to produce the full set of test702 test case to produce the full set of test

Subscribers

People subscribed via source and target branches

to all changes: