Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Import alias identifier Import alias identifier Assign NameStore Num FunctionDef arguments args NameParam defaults body Assign NameStore Dict For NameStore NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num If CompareIn NameLoad NameLoad body Raise Call NameLoad Str orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Str body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Return Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Return Call AttributeLoad NameLoad attr NameLoad If CompareNotIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Return Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn NameLoad AttributeLoad NameLoad attr body Delete SubscriptDel AttributeLoad NameLoad attr Index SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str BinOpAdd BinOpAdd BinOpAdd Str SubscriptLoad AttributeLoad NameLoad attr Index Num Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Assign AttributeStore AttributeLoad NameLoad attr attr TupleLoad Str SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Return Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str BinOpAdd BinOpAdd BinOpAdd Str SubscriptLoad AttributeLoad NameLoad attr Index Num Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr Delete SubscriptDel AttributeLoad AttributeLoad NameLoad attr attr Index NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Return Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore ListLoad Assign NameStore NameLoad For NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body If BoolOpAnd Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Return Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore ListLoad Assign NameStore NameLoad For NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body If BoolOpAnd Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad body For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If BoolOpAnd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr
N/A N/A 
Resource Directory example

Simple Resource Directory (draft-ietf-core-resource-directory-01) implementation for txThings

Supports register, update, remove.
Supports resource lookup and endpoint lookup.
No support for simple directory
No support for groups.
No support for domain lookup.

Created on 25-08-2014

