NAME

Net::DRI::Shell - Command Line Shell for Net::DRI, with batch features and autocompletion support

SYNOPSYS

perl -I../../ ./Shell.pm
or
perl -MNet::DRI::Shell -e 'Net::DRI::Shell->run()'
or in your programs
use Net::DRI::Shell;
Net::DRI::Shell->run();

Welcome to Net::DRI shell, version 1.07
Net::DRI object created with a cache TTL of 10 seconds and logging into files in current directory

NetDRI> add_registry registry=EURid clID=YOURLOGIN
NetDRI(EURid)> add_current_profile name=profile1 type=epp defer=0 client_login=YOURLOGIN client_password=YOURPASSWORD
Profile profile1 added successfully (1000/COMMAND_SUCCESSFUL) SUCCESS
NetDRI(EURid,profile1)> domain_info example.eu
Command completed successfully (1000/1000) SUCCESS
NetDRI(EURid,profile1)> get_info_all

... all data related to the domain name queried ...

NetDRI(EURid,profile1)> domain_check whatever.eu
Command completed successfully (1000/1000) SUCCESS
NetDRI(EURid,profile1)> get_info_all

... all data related to the domain name queried ...

NetDRI(EURid,profile1)> show profiles
EURid: profile1
NetDRI(EURid,profile1)> quit

DESCRIPTION

This is a shell to be able to use Net::DRI without writing any code.

Most of the time commands are the name of methods to use on the Net::DRI object, with some extra ones and some variations in API to make passing parameters simpler.

AVAILABLE COMMANDS

After having started this shell, the available commands are the following.

SESSION COMMANDS

add_registry registry=REGISTRYNAME clID=YOURLOGIN

Replace REGISTRYNAME with the Net::DRI::DRD module you want to use, and YOURLOGIN with your client login for this registry.

add_current_profile name=profile1 type=epp defer=0 client_login=YOURLOGIN client_password=YOURPASSWORD

This will really connect to the registry, replace YOURLOGIN by your client login at registry, and YOURPASSWORD by the associated password. You may have to add parameters remote_host= and remote_port= to connect to other endpoints than the hardcoded default which is most of the time the registry OT&E server, and not the production one !

add registry=REGISTRYNAME clID=YOURLOGIN name=profile1 type=epp defer=0 client_login=YOURLOGIN client_password=YOURPASSWORD

This is a shortcut, doing the equivalent of add_registry, and then add_current_profile.

get_info_all

After each call to the registry, like domain_info or domain_check, this will list all available data retrieved from registry. Things are pretty-printed as much as possible. You should call get_info_all right after your domain_something call otherwise if you do another operation previous information is lost. This is done automatically for you on the relevant commands, but you can also use it manually at any time.

show profiles

Show the list of registries and associated profiles currently in use (opened in this shell with add_registry + add_current_profile, or add).

show tlds

Show the list of TLDs handled by the currently selected registry.

show periods

Show the list of allowed periods (domain name durations) for the currently selected registry.

show objects

Show the list of managed objects types at the currently selected registry.

show types

Show the list of profile types at the currently selected registry

show status

Show the list of available status for the currently selected registry, to use as status name in some commands below (domain_update_status_* domain_update host_update_status_* host_update contact_update_status_* contact_update).

show config

This will show all current config options. See set command below for the list of config options.

set OPTION=VALUE

The set command can be used to change some options inside the shell.

The current list of available options is:

verbose

Set this option to 1 if you want a dump of all data retrieved from registry automatically after each operation, including failed ones, and including all displaying raw data exchanged with registry.

target REGISTRYNAME PROFILENAME

Switch to registry REGISTRYNAME (from currently available registries) and profile PROFILENAME (from currently available profiles in registry REGISTRYNAME).

run FILENAME

Will open the local FILENAME and read in it commands and execute all of them; you can also start your shell with a filename as argument and its commands will be run at beginning of session before giving the control back. They will be displayed (username and password will be masked) with their results.

record FILENAME

If called with a filename argument, all subsequent commands, and their results will be printed in the filename given. If called without argument, it stops a current recording session.

!cmd

All command line starting with a bang (!) will be treated as local commands to run through the local underlying OS shell.

Example: !ls -l will display the content of the current directory.

help

Returns a succinct list of available commands.

quit

Leave the shell.

DOMAIN COMMANDS

