doc/client_api_versions.txt
author Shawn Walker <srw@sun.com>
Wed, 02 Dec 2009 19:21:44 -0600
changeset 1537 00a5b4d54eb8
parent 1505 cc598d70bbbe
child 1538 78ac66abc186
permissions -rw-r--r--
5872 List APIs required 11541 Some pkg(5) list options should be mutually exclusive 12929 image.py:get_publisher_ranks can traceback after older client configuration changes 12946 pkg list should provide way to list only newest versions of all packages
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1537
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     1
Version 25:
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     2
Incompatible with clients using versions 0-24:
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     3
Changes:
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     4
    The PackageInfo class has changed as follows:
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     5
        * The NOT_INSTALLED constant has been removed as checking
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     6
          for the presence of INSTALLED should be sufficient.
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     7
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     8
        * A new constant named 'KNOWN' has been added.  It indicates
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
     9
          that the package is currently available from a publisher's
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    10
           repository.
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    11
     
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    12
         * A new constant named 'UPGRADABLE' has been added. It
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    13
           indicates that a new version of the package is available.
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    14
 
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    15
     The following new api functions were added to ImageInterface (see
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    16
     'pydoc pkg.client.api.ImageInterface' for more information):
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    17
         * get_pkg_categories
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    18
 
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    19
         * get_pkg_list
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    20
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    21
Version 24:
1537
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    22
Incompatible with clients using versions 0-23.
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    23
    The pkg.client.api module has changed as follows:
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    24
        * plan_install no longer takes a filters argument
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    25
	* plan_change_variant changed to plan_change_varcets.
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    26
	  w/ argument list changes.
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    27
	* Added get_pub_search_order
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    28
	* Added set_pub_search_after
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    29
	* Added set_pub_search_before
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
    30
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1389
diff changeset
    31
Version 23:
1537
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    32
Incompatible with clients using versions 0-22.
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1389
diff changeset
    33
    The pkg.client.api module has changed as follows:
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1389
diff changeset
    34
        * PackageInfo objects no longer take a "state" parameter, but a
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1389
diff changeset
    35
	  "states" parameter, and the corresponding "state" member is now
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1389
diff changeset
    36
	  "states", and is a list of states, rather than a single value.
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1389
diff changeset
    37
1389
1827f487a235 8868 Changes needed to handle package descriptions in the pkg Python API.
Brock Pytlik <bpytlik@sun.com>
parents: 1352
diff changeset
    38
Version 22:
1827f487a235 8868 Changes needed to handle package descriptions in the pkg Python API.
Brock Pytlik <bpytlik@sun.com>
parents: 1352
diff changeset
    39
Compatible with clients using version 21.
1827f487a235 8868 Changes needed to handle package descriptions in the pkg Python API.
Brock Pytlik <bpytlik@sun.com>
parents: 1352
diff changeset
    40
Changes:
1827f487a235 8868 Changes needed to handle package descriptions in the pkg Python API.
Brock Pytlik <bpytlik@sun.com>
parents: 1352
diff changeset
    41
	Adds the description field to the PackageInfo class.
1827f487a235 8868 Changes needed to handle package descriptions in the pkg Python API.
Brock Pytlik <bpytlik@sun.com>
parents: 1352
diff changeset
    42
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1335
diff changeset
    43
Version 21:
1537
00a5b4d54eb8 5872 List APIs required
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
    44
Incompatible with clients using versions 0-20.
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1335
diff changeset
    45
Changes:
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1335
diff changeset
    46
    The pkg.client.api_errors module has changed as follows:
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1335
diff changeset
    47
        * All CatalogCacheError class exceptions were removed as the
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1335
diff changeset
    48
          catalog cache no longer exists.
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1335
diff changeset
    49
1335
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    50
Version 20:
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    51
Compatible with clients using version 19.
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    52
Changes:
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    53
   The following exceptions were added to pkg.client.api_errors:
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    54
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    55
   class ReadOnlyFileSystemException(PermissionsException):
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    56
   """Used to indicate that the operation was attempted on a
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    57
   read-only filesystem"""
3dde2385d05c 516 Clean up traceback for installs to read-only filesystems
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1279
diff changeset
    58
