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)
bashcurl http://localhost:8080/draft/content/b7b871f6-8a89-11e4-8e24-00144feabdc0/annotations | json_pp
bashhttp GET http://localhost:8080/draft/content/b7b871f6-8a89-11e4-8e24-00144feabdc0/annotations
有关服务API端点的完整描述,请参阅Open API规范。
使用curl:
bashcurl 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中动态导入遗留注释策略的一部分。
响应体示例:
json{ "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:
bashcurl -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响应码。
规范化响应示例:
json{ "annotations": [ { "predicate": "[***]", "id": "[***]" }, { "predicate": "[***]", "id": "[***]" }, { "predicate": "[***]", "id": "[***]" } ] }
使用curl:
bashcurl http://localhost:8080/draft/content/{content-uuid}/annotations/{concept-uuid} | jq
此端点上的DELETE请求从特定内容的编辑已发布注释中删除单个概念的所有注释。为了检索这些特定注释,它会使用“lifecycle”参数调用UPP Public Annotations API。如果操作成功,应用将返回规范化的输入体,并附带HTTP 200响应码。
响应体示例:
json{ "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 登录认证访问私有仓库
在 Linux 系统配置镜像加速服务
在 Docker Desktop 配置镜像加速
Docker Compose 项目配置加速
Kubernetes 集群配置 Containerd
在宝塔面板一键配置镜像加速
Synology 群晖 NAS 配置加速
飞牛 fnOS 系统配置镜像加速
极空间 NAS 系统配置加速服务
爱快 iKuai 路由系统配置加速
绿联 NAS 系统配置镜像加速
QNAP 威联通 NAS 配置加速
Podman 容器引擎配置加速
HPC 科学计算容器配置加速
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名加速