11# Admin tool
22
3- Nomulus includes a command-line registry administration tool that is invoked
4- using the ` nomulus ` command. It has the ability to view and change a large
5- number of things in a live Nomulus environment, including creating registrars,
6- updating premium and reserved lists, running an EPP command from a given XML
7- file, and performing various backend tasks like re-running RDE if the most
3+ Nomulus includes a command-line registry administration tool. It has the ability
4+ to view and change a large number of things in a live Nomulus environment,
5+ including creating registrars, running arbitrary EPP commands from given XML
6+ files, and performing various backend tasks like re-running RDE if the most
87recent export failed. Its code lives inside the tools package
9- (` java/google/registry/tools ` ), and is compiled by building the ` nomulus ` target
10- in the Bazel BUILD file in that package .
8+ (` core/src/main/ java/google/registry/tools` ), and is compiled by building the
9+ ` nomulus ` Gradle target in the ` core ` project, e.g. ` ./gradlew core:nomulus ` .
1110
1211The tool connects to the Google Cloud Platform project (identified by project
1312ID) that was configured in your implementation of ` RegistryConfig ` when the tool
@@ -21,18 +20,25 @@ ID is also "acme-registry", and the project ID for the sandbox environment is
2120
2221## Build the tool
2322
24- To build the ` nomulus ` tool, execute the following ` bazel build ` command inside
25- any directory of the codebase. You must rebuild the tool any time that you edit
26- configuration or make database schema changes.
23+ To build the ` nomulus ` tool's jarfile, execute the following Gradle command
24+ inside the project's home directory: ` ./gradlew core:nomulus ` . You must rebuild
25+ the tool any time that you edit configuration or make database schema changes.
26+ Note that proper project configuration is necessary for building the tool --
27+ this includes the specialized configuration such as GCP project names.
28+
29+ It's recommended that you alias the compiled jarfile located at
30+ ` core/build/libs/nomulus.jar ` (or add it to your shell path) so that you can run
31+ it easily, e.g.
2732
2833``` shell
29- $ bazel build //java/google/registry/tools: nomulus
34+ $ alias nomulus= " java -jar core/build/libs/ nomulus.jar "
3035```
3136
32- It's recommended that you alias the compiled binary located at
33- ` bazel-genfiles/java/google/registry/nomulus ` (or add it to your shell path) so
34- that you can run it easily. The rest of this guide assumes that it has been
35- aliased to ` nomulus ` .
37+ The rest of this guide assumes that it has been aliased to ` nomulus ` .
38+
39+ Note: for Google Registry employees, the nomulus tool is built as part of the
40+ weekly deployment process and the nomulus jarfile is located at
41+ ` /google/data/ro/teams/domain-registry/tools/live/nomulus.jar `
3642
3743## Running the tool
3844
@@ -56,44 +62,37 @@ metadata contained within the code to yield documentation.
5662
5763## Local and server-side commands
5864
59- There are two broad ways that commands are implemented: some that send requests
60- to ` ToolsServlet ` to execute the action on the server (these commands implement
61- ` ServerSideCommand ` ), and others that execute the command locally using the
62- [ Remote API] ( https://cloud.google.com/appengine/docs/java/tools/remoteapi )
63- (these commands implement ` RemoteApiCommand ` ). Server-side commands take more
64- work to implement because they require both a client and a server-side
65- component.
66- However, they are fully capable of doing anything that is possible with App
67- Engine, including running a large MapReduce, because they execute on the tools
68- service in the App Engine cloud.
69-
70- Local commands, by contrast, are easier to implement, because there is only a
71- local component to write, but they aren't as powerful. A general rule of thumb
72- for making this determination is to use a local command if possible, or a
73- server-side command otherwise.
65+ There are two broad ways that commands are implemented: some send requests to
66+ the backend server to execute the action on the server (these commands implement
67+ ` CommandWithConnection ` ), and others that execute the command locally using
68+ access to the database. Commands that send requests to the backend server are
69+ more work to implement because they require both a client-side and server-side
70+ component, but they are more powerful -- even running Flow pipelines or other
71+ long-running intensive jobs.
72+
73+ Local commands are easier to implement (because there is only a local component
74+ to write) but they aren't as powerful. As a rule of thumb, use a local command
75+ if possible.
7476
7577## Common tool patterns
7678
7779All tools ultimately implement the ` Command ` interface located in the ` tools `
7880package. If you use an integrated development environment (IDE) such as IntelliJ
79- to view the type hierarchy of that interface, you'll see all of the commands
80- that exist, as well as how a lot of them are grouped using sub-interfaces or
81- abstract classes that provide additional functionality. The most common patterns
82- that are used by a large number of other tools are:
81+ to view the type hierarchy of that interface, you'll see all the commands that
82+ exist, as well as how a lot of them are grouped using sub-interfaces or abstract
83+ classes that provide additional functionality. The most common patterns that are
84+ used by a large number of other tools are:
8385
84- * ** ` BigqueryCommand ` ** -- Provides a connection to BigQuery for tools that
85- need it.
8686* ** ` ConfirmingCommand ` ** -- Provides the methods ` prompt() ` and ` execute() `
8787 to override. ` prompt() ` outputs a message (usually what the command is going
8888 to do) and prompts the user to confirm execution of the command, and then
8989 ` execute() ` actually does it.
9090* ** ` EppToolCommand ` ** -- Commands that work by executing EPP commands against
9191 the server, usually by filling in a template with parameters that were
9292 passed on the command-line.
93- * ** ` MutatingEppToolCommand ` ** -- A sub-class of ` EppToolCommand ` that
94- provides a ` --dry_run ` flag, that, if passed, will display the output from
95- the server of what the command would've done without actually committing
96- those changes.
93+ * ** ` MutatingEppToolCommand ` ** -- A subclass of ` EppToolCommand ` that provides
94+ a ` --dry_run ` flag, that, if passed, will display the output from the server
95+ of what the command would've done without actually committing those changes.
9796* ** ` GetEppResourceCommand ` ** -- Gets individual EPP resources from the server
9897 and outputs them.
9998* ** ` ListObjectsCommand ` ** -- Lists all objects of a specific type from the
0 commit comments