/usr/lib/python2.6/site-packages/openstack
Edit: /usr/lib/python2.6/site-packages/openstack/proxy2.pyc (14108B)
Ñò
5
Wc @ sF d d k l Z d d k l Z e d „ Z d e f d „ ƒ YZ d S( iÿÿÿÿ( t
exceptions( t resource2c s ‡ f d † } | S( Nc s d ‡ ‡ f d † } | S( Nc sœ ˆ o8 | d j o+ t | t i ƒ o t d | i ƒ ‚ nH t | t i ƒ o4 t | | ƒ o# t d | i | i i f ƒ ‚ n ˆ | | | | | Ž S( Ns A %s must be passeds Expected %s but received %s( t Nonet
isinstanceR t Resourcet
ValueErrort __name__t __class__( t selft expectedt actualt argst kwargs( t methodt strict( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt check s ( R ( R
R ( R ( R
s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt wrap s
( ( R R ( ( R s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _check_resource s t BaseProxyc B s e Z d „ Z d „ Z d „ Z e d „ Z e d e ƒ e d „ ƒ Z e d e ƒ d „ ƒ Z
d „ Z e d e ƒ d d „ ƒ Z
d e d „ Z d d
„ Z g d d d
„ Z d d d „ Z RS( c C s
| | _ d S( N( t session( R R ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt __init__+ s c K s` | d j o | i | } n= t | | ƒ p | i d | | } n | } | i | | S( s] Get a resource object to work on
:param resource_type: The type of resource to operate on. This should
be a subclass of
:class:`~openstack.resource2.Resource` with a
``from_id`` method.
:param value: The ID of a resource or an object of ``resource_type``
class if using an existing instance, or None to create a
new instance.
:param path_args: A dict containing arguments for forming the request
URL, if needed.
t idN( R t newR t _update( R t
resource_typet valuet attrst res( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt
_get_resource. s
c C s6 | d j o t | | ƒ } n t i i | ƒ } | S( s• Get a value to be associated with a URI attribute
`child` will not be None here as it's a required argument
on the proxy method. `parent` is allowed to be None if `child`
is an actual resource, but when an ID is given for the child
one must also be provided for the parent. An example of this
is that a parent is a Server and a child is a ServerInterface.
N( R t getattrR R t _get_id( R t childt parentt nameR ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _get_uri_attributeH s
c K s | i | i | d | | S( s Find a resource
:param name_or_id: The name or ID of a resource to find.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource2.
:param dict attrs: Attributes to be passed onto the
:meth:`~openstack.resource2.Resource.find`
method, such as query parameters.
:returns: An instance of ``resource_type`` or None
t ignore_missing( t findR ( R R t
name_or_idR# R ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _findW s R c K s´ | i | | | } y | i | i ƒ } Wn‚ t i j
os } | o d
St i d d | i | f d | i d | i d | i
d | i d | i d | i
d | i ƒ ‚ n X| S( sK Delete a resource
:param resource_type: The type of resource to delete. This should
be a :class:`~openstack.resource2.Resource`
subclass with a ``from_id`` method.
:param value: The value to delete. Can be either the ID of a
resource or a :class:`~openstack.resource2.Resource`
subclass.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
raised when the resource does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent resource2.
:param dict attrs: Attributes to be passed onto the
:meth:`~openstack.resource2.Resource.delete`
method, such as the ID of a parent resource.
:returns: The result of the ``delete``
:raises: ``ValueError`` if ``value`` is a
:class:`~openstack.resource2.Resource` that doesn't match
the ``resource_type``.
:class:`~openstack.exceptions.ResourceNotFound` when
ignore_missing if ``False`` and a nonexistent resource
is attempted to be deleted.
t messages No %s found for %st detailst responset
request_idt urlR
t http_statust causeN( R t deleteR R t NotFoundExceptionR t ResourceNotFoundR R( R) R* R+ R
R, R- ( R R R R# R R t rvt e( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _deletek s c K s% | i | | | } | i | i ƒ S( sQ Update a resource
:param resource_type: The type of resource to update.
:type resource_type: :class:`~openstack.resource2.Resource`
:param value: The resource to update. This must either be a
:class:`~openstack.resource2.Resource` or an id
that corresponds to a resource2.
:param dict attrs: Attributes to be passed onto the
:meth:`~openstack.resource2.Resource.update`
method to be updated. These should correspond
to either :class:`~openstack.resource2.Body`
or :class:`~openstack.resource2.Header`
values on this resource.
:returns: The result of the ``update``
:rtype: :class:`~openstack.resource2.Resource`
( R t updateR ( R R R R R ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyR ™ s c K s | i | } | i | i ƒ S( s Create a resource from attributes
:param resource_type: The type of resource to create.
:type resource_type: :class:`~openstack.resource2.Resource`
:param path_args: A dict containing arguments for forming the request
URL, if needed.
:param dict attrs: Attributes to be passed onto the
:meth:`~openstack.resource2.Resource.create`
method to be created. These should correspond
to either :class:`~openstack.resource2.Body`
or :class:`~openstack.resource2.Header`
values on this resource.
:returns: The result of the ``create``
:rtype: :class:`~openstack.resource2.Resource`
( R t createR ( R R R R ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _create¯ s c K s¦ | i | | | } y | i | i ƒ SWnv t i j
og } t i d d | i | f d | i d | i d | i d | i
d | i d | i d | i
ƒ ‚ n Xd
S( s# Get a resource
:param resource_type: The type of resource to get.
:type resource_type: :class:`~openstack.resource2.Resource`
:param value: The value to get. Can be either the ID of a
resource or a :class:`~openstack.resource2.Resource`
subclass.
:param dict attrs: Attributes to be passed onto the
:meth:`~openstack.resource2.Resource.get`
method. These should correspond
to either :class:`~openstack.resource2.Body`
or :class:`~openstack.resource2.Header`
values on this resource.
:returns: The result of the ``get``
:rtype: :class:`~openstack.resource2.Resource`
R' s No %s found for %sR( R) R* R+ R
R, R- N( R t getR R R/ R0 R R( R) R* R+ R
R, R- ( R R R R R R2 ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _getà s c K s. | i | | | } | i | i d | | S( sè List a resource
:param resource_type: The type of resource to delete. This should
be a :class:`~openstack.resource2.Resource`
subclass with a ``from_id`` method.
:param value: The resource to list. It can be the ID of a resource, or
a :class:`~openstack.resource2.Resource` object. When set
to None, a new bare resource is created.
:param bool paginated: When set to ``False``, expect all of the data
to be returned in one response. When set to
``True``, the resource supports data being
returned across multiple pages.
:param dict attrs: Attributes to be passed onto the
:meth:`~openstack.resource2.Resource.list` method. These should
correspond to either :class:`~openstack.resource2.URI` values
or appear in :data:`~openstack.resource2.Resource._query_mapping`.
:returns: A generator of Resource objects.
:raises: ``ValueError`` if ``value`` is a
:class:`~openstack.resource2.Resource` that doesn't match
the ``resource_type``.
t paginated( R t listR ( R R R R9 R R ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _listâ s c K s% | i | | | } | i | i ƒ S( s Retrieve a resource's header
:param resource_type: The type of resource to retrieve.
:type resource_type: :class:`~openstack.resource2.Resource`
:param value: The value of a specific resource to retreive headers
for. Can be either the ID of a resource,
a :class:`~openstack.resource2.Resource` subclass,
or ``None``.
:param dict attrs: Attributes to be passed onto the
:meth:`~openstack.resource2.Resource.head` method.
These should correspond to
:class:`~openstack.resource2.URI` values.
:returns: The result of the ``head`` call
:rtype: :class:`~openstack.resource2.Resource`
( R t headR ( R R R R R ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyt _headü s i ix c C s t i | i | | | | | ƒ S( së Wait for a resource to be in a particular status.
:param value: The resource to wait on to reach the status. The
resource must have a status attribute.
:type value: :class:`~openstack.resource2.Resource`
:param status: Desired status of the resource2.
:param list failures: Statuses that would indicate the transition
failed such as 'ERROR'.
:param interval: Number of seconds to wait between checks.
:param wait: Maximum number of seconds to wait for the change.
:return: Method returns resource on success.
:raises: :class:`~openstack.exceptions.ResourceTimeout` transition
to status failed to occur in wait seconds.
:raises: :class:`~openstack.exceptions.ResourceFailure` resource
transitioned to one of the failure states.
:raises: :class:`~AttributeError` if the resource does not have a
status attribute
( R t wait_for_statusR ( R R t statust failurest intervalt wait( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyR> s c C s t i | i | | | ƒ S( sî Wait for the resource to be deleted.
:param value: The resource to wait on to be deleted.
:type value: :class:`~openstack.resource2.Resource`
:param interval: Number of seconds to wait between checks.
:param wait: Maximum number of seconds to wait for the delete.
:return: Method returns resource on success.
:raises: :class:`~openstack.exceptions.ResourceTimeout` transition
to delete failed to occur in wait seconds.
( R t wait_for_deleteR ( R R RA RB ( ( s6 /tmp/pip-build-wCUybK/openstacksdk/openstack/proxy2.pyRC ( s N( R t
__module__R R R" t TrueR&