1279
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    59
Version 19:
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    60
Incompatible with clients using versions 0-18.
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    61
Changes:
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    62
    The ImageInterface class changed as follows:
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    63
        * plan_update_all no longer returns a third value, the exception
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    64
          caught.  This value was never set.
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    65
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    66
        * plan_install no longer returns a second value, the exception
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    67
          caught.  This value was never set.
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    68
1256
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    69
Version 18:
1279
12624144230f 10419 client api revisions doc update required
Shawn Walker <srw@sun.com>
parents: 1256
diff changeset
    70
Compatible with clients using versions 15-17.
1256
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    71
Changes:
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    72
   The following exceptions were added to pkg.client.api_errors:
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    73
    
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    74
    class SetDisabledPublisherPreferred(PublisherError):
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    75
        """Used to indicate an attempt to set a disabled publisher as
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    76
        the preferred publisher was made."""
921590dc232b 8863 error message unclear when trying to disable preferred publisher
Shawn Walker <srw@sun.com>
parents: 1255
diff changeset
    77
1255
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    78
Version 17:
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    79
Compatible with clients using versions 15-16.
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    80
Changes:
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    81
    The following properties were added to pkg.client.api
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    82
    ImageInterface class:
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    83
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    84
        root
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    85
            The absolute pathname of the filesystem root of the image.
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    86
            This property is read-only.
13914487fd06 8854 access to ImageInterface img root desired
Shawn Walker <srw@sun.com>
parents: 1254
diff changeset
    87
1254
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    88
Version 16:
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    89
Compatible with clients using version 15.
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    90
Changes:
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    91
   The following exceptions were added to pkg.client.api_errors:
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    92
    
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    93
    class NoSuchKey(CertificateError):
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    94
        """Used to indicate that a key could not be found."""
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    95
1141
a74d6815a7fc 4178 unfound_fmris is a poor name
Rich Burridge <rich.burridge@sun.com>
parents: 1087
diff changeset
    96
Version 15:
a74d6815a7fc 4178 unfound_fmris is a poor name
Rich Burridge <rich.burridge@sun.com>
parents: 1087
diff changeset
    97
Incompatible with clients using versions 1-14.
a74d6815a7fc 4178 unfound_fmris is a poor name
Rich Burridge <rich.burridge@sun.com>
parents: 1087
diff changeset
    98
Changes:
1254
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
    99
    The unfound_fmris variable in the
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
   100
    pkg.client.api_errors.PlanCreationException class is now called 
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
   101
    unmatched_fmris.
1141
a74d6815a7fc 4178 unfound_fmris is a poor name
Rich Burridge <rich.burridge@sun.com>
parents: 1087
diff changeset
   102
1087
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   103
Version 14:
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   104
Compatible with clients using versions 12-14.
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   105
Changes:
1254
28871b08d49c 8463 missing key file error message says certificate is missing
Shawn Walker <srw@sun.com>
parents: 1141
diff changeset
   106
    The following methods were added to pkg.client.publisher.Publisher:
1087
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   107
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   108
        def create_meta_root(self):
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   109
                """Create the publisher's meta_root."""
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   110
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   111
        def remove_meta_root(self):
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   112
                """Removes the publisher's meta_root."""
293c0aa5f32e 8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents: 996
diff changeset
   113
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   114
Version 13:
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   115
Compatible with clients using version 12.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   116
Changes:
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   117
    By default, publisher repositories will be checked for new metadata no more
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   118
    than once every four hours unless otherwise requested.  Each time a
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   119
    publisher's selected repository is checked for updates, the client will
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   120
    store a timestamp (in UTC) marking when the refresh was performed.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   121
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   122
    ImageInterface.refresh() has changed as follows:
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   123
        * Changed 'full_refresh' to an optional keyword argument that defaults
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   124
          to False.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   125
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   126
        * Added optional boolean keyword 'immediate' that allows the client to
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   127
          request that a publisher be checked for updates even if a check is
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   128
          not yet needed.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   129
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   130
        * Changed to properly use progress tracker for refreshing of publisher
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   131
          metadata.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   132
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   133
        * Now only refreshes publisher metadata based on the update interval
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   134
          specified by the refresh_seconds property on the publisher's
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   135
          selected_repository.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   136
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   137
    ImageInterface.update_publisher() has changed as follows:
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   138
        * When updating a publisher with 'refresh_allowed' set to False, its
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   139
          catalog will no longer be removed.  Instead, it is marked as needing
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   140
          refresh, and the next time the client can do so, it will.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   141
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   142
    pkg.client.publisher.Publisher has changed as follows:
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   143
        * New property 'last_refreshed':
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   144
                A datetime object representing the time (in UTC) the
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   145
                publisher's selected repository was last refreshed for new
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   146
                metadata (such as catalog updates).  'None' if the publisher
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   147
                hasn't been refreshed yet or the time is not available.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   148
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   149
          The above property will be automatically set by the api as needed
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   150
          although api consumers are free to retrieve its value.  Manually
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   151
          setting this value is not recommended.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   152
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   153
        * New property 'meta_root':
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   154
                The absolute pathname of the directory where the publisher's
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   155
                metadata should be written to and read from.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   156
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   157
          The above property will be automatically set by the api as needed
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   158
          although api consumers are free to retrieve its value.  Manually
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   159
          setting this value is not recommended.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   160
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   161
        * New property 'needs_refresh':
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   162
                A boolean value indicating whether the publisher's metadata for
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   163
                the currently selected repository needs to be refreshed.
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   164
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
   165
