
coco/draft-annotations-apiDraft 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 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务