diff --git a/scripts/aws/deploy_studio.py b/scripts/aws/deploy_studio.py deleted file mode 100755 index 2ea27c3..0000000 --- a/scripts/aws/deploy_studio.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/python - -"""Various functions for day-to-day management of AWS API Gateway instances.""" - -import argparse -import logging -from scripts.aws.common.deploy import deploy - -if __name__ == '__main__': - - logging.basicConfig(level=logging.INFO, format='[%(asctime)s] %(levelname)s %(message)s') - - parser = argparse.ArgumentParser() - - parser.add_argument("--aws-region", required=False, default="us-east-1") - parser.add_argument("--api-base-domain", required=True, - help="The name of the API Gateway domain to be deployed to.") - parser.add_argument("--swagger-filename", required=True, - help="The name of a complete Swagger 2.0 specification file with AWS vendor hooks.") - parser.add_argument("--tag", required=True, - help="Unique identifier for this deployment (such as a git hash)") - parser.add_argument("--rotation-order", required=True, nargs='+', - help="Ordered list of stages in the deployment ring (ex: 'red black')") - parser.add_argument("--log-level", required=False, default="OFF", choices=['OFF', 'ERROR', 'INFO'], - help="Verbosity of messages sent to CloudWatch Logs") - parser.add_argument("--metrics", required=False, default="false", choices=['false', 'true'], - help="Enable CloudWatch metrics") - parser.add_argument("--caching", required=False, default="false", choices=['false', 'true'], - help="Enable API Gateway caching feature") - parser.add_argument("--rate-limit", required=False, default="500", type=str, - help="Default per-resource average rate limit") - parser.add_argument("--burst-limit", required=False, default="1000", type=str, - help="Default per-resource maximum rate limit") - parser.add_argument("--landing-page", required=True, - help="Location of landing page for 'root' level requests") - parser.add_argument("--edxapp-host", required=True, - help="Location of edxapp for request routing") - parser.add_argument('--studio-host', required=True, - help="Location of Studio IDA for request routing") - - args = parser.parse_args() - cli_args = parser.parse_args() - integration_settings = { - 'id': cli_args.tag, - 'landing_page': cli_args.landing_page, - 'edxapp_host': cli_args.edxapp_host, - 'studio_host': cli_args.studio_host, - } - stage_settings = { - 'log_level': cli_args.log_level, - 'metrics': cli_args.metrics, - 'caching': cli_args.caching, - 'rate_limit': cli_args.rate_limit, - 'burst_limit': cli_args.burst_limit - } - deploy(cli_args, integration_settings, stage_settings) diff --git a/swagger/api.yaml b/swagger/api.yaml index bdffd99..9147102 100644 --- a/swagger/api.yaml +++ b/swagger/api.yaml @@ -138,6 +138,68 @@ paths: requestParameters: integration.request.path.proxy: "method.request.path.proxy" + # Authoring Domain API (e.g. content ingestion via CMS) + "/authoring/v0/file_assets/{proxy+}": + x-amazon-apigateway-any-method: + parameters: + - name: "proxy" + in: "path" + x-amazon-apigateway-integration: + type: "http_proxy" + uri: "https://${stageVariables.cms_host}/api/contentstore/v1/file_assets/{proxy}" + httpMethod: "ANY" + requestParameters: + integration.request.path.proxy: "method.request.path.proxy" + + "/authoring/v0/videos/uploads/{proxy+}": + x-amazon-apigateway-any-method: + parameters: + - name: "proxy" + in: "path" + x-amazon-apigateway-integration: + type: "http_proxy" + uri: "https://${stageVariables.cms_host}/api/contentstore/v0/videos/uploads/{proxy}" + httpMethod: "ANY" + requestParameters: + integration.request.path.proxy: "method.request.path.proxy" + + "/authoring/v0/videos/images/{proxy+}": + x-amazon-apigateway-any-method: + parameters: + - name: "proxy" + in: "path" + x-amazon-apigateway-integration: + type: "http_proxy" + uri: "https://${stageVariables.cms_host}/api/contentstore/v0/videos/images/{proxy}" + httpMethod: "ANY" + requestParameters: + integration.request.path.proxy: "method.request.path.proxy" + + "/authoring/v0/video_transcripts/{proxy+}": + x-amazon-apigateway-any-method: + parameters: + - name: "proxy" + in: "path" + x-amazon-apigateway-integration: + type: "http_proxy" + uri: "https://${stageVariables.cms_host}/api/contentstore/v0/video_transcripts/{proxy}" + httpMethod: "ANY" + requestParameters: + integration.request.path.proxy: "method.request.path.proxy" + + "/authoring/v0/xblock/{proxy+}": + x-amazon-apigateway-any-method: + parameters: + - name: "proxy" + in: "path" + x-amazon-apigateway-integration: + type: "http_proxy" + uri: "https://${stageVariables.cms_host}/api/contentstore/v0/xblock/{proxy}" + httpMethod: "ANY" + requestParameters: + integration.request.path.proxy: "method.request.path.proxy" + + # edX extension point. Lists the vendors in use and their specific # parameters that are expected by upstream refs. @@ -155,4 +217,4 @@ x-edx-api-vendors: - "analytics_api_host" - "registrar_host" - "enterprise_catalog_host" - - "studio_host" + - "cms_host" diff --git a/swagger/studio.yaml b/swagger/studio.yaml deleted file mode 100644 index fe55860..0000000 --- a/swagger/studio.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Swagger specification for the Studio content API - ---- -swagger: "2.0" -info: - version: "1.0.0" - title: "Studio content" -host: "your-open-edx-site.org" -basePath: "/contentstore/v1" -schemes: -- "https" - -# Complete set of whitelisted routes for use with Studio content API -paths: - - # Index - "/": - $ref: "./index.yaml#/endpoints/index" - - # Heartbeat - "/heartbeat": - $ref: "./heartbeat.yaml#/endpoints/heartbeat" - - # OAuth2 - "/oauth2/v1/access_token": - $ref: "./oauth.yaml#/endpoints/request_access_token" - - # Studio content API - "/file_assets/{proxy+}": - x-amazon-apigateway-any-method: - parameters: - - name: "proxy" - in: "path" - x-amazon-apigateway-integration: - type: "http_proxy" - uri: "https://${stageVariables.studio_host}/api/contentstore/v1/file_assets/{proxy}" - httpMethod: "ANY" - requestParameters: - integration.request.path.proxy: "method.request.path.proxy" - - "/videos/uploads/{proxy+}": - x-amazon-apigateway-any-method: - parameters: - - name: "proxy" - in: "path" - x-amazon-apigateway-integration: - type: "http_proxy" - uri: "https://${stageVariables.studio_host}/api/contentstore/v1/videos/uploads/{proxy}" - httpMethod: "ANY" - requestParameters: - integration.request.path.proxy: "method.request.path.proxy" - - "/videos/images/{proxy+}": - x-amazon-apigateway-any-method: - parameters: - - name: "proxy" - in: "path" - x-amazon-apigateway-integration: - type: "http_proxy" - uri: "https://${stageVariables.studio_host}/api/contentstore/v1/videos/images/{proxy}" - httpMethod: "ANY" - requestParameters: - integration.request.path.proxy: "method.request.path.proxy" - - "/video_transcripts/{proxy+}": - x-amazon-apigateway-any-method: - parameters: - - name: "proxy" - in: "path" - x-amazon-apigateway-integration: - type: "http_proxy" - uri: "https://${stageVariables.studio_host}/api/contentstore/v1/video_transcripts/{proxy}" - httpMethod: "ANY" - requestParameters: - integration.request.path.proxy: "method.request.path.proxy" - - "/xblock/{proxy+}": - x-amazon-apigateway-any-method: - parameters: - - name: "proxy" - in: "path" - x-amazon-apigateway-integration: - type: "http_proxy" - uri: "https://${stageVariables.studio_host}/api/contentstore/v1/xblock/{proxy}" - httpMethod: "ANY" - requestParameters: - integration.request.path.proxy: "method.request.path.proxy" -