Example #1
0
 def __init__(self, uri=None):
     if uri is None:
         service_root = ServiceRoot()
         manager = Resource(service_root.resource.metadata["management"])
         monitor = Monitor(manager.metadata["services"]["monitor"])
         uri = monitor.resource.uri
     Service.__init__(self)
     self.bind(uri)
Example #2
0
 def __init__(self, uri=None):
     if uri is None:
         service_root = ServiceRoot()
         manager = Resource(service_root.resource.metadata["management"])
         monitor = Monitor(manager.metadata["services"]["monitor"])
         uri = monitor.resource.uri
     Service.__init__(self)
     self.bind(uri)
Example #3
0
 def __init__(self, content_type, uri, name=None):
     Service.__init__(self)
     self._content_type = content_type
     key_value_pos = uri.find("/{key}/{value}")
     if key_value_pos >= 0:
         self._searcher = ResourceTemplate(uri)
         self.bind(uri[:key_value_pos])
     else:
         self.bind(uri)
         self._searcher = ResourceTemplate(uri.string + "/{key}/{value}")
     uri = self.resource.uri
     if self.graph.neo4j_version >= (1, 9):
         self._create_or_fail = Resource(uri.resolve("?uniqueness=create_or_fail"))
         self._get_or_create = Resource(uri.resolve("?uniqueness=get_or_create"))
     else:
         self._create_or_fail = None
         self._get_or_create = Resource(uri.resolve("?unique"))
     self._query_template = ResourceTemplate(uri.string + "{?query,order}")
     self._name = name or uri.path.segments[-1]
     self.__searcher_stem_cache = {}
Example #4
0
 def __init__(self, content_type, uri, name=None):
     Service.__init__(self)
     self._content_type = content_type
     key_value_pos = uri.find("/{key}/{value}")
     if key_value_pos >= 0:
         self._searcher = ResourceTemplate(uri)
         self.bind(uri[:key_value_pos])
     else:
         self.bind(uri)
         self._searcher = ResourceTemplate(uri.string + "/{key}/{value}")
     uri = self.resource.uri
     if self.graph.neo4j_version >= (1, 9):
         self._create_or_fail = Resource(
             uri.resolve("?uniqueness=create_or_fail"))
         self._get_or_create = Resource(
             uri.resolve("?uniqueness=get_or_create"))
     else:
         self._create_or_fail = None
         self._get_or_create = Resource(uri.resolve("?unique"))
     self._query_template = ResourceTemplate(uri.string + "{?query,order}")
     self._name = name or uri.path.segments[-1]
     self.__searcher_stem_cache = {}