doc/client_api_versions.txt
author Brock Pytlik <bpytlik@sun.com>
Thu, 12 Mar 2009 16:30:25 -0700
changeset 941 e7bff46da54e
parent 926 6ee411c9026a
child 996 31d152a5212b
permissions -rw-r--r--
6175 search needs to be moved to version 1 2666 Search should support structured/field specific search 2667 Search should support boolean search 2668 Search should have a mode which only returns packages 2670 Client should get entire action from search 3238 failed searches no longer distinguished by HTTP response code 3338 Search needs a more flexible protocol to communicate during remote searches 5874 Search API required 5967 indexer leaves open files 6062 paths stored with leading slash on server, not on client 6170 remote search needs to validate server response 6173 versioned_urlopen breaks on cherrypy based servers 6287 search api should be able to send multiple queries in one network transaction 6413 search should return which authority the response came from 6501 Case sensitive remote search should be allowed 6532 Search should allow control over the number, and starting point, of results 6560 Consider making "pkg search -r" the default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
     1
Version 12:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
     2
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
     3
Changes:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 926
diff changeset
     4
    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
     5
    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
     6
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
     7
Version 11:
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
     8
Incompatible with clients using versions 1-10:
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
     9
Changes:
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    10
   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
    11
   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
    12
   '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
    13
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    14
   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
    15
        def add_publisher(self, pub, refresh_allowed=True):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    16
                """Add the provided publisher object to the image
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    17
                configuration."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    18
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    19
        def get_preferred_publisher(self):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    20
                """Returns the preferred publisher object for the image."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    21
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    22
        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
    23
                """Retrieves a publisher object matching the provided prefix
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    24
                (name) or alias.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    25
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    26
                'duplicate' is an optional boolean value indicating whether
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    27
                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
    28
                of the original.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    29
                """
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    30
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    31
        def get_publishers(self, duplicate=False):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    32
                """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
    33
                image.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    34
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    35
                'duplicate' is an optional boolean value indicating whether
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    36
                copies of the publisher objects should be returned instead
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    37
                of the originals.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    38
                """
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    39
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    40
        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
    41
                """Returns a datetime object representing the last time the
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    42
                catalog for a publisher was modified or None."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    43
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    44
        def has_publisher(self, prefix=None, alias=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    45
                """Retrieves a publisher object matching the provided prefix
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    46
                (name) or alias."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    47
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    48
        def remove_publisher(self, prefix=None, alias=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    49
                """Removes a publisher object matching the provided prefix
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    50
                (name) or alias."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    51
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    52
        def set_preferred_publisher(self, prefix=None, alias=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    53
                """Sets the preferred publisher for the image."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    54
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    55
        def update_publisher(self, pub, refresh_allowed=True):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    56
                """Replaces an existing publisher object with the provided one
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    57
                using the _source_object_id identifier set during copy."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    58
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    59
        def update_publisher(self, pub, refresh_allowed=True):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    60
                """Replaces an existing publisher object with the provided one
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    61
                using the _source_object_id identifier set during copy.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    62
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    63
                'refresh_allowed' is an optional boolean value indicating
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    64
                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
    65
                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
    66
                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
    67
                made to retrieve publisher metadata."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    68
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    69
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    70
        def log_operation_end(self, error=None, result=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    71
                """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
    72
                history.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    73
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    74
                'result' should be a pkg.client.history constant value
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    75
                representing the outcome of an operation.  If not provided,
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    76
                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
    77
                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
    78
                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
    79
                provided, success is assumed."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    80
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    81
        def log_operation_error(self, error):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    82
                """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
    83
                history for the current opreation."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    84
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    85
        def log_operation_start(self, name):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    86
                """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
    87
                history."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    88
 
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    89
        def parse_p5i(self, fileobj=None, location=None):
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    90
                """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
    91
                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
    92
                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
    93
                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
    94
                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
    95
                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
    96
                pkg_names).
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    97
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
    98
                '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
    99
                'read' method for retrieving data.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   100
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   101
                '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
   102
                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
   103
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   104
                'fileobj' or 'location' must be provided."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   105
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   106
        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
   107
                """Writes the publisher, repository, and provided package names
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   108
                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
   109
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   110
                '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
   111
                data to be written as a parameter.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   112
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   113
                '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
   114
                publisher prefix that contain package names, FMRI strings, or
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   115
                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
   116
                that are not specific to a publisher.
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   117
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   118
                '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
   119
                objects.  If not provided, the information for all publishers
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   120
                (excluding those disabled) will be output."""
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 920
diff changeset
   121
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
   122
Version 10:
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
   123
Incompatible with clients using versions 1-9:
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
   124
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
   125
    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
   126
    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
   127
    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
   128
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
   129
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
   130
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
   131
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
   132
    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
   133
    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
   134
    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
   135
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
   136
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
   137
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
   138
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
   139
    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
   140
    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
   141
    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
   142
    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
   143
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
   144
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
   145
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
   146
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
   147
    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
   148
    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
   149
    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
   150
    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
   151
688
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   152
Version 6:
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   153
Compatible with clients using versions 1-5
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   154
Changes:
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   155
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
   156
     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
   157
     information for packages.
32a3ca40676e 4260 pkg info should print the classification
Brock Pytlik <bpytlik@sun.com>
parents: 685
diff changeset
   158
685
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   159
Version 5:
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   160
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
   161
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
   162
Changes:
6f53483db920 1469 image-update by unprivileged user should give better error message
Brock Pytlik <bpytlik@sun.com>
parents: 625
diff changeset
   163
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
   164
625
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   165
Version 4:
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   166
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
   167
Changes:
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   168
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
   169
    evaluate_start much sooner.
e46b345645d6 3799 need to start progress tracker going early on
Brock Pytlik <bpytlik@sun.com>
parents: 615
diff changeset
   170
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
   171
    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
   172
615
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   173
Version 3:
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   174
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
   175
Changes:
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   176
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
   177
    about actions will be returned
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   178
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
   179
    files, dirs, dependencies
aeeeb9f31173 4114 Api.Info needs to provide more info
Brock Pytlik <bpytlik@sun.com>
parents: 598
diff changeset
   180
598
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   181
Version 2:
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   182
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
   183
Changes:
c53f6107fdb6 2863 pkg install should have a way to disable indexing
Brock Pytlik <bpytlik@sun.com>
parents: 594
diff changeset
   184
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
   185
    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
   186
    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
   187
594
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   188
Version 1:
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   189
Incompatible with clients using Version 0
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   190
Changes:
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   191
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
   192
    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
   193
    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
   194
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   195
Version 0:
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   196
        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
   197
            cancel_state_callable, pkg_client_name):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   198
                """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
   199
                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
   200
                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
   201
                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
   202
                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
   203
                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
   204
                canceled changes. It can raise VersionException and
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   205
                ImageNotFoundException."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   206
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   207
        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
   208
            noexecute=False, verbose=False):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   209
                """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
   210
                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
   211
                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
   212
                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
   213
                automatically be refreshed. noexecute determines whether the
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   214
                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
   215
                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
   216
                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
   217
                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
   218
                False. It can raise InvalidCertException, PlanCreationException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   219
                NetworkUnavailableException, and InventoryException. The
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   220
                noexecute argument is included for compatibility with
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   221
                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
   222
                future."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   223
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   224
        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
   225
            verbose=False):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   226
                """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
   227
                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
   228
                recursive_removal controls whether recursive removal is
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   229
                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
   230
                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
   231
                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
   232
                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
   233
                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
   234
                can raise NonLeafPackageException and PlanCreationException."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   235
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   236
        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
   237
            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
   238
            verbose=False):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   239
                """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
   240
                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
   241
                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
   242
                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
   243
                catalogs will automatically be refreshed. noexecute determines
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   244
                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
   245
                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
   246
                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
   247
                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
   248
                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
   249
                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
   250
                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
   251
                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
   252
                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
   253
                catalogs. It can raise CatalogRefreshException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   254
                IpkgOutOfDateException, NetworkUnavailableException, and
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   255
                PlanCreationException."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   256
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   257
        def describe(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   258
                """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
   259
                a PlanDescription"""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   260
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   261
        def prepare(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   262
                """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
   263
                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
   264
                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
   265
                execution. It can raise ProblematicPermissionsIndexException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   266
                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
   267
                plan_X method has been called."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   268
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   269
        def execute_plan(self, be_name=None):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   270
                """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
   271
                can raise  CorruptedIndexException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   272
                ProblematicPermissionsIndexException, ImageplanStateException,
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   273
                ImageUpdateOnLiveImageException, and PlanMissingException.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   274
                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
   275
                called."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   276
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   277
        def refresh(self, full_refresh, auths=None):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   278
                """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
   279
                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
   280
                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
   281
                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
   282
                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
   283
                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
   284
                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
   285
                place."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   286
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   287
        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
   288
                """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
   289
                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
   290
                determines whether to retrieve the information locally.
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   291
                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
   292
                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
   293
                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
   294
                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
   295
                strings."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   296
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   297
        def can_be_canceled(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   298
                """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
   299
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   300
        def reset(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   301
                """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
   302
                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
   303
                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
   304
                the prepare method."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   305
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   306
        def cancel(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   307
                """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
   308
                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
   309
                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
   310
                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
   311
                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
   312
                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
   313
                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
   314
                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
   315
                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
   316
                prepare method."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   317
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   318
class PlanDescription(object):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   319
        """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
   320
        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
   321
        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
   322
        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
   323
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   324
        def get_changes(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   325
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   326
class LicenseInfo(object):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   327
        """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
   328
        provides."""
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   329
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   330
        def get_text(self):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   331
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   332
class PackageInfo(object):
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   333
        """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
   334
        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
   335
        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
   336
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   337
        # Possible package installation states
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   338
        INSTALLED = 1
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   339
        NOT_INSTALLED = 2
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   340
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   341
        self.pkg_stem
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   342
        self.summary
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   343
        self.state
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   344
        self.authority
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   345
        self.preferred_authority
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   346
        self.version
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   347
        self.build_release
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   348
        self.branch
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   349
        self.packaging_date
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   350
        self.size
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   351
        self.fmri
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   352
        self.licenses
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   353
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   354
        def __str__(self):