Merge lp:~noise/tanuki-agent/just-the-facts into lp:tanuki-agent

Proposed by Bret Barker
Status: Merged
Approved by: Bret Barker
Approved revision: 164
Merged at revision: 164
Proposed branch: lp:~noise/tanuki-agent/just-the-facts
Merge into: lp:tanuki-agent
Diff against target: 256 lines (+29/-119)
1 file modified
docs/api-reference.md (+29/-119)
To merge this branch: bzr merge lp:~noise/tanuki-agent/just-the-facts
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Review via email: mp+276710@code.launchpad.net

Commit message

remove extras from api ref; clean SPI refs

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

lots of red, that's usually good. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/api-reference.md'
2--- docs/api-reference.md 2015-11-04 14:37:58 +0000
3+++ docs/api-reference.md 2015-11-04 21:52:03 +0000
4@@ -1,59 +1,14 @@
5-Title: Snappy Product Integration API Guide
6-Version: 20151030
7+Title: Ubuntu Core Product Integration API Guide
8+Version: 20151105
9
10 [TOC]
11
12-System Overview
13-===============
14-
15-Snappy Product Integration(SPI) is system for
16-coordinating integration testing of Snappy-based products
17-across a matrix of supported platforms.
18-
19-
20-
21-It is important to note that SPI is not a build tool, image
22-composer, or unit test runner.
23-
24-
25-
26-There are four main actors in SPI:
27-
28-- Product Owners managing product definitions
29-- Developers providing Snaps or Images for test
30-
31-<!-- -->
32-
33-- Lab owners managing hardware installations that will consume
34- tests
35-- Quality Assurance engineers that will manage tests and
36- evaluate test results
37-
38-
39-
40-This separation of concerns is enforced by the design of the SPI
41-System and the APIs it provides. Below is a diagram of the
42-overall architecture and data flow. The blue boxes form the SPI software
43-provided by Canonical. The green boxes represent your organization’s
44-different responsibilities. They also represent the middle layer you
45-provide for the SPI system to talk to your hardware known as the
46-Provisioning Kit.
47-
48-![](images/image02.png)
49-
50-SPI Definitions
51----------------
52-
53-
54-
55-SPI models product integration testing using the following core
56-abstractions:
57-
58-
59+
60+Definitions
61+============
62
63 - **Manifest**: used to define a Product
64- that is based on Snaps. This is optional for image-based workflows
65- as detailed below under [Workflows](#workflows).
66+ that is based on Snaps. This is optional for image-based workflows.
67 - **Image Reference**: information passed
68 to the Provisioning Kit to use in setting up a device for testing
69 the Product. It is free-form with data of your choosing (e.g. a
70@@ -62,61 +17,13 @@
71 - **Test Spec**: defines Tests to be run on
72 matching images
73 - **Test Opportunity**: an instance of a
74- test for a given image that will be delivered to an Agent.
75-- **Agent**: SPI client installed in a
76- "lab" to coordinate running tests.
77-- **Test Result**: metadata
78- about output of a test run.
79-
80-
81-
82-
83-
84-Workflows
85----------
86-
87-
88-
89-There are two primary workflows supported by SPI:
90-
91-
92-
93-1. Snappy Based Image
94-2. Custom Image
95-
96-
97-
98-In the Snappy scenario, the product owner will first create a
99-Product (Manifest) and Test Specs in SPI. The product will point to a
100-base image that defines the "released" product and specify the names of
101-Snaps that comprise the product. Changes to the named Snaps, represented
102-as new uploads to the Snappy Store,  will be automatically advertised to
103-the SPI system to trigger tests of the base image with updated Snaps.
104-
105-
106-
107-
108-As an example, Canonical’s Snappy Core team uses this workflow to
109-perform integration, upgrade, and downgrade testing as each new revision
110-of the WebDM Snap is uploaded to the Store.
111-
112-
113-
114-The Custom Image workflow is simpler and designed to
115-help you transition from legacy product image testing to a
116-Snappy-generated product while running the same tests in the same manner
117-throughout this period. In this scenario, the product owner
118-(or developer) can create Test Specs (no Manifest required) and then
119-submit Images that match the Test Spec based on image\_name to trigger
120-test runs.
121-
122-API Reference
123-=============
124+ test for a given image and/or set of snaps that will be delivered to an Agent.
125+- **Agent**: Client software installed on a host computer to run
126+ tests against a target device.
127+- **Test Result**: metadata about output of a test run.
128
129 Authentication
130---------------
131-
132-
133+============
134
135 All API endpoints are authenticated, which ensures private access
136 to your Organization's information.
137@@ -129,7 +36,7 @@
138 <!-- LINK TO CORRECT PLACE IN TUTORIAL? -->
139
140 With those credentials, you can use an oauth library in your
141-language of choice to sign HTTP requests to the SPI API endpoints.
142+language of choice to sign HTTP requests to the API endpoints.
143
144
145 We'll walk through an example of that in Python using <span
146@@ -203,10 +110,10 @@
147 login process) into a file called conf.ini. Note, this script is meant only as an example and not
148 intended for production use.
149
150-API Errors
151-----------
152+Errors
153+============
154
155-The SPI APIs use standard HTTP response codes. Most errors will
156+The APIs use standard HTTP response codes. Most errors will
157 contain a human-readable "message" field in the JSON response body. Here
158 are the most common error codes and guidelines for handling them.
159
160@@ -230,14 +137,17 @@
161 <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.
162 </table>
163
164+API Reference
165+=============
166+
167 Product Management
168 ------------------
169
170 Note: Product Manifests support products built from
171-Snaps. If you are instead bootstrapping SPI with a pre-existing binary
172+Snaps. If you are instead bootstrapping Product Integration with a pre-existing binary
173 image, please skip ahead to the next section - Test Management.
174
175-In SPI, a Product is defined by a Manifest that has an image\_name
176+A Product is defined by a Manifest that has an image\_name
177 and either a list of snaps that comprise the image (e.g. as specified in
178 a Gadget Snap) or a base\_image\_reference.
179
180@@ -266,7 +176,7 @@
181 - ```release``` snappy release series, e.g.
182 “15.04”. Maximum length is 200 characters.
183 - ```base_image_reference``` is opaque to
184- the SPI system; it is for your Provisioning Kit in your lab to
185+ the system; it is for your Provisioning Kit in your lab to
186 interpret and use. It can be any JSON
187 value. This allows for URLs to actual image binaries,
188 data for on-the-fly image composition, etc. Maximum length is 1000
189@@ -478,7 +388,7 @@
190 Test Management
191 ---------------
192
193-Tests in SPI are defined with Test Specs. There may be multiple
194+Tests are defined with Test Specs. There may be multiple
195 Test Specs per product and they are related via the image\_name field.
196 TestSpecs are required for both Image and Snappy based workflows as they
197 form the basis for TestOpportunity creation.
198@@ -658,7 +568,7 @@
199 ### Image Submission
200
201 Test opportunities are triggered by a new image reference being
202-advertised by the user to the SPI system. An Image Reference
203+advertised by the user to the system. An Image Reference
204 has the following required fields:
205
206
207@@ -670,13 +580,13 @@
208 matching image_name, then two test opportunities will be created.
209 Maximum length is 200 characters.
210 - ```image_reference```: is opaque to the
211- SPI system; it is for your Provisioning Kit in your lab
212+ system; it is for your Provisioning Kit in your lab
213 to interpret and use. It can be any JSON
214 value. This allows for URLs to actual image binaries,
215 data for on-the-fly image composition, etc. Maximum length is 1000
216 characters.
217 - ```image_unique_id```: also opaque to the
218- SPI system. It is recommended that this uniquely
219+ system. It is recommended that this uniquely
220 identifies the advertised version of the image so that the
221 provisioning script can verify the image\_reference and results can
222 be queried by image\_unique\_id. For example it could
223@@ -737,10 +647,10 @@
224 ### Snap Revisions
225
226 Test opportunities may be triggered by snap revisions being
227-advertised to the SPI system.
228+advertised to the system.
229
230 New snap revisions uploaded to the Store will be automatically
231-advertised to SPI, however they can be re-advertised manually
232+advertised to the system, however they can be re-advertised manually
233 afterwards, re-triggering tests with their original context.
234
235 The new revision advertised will be matched with all **Manifests** within the context **Organization**
236@@ -782,7 +692,7 @@
237
238
239
240-SPI will return a list of test opportunity IDs and image unique IDs that can be used to [query for results](#querying-test-results) later.
241+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.
242
243 <table class="table">
244 <tr>
245@@ -877,7 +787,7 @@
246 <p>Using with_event=EVENT_TYPE will return only logs that contain that event type.
247 For example with_event=RESULT_POSTED returns only logs for tests for which a result has been posted back. Using without_event=EVENT_TYPE will return only logs that do not contain that event type. with_event and without_event cannot be used in the same query.
248
249-<p>For example, a large number of results that match without_event=PICKED_BY_AGENT could indicate either an under-resourced lab (all agents are busy) or that the agents have lost communication with the SPI servers. The combination of with_event=PICKED_BY_AGENT and without_event=RESULT_POSTED can be used to track down slow or stuck test runs, and the agent_id fields of the PICKED_BY_AGENT event can be used to identify the problem agent in the lab.
250+<p>For example, a large number of results that match without_event=PICKED_BY_AGENT could indicate either an under-resourced lab (all agents are busy) or that the agents have lost communication with Canonical's servers. The combination of with_event=PICKED_BY_AGENT and without_event=RESULT_POSTED can be used to track down slow or stuck test runs, and the agent_id fields of the PICKED_BY_AGENT event can be used to identify the problem agent in the lab.
251 <tr>
252 <td>Response <td><code>200 OK</code> with JSON list of matching progress event log documents
253 <tr>
254
255=== removed file 'docs/images/image02.png'
256Binary files docs/images/image02.png 2015-11-02 16:58:53 +0000 and docs/images/image02.png 1970-01-01 00:00:00 +0000 differ

Subscribers

People subscribed via source and target branches

to all changes: