mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +02:00
Add flag to delete domain immediately in nomulus too
We've already had the need to do this on a few occasions, so it's best to make it easy rather than requiring hand-generated XML all the time. Also normalizes the boolean --registrar_request parameter to not have arity=1. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=198093829
This commit is contained in:
parent
373b4feeb1
commit
674a914afc
4 changed files with 51 additions and 13 deletions
|
@ -35,6 +35,11 @@ final class DeleteDomainCommand extends MutatingEppToolCommand {
|
|||
required = true)
|
||||
private String domainName;
|
||||
|
||||
@Parameter(
|
||||
names = {"--immediately"},
|
||||
description = "Whether to bypass grace periods and delete the domain immediately.")
|
||||
private boolean immediately = false;
|
||||
|
||||
@Parameter(
|
||||
names = {"--reason"},
|
||||
description = "Reason for the change.",
|
||||
|
@ -43,15 +48,19 @@ final class DeleteDomainCommand extends MutatingEppToolCommand {
|
|||
|
||||
@Parameter(
|
||||
names = {"--registrar_request"},
|
||||
description = "Whether the change was requested by a registrar.",
|
||||
arity = 1)
|
||||
description = "Whether the change was requested by a registrar.")
|
||||
private boolean requestedByRegistrar = false;
|
||||
|
||||
@Override
|
||||
protected void initMutatingEppToolCommand() {
|
||||
if (immediately) {
|
||||
// Immediate deletion is accomplished using the superuser extension.
|
||||
superuser = true;
|
||||
}
|
||||
setSoyTemplate(DeleteDomainSoyInfo.getInstance(), DeleteDomainSoyInfo.DELETEDOMAIN);
|
||||
addSoyRecord(clientId, new SoyMapData(
|
||||
"domainName", domainName,
|
||||
"immediately", immediately,
|
||||
"reason", reason,
|
||||
"requestedByRegistrar", requestedByRegistrar));
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
{template .deletedomain stricthtml="false"}
|
||||
{@param domainName: string}
|
||||
{@param immediately: bool}
|
||||
{@param reason: string}
|
||||
{@param requestedByRegistrar: any}
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
@ -35,6 +36,12 @@
|
|||
<metadata:reason>Deleted by registry administrator: {$reason}</metadata:reason>
|
||||
<metadata:requestedByRegistrar>{$requestedByRegistrar}</metadata:requestedByRegistrar>
|
||||
</metadata:metadata>
|
||||
{if $immediately}
|
||||
<superuser:domainDelete xmlns:superuser="urn:google:params:xml:ns:superuser-1.0">
|
||||
<superuser:redemptionGracePeriodDays>0</superuser:redemptionGracePeriodDays>
|
||||
<superuser:pendingDeleteDays>0</superuser:pendingDeleteDays>
|
||||
</superuser:domainDelete>
|
||||
{/if}
|
||||
</extension>
|
||||
<clTRID>RegistryTool</clTRID>
|
||||
</command>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue