コード例 #1
0
ファイル: cli.py プロジェクト: gmr/infoblox
    def delete_old_host(self, hostname):
        """Remove all records for the host.

        :param str hostname: Hostname to remove
        :rtype: bool

        """
        host = Host(self.session, name=hostname)
        return host.delete()
コード例 #2
0
ファイル: cli.py プロジェクト: gmr/infoblox
    def add_new_host(self, hostname, ipv4addr, comment=None):
        """Add or update a host in the infoblox, overwriting any IP address
        entries.

        :param str hostname: Hostname to add/set
        :param str ipv4addr: IP Address to add/set
        :param str comment: The comment for the record

        """
        host = Host(self.session, name=hostname)
        if host.ipv4addrs:
            host.ipv4addrs = []
        host.add_ipv4addr(ipv4addr)
        host.comment = comment
        return host.save()