Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TNL-10746 CMS API on omnibus plan #241

Merged
merged 7 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/aws/deploy_studio.py
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[inform] You may have mentioned elsewhere the difficulty of renaming this file, but just noting that it is named deploy_studio.py, and was not renamed, even though the arg was renamed. This is non-blocking, but just noted in case you want to make this more consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. deploy_studio.py was necessary with the subdomain-based approach, but is superfluous with the omnibus approach. I'm deleting this file: the former deploy.py file will do just fine.

Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
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")
parser.add_argument('--cms-host', required=True,
bszabo marked this conversation as resolved.
Show resolved Hide resolved
help="Location of CMS 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,
'cms_host': cli_args.cms_host,
}
stage_settings = {
'log_level': cli_args.log_level,
Expand Down
13 changes: 12 additions & 1 deletion swagger/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ paths:
requestParameters:
integration.request.path.proxy: "method.request.path.proxy"

# CMS API (Studio ingestion)
robrap marked this conversation as resolved.
Show resolved Hide resolved
"/cms/v1/file_assets/{proxy+}":
$ref: "./cms.yaml#/endpoints/file_assets/{proxy+}"
"/cms/v1/videos/uploads/{proxy+}":
$ref: "./cms.yaml#/endpoints/videos/uploads/{proxy+}"
"/cms/v1/videos/images/{proxy+}":
$ref: "./cms.yaml#/endpoints/videos/images/{proxy+}"
"/cms/v1/video_transcripts/{proxy+}":
$ref: "./cms.yaml#/endpoints/video_transcripts/{proxy+}"
"/cms/v1/xblock/{proxy+}":
$ref: "./cms.yaml#/endpoints/xblock/{proxy+}"

# edX extension point. Lists the vendors in use and their specific
# parameters that are expected by upstream refs.
Expand All @@ -155,4 +166,4 @@ x-edx-api-vendors:
- "analytics_api_host"
- "registrar_host"
- "enterprise_catalog_host"
- "studio_host"
- "cms_host"
42 changes: 10 additions & 32 deletions swagger/studio.yaml → swagger/cms.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,17 @@
# 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
# This is a Swagger (swagger.org) specification fragment. It is
# designed to be included into a top-level Swagger 'index', not
# as a standalone document.
endpoints:
# CMS API (content ingestion)
"/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}"
uri: "https://${stageVariables.cms_host}/api/contentstore/v1/file_assets/{proxy}"
httpMethod: "ANY"
requestParameters:
integration.request.path.proxy: "method.request.path.proxy"
Expand All @@ -45,7 +23,7 @@ paths:
in: "path"
x-amazon-apigateway-integration:
type: "http_proxy"
uri: "https://${stageVariables.studio_host}/api/contentstore/v1/videos/uploads/{proxy}"
uri: "https://${stageVariables.cms_host}/api/contentstore/v1/videos/uploads/{proxy}"
httpMethod: "ANY"
requestParameters:
integration.request.path.proxy: "method.request.path.proxy"
Expand All @@ -57,7 +35,7 @@ paths:
in: "path"
x-amazon-apigateway-integration:
type: "http_proxy"
uri: "https://${stageVariables.studio_host}/api/contentstore/v1/videos/images/{proxy}"
uri: "https://${stageVariables.cms_host}/api/contentstore/v1/videos/images/{proxy}"
httpMethod: "ANY"
requestParameters:
integration.request.path.proxy: "method.request.path.proxy"
Expand All @@ -69,7 +47,7 @@ paths:
in: "path"
x-amazon-apigateway-integration:
type: "http_proxy"
uri: "https://${stageVariables.studio_host}/api/contentstore/v1/video_transcripts/{proxy}"
uri: "https://${stageVariables.cms_host}/api/contentstore/v1/video_transcripts/{proxy}"
httpMethod: "ANY"
requestParameters:
integration.request.path.proxy: "method.request.path.proxy"
Expand All @@ -81,7 +59,7 @@ paths:
in: "path"
x-amazon-apigateway-integration:
type: "http_proxy"
uri: "https://${stageVariables.studio_host}/api/contentstore/v1/xblock/{proxy}"
uri: "https://${stageVariables.cms_host}/api/contentstore/v1/xblock/{proxy}"
httpMethod: "ANY"
requestParameters:
integration.request.path.proxy: "method.request.path.proxy"
Expand Down
Loading