Version 12:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
   166
Incompatible with clients using versions 1-12
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
   167
Changes:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
   168
    This versions adds local_search and remote_search to the api and removes
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
   169
    those functions from pkg.client.image.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
   170
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   171
Version 11:
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   172
Incompatible with clients using versions 1-10
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   173
Changes:
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   174
   This version changes all parameter names and property names from 'authority'
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   175
   to 'publisher'.  For example, parameters named 'auths' were changed to
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   176
   'pubs'; parameters named 'authent' were changed to 'pubent' and so forth.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   177
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   178
   In addition, the following new api functions were added to ImageInterface:
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   179
        def add_publisher(self, pub, refresh_allowed=True):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   180
                """Add the provided publisher object to the image
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   181
                configuration."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   182
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   183
        def get_preferred_publisher(self):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   184
                """Returns the preferred publisher object for the image."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   185
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   186
        def get_publisher(self, prefix=None, alias=None, duplicate=False):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   187
                """Retrieves a publisher object matching the provided prefix
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   188
                (name) or alias.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   189
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   190
                'duplicate' is an optional boolean value indicating whether
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   191
                a copy of the publisher object should be returned instead
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   192
                of the original.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   193
                """
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   194
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   195
        def get_publishers(self, duplicate=False):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   196
                """Returns a list of the publisher objects for the current
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   197
                image.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   198
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   199
                'duplicate' is an optional boolean value indicating whether
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   200
                copies of the publisher objects should be returned instead
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   201
                of the originals.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   202
                """
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   203
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   204
        def get_publisher_last_update_time(self, prefix=None, alias=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   205
                """Returns a datetime object representing the last time the
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   206
                catalog for a publisher was modified or None."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   207
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   208
        def has_publisher(self, prefix=None, alias=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   209
                """Retrieves a publisher object matching the provided prefix
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   210
                (name) or alias."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   211
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   212
        def remove_publisher(self, prefix=None, alias=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   213
                """Removes a publisher object matching the provided prefix
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   214
                (name) or alias."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   215
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   216
        def set_preferred_publisher(self, prefix=None, alias=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   217
                """Sets the preferred publisher for the image."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   218
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   219
        def update_publisher(self, pub, refresh_allowed=True):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   220
                """Replaces an existing publisher object with the provided one
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   221
                using the _source_object_id identifier set during copy."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   222
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   223
        def update_publisher(self, pub, refresh_allowed=True):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   224
                """Replaces an existing publisher object with the provided one
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   225
                using the _source_object_id identifier set during copy.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   226
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   227
                'refresh_allowed' is an optional boolean value indicating
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   228
                whether a refresh of publisher metadata (such as its catalog)
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   229
                should be performed if transport information is changed for a
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   230
                repository, mirror, or origin.  If False, no attempt will be
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   231
                made to retrieve publisher metadata."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   232
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   233
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   234
        def log_operation_end(self, error=None, result=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   235
                """Marks the end of an operation to be recorded in image
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   236
                history.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   237
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   238
                'result' should be a pkg.client.history constant value
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   239
                representing the outcome of an operation.  If not provided,
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   240
                and 'error' is provided, the final result of the operation will
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   241
                be based on the class of 'error' and 'error' will be recorded
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   242
                for the current operation.  If 'result' and 'error' is not
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   243
                provided, success is assumed."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   244
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   245
        def log_operation_error(self, error):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   246
                """Adds an error to the list of errors to be recorded in image
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   247
                history for the current opreation."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   248
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   249
        def log_operation_start(self, name):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   250
                """Marks the start of an operation to be recorded in image
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   251
                history."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   252
 
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   253
        def parse_p5i(self, fileobj=None, location=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   254
                """Reads the pkg(5) publisher json formatted data at 'location'
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   255
                or from the provided file-like object 'fileobj' and returns a
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   256
                list of tuples of the format (publisher object, pkg_names).
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   257
                pkg_names is a list of strings representing package names or
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   258
                FMRIs.  If any pkg_names not specific to a publisher were
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   259
                provided, the last tuple returned will be of the format (None,
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   260
                pkg_names).
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   261
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   262
                'fileobj' is an optional file-like object that must support a
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   263
                'read' method for retrieving data.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   264
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   265
                'location' is an optional string value that should either start
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   266
                with a leading slash and be pathname of a file or a URI string.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   267
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   268
                'fileobj' or 'location' must be provided."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   269
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   270
        def write_p5i(self, fileobj, pkg_names=None, pubs=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   271
                """Writes the publisher, repository, and provided package names
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   272
                to the provided file-like object 'fileobj' in json p5i format.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   273
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   274
                'fileobj' is only required to have a 'write' method that accepts
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   275
                data to be written as a parameter.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   276
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   277
                'pkg_names' is a dict of lists, tuples, or sets indexed by
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   278
                publisher prefix that contain package names, FMRI strings, or
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   279
                package info objects.  A prefix of "" can be used for packages
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   280
                that are not specific to a publisher.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   281
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   282
                'pubs' is an optional list of publisher prefixes or Publisher
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   283
                objects.  If not provided, the information for all publishers
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   284
                (excluding those disabled) will be output."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   285
917
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 884
diff changeset
   286
Version 10:
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   287
Incompatible with clients using versions 1-9
917
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 884
diff changeset
   288
Changes:
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 884
diff changeset
   289
    This version changes the interface to info. It removes the action info
920
5cb8100e9cea 6902 api.info needs a "fast" flag or a way to pass a set of the information required (followup)
Brock Pytlik <bpytlik@sun.com>
parents: 917
diff changeset
   290
    and licenses flag and replaces them with a set of options to allow
5cb8100e9cea 6902 api.info needs a "fast" flag or a way to pass a set of the information required (followup)
Brock Pytlik <bpytlik@sun.com>
parents: 917
diff changeset
   291
    the caller control over which information is retrieved.
917
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 884
diff changeset
   292
884
d780afc023ff 3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents: 835
diff changeset
   293
Version 9:
d780afc023ff 3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents: 835
diff changeset
   294
Compatible with clients using versions 1-8
d780afc023ff 3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents: 835
diff changeset
   295
Changes:
917
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 884
diff changeset
   296
    This version adds an optional argument to plan_update_all to allow the
884
d780afc023ff 3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents: 835
diff changeset
   297
    specification of a name for the clone of the BE which is made. It also
d780afc023ff 3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents: 835
diff changeset
   298
    exposes check_be_name as part of the api.
d780afc023ff 3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents: 835
diff changeset
   299
835
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   300
Version 8:
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   301
Compatible with clients using versions 1-7
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   302
Changes:
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   303
    This version introduces InvalidDepotResponseException.  The
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   304
    exception is thrown when operations that refresh the catalog
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   305
    discover that the server is not a pkg depot.  Clients of the api
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   306
    should catch this exception and respond appropriately.
34ec4401dc48 686 Client needs a way to tell that a response is actually from an IPS server
johansen <johansen@sun.com>
parents: 696
diff changeset
   307
696
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 688
diff changeset
   308
Version 7:
884
d780afc023ff 3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents: 835
diff changeset
   309
Compatible with clients using versions 1-6
696
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 688
diff changeset
   310
Changes:
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 688
diff changeset
   311
    Ignore the pkg_client_name parameter passed to api.ImageInterface() if
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 688
diff changeset
   312
    pkg.client.global_settings.client_name isn't None.  This latter object
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 688
diff changeset
   313
    is now the preferred way to set the client name, and the
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 688
diff changeset
   314
    pkg_client_name parameter may be ignored or removed in the future.
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 688
diff changeset
   315
688
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   316
Version 6:
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   317
Compatible with clients using versions 1-5
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   318
Changes:
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   319
Adds a new field to PackageInfo, category_info_list, which is a list of 
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   320
     PackageCategory objects. These objects contain the scheme and category
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   321
     information for packages.
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   322
685
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   323
Version 5:
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   324
Compatible with clients using versions 1-4 as long as they have a generic
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   325
APIException. This is the case for PackageManager and UpdateManaget.
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   326
Changes:
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   327
plan_install and plan_update_all can now raise PermissionsException.
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   328
625
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   329
Version 4:
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   330
Compatible with clients using versions 1, 2, and 3
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   331
Changes:
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   332
Modifies where certain progress tracking calls were made, calling 
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   333
    evaluate_start much sooner.
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   334
Adds refresh tracking to progress.py. This allows for active feedback when
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   335
    the catalogs of authorities are being refreshed.
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   336
615
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   337
Version 3:
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   338
Compatible with clients using Versions 1 and 2
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   339
Changes:
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   340
Adds an optional argument to info which determines whether detailed information
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   341
    about actions will be returned
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   342
Adds the following new fields to PackageInfo objects: links, hardlinks,
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   343
    files, dirs, dependencies
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   344
598
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   345
Version 2:
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   346
Compatible with clients using Version 1
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   347
Changes:
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   348
Adds the optional argument update_index to plan_install, plan_uninstall, and 
615
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   349
    plan_update_all. When the argument is false, no automatic update to the
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   350
    index occurs. By default, the argument is true.
598
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   351
594
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   352
Version 1:
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   353
Incompatible with clients using Version 0
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   354
Changes:
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   355
plan_install now returns a tuple of whether there is anything to do and 
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   356
    a catalog refresh exception, if one was caught. In this, it mirrors the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   357
    first and third return values from plan_update_all.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   358
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   359
Version 0:
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   360
        def __init__(self, img_path, version_id, progesstracker,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   361
            cancel_state_callable, pkg_client_name):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   362
                """Constructs an ImageInterface. img_path should point to an
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   363
                existing image. version_id indicates the version of the api
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   364
                the client is expecting to use. progesstracker is the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   365
                progresstracker the client wants the api to use for UI
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   366
                callbacks. cancel_state_callable is a function which the client
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   367
                wishes to have called each time whether the operation can be
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   368
                canceled changes. It can raise VersionException and
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   369
                ImageNotFoundException."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   370
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   371
        def plan_install(self, pkg_list, filters, refresh_catalogs=True,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   372
            noexecute=False, verbose=False):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   373
                """Contructs a plan to install the packages provided in
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   374
                pkg_list. pkg_list is a list of packages to install. filters
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   375
                is a list of filters to apply to the actions of the installed
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   376
                packages. refresh_catalogs controls whether the catalogs will
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   377
                automatically be refreshed. noexecute determines whether the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   378
                history will be recorded after planning is finished. verbose
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   379
                controls whether verbose debugging output will be printed to the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   380
                terminal. Its existence is temporary. If there are things to do
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   381
                to complete the install, it returns True, otherwise it returns
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   382
                False. It can raise InvalidCertException, PlanCreationException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   383
                NetworkUnavailableException, and InventoryException. The
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   384
                noexecute argument is included for compatibility with
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   385
                operational history. The hope is it can be removed in the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   386
                future."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   387
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   388
        def plan_uninstall(self, pkg_list, recursive_removal, noexecute=False,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   389
            verbose=False):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   390
                """Contructs a plan to uninstall the packages provided in
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   391
                pkg_list. pkg_list is a list of packages to install.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   392
                recursive_removal controls whether recursive removal is
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   393
                allowed. noexecute determines whether the history will be
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   394
                recorded after planning is finished. verbose controls whether
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   395
                verbose debugging output will be printed to the terminal. Its
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   396
                existence is temporary. If there are things to do to complete
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   397
                the uninstall, it returns True, otherwise it returns False. It
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   398
                can raise NonLeafPackageException and PlanCreationException."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   399
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   400
        def plan_update_all(self, actual_cmd, refresh_catalogs=True,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   401
            noexecute=False, force=False, pkgs_must_be_up_to_date=None,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   402
            verbose=False):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   403
                """Creates a plan to update all packages on the system to the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   404
                latest known versions. actual_cmd is the command used to start
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   405
                the client. It is used to determine the image to check whether
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   406
                SUNWipkg is up to date. refresh_catalogs controls whether the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   407
                catalogs will automatically be refreshed. noexecute determines
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   408
                whether the history will be recorded after planning is finished.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   409
                force controls whether update should proceed even if ipkg is not
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   410
                up to date. verbose controls whether verbose debugging output
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   411
                will be printed to the terminal. Its existence is temporary. It
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   412
                returns a tuple of three things. The first is a boolean which
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   413
                tells the client whether there is anything to do. The second
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   414
                tells whether the image is an opensolaris image. The third is
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   415
                either None, or an exception which indicates partial success.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   416
                This is currently used to indicate a failure in refreshing
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   417
                catalogs. It can raise CatalogRefreshException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   418
                IpkgOutOfDateException, NetworkUnavailableException, and
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   419
                PlanCreationException."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   420
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   421
        def describe(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   422
                """Returns None if no plan is ready yet, otherwise returns
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   423
                a PlanDescription"""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   424
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   425
        def prepare(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   426
                """Takes care of things which must be done before the plan
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   427
                can be executed. This includes downloading the packages to
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   428
                disk and preparing the indexes to be updated during
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   429
                execution. It can raise ProblematicPermissionsIndexException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   430
                and PlanMissingException. Should only be called once a
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   431
                plan_X method has been called."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   432
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   433
        def execute_plan(self, be_name=None):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   434
                """Executes the plan. This is uncancelable one it begins. It
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   435
                can raise  CorruptedIndexException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   436
                ProblematicPermissionsIndexException, ImageplanStateException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   437
                ImageUpdateOnLiveImageException, and PlanMissingException.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   438
                Should only be called after the prepare method has been
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   439
                called."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   440
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   441
        def refresh(self, full_refresh, auths=None):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   442
                """Refreshes the catalogs. full_refresh controls whether to do
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   443
                a full retrieval of the catalog from the publisher or only
594
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   444
                update the existing catalog. auths is a list of authorities to
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   445
                refresh. Passing an empty list or using the default value means
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   446
                all known authorities will be refreshed. While it currently
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   447
                returns an image object, this is an expedient for allowing
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   448
                existing code to work while the rest of the API is put into
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   449
                place."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   450
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   451
        def info(self, fmri_strings, local, get_licenses):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   452
                """Gathers information about fmris. fmri_strings is a list
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   453
                of fmri_names for which information is desired. local
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   454
                determines whether to retrieve the information locally.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   455
                get_licenses determines whether to retrieve the text of
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   456
                the licenses. It returns a dictionary of lists. The keys
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   457
                for the dictionary are the constants specified in the class
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   458
                definition. The values are lists of PackageInfo objects or
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   459
                strings."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   460
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   461
        def can_be_canceled(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   462
                """Returns true if the API is in a cancelable state."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   463
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   464
        def reset(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   465
                """Resets the API back the the initial state. Note:
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   466
                this does not necessarily return the disk to its initial state
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   467
                since the indexes or download cache may have been changed by
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   468
                the prepare method."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   469
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   470
        def cancel(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   471
                """Used for asynchronous cancelation. It returns the API
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   472
                to the state it was in prior to the current method being
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   473
                invoked.  Canceling during a plan phase returns the API to
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   474
                its initial state. Canceling during prepare puts the API
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   475
                into the state it was in just after planning had completed.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   476
                Plan execution cannot be canceled. A call to this method blocks
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   477
                until the canelation has happened. Note: this does not
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   478
                necessarily return the disk to its initial state since the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   479
                indexes or download cache may have been changed by the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   480
                prepare method."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   481
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   482
class PlanDescription(object):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   483
        """A class which describes the changes the plan will make. It
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   484
        provides a list of tuples of PackageInfo's. The first item in the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   485
        tuple is the package that is being changed. The second item in the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   486
        tuple is the package that will be in the image after the change."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   487
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   488
        def get_changes(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   489
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   490
class LicenseInfo(object):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   491
        """A class representing the license information a package
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   492
        provides."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   493
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   494
        def get_text(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   495
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   496
class PackageInfo(object):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   497
        """A class capturing the information about packages that a client
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   498
        could need. The fmri is guaranteed to be set. All other values may
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   499
        be None, depending on how the PackageInfo instance was created."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   500
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   501
        # Possible package installation states
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   502
        INSTALLED = 1
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   503
        NOT_INSTALLED = 2
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   504
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   505
        self.pkg_stem
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   506
        self.summary
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   507
        self.state
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   508
        self.authority
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   509
        self.preferred_authority
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   510
        self.version
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   511
        self.build_release
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   512
        self.branch
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   513
        self.packaging_date
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   514
        self.size
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   515
        self.fmri
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   516
        self.licenses
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   517
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   518
        def __str__(self):