示例#1
0
    def create_domain(self, context, values):
        domain = self.storage_conn.create_domain(context, values)

        agent_api.create_domain(context, domain)
        utils.notify(context, "api", "domain.create", domain)

        return domain
示例#2
0
    def delete_domain(self, context, domain_id):
        domain = self.storage_conn.get_domain(context, domain_id)

        agent_api.delete_domain(context, domain)
        utils.notify(context, 'api', 'domain.delete', domain)

        return self.storage_conn.delete_domain(context, domain_id)
示例#3
0
    def update_domain(self, context, domain_id, values):
        domain = self.storage_conn.update_domain(context, domain_id, values)

        agent_api.update_domain(context, domain)
        utils.notify(context, 'api', 'domain.update', domain)

        return domain
示例#4
0
    def update_domain(self, context, domain_id, values):
        domain = self.storage_conn.update_domain(context, domain_id, values)

        agent_api.update_domain(context, domain)
        utils.notify(context, 'api', 'domain.update', domain)

        return domain
示例#5
0
    def delete_domain(self, context, domain_id):
        domain = self.storage_conn.get_domain(context, domain_id)

        agent_api.delete_domain(context, domain)
        utils.notify(context, 'api', 'domain.delete', domain)

        return self.storage_conn.delete_domain(context, domain_id)
示例#6
0
    def delete_server(self, context, server_id):
        policy.check('delete_server', context, {'server_id': server_id})

        server = self.storage.get_server(context, server_id)

        utils.notify(context, 'central', 'server.delete', server)

        return self.storage.delete_server(context, server_id)
示例#7
0
    def update_server(self, context, server_id, values):
        policy.check('update_server', context, {'server_id': server_id})

        server = self.storage.update_server(context, server_id, values)

        utils.notify(context, 'central', 'server.update', server)

        return server
示例#8
0
    def create_server(self, context, values):
        policy.check('create_server', context)

        server = self.storage.create_server(context, values)

        utils.notify(context, 'central', 'server.create', server)

        return server
示例#9
0
    def create_record(self, context, domain_id, values):
        record = self.storage_conn.create_record(context, domain_id, values)

        domain = self.storage_conn.get_domain(context, domain_id)

        agent_api.create_record(context, domain, record)
        utils.notify(context, 'api', 'record.create', record)

        return record
示例#10
0
    def delete_record(self, context, domain_id, record_id):
        record = self.storage_conn.get_record(context, record_id)

        domain = self.storage_conn.get_domain(context, domain_id)

        agent_api.delete_record(context, domain, record)
        utils.notify(context, 'api', 'record.delete', record)

        return self.storage_conn.delete_record(context, record_id)
示例#11
0
    def create_record(self, context, domain_id, values):
        record = self.storage_conn.create_record(context, domain_id, values)

        domain = self.storage_conn.get_domain(context, domain_id)

        agent_api.create_record(context, domain, record)
        utils.notify(context, "api", "record.create", record)

        return record
示例#12
0
    def update_record(self, context, domain_id, record_id, values):
        record = self.storage_conn.update_record(context, record_id, values)

        domain = self.storage_conn.get_domain(context, domain_id)

        agent_api.update_record(context, domain, record)
        utils.notify(context, 'api', 'record.update', record)

        return record
示例#13
0
    def delete_record(self, context, domain_id, record_id):
        record = self.storage_conn.get_record(context, record_id)

        domain = self.storage_conn.get_domain(context, domain_id)

        agent_api.delete_record(context, domain, record)
        utils.notify(context, 'api', 'record.delete', record)

        return self.storage_conn.delete_record(context, record_id)
示例#14
0
    def delete_domain(self, context, domain_id):
        domain = self.storage_conn.get_domain(context, domain_id)

        target = {'domain_id': domain_id, 'tenant_id': domain['tenant_id']}
        policy.check('delete_domain', context, target)

        self.backend.delete_domain(context, domain)
        utils.notify(context, 'api', 'domain.delete', domain)

        return self.storage_conn.delete_domain(context, domain_id)
示例#15
0
    def create_record(self, context, domain_id, values):
        domain = self.storage_conn.get_domain(context, domain_id)

        target = {'domain_id': domain_id, 'tenant_id': domain['tenant_id']}
        policy.check('create_record', context, target)

        record = self.storage_conn.create_record(context, domain_id, values)

        self.backend.create_record(context, domain, record)
        utils.notify(context, 'api', 'record.create', record)

        return record
