How to use the fastly.models.VCL function in fastly

To help you get started, we’ve selected a few fastly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fastly / fastly-py / fastly / fastly.py View on Github external
def vcls(self, service_id, version):
        return VCL.list(self.conn, service_id=service_id, version=version)
github fastly / fastly-py / fastly / fastly.py View on Github external
def vcl(self, service_id, version, name):
        return VCL.find(self.conn, service_id=service_id, version=version, name=name)
github fastly / fastly-py / fastly / models.py View on Github external
def vcl(self, name, content):
        """ Create a new VCL under this version. """
        vcl = VCL()
        vcl.conn = self.conn

        vcl.attrs = {
            # Parent params
            'service_id': self.attrs['service_id'],
            'version': self.attrs['number'],

            # New instance params
            'name': name,
            'content': content,
        }

        vcl.save()

        return vcl