domain_create DOMAIN [duration=X] [ns=HOSTNAMEA IPA1 IPA2 ... HOSTNAMEB IPB1 IPB2 ...] [admin=SRID1] [registrant=SRID2] [billing=SRID3] [tech=SRID4] [auth=X]

Create the given domain name. See above for the duration format to use. Admin, registrant, billing and tech contact ids are mandatory or optional depending on the registry. They may be repeated (except registrant) for registries allowing multiple contacts per role.

domain_info DOMAIN

Do a domain_info call to the registry for the domain YOURDOMAIN ; most of the the registries prohibit getting information on domain names you do not sponsor.

domain_check DOMAIN

Do a domain_check call to the registry for the domain ANYDOMAIN ; you can check any domain, existing or not, if you are the sponsoring registrar or not.

domain_exist DOMAIN

A kind of simpler domain_check, just reply by YES or NO for the given domain name.

domain_transfer_start DOMAIN auth=AUTHCODE [duration=PERIOD]

domain_transfer_stop DOMAIN [auth=AUTHCODE]

domain_transfer_query DOMAIN [auth=AUTHCODE]

domain_transfer_accept DOMAIN [auth=AUTHCODE]

domain_transfer_refuse DOMAIN [auth=AUTHCODE]

Start, or stop an incoming transfer, query status of a current running transfer, accept or refuse an outgoing domain name transfer.

The AUTHCODE is mandatory or optional, depending on the registry.

The duration is optional and can be specified (the allowed values depend on the registry) as Ayears or Bmonths where A and B are integers for the number of years or months (this can be abbreviated as Ay or Bm).

domain_update_ns_set DOMAIN HOSTNAMEA IPA1 IPA2 ... HOSTNAMEB IPB1 IPB2 ...

domain_update_ns_add DOMAIN HOSTNAMEA IPA1 IPA2 ... HOSTNAMEB IPB1 IPB2 ...

domain_update_ns_del DOMAIN HOSTNAMEA IPA1 IPA2 ... HOSTNAMEB IPB1 IPB2 ...

Set the current list of nameservers associated to this DOMAIN, add to the current list or delete from the current list.

domain_update_status_set DOMAIN STATUS1 STATUS2 ...

domain_update_status_add DOMAIN STATUS1 STATUS2 ...

domain_update_status_del DOMAIN STATUS1 STATUS2 ...

Set the current list of status associated to this DOMAIN, add to the current list or delete from the current list. First parameter is the domain name, then status names, as needed.

The status names are those in the list given back by the show status command (see above).

domain_update_contact_set DOMAIN SRVID1 SRVID2 ...

domain_update_contact_add DOMAIN SRVID2 SRVID2 ...

domain_update_contact_del DOMAIN SRVID1 SRVID2 ...

Set the current list of contacts associated to this DOMAIN, add to the current list or delete from the current list by providing the contact server ids.

domain_update DOMAIN +status=S1 -status=S2 +admin=C1 -tech=C2 -billing=C3 registrant=C4 auth=A +ns=... -ns=...

Combination of the previous methods, plus ability to change authInfo and other parameters depending on registry.

domain_renew DOMAIN [duration=X] [current_expiration=YYYY-MM-DD]

Renew the given domain name. Duration and current expiration are optional. See above for the duration format to use.

domain_delete DOMAIN

Delete the given domain name.

HOST COMMANDS

For registries handling nameservers as separate objects.

host_create HOSTNAME IP1 IP2 ...

Create the host named HOSTNAME at the registry with the list of IP (IPv4 and IPv6 depending on registry support) given.

host_delete HOSTNAME

host_info HOSTNAME

host_check HOSTNAME

Various operations on host objects.

host_update_ip_set HOSTNAME IP1 IP2 ...

host_update_ip_add HOSTNAME IP1 IP2 ...

host_update_ip_del HOSTNAME IP1 IP2 ...

Set the current list of IP addresses associated to this HOSTNAME, add to the current list or delete from the current list. First parameter is the nameserver hostname, then IP addresses, as needed.

host_update_status_set HOSTNAME STATUS1 STATUS2 ...

host_update_status_add HOSTNAME STATUS1 STATUS2 ...

host_update_status_del HOSTNAME STATUS1 STATUS2 ...

Set the current list of status associated to this HOSTNAME, add to the current list or delete from the current list. First parameter is the nameserver hostname, then status names, as needed.

The status names are those in the list given back by the show status command (see above).

host_update HOSTNAME +ip=IP1 +ip=IP2 -ip=IP3 +status=STATUS1 -status=STATUS2 name=NEWNAME

