mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Refactor/rename refresh all DNS action
I'm moving it out of the scrap folder too because there's nothing else in there and we do want to retain this indefinitely because it's a useful tool for performing DNS writer migrations. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=160168902
This commit is contained in:
parent
5a31be12ba
commit
30d5d05fdf
8 changed files with 40 additions and 61 deletions
|
@ -71,7 +71,8 @@ with the tools service are not visible to users.
|
||||||
|
|
||||||
The tools service also runs ad-hoc MapReduces, like those invoked via `nomulus`
|
The tools service also runs ad-hoc MapReduces, like those invoked via `nomulus`
|
||||||
tool subcommands like `generate_zone_files` and by manually hitting URLs under
|
tool subcommands like `generate_zone_files` and by manually hitting URLs under
|
||||||
https://tools-dot-project-id.appspot.com, like `/_dr/task/refreshAllDomains`.
|
https://tools-dot-project-id.appspot.com, like
|
||||||
|
`/_dr/task/refreshDnsForAllDomains`.
|
||||||
|
|
||||||
## Task queues
|
## Task queues
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
<!-- Refreshes all active domains in DNS -->
|
<!-- Refreshes all active domains in DNS -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>tools-servlet</servlet-name>
|
<servlet-name>tools-servlet</servlet-name>
|
||||||
<url-pattern>/_dr/task/refreshAllDomains</url-pattern>
|
<url-pattern>/_dr/task/refreshDnsForAllDomains</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- Registrar detail report publishing action. -->
|
<!-- Registrar detail report publishing action. -->
|
||||||
|
|
|
@ -23,9 +23,7 @@ java_library(
|
||||||
"//java/google/registry/request",
|
"//java/google/registry/request",
|
||||||
"//java/google/registry/request:modules",
|
"//java/google/registry/request:modules",
|
||||||
"//java/google/registry/request/auth",
|
"//java/google/registry/request/auth",
|
||||||
"//java/google/registry/security",
|
|
||||||
"//java/google/registry/tools/server",
|
"//java/google/registry/tools/server",
|
||||||
"//java/google/registry/tools/server/javascrap",
|
|
||||||
"//java/google/registry/util",
|
"//java/google/registry/util",
|
||||||
"@com_google_appengine_api_1_0_sdk",
|
"@com_google_appengine_api_1_0_sdk",
|
||||||
"@com_google_code_findbugs_jsr305",
|
"@com_google_code_findbugs_jsr305",
|
||||||
|
|
|
@ -42,11 +42,11 @@ import google.registry.tools.server.ListPremiumListsAction;
|
||||||
import google.registry.tools.server.ListRegistrarsAction;
|
import google.registry.tools.server.ListRegistrarsAction;
|
||||||
import google.registry.tools.server.ListReservedListsAction;
|
import google.registry.tools.server.ListReservedListsAction;
|
||||||
import google.registry.tools.server.ListTldsAction;
|
import google.registry.tools.server.ListTldsAction;
|
||||||
|
import google.registry.tools.server.RefreshDnsForAllDomainsAction;
|
||||||
import google.registry.tools.server.ResaveAllEppResourcesAction;
|
import google.registry.tools.server.ResaveAllEppResourcesAction;
|
||||||
import google.registry.tools.server.ToolsServerModule;
|
import google.registry.tools.server.ToolsServerModule;
|
||||||
import google.registry.tools.server.UpdatePremiumListAction;
|
import google.registry.tools.server.UpdatePremiumListAction;
|
||||||
import google.registry.tools.server.VerifyOteAction;
|
import google.registry.tools.server.VerifyOteAction;
|
||||||
import google.registry.tools.server.javascrap.RefreshAllDomainsAction;
|
|
||||||
|
|
||||||
/** Dagger component with per-request lifetime for "tools" App Engine module. */
|
/** Dagger component with per-request lifetime for "tools" App Engine module. */
|
||||||
@RequestScope
|
@RequestScope
|
||||||
|
@ -78,7 +78,7 @@ interface ToolsRequestComponent {
|
||||||
ListTldsAction listTldsAction();
|
ListTldsAction listTldsAction();
|
||||||
LoadTestAction loadTestAction();
|
LoadTestAction loadTestAction();
|
||||||
PublishDetailReportAction publishDetailReportAction();
|
PublishDetailReportAction publishDetailReportAction();
|
||||||
RefreshAllDomainsAction refreshAllDomainsAction();
|
RefreshDnsForAllDomainsAction refreshDnsForAllDomainsAction();
|
||||||
ResaveAllEppResourcesAction resaveAllEppResourcesAction();
|
ResaveAllEppResourcesAction resaveAllEppResourcesAction();
|
||||||
RestoreCommitLogsAction restoreCommitLogsAction();
|
RestoreCommitLogsAction restoreCommitLogsAction();
|
||||||
UpdatePremiumListAction updatePremiumListAction();
|
UpdatePremiumListAction updatePremiumListAction();
|
||||||
|
|
|
@ -9,6 +9,7 @@ java_library(
|
||||||
srcs = glob(["*.java"]),
|
srcs = glob(["*.java"]),
|
||||||
deps = [
|
deps = [
|
||||||
"//java/google/registry/config",
|
"//java/google/registry/config",
|
||||||
|
"//java/google/registry/dns",
|
||||||
"//java/google/registry/export",
|
"//java/google/registry/export",
|
||||||
"//java/google/registry/flows",
|
"//java/google/registry/flows",
|
||||||
"//java/google/registry/gcs",
|
"//java/google/registry/gcs",
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package google.registry.tools.server.javascrap;
|
package google.registry.tools.server;
|
||||||
|
|
||||||
import static google.registry.mapreduce.inputs.EppResourceInputs.createEntityInput;
|
import static google.registry.mapreduce.inputs.EppResourceInputs.createEntityInput;
|
||||||
import static google.registry.util.PipelineUtils.createJobPath;
|
import static google.registry.util.PipelineUtils.createJobPath;
|
||||||
|
@ -33,14 +33,18 @@ import org.joda.time.DateTime;
|
||||||
import org.joda.time.DateTimeZone;
|
import org.joda.time.DateTimeZone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapreduce that enqueues publish tasks on all active domains.
|
* A mapreduce that enqueues DNS publish tasks on all active domains.
|
||||||
|
*
|
||||||
|
* <p>This refreshes DNS both for all domain names and all in-bailiwick hostnames, as DNS writers
|
||||||
|
* are responsible for enqueuing refresh tasks for subordinate hosts. So this action thus refreshes
|
||||||
|
* DNS for everything applicable under all TLDs under management.
|
||||||
*
|
*
|
||||||
* <p>Because there are no auth settings in the {@link Action} annotation, this command can only be
|
* <p>Because there are no auth settings in the {@link Action} annotation, this command can only be
|
||||||
* run internally, or by pretending to be internal by setting the X-AppEngine-QueueName header,
|
* run internally, or by pretending to be internal by setting the X-AppEngine-QueueName header,
|
||||||
* which only admin users can do.
|
* which only admin users can do.
|
||||||
*/
|
*/
|
||||||
@Action(
|
@Action(
|
||||||
path = "/_dr/task/refreshAllDomains",
|
path = "/_dr/task/refreshDnsForAllDomains",
|
||||||
auth =
|
auth =
|
||||||
@Auth(
|
@Auth(
|
||||||
methods = {Auth.AuthMethod.INTERNAL, Auth.AuthMethod.API},
|
methods = {Auth.AuthMethod.INTERNAL, Auth.AuthMethod.API},
|
||||||
|
@ -48,13 +52,13 @@ import org.joda.time.DateTimeZone;
|
||||||
userPolicy = Auth.UserPolicy.ADMIN
|
userPolicy = Auth.UserPolicy.ADMIN
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
public class RefreshAllDomainsAction implements Runnable {
|
public class RefreshDnsForAllDomainsAction implements Runnable {
|
||||||
|
|
||||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||||
|
|
||||||
@Inject MapreduceRunner mrRunner;
|
@Inject MapreduceRunner mrRunner;
|
||||||
@Inject Response response;
|
@Inject Response response;
|
||||||
@Inject RefreshAllDomainsAction() {}
|
@Inject RefreshDnsForAllDomainsAction() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -65,12 +69,13 @@ public class RefreshAllDomainsAction implements Runnable {
|
||||||
.setModuleName("tools")
|
.setModuleName("tools")
|
||||||
.setDefaultMapShards(10)
|
.setDefaultMapShards(10)
|
||||||
.runMapOnly(
|
.runMapOnly(
|
||||||
new RefreshAllDomainsActionMapper(),
|
new RefreshDnsForAllDomainsActionMapper(),
|
||||||
ImmutableList.of(createEntityInput(DomainResource.class)))));
|
ImmutableList.of(createEntityInput(DomainResource.class)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Mapper to refresh all active domain resources. */
|
/** Mapper to refresh DNS for all active domain resources. */
|
||||||
public static class RefreshAllDomainsActionMapper extends Mapper<DomainResource, Void, Void> {
|
public static class RefreshDnsForAllDomainsActionMapper
|
||||||
|
extends Mapper<DomainResource, Void, Void> {
|
||||||
|
|
||||||
private static final DnsQueue dnsQueue = DnsQueue.create();
|
private static final DnsQueue dnsQueue = DnsQueue.create();
|
||||||
private static final long serialVersionUID = 1356876487351666133L;
|
private static final long serialVersionUID = 1356876487351666133L;
|
|
@ -1,26 +0,0 @@
|
||||||
package(
|
|
||||||
default_visibility = ["//java/google/registry:registry_project"],
|
|
||||||
)
|
|
||||||
|
|
||||||
licenses(["notice"]) # Apache 2.0
|
|
||||||
|
|
||||||
java_library(
|
|
||||||
name = "javascrap",
|
|
||||||
srcs = glob(["*.java"]),
|
|
||||||
deps = [
|
|
||||||
"//java/google/registry/dns",
|
|
||||||
"//java/google/registry/mapreduce",
|
|
||||||
"//java/google/registry/mapreduce/inputs",
|
|
||||||
"//java/google/registry/model",
|
|
||||||
"//java/google/registry/request",
|
|
||||||
"//java/google/registry/request/auth",
|
|
||||||
"//java/google/registry/util",
|
|
||||||
"//third_party/java/objectify:objectify-v4_1",
|
|
||||||
"@com_google_appengine_api_1_0_sdk",
|
|
||||||
"@com_google_appengine_tools_appengine_mapreduce",
|
|
||||||
"@com_google_code_findbugs_jsr305",
|
|
||||||
"@com_google_dagger",
|
|
||||||
"@com_google_guava",
|
|
||||||
"@joda_time",
|
|
||||||
],
|
|
||||||
)
|
|
|
@ -1,21 +1,21 @@
|
||||||
PATH CLASS METHODS OK AUTH_METHODS MIN USER_POLICY
|
PATH CLASS METHODS OK AUTH_METHODS MIN USER_POLICY
|
||||||
/_dr/admin/createGroups CreateGroupsAction POST n INTERNAL,API APP ADMIN
|
/_dr/admin/createGroups CreateGroupsAction POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/createPremiumList CreatePremiumListAction POST n INTERNAL,API APP ADMIN
|
/_dr/admin/createPremiumList CreatePremiumListAction POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/deleteEntity DeleteEntityAction GET n INTERNAL,API APP ADMIN
|
/_dr/admin/deleteEntity DeleteEntityAction GET n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/list/domains ListDomainsAction GET,POST n INTERNAL,API APP ADMIN
|
/_dr/admin/list/domains ListDomainsAction GET,POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/list/hosts ListHostsAction GET,POST n INTERNAL,API APP ADMIN
|
/_dr/admin/list/hosts ListHostsAction GET,POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/list/premiumLists ListPremiumListsAction GET,POST n INTERNAL,API APP ADMIN
|
/_dr/admin/list/premiumLists ListPremiumListsAction GET,POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/list/registrars ListRegistrarsAction GET,POST n INTERNAL,API APP ADMIN
|
/_dr/admin/list/registrars ListRegistrarsAction GET,POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/list/reservedLists ListReservedListsAction GET,POST n INTERNAL,API APP ADMIN
|
/_dr/admin/list/reservedLists ListReservedListsAction GET,POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/list/tlds ListTldsAction GET,POST n INTERNAL,API APP ADMIN
|
/_dr/admin/list/tlds ListTldsAction GET,POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/updatePremiumList UpdatePremiumListAction POST n INTERNAL,API APP ADMIN
|
/_dr/admin/updatePremiumList UpdatePremiumListAction POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/admin/verifyOte VerifyOteAction POST n INTERNAL,API APP ADMIN
|
/_dr/admin/verifyOte VerifyOteAction POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/epptool EppToolAction POST n INTERNAL,API APP ADMIN
|
/_dr/epptool EppToolAction POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/loadtest LoadTestAction POST y INTERNAL,API APP ADMIN
|
/_dr/loadtest LoadTestAction POST y INTERNAL,API APP ADMIN
|
||||||
/_dr/publishDetailReport PublishDetailReportAction POST n INTERNAL,API APP ADMIN
|
/_dr/publishDetailReport PublishDetailReportAction POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/task/generateZoneFiles GenerateZoneFilesAction POST n INTERNAL,API APP ADMIN
|
/_dr/task/generateZoneFiles GenerateZoneFilesAction POST n INTERNAL,API APP ADMIN
|
||||||
/_dr/task/killAllCommitLogs KillAllCommitLogsAction POST n INTERNAL APP IGNORED
|
/_dr/task/killAllCommitLogs KillAllCommitLogsAction POST n INTERNAL APP IGNORED
|
||||||
/_dr/task/killAllEppResources KillAllEppResourcesAction POST n INTERNAL APP IGNORED
|
/_dr/task/killAllEppResources KillAllEppResourcesAction POST n INTERNAL APP IGNORED
|
||||||
/_dr/task/refreshAllDomains RefreshAllDomainsAction GET n INTERNAL,API APP ADMIN
|
/_dr/task/refreshDnsForAllDomains RefreshDnsForAllDomainsAction GET n INTERNAL,API APP ADMIN
|
||||||
/_dr/task/resaveAllEppResources ResaveAllEppResourcesAction GET n INTERNAL,API APP ADMIN
|
/_dr/task/resaveAllEppResources ResaveAllEppResourcesAction GET n INTERNAL,API APP ADMIN
|
||||||
/_dr/task/restoreCommitLogs RestoreCommitLogsAction POST y INTERNAL,API APP ADMIN
|
/_dr/task/restoreCommitLogs RestoreCommitLogsAction POST y INTERNAL,API APP ADMIN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue