Update activity reports to comply with agreement changes

This removes the ramp-up and pre-ramp-up registrar fields, and lists 'CZDS' as
the zfa-passwords field, in accordance to the registry agreement changes listed
on the associated bug.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170337426
This commit is contained in:
larryruili 2017-09-28 06:52:30 -07:00 committed by Ben McIlwain
parent c69b409b30
commit d4ab6fe90b
6 changed files with 19 additions and 32 deletions

View file

@ -76,8 +76,8 @@ public final class ActivityReportingQueryBuilder implements QueryBuilder {
String operationalRegistrarsQuery =
SqlTemplate.create(getQueryFromFile("registrar_operating_status.sql"))
.put("PROJECT_ID", projectId)
.put("REGISTRAR_DATA_SET", "registrar_data")
.put("REGISTRAR_STATUS_TABLE", "registrar_status")
.put("DATASTORE_EXPORT_DATA_SET", DATASTORE_EXPORT_DATA_SET)
.put("REGISTRAR_TABLE", "Registrar")
.build();
queriesBuilder.put(getTableName(REGISTRAR_OPERATING_STATUS), operationalRegistrarsQuery);

View file

@ -47,7 +47,6 @@ public final class IcannReportingModule {
static final String ICANN_REPORTING_DATA_SET = "icann_reporting";
static final String DATASTORE_EXPORT_DATA_SET = "latest_datastore_export";
private static final String BIGQUERY_SCOPE = "https://www.googleapis.com/auth/bigquery";
private static final String DRIVE_SCOPE = "https://www.googleapis.com/auth/drive.readonly";
@Provides
@Parameter(PARAM_YEAR_MONTH)
@ -90,7 +89,7 @@ public final class IcannReportingModule {
.getApplicationDefault(transport, new JacksonFactory());
BigqueryConnection connection = new BigqueryConnection.Builder()
.setExecutorService(Executors.newFixedThreadPool(20))
.setCredential(credential.createScoped(ImmutableList.of(BIGQUERY_SCOPE, DRIVE_SCOPE)))
.setCredential(credential.createScoped(ImmutableList.of(BIGQUERY_SCOPE)))
.setDatasetId(ICANN_REPORTING_DATA_SET)
.setOverwrite(true)
.setPollInterval(Duration.standardSeconds(1))

View file

@ -21,8 +21,8 @@ SELECT
SUM(IF(metricName = 'operational-registrars', count, 0)) AS operational_registrars,
SUM(IF(metricName = 'ramp-up-registrars', count, 0)) AS ramp_up_registrars,
SUM(IF(metricName = 'pre-ramp-up-registrars', count, 0)) AS pre_ramp_up_registrars,
-- We don't support ZFA over SFTP, only AXFR.
0 AS zfa_passwords,
-- We use the Centralized Zone Data Service.
"CZDS" AS zfa_passwords,
SUM(IF(metricName = 'whois-43-queries', count, 0)) AS whois_43_queries,
SUM(IF(metricName = 'web-whois-queries', count, 0)) AS web_whois_queries,
-- We don't support searchable WHOIS.

View file

@ -13,21 +13,15 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Query for all registrar statuses:
-- production, ramping up (OTE), or pre-ramp-up (requested).
-- Query that counts the number of real registrars in system.
SELECT
-- Applies to all TLDs, hence the 'null' magic value.
STRING(NULL) AS tld,
CASE WHEN access_type = 'PROD' AND registrar_name IS NOT NULL
THEN 'operational-registrars'
WHEN access_type = 'OTE' AND registrar_name IS NOT NULL
THEN 'ramp-up-registrars'
WHEN access_type IS NULL AND registrar_name IS NOT NULL
THEN 'pre-ramp-up-registrars'
-- The import process is imprecise; filter out invalid rows.
ELSE 'not-applicable' END AS metricName,
COUNT(registrar_id) AS count
'operational-registrars' AS metricName,
COUNT(registrarName) AS count
FROM
`%PROJECT_ID%.%REGISTRAR_DATA_SET%.%REGISTRAR_STATUS_TABLE%`
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRAR_TABLE%`
WHERE
type = 'REAL'
GROUP BY metricName

View file

@ -21,8 +21,8 @@ SELECT
SUM(IF(metricName = 'operational-registrars', count, 0)) AS operational_registrars,
SUM(IF(metricName = 'ramp-up-registrars', count, 0)) AS ramp_up_registrars,
SUM(IF(metricName = 'pre-ramp-up-registrars', count, 0)) AS pre_ramp_up_registrars,
-- We don't support ZFA over SFTP, only AXFR.
0 AS zfa_passwords,
-- We use the Centralized Zone Data Service.
"CZDS" AS zfa_passwords,
SUM(IF(metricName = 'whois-43-queries', count, 0)) AS whois_43_queries,
SUM(IF(metricName = 'web-whois-queries', count, 0)) AS web_whois_queries,
-- We don't support searchable WHOIS.

View file

@ -13,21 +13,15 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Query for all registrar statuses:
-- production, ramping up (OTE), or pre-ramp-up (requested).
-- Query that counts the number of real registrars in system.
SELECT
-- Applies to all TLDs, hence the 'null' magic value.
STRING(NULL) AS tld,
CASE WHEN access_type = 'PROD' AND registrar_name IS NOT NULL
THEN 'operational-registrars'
WHEN access_type = 'OTE' AND registrar_name IS NOT NULL
THEN 'ramp-up-registrars'
WHEN access_type IS NULL AND registrar_name IS NOT NULL
THEN 'pre-ramp-up-registrars'
-- The import process is imprecise; filter out invalid rows.
ELSE 'not-applicable' END AS metricName,
COUNT(registrar_id) AS count
'operational-registrars' AS metricName,
COUNT(registrarName) AS count
FROM
`domain-registry-alpha.registrar_data.registrar_status`
`domain-registry-alpha.latest_datastore_export.Registrar`
WHERE
type = 'REAL'
GROUP BY metricName