Combines the previous operations.

host_update_name_set HOSTNAME NEWNAME

Change the current name of host objects from HOSTNAME to NEWNAME.

CONTACT COMMANDS

For registries handling contacts as separate objects.

contact_create name=X org=Y street=Z1 street=Z2 email=A voice=B ...

Create a new contact object.

The list of mandatory attributes depend on the registry. Some attributes (like street) may appear multiple times.

Some registry allow setting an ID (using srid=yourchoice), others create the ID, in which case you need to do a get_info_all after contact_create to retrieve the given server ID.

contact_delete SRID

contact_info SRID

contact_check SRID

Various operations on contacts.

contact_update_status_set SRID STATUS1 STATUS2 ...

contact_update_status_add SRID STATUS1 STATUS2 ...

contact_update_status_del SRID STATUS1 STATUS2 ...

Set the current list of status associated to this contact SRID, add to the current list or delete from the current list. First parameter is the contact server ID, then status names, as needed.

The status names are those in the list given back by the show status command (see above).

contact_update SRID name=X org=Y ... +status=... -status=...

Change some contacts attributes, as well as statuses.

contact_transfer_start SRID

contact_transfer_stop SRID

contact_transfer_query SRID

contact_transfer_accept SRID

contact_transfer_refuse SRID

Start, or stop an incoming transfer, query status of a current running transfer, accept or refuse an outgoing contact transfer.

MESSAGE COMMANDS

For registries handling messages, like EPP poll features.

message_retrieve [ID]

Retrieve a message waiting at registry.

message_delete [ID]

Delete a message waiting at registry.

message_waiting

Notifies if messages are waiting at registry.

message_count

Get the numbers of messages waiting at the registry.

COMPLETION

If Term::Readline::Gnu or Term::Readline::Perl are installed, it will be automatically used by this shell to provide standard shell autocompletion for commands and parameters.

All commands described above will be available through autocompletion. As you use them, all parameters (domain names, contacts, hostnames, local files) will also be stored and provided to later autocompletion calls (with the [TAB] key).

It will also autocomplete registry= and type= parameters during add/add_registry, from a basic default set of values: registry= values are taken from a basic Net::DRI install without taking into account any private DRD module, and type= values are a default set, not checked against registry= value. Same for target calls, where registry and/or profile name will be autocompleted as possible.

It will even autocomplete TLD on domain names for your current registry after your typed the first label and a dot (and eventually some other characters), during any domain name operation. Same for durations and status values.

Contacts and nameservers will also be autocompleted when used in any domain_* operation.

Contacts attributes will be autocompleted during contact_create based on the current registry & profile.

Information retrieved with domain_info calls will also be used in later autocompletion tries, regarding contact ids and hostnames. During a contact creation, the registry returned contact id is also added for later autocompletion tries.

For autocompletion, contacts are specific to each registry. Hostnames are common to all registries, as are domain names, but domain names are checked against the available TLDs of the current registry when used for autocompletion.

LOGGING

By default, all operations will have some logging information done in files stored in the working directory. There will be a core.log file for all operations and then one file per tuple (registry,profile).

BATCH OPERATIONS

Batch operations are available for some domain name commands: domain_create, domain_delete, domain_renew, domain_check, domain_info, domain_transfer and all domain_update commands. It can be used on a list of domain names for which all other parameters needed by the command are the same.

To do that, just use the command normally as outlined above, but instead of the domain name, put a file path, with at least one / (so for a file "batch.txt" in the current directory, use "./batch.txt").

If you use backticks such as `command` for the domain name, the command will be started locally and its output will be used just like a file.

The shell will then apply the command and its parameters on the domain names listed in the specified file: you should have one domain name per line, blank lines and lines starting with # are ignored.

At the same place a new file is created with a name derived from the given name in which the result of each domain name command will be written. If "input" is the filename used, the results will be written to "input.PID.TIME.results" where PID is the program id of the running shell for these commands and TIME the Unix epoch when the batch started.

As output the shell will give a summary of the number of operations done for each possible outcome (success or error), as well as time statistics.

SUPPORT

For now, support questions should be sent to:

<netdri@dotandco.com>

Please also see the SUPPORT file in the distribution.

SEE ALSO

<http://www.dotandco.com/services/software/Net-DRI/>

AUTHOR

Patrick Mevzek, <netdri@dotandco.com>

COPYRIGHT

Copyright (c) 2008-2010 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

See the LICENSE file that comes with this distribution for more details.