def retrieve(self, id, **params): base = self.get("url") id = util.utf8(id) extn = urllib.parse.quote_plus(id) url = "%s/%s" % (base, extn) return self.request("get", url, params)
def retrieve(self, id, **params): base = self.get('url') id = util.utf8(id) extn = urllib.parse.quote_plus(id) url = "%s/%s" % (base, extn) return self.request('get', url, params)
def instance_path(self): id = self.get('id') if not id: raise error.InvalidRequestError( 'Could not determine which URL to request: %s instance ' 'has invalid ID: %r' % (type(self).__name__, id), 'id') id = util.utf8(id) base = self.class_path() extn = urllib.quote_plus(id) return "%s/%s" % (base, extn)
def instance_path(self): user_repo = self.get('id', '').split('/') # id is username/repository if not len(user_repo) == 2: raise error.InvalidRequestError( 'Could not determine which URL to request: %s instance ' 'has missing id: %r' % (type(self).__name__, 'username/repository'), None) commit_hash = self.get( 'commit_hash', 'master') # Downloading from master branch by default username = urllib.parse.quote_plus(util.utf8(user_repo[0])) repository = urllib.parse.quote_plus(util.utf8(user_repo[1])) commit_hash = urllib.parse.quote_plus(util.utf8(commit_hash)) config_file = urllib.parse.quote_plus(util.utf8(github_yaml_file)) return "/%s/%s/%s/%s" % (username, repository, commit_hash, config_file)
def instance_path(self): id = self.get('id') if not id: raise error.InvalidRequestError( 'Could not determine which URL to request: %s instance ' 'has invalid ID: %r' % (type(self).__name__, id), 'id') id = util.utf8(id) base = self.class_path() extn = urllib.parse.quote_plus(id) return "%s/%s" % (base, extn)