Merge lp:~jpds/launchpad/fix_515388 into lp:launchpad
- fix_515388
- Merge into devel
Proposed by
Jonathan Davies
Status: | Merged |
---|---|
Approved by: | Graham Binns |
Approved revision: | not available |
Merged at revision: | 10252 |
Proposed branch: | lp:~jpds/launchpad/fix_515388 |
Merge into: | lp:launchpad |
Diff against target: |
354 lines (+164/-36) 5 files modified
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+5/-0) lib/lp/registry/interfaces/distribution.py (+16/-7) lib/lp/registry/interfaces/distributionmirror.py (+41/-29) lib/lp/registry/stories/webservice/xx-distribution-mirror.txt (+75/-0) lib/lp/registry/stories/webservice/xx-distribution.txt (+27/-0) |
To merge this branch: | bzr merge lp:~jpds/launchpad/fix_515388 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Review via email: mp+18413@code.launchpad.net |
Commit message
Added DistributionMirrors to the Launchpad API.
Description of the change
To post a comment you must log in.
Revision history for this message
Jonathan Davies (jpds) wrote : | # |
Revision history for this message
Graham Binns (gmb) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py' | |||
2 | --- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-01-15 01:59:08 +0000 | |||
3 | +++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-02-01 23:20:32 +0000 | |||
4 | @@ -44,6 +44,7 @@ | |||
5 | 44 | from lp.code.interfaces.diff import IPreviewDiff | 44 | from lp.code.interfaces.diff import IPreviewDiff |
6 | 45 | from lp.code.interfaces.hasbranches import IHasBranches, IHasMergeProposals | 45 | from lp.code.interfaces.hasbranches import IHasBranches, IHasMergeProposals |
7 | 46 | from lp.registry.interfaces.distribution import IDistribution | 46 | from lp.registry.interfaces.distribution import IDistribution |
8 | 47 | from lp.registry.interfaces.distributionmirror import IDistributionMirror | ||
9 | 47 | from lp.registry.interfaces.distributionsourcepackage import ( | 48 | from lp.registry.interfaces.distributionsourcepackage import ( |
10 | 48 | IDistributionSourcePackage) | 49 | IDistributionSourcePackage) |
11 | 49 | from lp.registry.interfaces.distroseries import IDistroSeries | 50 | from lp.registry.interfaces.distroseries import IDistroSeries |
12 | @@ -261,6 +262,10 @@ | |||
13 | 261 | IDistribution['all_distro_archives'].value_type.schema = IArchive | 262 | IDistribution['all_distro_archives'].value_type.schema = IArchive |
14 | 262 | 263 | ||
15 | 263 | 264 | ||
16 | 265 | # IDistributionMirror | ||
17 | 266 | IDistributionMirror['distribution'].schema = IDistribution | ||
18 | 267 | |||
19 | 268 | |||
20 | 264 | # IDistroSeries | 269 | # IDistroSeries |
21 | 265 | patch_entry_return_type( | 270 | patch_entry_return_type( |
22 | 266 | IDistroSeries, 'getDistroArchSeries', IDistroArchSeries) | 271 | IDistroSeries, 'getDistroArchSeries', IDistroArchSeries) |
23 | 267 | 272 | ||
24 | === modified file 'lib/lp/registry/interfaces/distribution.py' | |||
25 | --- lib/lp/registry/interfaces/distribution.py 2009-12-09 14:55:02 +0000 | |||
26 | +++ lib/lp/registry/interfaces/distribution.py 2010-02-01 23:20:32 +0000 | |||
27 | @@ -20,7 +20,7 @@ | |||
28 | 20 | 'NoSuchDistribution', | 20 | 'NoSuchDistribution', |
29 | 21 | ] | 21 | ] |
30 | 22 | 22 | ||
32 | 23 | from zope.schema import Bool, Choice, Datetime, List, Text, TextLine | 23 | from zope.schema import Bool, Choice, Datetime, List, Object, Text, TextLine |
33 | 24 | from zope.interface import Attribute, Interface | 24 | from zope.interface import Attribute, Interface |
34 | 25 | 25 | ||
35 | 26 | from lazr.restful.fields import CollectionField, Reference | 26 | from lazr.restful.fields import CollectionField, Reference |
36 | @@ -39,6 +39,7 @@ | |||
37 | 39 | IStructuralSubscriptionTarget) | 39 | IStructuralSubscriptionTarget) |
38 | 40 | from lp.app.interfaces.headings import IRootContext | 40 | from lp.app.interfaces.headings import IRootContext |
39 | 41 | from lp.registry.interfaces.announcement import IMakesAnnouncements | 41 | from lp.registry.interfaces.announcement import IMakesAnnouncements |
40 | 42 | from lp.registry.interfaces.distributionmirror import IDistributionMirror | ||
41 | 42 | from lp.bugs.interfaces.bugtarget import ( | 43 | from lp.bugs.interfaces.bugtarget import ( |
42 | 43 | IBugTarget, IOfficialBugTagTargetPublic, IOfficialBugTagTargetRestricted) | 44 | IBugTarget, IOfficialBugTagTargetPublic, IOfficialBugTagTargetRestricted) |
43 | 44 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 45 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
44 | @@ -184,18 +185,22 @@ | |||
45 | 184 | title=_("Members"), | 185 | title=_("Members"), |
46 | 185 | description=_("The distro's members team."), required=True, | 186 | description=_("The distro's members team."), required=True, |
47 | 186 | vocabulary='ValidPersonOrTeam') | 187 | vocabulary='ValidPersonOrTeam') |
49 | 187 | mirror_admin = PublicPersonChoice( | 188 | mirror_admin = exported(PublicPersonChoice( |
50 | 188 | title=_("Mirror Administrator"), | 189 | title=_("Mirror Administrator"), |
51 | 189 | description=_("The person or team that has the rights to review and " | 190 | description=_("The person or team that has the rights to review and " |
52 | 190 | "mark this distribution's mirrors as official."), | 191 | "mark this distribution's mirrors as official."), |
54 | 191 | required=True, vocabulary='ValidPersonOrTeam') | 192 | required=True, vocabulary='ValidPersonOrTeam')) |
55 | 192 | lucilleconfig = TextLine( | 193 | lucilleconfig = TextLine( |
56 | 193 | title=_("Lucille Config"), | 194 | title=_("Lucille Config"), |
57 | 194 | description=_("The Lucille Config."), required=False) | 195 | description=_("The Lucille Config."), required=False) |
62 | 195 | archive_mirrors = Attribute( | 196 | archive_mirrors = exported(CollectionField( |
63 | 196 | "All enabled and official ARCHIVE mirrors of this Distribution.") | 197 | description=_("All enabled and official ARCHIVE mirrors of this " |
64 | 197 | cdimage_mirrors = Attribute( | 198 | "Distribution."), |
65 | 198 | "All enabled and official RELEASE mirrors of this Distribution.") | 199 | readonly=True, value_type=Object(schema=IDistributionMirror))) |
66 | 200 | cdimage_mirrors = exported(CollectionField( | ||
67 | 201 | description=_("All enabled and official RELEASE mirrors of this " | ||
68 | 202 | "Distribution."), | ||
69 | 203 | readonly=True, value_type=Object(schema=IDistributionMirror))) | ||
70 | 199 | disabled_mirrors = Attribute( | 204 | disabled_mirrors = Attribute( |
71 | 200 | "All disabled and official mirrors of this Distribution.") | 205 | "All disabled and official mirrors of this Distribution.") |
72 | 201 | unofficial_mirrors = Attribute( | 206 | unofficial_mirrors = Attribute( |
73 | @@ -304,6 +309,10 @@ | |||
74 | 304 | `IDistroSeries.version`. | 309 | `IDistroSeries.version`. |
75 | 305 | """ | 310 | """ |
76 | 306 | 311 | ||
77 | 312 | @operation_parameters( | ||
78 | 313 | name=TextLine(title=_("Name"), required=True)) | ||
79 | 314 | @operation_returns_entry(IDistributionMirror) | ||
80 | 315 | @export_read_operation() | ||
81 | 307 | def getMirrorByName(name): | 316 | def getMirrorByName(name): |
82 | 308 | """Return the mirror with the given name for this distribution or None | 317 | """Return the mirror with the given name for this distribution or None |
83 | 309 | if it's not found. | 318 | if it's not found. |
84 | 310 | 319 | ||
85 | === modified file 'lib/lp/registry/interfaces/distributionmirror.py' | |||
86 | --- lib/lp/registry/interfaces/distributionmirror.py 2009-10-26 18:40:04 +0000 | |||
87 | +++ lib/lp/registry/interfaces/distributionmirror.py 2010-02-01 23:20:32 +0000 | |||
88 | @@ -27,6 +27,9 @@ | |||
89 | 27 | from zope.interface.interface import invariant | 27 | from zope.interface.interface import invariant |
90 | 28 | from zope.component import getUtility | 28 | from zope.component import getUtility |
91 | 29 | from lazr.enum import DBEnumeratedType, DBItem | 29 | from lazr.enum import DBEnumeratedType, DBItem |
92 | 30 | from lazr.restful.declarations import ( | ||
93 | 31 | export_as_webservice_entry, export_read_operation, exported) | ||
94 | 32 | from lazr.restful.fields import Reference | ||
95 | 30 | 33 | ||
96 | 31 | from canonical.launchpad import _ | 34 | from canonical.launchpad import _ |
97 | 32 | from canonical.launchpad.fields import ( | 35 | from canonical.launchpad.fields import ( |
98 | @@ -280,61 +283,68 @@ | |||
99 | 280 | 283 | ||
100 | 281 | class IDistributionMirror(Interface): | 284 | class IDistributionMirror(Interface): |
101 | 282 | """A mirror of a given distribution.""" | 285 | """A mirror of a given distribution.""" |
102 | 286 | export_as_webservice_entry() | ||
103 | 283 | 287 | ||
104 | 284 | id = Int(title=_('The unique id'), required=True, readonly=True) | 288 | id = Int(title=_('The unique id'), required=True, readonly=True) |
106 | 285 | owner = PublicPersonChoice( | 289 | owner = exported(PublicPersonChoice( |
107 | 286 | title=_('Owner'), required=False, readonly=True, | 290 | title=_('Owner'), required=False, readonly=True, |
109 | 287 | vocabulary='ValidOwner') | 291 | vocabulary='ValidOwner')) |
110 | 288 | reviewer = PublicPersonChoice( | 292 | reviewer = PublicPersonChoice( |
111 | 289 | title=_('Reviewer'), required=False, readonly=False, | 293 | title=_('Reviewer'), required=False, readonly=False, |
112 | 290 | vocabulary='ValidPersonOrTeam') | 294 | vocabulary='ValidPersonOrTeam') |
115 | 291 | distribution = Attribute(_("The distribution that is mirrored")) | 295 | distribution = exported( |
116 | 292 | name = DistributionMirrorNameField( | 296 | Reference( |
117 | 297 | Interface, | ||
118 | 298 | # Really IDistribution, circular import fixed in | ||
119 | 299 | # _schema_circular_imports. | ||
120 | 300 | title=_("Distribution"), required=True, | ||
121 | 301 | description=_("The distribution that is mirrored"))) | ||
122 | 302 | name = exported(DistributionMirrorNameField( | ||
123 | 293 | title=_('Name'), required=True, readonly=False, | 303 | title=_('Name'), required=True, readonly=False, |
124 | 294 | description=_('A short and unique name for this mirror.'), | 304 | description=_('A short and unique name for this mirror.'), |
127 | 295 | constraint=name_validator) | 305 | constraint=name_validator)) |
128 | 296 | displayname = TextLine( | 306 | displayname = exported(TextLine( |
129 | 297 | title=_('Organisation'), required=False, readonly=False, | 307 | title=_('Organisation'), required=False, readonly=False, |
134 | 298 | description=_('The name of the organization hosting this mirror.')) | 308 | description=_('The name of the organization hosting this mirror.'))) |
135 | 299 | description = TextLine( | 309 | description = exported(TextLine( |
136 | 300 | title=_('Description'), required=False, readonly=False) | 310 | title=_('Description'), required=False, readonly=False)) |
137 | 301 | http_base_url = DistroMirrorHTTPURIField( | 311 | http_base_url = exported(DistroMirrorHTTPURIField( |
138 | 302 | title=_('HTTP URL'), required=False, readonly=False, | 312 | title=_('HTTP URL'), required=False, readonly=False, |
139 | 303 | allowed_schemes=['http'], allow_userinfo=False, | 313 | allowed_schemes=['http'], allow_userinfo=False, |
140 | 304 | allow_query=False, allow_fragment=False, trailing_slash=True, | 314 | allow_query=False, allow_fragment=False, trailing_slash=True, |
143 | 305 | description=_('e.g.: http://archive.ubuntu.com/ubuntu/')) | 315 | description=_('e.g.: http://archive.ubuntu.com/ubuntu/'))) |
144 | 306 | ftp_base_url = DistroMirrorFTPURIField( | 316 | ftp_base_url = exported(DistroMirrorFTPURIField( |
145 | 307 | title=_('FTP URL'), required=False, readonly=False, | 317 | title=_('FTP URL'), required=False, readonly=False, |
146 | 308 | allowed_schemes=['ftp'], allow_userinfo=False, | 318 | allowed_schemes=['ftp'], allow_userinfo=False, |
147 | 309 | allow_query=False, allow_fragment=False, trailing_slash=True, | 319 | allow_query=False, allow_fragment=False, trailing_slash=True, |
150 | 310 | description=_('e.g.: ftp://archive.ubuntu.com/ubuntu/')) | 320 | description=_('e.g.: ftp://archive.ubuntu.com/ubuntu/'))) |
151 | 311 | rsync_base_url = DistroMirrorRsyncURIField( | 321 | rsync_base_url = exported(DistroMirrorRsyncURIField( |
152 | 312 | title=_('Rsync URL'), required=False, readonly=False, | 322 | title=_('Rsync URL'), required=False, readonly=False, |
153 | 313 | allowed_schemes=['rsync'], allow_userinfo=False, | 323 | allowed_schemes=['rsync'], allow_userinfo=False, |
154 | 314 | allow_query=False, allow_fragment=False, trailing_slash=True, | 324 | allow_query=False, allow_fragment=False, trailing_slash=True, |
157 | 315 | description=_('e.g.: rsync://archive.ubuntu.com/ubuntu/')) | 325 | description=_('e.g.: rsync://archive.ubuntu.com/ubuntu/'))) |
158 | 316 | enabled = Bool( | 326 | enabled = exported(Bool( |
159 | 317 | title=_('This mirror was probed successfully.'), | 327 | title=_('This mirror was probed successfully.'), |
162 | 318 | required=False, readonly=False, default=False) | 328 | required=False, readonly=False, default=False)) |
163 | 319 | speed = Choice( | 329 | speed = exported(Choice( |
164 | 320 | title=_('Link Speed'), required=True, readonly=False, | 330 | title=_('Link Speed'), required=True, readonly=False, |
166 | 321 | vocabulary=MirrorSpeed) | 331 | vocabulary=MirrorSpeed)) |
167 | 322 | country = Choice( | 332 | country = Choice( |
168 | 323 | title=_('Location'), required=True, readonly=False, | 333 | title=_('Location'), required=True, readonly=False, |
169 | 324 | vocabulary='CountryName') | 334 | vocabulary='CountryName') |
171 | 325 | content = Choice( | 335 | content = exported(Choice( |
172 | 326 | title=_('Content'), required=True, readonly=False, | 336 | title=_('Content'), required=True, readonly=False, |
173 | 327 | description=_( | 337 | description=_( |
174 | 328 | 'Choose "CD Image" if this mirror contains CD images of ' | 338 | 'Choose "CD Image" if this mirror contains CD images of ' |
175 | 329 | 'this distribution. Choose "Archive" if this is a ' | 339 | 'this distribution. Choose "Archive" if this is a ' |
176 | 330 | 'mirror of packages for this distribution.'), | 340 | 'mirror of packages for this distribution.'), |
179 | 331 | vocabulary=MirrorContent) | 341 | vocabulary=MirrorContent)) |
180 | 332 | official_candidate = Bool( | 342 | official_candidate = exported(Bool( |
181 | 333 | title=_('Apply to be an official mirror of this distribution'), | 343 | title=_('Apply to be an official mirror of this distribution'), |
184 | 334 | required=False, readonly=False, default=True) | 344 | required=False, readonly=False, default=True)) |
185 | 335 | status = Choice( | 345 | status = exported(Choice( |
186 | 336 | title=_('Status'), required=True, readonly=False, | 346 | title=_('Status'), required=True, readonly=False, |
188 | 337 | vocabulary=MirrorStatus) | 347 | vocabulary=MirrorStatus)) |
189 | 338 | 348 | ||
190 | 339 | title = Attribute('The title of this mirror') | 349 | title = Attribute('The title of this mirror') |
191 | 340 | cdimage_series = Attribute( | 350 | cdimage_series = Attribute( |
192 | @@ -345,11 +355,11 @@ | |||
193 | 345 | last_probe_record = Attribute( | 355 | last_probe_record = Attribute( |
194 | 346 | 'The last MirrorProbeRecord for this mirror.') | 356 | 'The last MirrorProbeRecord for this mirror.') |
195 | 347 | all_probe_records = Attribute('All MirrorProbeRecords for this mirror.') | 357 | all_probe_records = Attribute('All MirrorProbeRecords for this mirror.') |
198 | 348 | has_ftp_or_rsync_base_url = Bool( | 358 | has_ftp_or_rsync_base_url = exported(Bool( |
199 | 349 | title=_('Does this mirror have a ftp or rsync base URL?')) | 359 | title=_('Does this mirror have a ftp or rsync base URL?'))) |
200 | 350 | base_url = Attribute('The HTTP or FTP base URL of this mirror') | 360 | base_url = Attribute('The HTTP or FTP base URL of this mirror') |
203 | 351 | date_created = Datetime( | 361 | date_created = exported(Datetime( |
204 | 352 | title=_('Date Created'), required=True, readonly=True) | 362 | title=_('Date Created'), required=True, readonly=True)) |
205 | 353 | date_reviewed = Datetime( | 363 | date_reviewed = Datetime( |
206 | 354 | title=_('Date reviewed'), required=False, readonly=False) | 364 | title=_('Date reviewed'), required=False, readonly=False) |
207 | 355 | whiteboard = Whiteboard( | 365 | whiteboard = Whiteboard( |
208 | @@ -380,6 +390,7 @@ | |||
209 | 380 | each distro_arch_series of this distribution mirror. | 390 | each distro_arch_series of this distribution mirror. |
210 | 381 | """ | 391 | """ |
211 | 382 | 392 | ||
212 | 393 | @export_read_operation() | ||
213 | 383 | def getOverallFreshness(): | 394 | def getOverallFreshness(): |
214 | 384 | """Return this mirror's overall freshness. | 395 | """Return this mirror's overall freshness. |
215 | 385 | 396 | ||
216 | @@ -392,6 +403,7 @@ | |||
217 | 392 | contain one or more ISO images. | 403 | contain one or more ISO images. |
218 | 393 | """ | 404 | """ |
219 | 394 | 405 | ||
220 | 406 | @export_read_operation() | ||
221 | 395 | def isOfficial(): | 407 | def isOfficial(): |
222 | 396 | """Return True if this is an official mirror.""" | 408 | """Return True if this is an official mirror.""" |
223 | 397 | 409 | ||
224 | 398 | 410 | ||
225 | === added file 'lib/lp/registry/stories/webservice/xx-distribution-mirror.txt' | |||
226 | --- lib/lp/registry/stories/webservice/xx-distribution-mirror.txt 1970-01-01 00:00:00 +0000 | |||
227 | +++ lib/lp/registry/stories/webservice/xx-distribution-mirror.txt 2010-02-01 23:20:32 +0000 | |||
228 | @@ -0,0 +1,75 @@ | |||
229 | 1 | = Distribution Mirrors = | ||
230 | 2 | |||
231 | 3 | For every mirror of distribution we publish most of its attributes. For archive | ||
232 | 4 | mirrors: | ||
233 | 5 | |||
234 | 6 | >>> from lazr.restful.testing.webservice import pprint_entry | ||
235 | 7 | >>> distros = webservice.get("/distros").jsonBody() | ||
236 | 8 | >>> distro = distros['entries'][0] | ||
237 | 9 | >>> ubuntu = webservice.get(distro['self_link']).jsonBody() | ||
238 | 10 | >>> ubuntu_archive_mirrors = webservice.get(ubuntu['archive_mirrors_collection_link']).jsonBody() | ||
239 | 11 | >>> canonical_archive = ubuntu_archive_mirrors['entries'][0] | ||
240 | 12 | >>> canonical_archive_json = webservice.get(canonical_archive['self_link']).jsonBody() | ||
241 | 13 | >>> pprint_entry(canonical_archive_json) | ||
242 | 14 | content: u'Archive' | ||
243 | 15 | date_created: u'2006-10-16T18:31:43.434567+00:00' | ||
244 | 16 | description: None | ||
245 | 17 | displayname: None | ||
246 | 18 | distribution_link: u'http://.../ubuntu' | ||
247 | 19 | enabled: True | ||
248 | 20 | ftp_base_url: None | ||
249 | 21 | has_ftp_or_rsync_base_url: False | ||
250 | 22 | http_base_url: u'http://archive.ubuntu.com/ubuntu/' | ||
251 | 23 | name: u'canonical-archive' | ||
252 | 24 | official_candidate: True | ||
253 | 25 | owner_link: u'http://.../~mark' | ||
254 | 26 | resource_type_link: u'http://.../#distribution_mirror' | ||
255 | 27 | rsync_base_url: None | ||
256 | 28 | self_link: u'http://.../ubuntu/+mirror/canonical-archive' | ||
257 | 29 | speed: u'100 Mbps' | ||
258 | 30 | status: u'Official' | ||
259 | 31 | |||
260 | 32 | And CD image mirrors: | ||
261 | 33 | |||
262 | 34 | >>> ubuntu_cd_mirrors = webservice.get(ubuntu['cdimage_mirrors_collection_link']).jsonBody() | ||
263 | 35 | >>> canonical_releases = ubuntu_cd_mirrors['entries'][0] | ||
264 | 36 | >>> canonical_releases_json = webservice.get(canonical_releases['self_link']).jsonBody() | ||
265 | 37 | >>> pprint_entry(canonical_releases_json) | ||
266 | 38 | content: u'CD Image' | ||
267 | 39 | date_created: u'2006-10-16T18:31:43.434567+00:00' | ||
268 | 40 | description: None | ||
269 | 41 | displayname: None | ||
270 | 42 | distribution_link: u'http://.../ubuntu' | ||
271 | 43 | enabled: True | ||
272 | 44 | ftp_base_url: None | ||
273 | 45 | has_ftp_or_rsync_base_url: False | ||
274 | 46 | http_base_url: u'http://releases.ubuntu.com/' | ||
275 | 47 | name: u'canonical-releases' | ||
276 | 48 | official_candidate: True | ||
277 | 49 | owner_link: u'http://.../~mark' | ||
278 | 50 | resource_type_link: u'http://.../#distribution_mirror' | ||
279 | 51 | rsync_base_url: None | ||
280 | 52 | self_link: u'http://.../ubuntu/+mirror/canonical-releases' | ||
281 | 53 | speed: u'100 Mbps' | ||
282 | 54 | status: u'Official' | ||
283 | 55 | |||
284 | 56 | = Distribution Mirror Custom Operations = | ||
285 | 57 | |||
286 | 58 | DistributionMirror has some custom operations. | ||
287 | 59 | |||
288 | 60 | "isOfficial" returns a boolean result on whether a mirror is an official mirror | ||
289 | 61 | or not. | ||
290 | 62 | |||
291 | 63 | >>> is_official_mirror = webservice.named_get(canonical_releases['self_link'], | ||
292 | 64 | ... 'isOfficial').jsonBody() | ||
293 | 65 | >>> print is_official_mirror | ||
294 | 66 | True | ||
295 | 67 | |||
296 | 68 | "getOverallFreshness" returns the freshness of the mirror determined by the | ||
297 | 69 | mirror prober from the mirror's last probe. | ||
298 | 70 | |||
299 | 71 | >>> releases_mirror2 = ubuntu_cd_mirrors['entries'][2] | ||
300 | 72 | >>> freshness = webservice.named_get(releases_mirror2['self_link'], | ||
301 | 73 | ... 'getOverallFreshness').jsonBody() | ||
302 | 74 | >>> print freshness | ||
303 | 75 | Up to date | ||
304 | 0 | 76 | ||
305 | === modified file 'lib/lp/registry/stories/webservice/xx-distribution.txt' | |||
306 | --- lib/lp/registry/stories/webservice/xx-distribution.txt 2009-05-08 20:20:40 +0000 | |||
307 | +++ lib/lp/registry/stories/webservice/xx-distribution.txt 2010-02-01 23:20:32 +0000 | |||
308 | @@ -21,8 +21,10 @@ | |||
309 | 21 | active: True | 21 | active: True |
310 | 22 | active_milestones_collection_link: u'http://.../ubuntu/active_milestones' | 22 | active_milestones_collection_link: u'http://.../ubuntu/active_milestones' |
311 | 23 | all_milestones_collection_link: u'http://.../ubuntu/all_milestones' | 23 | all_milestones_collection_link: u'http://.../ubuntu/all_milestones' |
312 | 24 | archive_mirrors_collection_link: u'http://.../ubuntu/archive_mirrors' | ||
313 | 24 | archives_collection_link: u'http://.../ubuntu/archives' | 25 | archives_collection_link: u'http://.../ubuntu/archives' |
314 | 25 | bug_reporting_guidelines: None | 26 | bug_reporting_guidelines: None |
315 | 27 | cdimage_mirrors_collection_link: u'http://.../ubuntu/cdimage_mirrors' | ||
316 | 26 | current_series_link: u'http://.../ubuntu/hoary' | 28 | current_series_link: u'http://.../ubuntu/hoary' |
317 | 27 | date_created: u'2006-10-16T18:31:43.415195+00:00' | 29 | date_created: u'2006-10-16T18:31:43.415195+00:00' |
318 | 28 | description: u'Ubuntu is a new approach...' | 30 | description: u'Ubuntu is a new approach...' |
319 | @@ -33,6 +35,7 @@ | |||
320 | 33 | icon_link: u'http://.../ubuntu/icon' | 35 | icon_link: u'http://.../ubuntu/icon' |
321 | 34 | logo_link: u'http://.../ubuntu/logo' | 36 | logo_link: u'http://.../ubuntu/logo' |
322 | 35 | main_archive_link: u'http://.../ubuntu/+archive/primary' | 37 | main_archive_link: u'http://.../ubuntu/+archive/primary' |
323 | 38 | mirror_admin_link: u'http://.../~ubuntu-mirror-admins' | ||
324 | 36 | mugshot_link: u'http://.../ubuntu/mugshot' | 39 | mugshot_link: u'http://.../ubuntu/mugshot' |
325 | 37 | name: u'ubuntu' | 40 | name: u'ubuntu' |
326 | 38 | official_bug_tags: [] | 41 | official_bug_tags: [] |
327 | @@ -112,3 +115,27 @@ | |||
328 | 112 | http://.../ubuntu/+source/alsa-utils | 115 | http://.../ubuntu/+source/alsa-utils |
329 | 113 | http://.../ubuntu/+source/foobar | 116 | http://.../ubuntu/+source/foobar |
330 | 114 | http://.../ubuntu/+source/commercialpackage | 117 | http://.../ubuntu/+source/commercialpackage |
331 | 118 | |||
332 | 119 | "getMirrorByName" returns a mirror by its unique name. | ||
333 | 120 | |||
334 | 121 | >>> canonical_releases = webservice.named_get( | ||
335 | 122 | ... ubuntu['self_link'], 'getMirrorByName', | ||
336 | 123 | ... name='canonical-releases').jsonBody() | ||
337 | 124 | >>> pprint_entry(canonical_releases) | ||
338 | 125 | content: u'CD Image' | ||
339 | 126 | date_created: u'2006-10-16T18:31:43.434567+00:00' | ||
340 | 127 | description: None | ||
341 | 128 | displayname: None | ||
342 | 129 | distribution_link: u'http://.../ubuntu' | ||
343 | 130 | enabled: True | ||
344 | 131 | ftp_base_url: None | ||
345 | 132 | has_ftp_or_rsync_base_url: False | ||
346 | 133 | http_base_url: u'http://releases.ubuntu.com/' | ||
347 | 134 | name: u'canonical-releases' | ||
348 | 135 | official_candidate: True | ||
349 | 136 | owner_link: u'http://.../~mark' | ||
350 | 137 | resource_type_link: u'http://.../#distribution_mirror' | ||
351 | 138 | rsync_base_url: None | ||
352 | 139 | self_link: u'http://.../ubuntu/+mirror/canonical-releases' | ||
353 | 140 | speed: u'100 Mbps' | ||
354 | 141 | status: u'Official' |
= Summary =
Distribution mirrors should be exposed via the Launchpad API. This branch makes the necessary changes to make this a reality.