コード例 #1
0
ファイル: txdocker.py プロジェクト: hydface2/mcloud
    def find_container_by_name(self, name):
        result = yield self._get('containers/%s/json' % str(name))

        if result.code != 200:
            defer.returnValue(None)

        ct = yield txhttp.json_content(result)

        defer.returnValue(ct['Id'])
コード例 #2
0
ファイル: txdocker.py プロジェクト: hydface2/mcloud
    def find_container_by_name(self, name):
        result = yield self._get('containers/%s/json' % str(name))

        if result.code != 200:
            defer.returnValue(None)

        ct = yield txhttp.json_content(result)

        defer.returnValue(ct['Id'])
コード例 #3
0
ファイル: txdocker.py プロジェクト: hydface2/mcloud
    def find_containers_by_names(self, names):
        result = yield self._get('containers/json?all=1')
        response = yield txhttp.json_content(result)

        ids = dict([(name, None) for name in names])

        for ct in response:
            for name in names:
                if ('/%s' % name) in ct['Names']:
                    ids[name] = ct['Id']

        defer.returnValue(ids)
コード例 #4
0
ファイル: txdocker.py プロジェクト: hydface2/mcloud
    def find_containers_by_names(self, names):
        result = yield self._get('containers/json?all=1')
        response = yield txhttp.json_content(result)

        ids = dict([(name, None) for name in names])

        for ct in response:
            for name in names:
                if ('/%s' % name) in ct['Names']:
                    ids[name] = ct['Id']

        defer.returnValue(ids)
コード例 #5
0
ファイル: txdocker.py プロジェクト: hydface2/mcloud
def json_response(result):
    return txhttp.json_content(result)
コード例 #6
0
ファイル: txdocker.py プロジェクト: hydface2/mcloud
def json_response(result):
    return txhttp.json_content(result)