
coco/internal-content-apiInternal Content API用于提供已发布内容,包含内部组件和富内容字段的聚合结果,通过整合富内容源与内部组件源的信息,为客户端提供完整的内部内容访问服务。
unrollContent参数,支持动态内容、图片等资源的展开功能适用于需要访问包含内部组件的已发布内容的服务场景,如内容管理系统、内部内容预览平台、内容分析工具等,尤其适合需要整合富内容与内部组件数据的业务系统。
bash# 假设镜像名称为internal-content-api,具体请替换为实际镜像仓库地址 docker pull internal-content-api:latest
bashdocker run -d \ -p 8084:8084 \ --name internal-content-api \ internal-content-api:latest \ --app-port "8084" \ --handler-path "internalcontent" \ --content-source-uri "[***]" \ --internal-components-source-uri "[***]" \ --content-source-app-name "Content Source Service" \ --internal-components-source-app-name "Internal Components Source Service" \ --content-source-app-health-uri "[***]" \ --internal-components-source-app-health-uri "[***]" \ --content-unroller-app-name "Content Unroller" \ --content-unroller-uri "[***]" \ --content-unroller-app-health-uri "[***]"
| 参数名 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|
| --app-port | 服务监听端口 | 是 | - |
| --handler-path | API处理路径前缀,用于构建内容访问端点 | 否 | "internalcontent" |
| --content-source-uri | 富内容源服务的内容访问URI | 是 | - |
| --internal-components-source-uri | 内部组件源服务的内容访问URI | 是 | - |
| --content-source-app-name | 富内容源服务名称(用于日志和监控) | 否 | - |
| --internal-components-source-app-name | 内部组件源服务名称(用于日志和监控) | 否 | - |
| --content-source-app-health-uri | 富内容源服务的健康检查URI | 否 | - |
| --internal-components-source-app-health-uri | 内部组件源服务的健康检查URI | 否 | - |
| --content-unroller-app-name | 内容展开器服务名称(用于日志和监控) | 否 | - |
| --content-unroller-uri | 内容展开器服务的访问URI | 否 | - |
| --content-unroller-app-health-uri | 内容展开器服务的健康检查URI | 否 | - |
bash# 获取源码 go get -u github.com/Financial-Times/internal-content-api cd $GOPATH/src/github.com/Financial-Times/internal-content-api # 安装依赖 dep ensure # 运行测试并构建 go test -race ./... go build .
bash# 安装二进制 go install # 启动服务(参数为示例,需根据实际环境调整) $GOPATH/bin/internal-content-api \ --app-port "8084" \ --handler-path "internalcontent" \ --content-source-uri "http://localhost:8080/__enriched-content-read-api/enrichedcontent" \ --internal-components-source-uri "http://localhost:8080/__content-public-read/internalcontent" \ --content-source-app-health-uri "http://localhost:8080/__enriched-content-read-api/__health" \ --internal-components-source-app-health-uri "http://localhost:8080/__content-public-read/__health" \ --content-unroller-uri "http://localhost:8080/__content-unroller-api/internalcontent" \ --content-unroller-app-health-uri "http://localhost:8080/__content-unroller-api/__health"
获取指定UUID的内部内容(富内容与内部组件的聚合结果)。
bashcurl -v http://localhost:8084/internalcontent/9358ba1e-c07f-11e5-846f-79b0e3d20eaf
unrollContent={boolean}:是否展开动态内容、主图、正文图片、导语图片和备选图片,默认falsetrue时,将通过内容展开器服务获取并展开相关资源内容;设为false时,仅返回资源ID。200:成功返回内容404:指定UUID的内容不存在503:依赖的服务(如富内容源、内部组件源)不可用| 端点 | 描述 |
|---|---|
| GET /__health | 服务健康检查,基于依赖服务(富内容源、内部组件源等)的健康状态 |
| GET /__gtg | 服务就绪检查,指示服务是否可处理请求 |
| GET /__build-info | 返回服务构建信息 |
| GET /__metrics | 返回服务性能指标 |
当handler-path配置为非默认值(如internalcontent-preview)时,内容访问端点将自动调整为/{handler-path}/{uuid},例如:
http://localhost:8084/internalcontent-preview/9358ba1e-c07f-11e5-846f-79b0e3d20eaf

manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务