App-pepper

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


This command creates the domain `NEW` using the same contacts and nameservers as `OLD`.

    create domain DOMAIN PARAMS

This command creates a domain according to the parameters specified after the domain. `PARAMS` consists of pairs of name and (optionally quoted) value pairs as follows:

- `period` - the registration period. Defaults to 1 year.
- `registrant` - the registrant.
- `admin` - the admin contact.
- `tech` - the tech contact.
- `billing` - the billing contact.
- `ns` - add a nameserver.
- `authinfo` - authInfo code. A random string will be used if not provided.

Example:

    pepper (id@host)> create domain example.xyz period 1 registrant sh8013 admin sh8013 tech sh8013 billing sh8013 ns ns0.example.com ns ns1.example.net

### Creating Host Objects

Syntax:

    create host HOSTNAME [IP [IP [IP [...]]]]

Create a host object with the specified `HOSTNAME`. IP address may also be
specified: IPv4 and IPv6 addresses are automatically detected.

### Creating Contact Objects

There are two ways of creating a contact:

    clone contact OLD NEW

This command creates the contact `NEW` using the same data as `OLD`.

    create contact PARAMS

This command creates a contact object according to the parameters specified. `PARAMS` consists of pairs of name and (optionally quoted) value pairs as follows:

- `id` - contact ID. If not provided, a random 16-charater ID will be generated
- `type` - specify the "type" attribute for the postal address information. Only one type is supported. Possible values are "int" (default) and "loc".
- `name` - contact name
- `org` - contact organisation
- `street` - street address, may be provided multiple times
- `city` - city
- `sp` - state/province
- `pc` - postcode
- `cc` - ISO-3166-alpha2 country code
- `voice` - E164 voice number
- `fax` - E164 fax number
- `email` - email address
- `authinfo` - authInfo code. A random string will be used if not provided.

Example:

    pepper (id@host)> create contact id "sh8013" name "John Doe" org "Example Inc." type int street "123 Example Dr." city Dulles sp VA pc 20166-6503 cc US voice +1.7035555555 email jdoe@example.com

## Object Updates

Objects may be updated using the `update` command.

### Domain Updates

    update domain DOMAIN CHANGES

The `CHANGES` argument consists of groups of three values: an action (ie `add`, `rem` or `chg`), followed by a property name (e.g. `ns`, a contact type (such as `admin`, `tech` or `billing`) or `status`), followed by a value.

Example:

    update domain example.com add ns ns0.example.com

    update domain example.com rem ns ns0.example.com

    update domain example.com add status clientUpdateProhibited

    update domain example.com rem status clientHold

    update domain example.com add admin H12345

    update domain example.com rem tech H54321

    update domain example.com chg registrant H54321

    update domain example.cm chg authinfo foo2bar

Multiple changes can be combined in a single command:

    update domain example.com add status clientUpdateProhibited rem ns ns0.example.com chg registrant H54321

### Host Updates

Syntax:

    update host HOSTNAME CHANGES

The `CHANGES` argument consists of groups of three values: an action (ie `add`, `rem` or `chg`), followed by a property name (ie `addr`, `status` or `name`), followed by a value (which may be quoted).

Examples:

    update host ns0.example.com add status clientUpdateProhibited

    update host ns0.example.com rem addr 10.0.0.1

    update host ns0.example.com chg name ns0.example.net

Multiple changes can be combined in a single command:

    update host ns0.example.com add status clientUpdateProhibited rem addr 10.0.0.1 add addr 1::1 chg name ns0.example.net

### Contact Updates

    update contact ID CHANGES

The `CHANGES` argument consists of groups of three values: an action (ie `add`, `rem` or `chg`), followed by a property name, followed by a value (which may be quoted, and may be empty). The property name may be one of:

- `status`
- `name`
- `type` (either "`int`" or "`loc`", which applies to all subsequent values, and which may appear multiple times)
- `org`
- `street1`, `street2`, `street3`
- `city`
- `sp`
- `pc`
- `cc`
- `voice`
- `fax`
- `email`
- `authInfo`

If postal address information is being changed, then any values not specified in the command line will be populated from the existing object information. This is because contact information is updated atomically.

Examples:

    pepper (id@host)> create contact id "sh8013" name "John Doe" org "Example Inc." type int street "123 Example Dr." city Dulles sp VA pc 20166-6503 cc US voice  email jdoe@example.com

    update contact sh8013 chg email example@example.com

    update contact sh8013 chg voice +1.7035555555

    update contact sh8013 street1 "123 Example Dr." street2 "" street3 ""

    update contact city Dulles sp VA pc 20166-6503 cc US

    update contact authInfo foo2bar

## Object Transfers

Object transfers may be managed with the `transfer` command. Usage:

    transfer TYPE OBJECT CMD [AUTHINFO [PERIOD]]

where:

- `TYPE` - `domain` or `contact`
- `OBJECT` - domain name or contact ID
- `CMD` - one of (`request`, `query`, `approve`, `reject`, or `cancel`)
- `AUTHINFO` - authInfo code (used with `request` only)
- `PERIOD` - additional validity period (used with domain `request` only)

## Errors

If you prefix a command with a `!` character, then Pepper will end the session if an EPP command fails (that is, if the result code of the response is 2000 or higher).

This is mostly useful in scripting mode where you may want the script to terminate if an error occurs.

Example usage:

    !create domain example.com authinfo foo2bar
    update domain example.com add ns ns0.example.com

In the above example, Pepper will end the session if the first command fails, since there is no point in running the second command if the first has failed.

# INSTALLATION

To install, run:

    cpanm --sudo App::pepper

If [Term::ReadLine::Gnu](https://metacpan.org/pod/Term%3A%3AReadLine%3A%3AGnu) is available, then Pepper can provide a richer interactive command line, with support for history and rich command editing.

# RUNNING VIA DOCKER

The [git repository](https://github.com/gbxyz/pepper) contains a `Dockerfile`
that can be used to build an image on your local system.

Alternatively, you can pull the [image from Docker Hub](https://hub.docker.com/r/gbxyz/pepper):

    $ docker pull gbxyz/pepper

    $ docker run -it gbxyz/pepper --help



( run in 0.590 second using v1.01-cache-2.11-cpan-d8267643d1d )