示例#16
0
    def create_domain(self, context, values):
        values['tenant_id'] = context.effective_tenant_id

        target = {'tenant_id': values['tenant_id']}
        policy.check('create_domain', context, target)

        # Ensure the domain does not end with a reserved suffix.
        self._check_reserved_domain_suffixes(context, values['name'])

        domain = self.storage_conn.create_domain(context, values)

        self.backend.create_domain(context, domain)
        utils.notify(context, 'api', 'domain.create', domain)

        return domain
示例#17
0
    def delete_record(self, context, domain_id, record_id):
        domain = self.storage_conn.get_domain(context, domain_id)

        target = {
            'domain_id': domain_id,
            'record_id': record_id,
            'tenant_id': domain['tenant_id']
        }
        policy.check('delete_record', context, target)

        record = self.storage_conn.get_record(context, record_id)

        self.backend.delete_record(context, domain, record)
        utils.notify(context, 'api', 'record.delete', record)

        return self.storage_conn.delete_record(context, record_id)
示例#18
0
    def touch_domain(self, context, domain_id):
        domain = self.storage.get_domain(context, domain_id)

        target = {
            'domain_id': domain_id,
            'domain_name': domain['name'],
            'tenant_id': domain['tenant_id']
        }

        policy.check('touch_domain', context, target)

        domain = self._increment_domain_serial(context, domain_id)

        utils.notify(context, 'central', 'domain.touch', domain)

        return domain
示例#19
0
    def update_domain(self, context, domain_id, values):
        domain = self.storage_conn.get_domain(context, domain_id)

        target = {'domain_id': domain_id, 'tenant_id': domain['tenant_id']}
        policy.check('update_domain', context, target)

        if 'tenant_id' in values:
            target = {'domain_id': domain_id, 'tenant_id': values['tenant_id']}
            policy.check('create_domain', context, target)

        if 'name' in values:
            # Ensure the domain does not end with a reserved suffix.
            self._check_reserved_domain_suffixes(context, values['name'])

        domain = self.storage_conn.update_domain(context, domain_id, values)

        self.backend.update_domain(context, domain)
        utils.notify(context, 'api', 'domain.update', domain)

        return domain
示例#20
0
    # TSIG Key Methods
    def create_tsigkey(self, context, values):
        policy.check('create_tsigkey', context)

        tsigkey = self.storage.create_tsigkey(context, values)

        try:
            self.backend.create_tsigkey(context, tsigkey)
        except exceptions.Backend:
            # Re-raise Backend exceptions as is..
            raise
        except Exception, e:
            raise exceptions.Backend('Unknown backend failure: %s' % e)

        utils.notify(context, 'central', 'tsigkey.create', tsigkey)

        return tsigkey

    def get_tsigkeys(self, context, criterion=None):
        policy.check('get_tsigkeys', context)

        return self.storage.get_tsigkeys(context, criterion)

    def get_tsigkey(self, context, tsigkey_id):
        policy.check('get_tsigkey', context, {'tsigkey_id': tsigkey_id})

        return self.storage.get_tsigkey(context, tsigkey_id)

    def update_tsigkey(self, context, tsigkey_id, values):
        policy.check('update_tsigkey', context, {'tsigkey_id': tsigkey_id})
示例#21
0
    def update_server(self, context, server_id, values):
        server = self.storage_conn.update_server(context, server_id, values)

        utils.notify(context, 'api', 'server.update', server)

        return server
示例#22
0
    def delete_server(self, context, server_id):
        server = self.storage_conn.get_server(context, server_id)

        utils.notify(context, 'api', 'server.delete', server)

        return self.storage_conn.delete_server(context, server_id)
示例#23
0
    def delete_server(self, context, server_id):
        server = self.storage_conn.get_server(context, server_id)

        utils.notify(context, 'api', 'server.delete', server)

        return self.storage_conn.delete_server(context, server_id)
示例#24
0
    def update_server(self, context, server_id, values):
        server = self.storage_conn.update_server(context, server_id, values)

        utils.notify(context, 'api', 'server.update', server)

        return server
示例#25
0
    def create_server(self, context, values):
        server = self.storage_conn.create_server(context, values)

        utils.notify(context, 'api', 'server.create', server)

        return server
示例#26
0
    def create_server(self, context, values):
        server = self.storage_conn.create_server(context, values)

        utils.notify(context, 'api', 'server.create', server)

        return server
示例#27
0
    def create_server(self, context, values):
        server = self.storage_conn.create_server(context, values)

        utils.notify(context, "api", "server.create", server)

        return server