为了使用最低下层协议(MLLP(通过TCP/IP连接传输HL7v2消息,我遵循本指南。当我进入创建配置有Pub/Sub主题的HL7v2存储的部分时(此处(,我会收到一个错误。
这是我在终端中键入的内容:
curl -X POST
--data "{
'notificationConfigs': [
{
'pubsubTopic': 'projects/PROJECT_ID/topics/PUBSUB_TOPIC',
'filter': ''
}
]
}"
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)"
-H "Content-Type: application/json; charset=utf-8"
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores?hl7V2StoreId=HL7V2_STORE_ID"
这是我得到的错误:
{
"error": {
"code": 403,
"message": "Permission healthcare.hl7V2Stores.create denied on resource projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID (or it may be malformed or not exist)",
"status": "PERMISSION_DENIED"
}
}
数据集projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID
存在,我仔细检查了一下。那么,这在某种程度上与我的权限(IAM策略(有关吗?我不明白,因为我是Administer HL7v2 Stores
。
如何在不出现此错误的情况下创建数据存储?
我发现命令gcloud auth application-default print-access-token
没有返回正确的令牌,但gcloud auth print-access-token
是.
因此,有了正确的auth令牌,命令就可以工作了,我得到了正确的响应:
{
"name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID",
"notificationConfigs": [
{
"pubsubTopic": "projects/PROJECT_ID/topics/PUBSUB_TOPIC"
}
]
}