/usr/lib/python2.6/site-packages/openstackclient/api
NameSizeModeActions
api.py99690644editdlrm
api.pyc95710644editdlrm
auth.py88550644editdlrm
auth.pyc64350644editdlrm
auth_plugin.py37330644editdlrm
auth_plugin.pyc38670644editdlrm
image_v1.py26450644editdlrm
image_v1.pyc26130644editdlrm
image_v2.py22980644editdlrm
image_v2.pyc20950644editdlrm
network_v2.py17360644editdlrm
network_v2.pyc19290644editdlrm
object_store_v1.py111760644editdlrm
object_store_v1.pyc97020644editdlrm
utils.py31240644editdlrm
utils.pyc20540644editdlrm
__init__.py00644editdlrm
__init__.pyc1630644editdlrm
Edit: /usr/lib/python2.6/site-packages/openstackclient/api/api.pyc (9571B)
Ñò ;vVc@srdZddkZddklZddklZddklZde fd„ƒYZ de fd„ƒYZ dS( sBase API LibraryiÿÿÿÿN(t exceptions(tsessiontKeystoneSessioncBs)eZdZddd„Zdd„ZRS(såWrapper for the Keystone Session Restore some requests.session.Session compatibility; keystoneclient.session.Session.request() has the method and url arguments swapped from the rest of the requests-using world. cKs)tt|ƒiƒ||_||_dS(s?Base object that contains some common API objects and methods :param Session session: The default session to be used for making the HTTP API calls. :param string endpoint: The URL from the Service Catalog to be used as the base for API requests on this API. N(tsuperRt__init__Rtendpoint(tselfRRtkwargs((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyR s cKs“|p |i}n|ptiƒ}n|ioK|o.di|iidƒ|idƒgƒ}q€|iidƒ}n|i|||S(sPerform call into session All API calls are funneled through this method to provide a common place to finalize the passed URL and other things. :param string method: The HTTP method name, i.e. ``GET``, ``PUT``, etc :param string url: The API-specific portion of the URL path :param Session session: HTTP client session :param kwargs: keyword arguments passed to requests.request(). :return: the requests.Response object t/(Rt ksc_sessiontSessionRtjointrstriptlstriptrequest(RtmethodturlRR((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyt_request5s  .N(t__name__t __module__t__doc__tNoneRR(((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyRs tBaseAPIcBs€eZdZd d d d„Zd d d„Zd d„Zd d ed„Zd d d d„Z d„Z d„Z d d d„Z RS( sBase APIcKs,tt|ƒid|d|ƒ||_dS(sšBase object that contains some common API objects and methods :param Session session: The default session to be used for making the HTTP API calls. :param string service_type: API name, i.e. ``identity`` or ``compute`` :param string endpoint: The URL from the Service Catalog to be used as the base for API requests on this API. RRN(RRRt service_type(RRRRR((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyRXscKsX|p d}n|i||d||}y|iƒSWntij o|SXdS(sôCreate a new resource :param string url: The API-specific portion of the URL path :param Session session: HTTP client session :param string method: HTTP method (default POST) tPOSTRN(RtjsontJSONDecodeError(RRRRtparamstret((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pytcreateps cKs|id||S(s«Delete a resource :param string url: The API-specific portion of the URL path :param Session session: HTTP client session tDELETE(R(RRRR((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pytdeleteŠscKs–|o"di|idƒdgƒ}n|o"|id|d|d|ƒ}n|id|d|ƒ}y|iƒSWntij o|SXdS(s_Return a list of resources GET ${ENDPOINT}/${PATH}?${PARAMS} path is often the object's plural resource type :param string path: The API-specific portion of the URL path :param Session session: HTTP client session :param body: data that will be encoded as JSON and passed in POST request (GET will be sent by default) :param bool detailed: Adds '/details' to path for some APIs to return extended attributes :returns: JSON-decoded response, could be a list or a dict-wrapped-list RtdetailsRRRtGETN(R R RRR(RtpathRtbodytdetailedRR((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pytlistšs "  c s$|djo d}nˆdjo ˆ‰n‡‡‡fd†}h||6}||ƒ}t|ƒtjo|St|ƒdjo |dSt|ƒdjo&d}ti|ˆ||fƒ‚nh|d6}||ƒ}t|ƒdjo |dSd}ti|ˆ||fƒ‚dS( sïFind a resource via attribute or ID Most APIs return a list wrapped by a dict with the resource name as key. Some APIs (Identity) return a dict when a query string is present and there is one return value. Take steps to unwrap these bodies and return a single dict without any resource wrappers. :param string path: The API-specific portion of the URL path :param string value: value to search for :param string attr: attribute to use for resource search :param string resource: plural of the object resource name; defaults to path For example: n = find(netclient, 'network', 'networks', 'matrix') tnamecsDˆiˆ|}t|ƒtjoˆ|jo|ˆ}n|S(s-Do list call, unwrap resource dict if present(R%ttypetdict(tkwR(tresourceRR"(sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pytgetlistòs iisMultiple %s exist with %s='%s'tids#No %s with a %s or ID of '%s' foundN(RR'R(tlentksc_exceptionst CommandErrorR( RR"tvaluetattrR*R+Rtdatatmsg((R*RR"sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyt find_attrÎs*          c sµ|i|ƒ}t|ƒtjo$t|iƒƒd}||}ng}xb|D]Z‰y;t‡‡fd†ˆiƒDƒƒo|iˆƒnWqStj o qSqSXqSW|S(séBulk load and filter locally :param string path: The API-specific portion of the URL path :param kwargs: A dict of AVPs to match - logical AND :returns: list of resource dicts ic3s'x |]}ˆ|ˆ|jVqWdS(N((t.0R1(toR(sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pys %s (R%R'R(tkeystalltappendtKeyError(RR"RtitemstkeyR((R6RsG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyt find_bulks& cKso|i||}t|ƒ}|djod}ti|ƒ‚n$|djod}t|ƒ‚n|dS(s¤Find a resource by name or ID :param string path: The API-specific portion of the URL path :returns: resource dict is none foundis many found(R=R-R.tNotFoundt RuntimeError(RR"Rt bulk_listtnum_bulkR3((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pytfind_one,s    cCsœy&|idd||fƒiƒ}Wnotij o`h||6}y|id||}Wq˜tij o d|}ti|ƒ‚q˜XnX|S(s Find a single resource by name or ID :param string path: The API-specific portion of the URL path :param string search: search expression :param string attr: name of attribute for secondary search R!s/%s/%ss /%s/details %s not found(RRR.R>RB(RR"R0R1RRR3((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pytfindCs&  N( RRRRRRRtFalseR%R4R=RBRC(((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyRUs"    2 ;  ( Rt simplejsonRtkeystoneclientRR.RR topenstackclient.commontobjectRR(((sG/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/api.pyts  >