def do_domain_delete(cs, args): """Delete a domain by name.""" domain = utils.find_resource(cs.domains, args.domain) cs.domains.delete(domain.id)
def do_domain_modify(cs, args): """Modify a domain.""" domainId = utils.find_resource(cs.domains, args.domain) cs.domains.modify(args, domainId)
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)
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)
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)
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)
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)
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)
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)