Bugzilla – Bug 5871
publisher apis desired
Last modified: 2009-04-03 06:54:42 UTC
You need to log in before you can comment on or make changes to this bug.
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
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)
We also need to know whether an authority is enabled or disabled and to enable or disable an authority.
We also need to be able to add and remove mirrors.
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
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
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
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.
Work already in progress.
*** Bug 2339 has been marked as a duplicate of this bug. ***
Implemented in changeset 926 / 6ee411c9026af426a657cb1f5e4b73c14c2e1112.