Internal 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
来自真实用户的反馈,见证轩辕镜像的优质服务
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像加速服务
在 Docker Desktop 配置镜像加速
Docker Compose 项目配置加速
Kubernetes 集群配置 Containerd
在宝塔面板一键配置镜像加速
Synology 群晖 NAS 配置加速
飞牛 fnOS 系统配置镜像加速
极空间 NAS 系统配置加速服务
爱快 iKuai 路由系统配置加速
绿联 NAS 系统配置镜像加速
QNAP 威联通 NAS 配置加速
Podman 容器引擎配置加速
HPC 科学计算容器配置加速
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名加速
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429