Bug 5871 - publisher apis desired
: publisher apis desired
Status: RESOLVED FIXINSOURCE
Product: pkg
api-python
: in96 (bfe78d71dc9a)
: Other Solaris
: P3 enhancement (vote)
: ---
Assigned To: Shawn Walker
: pkg/api-python watcher
:
: api
:
:
: 3388 2283 5197 5373 6352 6843 6871 6897 7046
  Show dependency treegraph
 
Reported: 2008-12-17 03:35 UTC by John Rice
Modified: 2009-04-03 06:54 UTC (History)
5 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description John Rice 2008-12-17 03:35:25 UTC
Authority API's required by PM client to allow us remove calls to internal IPS
functions.

Function:
api.get_authorities()
- Return list of AuthorityInfo objects, one for each registered authority.

Currently using img.gen_authorities() and img.get_default_authority() to get
this info.
Performance:
- The maximum time of this call should be 0.1sec

Object: 
AuthorityInfo()

Fields:
- authority: 'opensolaris.org'
- origin: 'http://pkg.opensolaris.org/release'
- ssl_key: None
- ssl_cert: None
- uuid: '2697f04c-c08d-11dd-a2d1-008027f49158' (optional)
- mirrors[]
- preferred: True/ False

Function:
api.set_authority(AuthorityInfo)
- Add authority specified in the AuthorityInfo object, if preferred is set to
True, set as preferred authority
Performance:
- Used when adding repo in Manage Repositories, so < 10 seconds is fine

Function:
api.unset_authority(authority)
- Unset specified authority (string).
Performance:
- Used when removing repo in Manage Repositories, so < 10 seconds is fine
Comment 1 John Rice 2008-12-17 03:39:03 UTC
Performance Criteria:
----------------------
- Agree on a test machine spec: MacBook Pro 2 Gig Hz 2 Gig RAM machine, and
Toshiba Tecra 1.2 GigHz 1 Gig RAM
- Will have different performance criteria for each type.
- Agree on number of registered repos for Authority operations, say 5.
- Agree on repo size for per repo listing operation tests (we are currently
working against opensolaris.org (~20k FMRI's and ~2k Unique Package Names). I
would like to add in contrib and pending to get additional timing tests for
different repo sizes. I would expect there to be different criteria based on
repo size.
- Agree on network speeds to test against (DSL line, a cable modem, and across
a wired LAN)
Comment 2 Padraig O'Briain 2009-01-13 07:49:21 UTC
We also need to know whether an authority is enabled or disabled and to enable
or disable an authority.
Comment 3 Padraig O'Briain 2009-01-21 02:14:02 UTC
We also need to be able to add and remove mirrors.
Comment 4 John Rice 2009-02-13 05:42:20 UTC
After discussions about this:

AuthorityInfo Fields:
- authority_name: Optional
- origin_urls: one or more Required.
- mirrors: one or more, Optional
- update_period:  Optional
- license_url:  Optional.
- registration_url: Optional
- registration_protocol: Optional
- ssl_key: None
- ssl_cert: None
- mirrors[]
- preferred: True/ False
- status: True/ False - registered, not registered
- enabled: True/ Fale
Comment 5 John Rice 2009-02-13 23:21:44 UTC
Change status to registered

AuthorityInfo Fields:
- authority_name: Optional
- origin_urls: one or more Required.
- mirrors: one or more, Optional
- update_period:  Optional
- license_url:  Optional.
- registration_url: Optional
- registration_protocol: Optional
- ssl_key: None
- ssl_cert: None
- mirrors[]
- preferred: True/ False
- regustered: True/ False
- enabled: True/ Fale
Comment 6 John Rice 2009-02-13 23:23:04 UTC
Would be good if I could spell:

AuthorityInfo Fields:
- authority_name: Optional
- origin_urls: one or more Required.
- mirrors: one or more, Optional
- update_period:  Optional
- license_url:  Optional.
- registration_url: Optional
- registration_protocol: Optional
- ssl_key: None
- ssl_cert: None
- mirrors[]
- preferred: True/ False
- registered: True/ False
- enabled: True/ Fale
Comment 7 John Rice 2009-02-13 23:49:15 UTC
Function:
api.parse_authority_info(<path to mimetype file|origin_url>)
- Param path to .p5i mimetype file or authority origin url.
- Return a list of tuples, each tuple containing an AuhtorityInfo object and an
optional list of packages to install if .p5i mimetype file passed in. If an
origin url is passed in the returned list of tuples will only contain the
AuthorityInfo and None for the list of packages.
Performance:
- Will be fetching information from the depot using authority/0 query, so is
network dependent, should time out in < 15 sec if network problems and raise
appropriate exception.
- Consumes a .p5i mimetype file in JSON format that contains, at least one or
more origin_url and optional set of packages to install, along the lines of:
{
  {
   "origin_url": "http://example1", <required>
     {
         "package_name": "foobar1"} <optional>
     },
     {
         "package_name": "foobar2"} <optional>
     },
   },
  {
   "origin_url": "http://example2", <required>
     {
         "package_name": "foo1"} <optional>
     },
     {
         "package_name": "foo2"} <optional>
     },
   },
}


Function:
api.save_authority_info(<list of tuples>, <path to mimetype file>)

- Param, list of tuples, each tuple containing an AuhtorityInfo object and an
optional list of package names
- Generates a .p5i file containing in JSON format a list of the authority
orign_urls and related package_names if any. Can be consumed by the
parse_authority_info() api, to add authorities and install packages from these
authorities.
Performance:
- Expected to be fast, but is dependent on the size of the list passed into it.
Shold be tested on list containing 1000 package names to make sure performance
is < 2secs.
- Generates a .p5i mimetype file in JSON format that contains, at least one or
more origin_url and optional set of package names.
Comment 8 Shawn Walker 2009-02-27 11:57:42 UTC
Work already in progress.
Comment 9 Tom Mueller 2009-03-03 14:14:58 UTC
*** Bug 2339 has been marked as a duplicate of this bug. ***
Comment 10 Shawn Walker 2009-03-09 14:27:01 UTC
Implemented in changeset 926 / 6ee411c9026af426a657cb1f5e4b73c14c2e1112.