7个稳定版本 (3个主要版本)

5.0.4+20240228 2024年3月5日
3.1.0+20220223 2022年4月26日
3.0.0+20220223 2022年3月8日
2.0.4+20210317 2021年4月15日
1.0.14+20200612 2020年7月10日

#2#healthcare

Download history 24/week @ 2024-03-08 5/week @ 2024-03-15 55/week @ 2024-03-29 12/week @ 2024-04-05 3/week @ 2024-05-17 1/week @ 2024-05-24

每月133 次下载

MIT 许可证

3MB
38K SLoC

healthcare1 命令行界面(CLI)允许您从终端舒适地使用Google Cloud Healthcare服务的多数功能。

默认情况下,所有输出都打印到标准输出,但可以通过设置标志将其直接重定向到文件,而与您的shell功能无关。错误将打印到标准错误,并将导致程序的退出码不为零。

如果请求数据结构,则这些结构将作为美观打印的JSON返回,以便作为其他工具的输入。

有关Cloud Healthcare API的所有其他信息,请参阅官方文档网站

安装和源代码

使用cargo安装命令行界面:

cargo install google-healthcare1-cli

GitHub上查找源代码。

用法

此文档是从Cloud Healthcare API的修订版20240228生成的。CLI的版本为5.0.4

healthcare1 [options]
        projects
                locations-datasets-consent-stores-attribute-definitions-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-attribute-definitions-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-attribute-definitions-get <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-attribute-definitions-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-attribute-definitions-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-check-data-access <consent-store> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consent-artifacts-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consent-artifacts-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consent-artifacts-get <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consent-artifacts-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-activate <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-delete-revision <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-get <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-list-revisions <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-reject <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-consents-revoke <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-evaluate-user-consents <consent-store> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-get <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-get-iam-policy <resource> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-query-accessible-data <consent-store> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-set-iam-policy <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-test-iam-permissions <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-user-data-mappings-archive <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-user-data-mappings-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-user-data-mappings-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-user-data-mappings-get <name> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-user-data-mappings-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-consent-stores-user-data-mappings-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-data-mapper-workspaces-get-iam-policy <resource> [-p <v>]... [-o <out>]
                locations-datasets-data-mapper-workspaces-set-iam-policy <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-data-mapper-workspaces-test-iam-permissions <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-deidentify <source-dataset> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-deidentify <source-store> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-dicom-web-studies-get-study-metrics <study> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-dicom-web-studies-series-get-series-metrics <series> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-export <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-get <name> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-get-dicom-store-metrics <name> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-get-iam-policy <resource> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-import <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-search-for-instances <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-search-for-series <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-search-for-studies <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-set-iam-policy <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-store-instances <parent> <dicom-web-path> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-delete <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-retrieve-metadata <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-retrieve-study <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-search-for-instances <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-search-for-series <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-delete <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-instances-delete <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-instances-frames-retrieve-frames <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-instances-frames-retrieve-rendered <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-instances-retrieve-instance <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-instances-retrieve-metadata <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-instances-retrieve-rendered <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-retrieve-metadata <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-retrieve-series <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-series-search-for-instances <parent> <dicom-web-path> [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-studies-store-instances <parent> <dicom-web-path> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-dicom-stores-test-iam-permissions <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-deidentify <source-store> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-export <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir--patient-everything <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir--resource-purge <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir--resource-validate <parent> <type> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-capabilities <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-conditional-delete <parent> <type> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-conditional-patch <parent> <type> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-conditional-update <parent> <type> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-create <parent> <type> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-execute-bundle <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-history <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-read <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-search <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-search-type <parent> <resource-type> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-update <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-fhir-vread <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-get <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-get-fhir-store-metrics <name> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-get-iam-policy <resource> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-import <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-rollback <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-set-iam-policy <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-fhir-stores-test-iam-permissions <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-get <name> [-p <v>]... [-o <out>]
                locations-datasets-get-iam-policy <resource> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-export <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-get <name> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-get-hl7v2-store-metrics <name> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-get-iam-policy <resource> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-import <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-messages-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-messages-delete <name> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-messages-get <name> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-messages-ingest <parent> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-messages-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-messages-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-set-iam-policy <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-hl7-v2-stores-test-iam-permissions <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-list <parent> [-p <v>]... [-o <out>]
                locations-datasets-operations-cancel <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-operations-get <name> [-p <v>]... [-o <out>]
                locations-datasets-operations-list <name> [-p <v>]... [-o <out>]
                locations-datasets-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-set-iam-policy <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-datasets-test-iam-permissions <resource> (-r <kv>)... [-p <v>]... [-o <out>]
                locations-get <name> [-p <v>]... [-o <out>]
                locations-list <name> [-p <v>]... [-o <out>]
                locations-services-nlp-analyze-entities <nlp-service> (-r <kv>)... [-p <v>]... [-o <out>]
  healthcare1 --help

Configuration:
  [--scope <url>]...
            Specify the authentication a method should be executed in. Each scope
            requires the user to grant this application permission to use it.
            If unset, it defaults to the shortest scope url for a particular method.
  --config-dir <folder>
            A directory into which we will store our persistent data. Defaults to
            a user-writable directory that we will create during the first invocation.
            [default: ~/.google-service-cli]

配置

程序将所有持久数据存储在~/.google-service-cli目录中的JSON文件中,文件名以healthcare1-开头。您可以使用--config-dir标志在每次调用中更改用于存储配置的目录。

以下段落提供了有关各种类型持久数据的更多信息。

身份验证

大多数API需要用户对请求进行身份验证。如果是这种情况,则范围确定授予的权限集。这些的粒度通常不超过只读完全访问

如果没有设置,系统将自动选择最小的可行范围,例如,在调用只读方法时,它将仅请求只读范围。您可以使用--scope标志直接指定范围。所有适用的范围都在相应方法的CLI文档中记录。

第一次使用作用域时,会要求用户授权。按照CLI提供的说明进行授权或拒绝。

如果用户已验证作用域,相应的信息将以JSON格式存储在配置目录中,例如:~/.google-service-cli/healthcare1-token-<scope-hash>.json。不需要手动管理这些令牌。

要撤销授权,请参阅官方文档

应用程序密钥

为了让任何应用程序使用Google服务,需要使用Google开发者控制台进行注册。然后逐个为应用程序启用它可能使用的API。大多数API都可以免费使用,并且有每日配额。

为了在不强制任何人注册自己的应用程序的情况下更方便地使用CLI,CLI自带了一个默认的应用程序密钥,并相应地进行了配置。这也意味着全球范围内的重用可能会耗尽每日配额。

您可以通过将您自己的密钥文件放在此位置来解决这个问题:~/.google-service-cli/healthcare1-secret.json,假设已为它启用了所需的healthcare API。此类密钥文件可以在Google开发者控制台APIs & auth -> Credentials -> Download JSON中下载,并直接使用。

有关如何设置Google项目和启用API的更多信息,请参阅官方文档

调试

尽管CLI尽可能提供可用的错误消息,但有时可能希望了解导致特定问题的确切原因。这通过允许所有客户端-服务器通信直接输出到标准错误实现

使用--debug标志将使用Debug表示法将错误打印到标准错误。

您可以考虑将标准错误重定向到文件以方便使用,例如:healthcare1 --debug <resource> <method> [options] 2>debug.txt

依赖项

~20–31MB
~582K SLoC