Alexandros Kosiaris has submitted this change and it was merged. Change subject: RESTBase: Set up the AQS public API ......................................................................
RESTBase: Set up the AQS public API This patch exposes the Analytics Query Service public API endpoints for the global domain. Bug: T114830 Change-Id: I17ae36660ebb374e7062cd1e4ad4634ffddf66a7 --- M hieradata/labs/deployment-prep/common.yaml M hieradata/role/common/restbase.yaml M modules/restbase/manifests/init.pp M modules/restbase/templates/config.labs.yaml.erb M modules/restbase/templates/config.yaml.erb 5 files changed, 53 insertions(+), 0 deletions(-) Approvals: Alexandros Kosiaris: Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/labs/deployment-prep/common.yaml b/hieradata/labs/deployment-prep/common.yaml index 9d63af7..32c1083 100644 --- a/hieradata/labs/deployment-prep/common.yaml +++ b/hieradata/labs/deployment-prep/common.yaml @@ -73,6 +73,7 @@ restbase::graphoid_uri: http://deployment-sca01.deployment-prep.eqiad.wmflabs:19000 restbase::mobileapps_uri: http://appservice.wmflabs.org restbase::mathoid_uri: http://mathoid-tester.wmflabs.org +restbase::aqs_uri: https://wikimedia.org/api/rest_v1/metrics "mediawiki::log_aggregator": deployment-fluorine.eqiad.wmflabs:8420 "mediawiki::forward_syslog": deployment-logstash2.deployment-prep.eqiad.wmflabs:10514 mediawiki_memcached_servers: diff --git a/hieradata/role/common/restbase.yaml b/hieradata/role/common/restbase.yaml index 3d0cde3..1fb5478 100644 --- a/hieradata/role/common/restbase.yaml +++ b/hieradata/role/common/restbase.yaml @@ -14,6 +14,7 @@ restbase::graphoid_uri: http://graphoid.svc.eqiad.wmnet:19000 restbase::mobileapps_uri: http://mobileapps.svc.eqiad.wmnet:8888 restbase::mathoid_uri: http://mathoid.svc.eqiad.wmnet:10042 +restbase::aqs_uri: http://aqs.svc.eqiad.wmnet:7232/analytics.wikimedia.org/v1 restbase::cassandra_user: restbase restbase::cassandra_password: "%{passwords::cassandra::restbase}" restbase::monitoring::monitor_domain: en.wikipedia.org diff --git a/modules/restbase/manifests/init.pp b/modules/restbase/manifests/init.pp index 3c6b85d..2c4fe07 100644 --- a/modules/restbase/manifests/init.pp +++ b/modules/restbase/manifests/init.pp @@ -42,6 +42,9 @@ # MobileApps service URI. Default: http://mobileapps.svc.eqiad.wmnet:8888 # [*mathoid_uri*] # Mathoid service URI. Default: http://mathoid.svc.eqiad.wmnet:10042 +# [*aqs_uri*] +# Analytics Query Service URI. Default: +# http://aqs.svc.eqiad.wmnet:7232/analytics.wikimedia.org/v1 # class restbase( $cassandra_user = 'cassandra', @@ -63,6 +66,8 @@ $graphoid_uri = 'http://graphoid.svc.eqiad.wmnet:19000', $mobileapps_uri = 'http://mobileapps.svc.eqiad.wmnet:8888', $mathoid_uri = 'http://mathoid.svc.eqiad.wmnet:10042', + $aqs_uri = + 'http://aqs.svc.eqiad.wmnet:7232/analytics.wikimedia.org/v1', ) { if $::realm == 'labs' { include restbase::deploy diff --git a/modules/restbase/templates/config.labs.yaml.erb b/modules/restbase/templates/config.labs.yaml.erb index 47dde31..4674dfa 100644 --- a/modules/restbase/templates/config.labs.yaml.erb +++ b/modules/restbase/templates/config.labs.yaml.erb @@ -62,6 +62,7 @@ - <%= @graphoid_uri %> - <%= @mobileapps_uri %> - <%= @mathoid_uri %> + - <%= @aqs_uri %> header_match: description: Checks client ip against one of the predefined whitelists x-error-message: This client is not allowed to use the endpoint @@ -201,6 +202,10 @@ securityDefinitions: *wp/content-security/1.0.0 x-subspecs: - media/v1/mathoid + paths: + /metrics: + x-subspecs: + - analytics/v1/pageviews global-sys: &gb/sys/1.0.0 @@ -293,6 +298,24 @@ headers: '{$$.merge($.mathoid.body[$.request.params.format].headers,$$.merge($.mathoid.headers, {"x-resource-location": $.request.headers.x-resource-location}))}' body: '{$.mathoid.body[$.request.params.format].body}' + /{module:pageviews}/per-article/{+rest}: + get: + x-request-handler: + - get_from_backend: + request: + uri: <%= @aqs_uri %>/pageviews/per-article/{+rest} + /{module:pageviews}/per-project/{+rest}: + get: + x-request-handler: + - get_from_backend: + request: + uri: <%= @aqs_uri %>/pageviews/aggregate/{+rest} + /{module:pageviews}/top/{+rest}: + get: + x-request-handler: + - get_from_backend: + request: + uri: <%= @aqs_uri %>/pageviews/top/{+rest} wp-default-1.0.0: &wp/default/1.0.0 x-subspecs: diff --git a/modules/restbase/templates/config.yaml.erb b/modules/restbase/templates/config.yaml.erb index 84c3d24..fc40d75 100644 --- a/modules/restbase/templates/config.yaml.erb +++ b/modules/restbase/templates/config.yaml.erb @@ -62,6 +62,7 @@ - <%= @graphoid_uri %> - <%= @mobileapps_uri %> - <%= @mathoid_uri %> + - <%= @aqs_uri %> header_match: description: Checks client ip against one of the predefined whitelists x-error-message: This client is not allowed to use the endpoint @@ -218,6 +219,10 @@ securityDefinitions: *wp/content-security/1.0.0 x-subspecs: - media/v1/mathoid + paths: + /metrics: + x-subspecs: + - analytics/v1/pageviews global-sys: &gb/sys/1.0.0 @@ -310,6 +315,24 @@ headers: '{$$.merge($.mathoid.body[$.request.params.format].headers,$$.merge($.mathoid.headers, {"x-resource-location": $.request.headers.x-resource-location}))}' body: '{$.mathoid.body[$.request.params.format].body}' + /{module:pageviews}/per-article/{+rest}: + get: + x-request-handler: + - get_from_backend: + request: + uri: <%= @aqs_uri %>/pageviews/per-article/{+rest} + /{module:pageviews}/per-project/{+rest}: + get: + x-request-handler: + - get_from_backend: + request: + uri: <%= @aqs_uri %>/pageviews/aggregate/{+rest} + /{module:pageviews}/top/{+rest}: + get: + x-request-handler: + - get_from_backend: + request: + uri: <%= @aqs_uri %>/pageviews/top/{+rest} wp-default-1.0.0: &wp/default/1.0.0 x-subspecs: -- To view, visit https://gerrit.wikimedia.org/r/247935 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I17ae36660ebb374e7062cd1e4ad4634ffddf66a7 Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mobrovac <[email protected]> Gerrit-Reviewer: Alexandros Kosiaris <[email protected]> Gerrit-Reviewer: Eevans <[email protected]> Gerrit-Reviewer: Filippo Giunchedi <[email protected]> Gerrit-Reviewer: GWicke <[email protected]> Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]> Gerrit-Reviewer: Milimetric <[email protected]> Gerrit-Reviewer: Mobrovac <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
