Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def versions(self, service_id):
return Version.list(self.conn, service_id=service_id)
def version(self, service_id, version):
return Version.find(self.conn, service_id=service_id, number=version)
def version(self):
""" Create a new version under this service. """
ver = Version()
ver.conn = self.conn
ver.attrs = {
# Parent params
'service_id': self.attrs['id'],
}
ver.save()
return ver
INSTANCE_PATTERN = COLLECTION_PATTERN + '/$id'
class Settings(Model):
INSTANCE_PATTERN = Version.COLLECTION_PATTERN + '/$version/settings'
COLLECTION_PATTERN = INSTANCE_PATTERN
class Condition(Model):
COLLECTION_PATTERN = Version.COLLECTION_PATTERN + '/$version/condition'
INSTANCE_PATTERN = COLLECTION_PATTERN + '/$name'
class Header(Model):
COLLECTION_PATTERN = Version.COLLECTION_PATTERN + '/$version/header'
INSTANCE_PATTERN = COLLECTION_PATTERN + '/$name'
class VCL(Model):
COLLECTION_PATTERN = Version.COLLECTION_PATTERN + '/$version/vcl'
INSTANCE_PATTERN = COLLECTION_PATTERN + '/$name'
def download(self):
resp, data = self._query('GET', '/download')
return data
def main(self):
resp, data = self._query('PUT', '/main')
return data
class Dictionary(Model):
COLLECTION_PATTERN = Version.COLLECTION_PATTERN + '/$version/dictionary'
INSTANCE_PATTERN = COLLECTION_PATTERN + '/$name'
def info(self):
resp, data = self._collection_query('GET', suffix='/$id/info')