@author: Maciej Wasilak
 N/A sys N/A fnmatch twisted.internet defer twisted.internet.protocol DatagramProtocol twisted.internet reactor twisted.python log N/A txthings.coap coap N/A txthings.resource resource N/A txthings.ext.link_header link_header N/A DEFAULT_LIFETIME 86400 parseUriQuery N/A N/A query_list N/A N/A N/A query_dict N/A N/A query query_list N/A N/A N/A name value N/A N/A query split = 1 N/A N/A name query_dict N/A N/A N/A ValueError Multiple query segments with same name N/A N/A N/A query_dict N/A name value N/A query_dict N/A DirectoryResource N/A N/A resource CoAPResource N/A N/A 
    This class implements Registration function (point 5.2 of the draft).
     __init__ N/A N/A self N/A N/A N/A N/A N/A N/A resource CoAPResource __init__ self N/A N/A self visible True N/A N/A N/A self addParam N/A N/A resource LinkParam title Resource Directory N/A N/A self directory N/A N/A N/A self eid 0 N/A render_POST N/A N/A self request N/A N/A N/A 
        Add new entry to resource directory.
         N/A N/A N/A N/A request opt content_format N/A N/A coap media_types_rev N/A application/link-format N/A N/A N/A N/A log msg Unsupported content-format! N/A response N/A N/A coap Message code N/A coap UNSUPPORTED_CONTENT_FORMAT payload N/A N/A N/A defer succeed response N/A N/A N/A params N/A parseUriQuery N/A N/A request opt uri_query N/A N/A N/A ValueError N/A N/A N/A N/A log msg Bad or ambiguous query options! N/A response N/A N/A coap Message code N/A coap BAD_REQUEST payload Bad or ambiguous query options! N/A N/A N/A defer succeed response N/A N/A ep params N/A N/A N/A N/A log msg No 'ep' query option in request. N/A response N/A N/A coap Message code N/A coap BAD_REQUEST payload No 'ep' query option in request. N/A N/A N/A defer succeed response N/A endpoint N/A params N/A ep N/A N/A endpoint N/A self directory N/A N/A N/A N/A self children N/A N/A N/A self directory N/A endpoint N/A N/A N/A N/A self directory N/A endpoint N/A str N/A self eid N/A N/A self eid 1 N/A link_format N/A N/A link_header parse_link_value N/A request payload N/A domain N/A N/A params get d N/A endpoint_type N/A N/A params get et N/A lifetime N/A N/A params get lt DEFAULT_LIFETIME N/A context N/A N/A params get con N/A N/A N/A coap:// N/A N/A request remote N/A 0 : N/A str N/A N/A request remote N/A 1 N/A entry N/A DirectoryEntryResource self link_format endpoint domain endpoint_type lifetime context N/A N/A N/A self putChild N/A N/A self directory N/A endpoint entry N/A response N/A N/A coap Message code N/A coap CREATED payload N/A N/A N/A response opt location_path N/A rd N/A N/A self directory N/A endpoint N/A N/A N/A log msg N/A RD entry added: endpoint=%s, lifetime=%d N/A endpoint lifetime N/A N/A N/A defer succeed response N/A N/A DirectoryEntryResource N/A N/A resource CoAPResource N/A N/A 
    Simple implementation of Resource Directory (draft-ietf-core-resource-directory-01).
    
    This class implements Update and Removal functions (points 5.3 and 5.4
    of the draft).
     __init__ N/A N/A self parent link_format endpoint domain endpoint_type lifetime context N/A N/A N/A N/A N/A N/A resource CoAPResource __init__ self N/A N/A self visible False N/A N/A self parent parent N/A N/A self endpoint endpoint N/A N/A self link_format link_format N/A N/A self domain domain N/A N/A self endpoint_type endpoint_type N/A N/A self context context N/A N/A self timeout N/A N/A reactor callLater N/A float lifetime N/A self removeResource N/A render_PUT N/A N/A self request N/A N/A N/A 
        Update this resource directory entry.
         N/A N/A N/A params N/A parseUriQuery N/A N/A request opt uri_query N/A N/A N/A ValueError N/A N/A N/A N/A log msg Bad or ambiguous query options! N/A response N/A N/A coap Message code N/A coap BAD_REQUEST payload Bad or ambiguous query options! N/A N/A N/A defer succeed response N/A lifetime N/A N/A params get lt DEFAULT_LIFETIME N/A N/A N/A N/A self timeout cancel N/A N/A self timeout N/A N/A reactor callLater N/A float lifetime N/A self removeResource N/A N/A self endpoint_type N/A N/A params get et N/A N/A self context N/A N/A params get con N/A N/A N/A coap:// N/A N/A request remote N/A 0 : N/A str N/A N/A request remote N/A 1 N/A response N/A N/A coap Message code N/A coap CHANGED payload N/A N/A N/A log msg N/A RD entry updated: endpoint=%s, lifetime=%d N/A N/A self endpoint lifetime N/A N/A N/A defer succeed response N/A render_DELETE N/A N/A self request N/A N/A N/A 
        Delete this resource directory entry.
         N/A N/A N/A log msg N/A RD entry deleted: endpoint=%s N/A self endpoint N/A N/A N/A self removeResource N/A response N/A N/A coap Message code N/A coap DELETED payload N/A N/A N/A defer succeed response N/A removeResource N/A N/A self N/A N/A N/A 
        Remove this resource. Used by both expiry and deletion.
         N/A location N/A N/A N/A N/A self parent directory pop N/A self endpoint N/A N/A N/A N/A self parent children N/A location N/A N/A EndpointLookupResource N/A N/A resource CoAPResource N/A N/A 
    Simple implementation of Resource Directory (draft-ietf-core-resource-directory-01).
    
    This class implements Endpoint Lookup function (point 7 of the draft).
     __init__ N/A N/A self directory_resource N/A N/A N/A N/A N/A N/A resource CoAPResource __init__ self N/A N/A self visible True N/A N/A self directory directory_resource N/A render_GET N/A N/A self request N/A N/A N/A 
        Return list of endpoints matching params specified in URI query.
         N/A N/A N/A params N/A parseUriQuery N/A N/A request opt uri_query N/A N/A N/A ValueError N/A N/A N/A N/A log msg Bad or ambiguous query options! N/A response N/A N/A coap Message code N/A coap BAD_REQUEST payload Bad or ambiguous query options! N/A N/A N/A defer succeed response N/A ep_pattern N/A N/A params get ep * N/A d_pattern N/A N/A params get d * N/A et_pattern N/A N/A params get et * N/A link_format N/A N/A first_entry True N/A entry N/A N/A N/A N/A self directory children values N/A N/A N/A N/A N/A fnmatch fnmatch N/A entry endpoint ep_pattern N/A N/A fnmatch fnmatch N/A entry domain d_pattern N/A N/A fnmatch fnmatch N/A entry endpoint_type et_pattern N/A N/A N/A first_entry True N/A N/A first_entry False N/A N/A N/A N/A link_format append , N/A N/A N/A link_format append < N/A N/A N/A link_format append N/A entry context N/A N/A N/A link_format append >;ep=" N/A N/A N/A link_format append N/A entry endpoint N/A N/A N/A link_format append " N/A response N/A N/A coap Message code N/A coap CONTENT payload N/A N/A join link_format N/A N/A N/A response opt content_format N/A N/A coap media_types_rev N/A application/link-format N/A N/A N/A defer succeed response N/A N/A ResourceLookupResource N/A N/A resource CoAPResource N/A N/A 
    Simple implementation of Resource Directory (draft-ietf-core-resource-directory-01).
    
    This class implements Resource Lookup function (point 7 of the draft).
     __init__ N/A N/A self directory_resource N/A N/A N/A N/A N/A N/A resource CoAPResource __init__ self N/A N/A self visible True N/A N/A self directory directory_resource N/A render_GET N/A N/A self request N/A N/A N/A 
        Return list of resources matching params specified in URI query.
         N/A N/A N/A params N/A parseUriQuery N/A N/A request opt uri_query N/A N/A N/A ValueError N/A N/A N/A N/A log msg Bad or ambiguous query options! N/A response N/A N/A coap Message code N/A coap BAD_REQUEST payload Bad or ambiguous query options! N/A N/A N/A defer succeed response N/A ep_pattern N/A N/A params get ep * N/A d_pattern N/A N/A params get d * N/A et_pattern N/A N/A params get et * N/A rt_pattern N/A N/A params get rt * N/A title_pattern N/A N/A params get title * N/A if_pattern N/A N/A params get if * N/A link_format N/A N/A first_entry True N/A entry N/A N/A N/A N/A self directory children values N/A N/A N/A N/A N/A fnmatch fnmatch N/A entry endpoint ep_pattern N/A N/A fnmatch fnmatch N/A entry domain d_pattern N/A N/A fnmatch fnmatch N/A entry endpoint_type et_pattern N/A N/A N/A uri params N/A N/A N/A entry link_format items N/A N/A N/A N/A N/A fnmatch fnmatch N/A N/A params get rt rt_pattern N/A N/A fnmatch fnmatch N/A N/A params get title title_pattern N/A N/A fnmatch fnmatch N/A N/A params get if if_pattern N/A N/A N/A first_entry True N/A N/A first_entry False N/A N/A N/A N/A link_format append , N/A N/A N/A link_format append < N/A N/A N/A link_format append N/A entry context N/A N/A N/A link_format append uri N/A N/A N/A link_format append > N/A N/A name value N/A N/A params items N/A N/A N/A N/A link_format append ; N/A N/A N/A link_format append name N/A N/A N/A link_format append =" N/A N/A N/A link_format append value N/A N/A N/A link_format append " N/A response N/A N/A coap Message code N/A coap CONTENT payload N/A N/A join link_format N/A N/A N/A response opt content_format N/A N/A coap media_types_rev N/A application/link-format N/A N/A N/A defer succeed response N/A N/A N/A N/A N/A log startLogging N/A sys stdout N/A root N/A N/A resource CoAPResource N/A rd N/A DirectoryResource N/A N/A N/A root putChild rd rd N/A lookup N/A N/A resource CoAPResource N/A N/A N/A root putChild rd-lookup lookup N/A ep_lookup N/A EndpointLookupResource rd N/A N/A N/A lookup putChild ep ep_lookup N/A res_lookup N/A ResourceLookupResource rd N/A N/A N/A lookup putChild res res_lookup N/A endpoint N/A N/A resource Endpoint root N/A protocol N/A N/A coap Coap endpoint N/A N/A N/A reactor listenUDP N/A coap COAP_PORT protocol N/A N/A N/A reactor run