本站支持搜索的镜像仓库:Docker Hub、gcr.io、ghcr.io、quay.io、k8s.gcr.io、registry.gcr.io、elastic.co、mcr.microsoft.com

Draft Annotations API是一个微服务,提供对存储在PAC中的内容草稿注释的访问。
下载源代码、依赖项和测试依赖项:
mkdir $GOPATH/src/github.com/Financial-Times/draft-annotations-api cd $GOPATH/src/github.com/Financial-Times git clone [***] cd draft-annotations-api GO111MODULE=on go build -mod=readonly
GO111MODULE=on go test -mod=readonly ./... go install
help标志查看可用的可选参数)$GOPATH/bin/draft-annotations-api [--help] 选项: --app-system-code="draft-annotations-api" 应用的系统代码 ($APP_SYSTEM_CODE) --app-name="draft-annotations-api" 应用名称 ($APP_NAME) --port="8080" 监听端口 ($APP_PORT) --annotations-rw-endpoint="http://localhost:8888" 从数据库获取草稿注释的端点 ($ANNOTATIONS_RW_ENDPOINT) --upp-annotations-endpoint="[***]" 公共注释API端点 ($ANNOTATIONS_ENDPOINT) --internal-concordances-endpoint="[***]" 从UPP获取概念的端点 ($INTERNAL_CONCORDANCES_ENDPOINT) --internal-concordances-batch-size=30 查询UPP Internal Concordances API时使用的概念ID最大批大小 ($INTERNAL_CONCORDANCES_BATCH_SIZE) --upp-api-key="" 访问UPP的API密钥 ($UPP_APIKEY) --api-yml="./_ft/api.yml" API Swagger YML文件的位置 ($API_YML) --http-timeout="8s" 请求超时前的等待时间 ($HTTP_TIMEOUT) --log-level="INFO" 日志级别 ($LOG_LEVEL)
curl http://localhost:8080/draft/content/b7b871f6-8a89-11e4-8e24-00144feabdc0/annotations | json_pp
http GET http://localhost:8080/draft/content/b7b871f6-8a89-11e4-8e24-00144feabdc0/annotations
有关服务API端点的完整描述,请参阅Open API规范。
使用curl:
curl http://localhost:8080/draft/content/{content-uuid}/annotations | jq
此端点上的GET请求通过调用Generic RW Aurora获取特定内容的草稿注释。成功时,通过调用UPP Concept Search API为注释添加概念信息。如果PAC中没有可用的注释,Draft Annotations API会通过调用UPP Public Annotations API获取已发布的注释。获取已发布注释是在PAC中动态导入遗留注释策略的一部分。
响应体示例:
{ "annotations": [ { "predicate": "[***]", "id": "[***]", "apiUrl": "[***]", "type": "[***]", "prefLabel": "Emily Cadman", "isFTAuthor": true }, { "predicate": "[***]", "id": "[***]", "apiUrl": "[***]", "type": "[***]", "prefLabel": "Lisa Barrett", "isFTAuthor": true }, { "predicate": "[***]", "id": "[***]", "apiUrl": "[***]", "type": "[***]", "prefLabel": "Global economic growth" } ] }
使用curl:
curl -X PUT \ http://localhost:8080/drafts/content/{content-uuid}/annotations \ -d '{ "annotations": [ { "predicate": "[***]", "id": "[***]", "apiUrl": "[***]", "type": "[***]", "prefLabel": "Lisa Barrett" }, { "predicate": "[***]", "id": "[***]", "apiUrl": "[***]", "type": "[***]", "prefLabel": "Global economic growth" }, { "predicate": "[***]", "id": "[***]", "apiUrl": "[***]", "type": "[***]", "prefLabel": "Global economic growth" } ] }'
此端点上的PUT请求将草稿注释写入PAC。输入体是注释JSON对象数组,其中仅predicate和id是必填字段。如果写入操作成功,应用将返回规范化的输入体,并附带HTTP 200响应码。
规范化响应示例:
{ "annotations": [ { "predicate": "[***]", "id": "[***]" }, { "predicate": "[***]", "id": "[***]" }, { "predicate": "[***]", "id": "[***]" } ] }
使用curl:
curl http://localhost:8080/draft/content/{content-uuid}/annotations/{concept-uuid} | jq
此端点上的DELETE请求从特定内容的编辑已发布注释中删除单个概念的所有注释。为了检索这些特定注释,它会使用“lifecycle”参数调用UPP Public Annotations API。如果操作成功,应用将返回规范化的输入体,并附带HTTP 200响应码。
响应体示例:
{ "annotations": [ { "predicate": "[***]", "id": "[***]" }, { "predicate": "[***]", "id": "[***]" }, { "predicate": "[***]", "id": "[***]" } ] }
管理端点包括:
/__gtg/__health/__build-info目前,/__health和/__gtg检查UPP Public Annotations API的可用性。
/__build-info和/__gtg端点不会被记录,因为它们每秒都会被varnish/vulcand调用,这些信息在日志/Splunk中不需要。免费版仅支持 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 登录方式配置轩辕镜像加速服务,包含7个详细步骤
在 Linux 系统上配置轩辕镜像源,支持主流发行版
在 Docker Desktop 中配置轩辕镜像加速,适用于桌面系统
在 Docker Compose 中使用轩辕镜像加速,支持容器编排
在 k8s 中配置 containerd 使用轩辕镜像加速
在宝塔面板中配置轩辕镜像加速,提升服务器管理效率
在 Synology 群晖NAS系统中配置轩辕镜像加速
在飞牛fnOS系统中配置轩辕镜像加速
在极空间NAS中配置轩辕镜像加速
在爱快ikuai系统中配置轩辕镜像加速
在绿联NAS系统中配置轩辕镜像加速
在威联通NAS系统中配置轩辕镜像加速
在 Podman 中配置轩辕镜像加速,支持多系统
配置轩辕镜像加速9大主流镜像仓库,包含详细配置步骤
无需登录即可使用轩辕镜像加速服务,更加便捷高效
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429