Exemple #1
0
def do_domain_delete(cs, args):
    """Delete a domain by name."""
    domain = utils.find_resource(cs.domains, args.domain)
    cs.domains.delete(domain.id)
Exemple #2
0
def do_domain_modify(cs, args):
    """Modify a domain."""
    domainId = utils.find_resource(cs.domains, args.domain)
    cs.domains.modify(args, domainId)
Exemple #3
0
def do_domain_show(cs, args):
    """Show details about the given domain"""
    domainId = utils.find_resource(cs.domains, args.domain)
    domain = cs.domains.get(domainId)
    print json.dumps(domain._info, sort_keys=True, indent=4)
Exemple #4
0
def do_domain_export(cs, args):
    """Export details of the specified domain."""
    domain = utils.find_resource(cs.domains, args.domain)
    domain = cs.domains.export(domain.id)
    utils.print_dict(domain._info)
Exemple #5
0
def do_record_delete(cs, args):
    """Delete a record of the specified domain."""
    domainId = utils.find_resource(cs.domains, args.domain)
    cs.records.delete(domainId, args.record_id)
Exemple #6
0
def do_record_modify(cs, args):
    """Modify a record of the specified domain."""
    domainId = utils.find_resource(cs.domains, args.domain)
    cs.records.modify(args, domainId)
Exemple #7
0
def do_record_create(cs, args):
    """Add a record to the specified domain."""
    domainId = utils.find_resource(cs.domains, args.domain)
    record = cs.records.create(args, domainId)
    print json.dumps(record._info, sort_keys=True, indent=4)
Exemple #8
0
def do_record_list(cs, args):
    """Print a list of records for the given domain."""
    domainId = utils.find_resource(cs.domains, args.domain)
    record_list = cs.records.list(domainId)
    columns = ['ID', 'Name', 'Type', "Data", "TTL", "Priority", "Comment"]
    utils.print_list(record_list, columns)
Exemple #9
0
def do_subdomain_list(cs, args):
    """Print a list of available sub-domains for the given domain."""
    domainId = utils.find_resource(cs.domains, args.domain)
    domain_list = cs.domains.subdomains_list(domainId)
    columns = ['ID', 'Name', 'emailAddress']
    utils.print_list(domain_list, columns)