MCPcopy Create free account
hub / github.com/apache/mesos / get

Function get

src/python/cli/src/mesos/http.py:31–44  ·  view source on GitHub ↗
(pid, path, query=None)

Source from the content-addressed store, hash-verified

29# Note that you can also pass an IP:port (or hostname:port) for 'pid'
30# (i.e., you can omit the ID component of the PID, e.g., 'foo@').
31def get(pid, path, query=None):
32 import urllib2
33
34 from contextlib import closing
35
36 url = 'http://' + pid[(pid.find('@') + 1):] + path
37
38 if query is not None and len(query) > 0:
39 url += '?' + '&'.join(
40 ['%s=%s' % (urllib2.quote(str(key)), urllib2.quote(str(value)))
41 for (key, value) in query.items()])
42
43 with closing(urllib2.urlopen(url)) as file:
44 return file.read()

Callers

nothing calls this directly

Calls 3

joinMethod · 0.65
findMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected