5个稳定版本

3.1.0+20220303 2022年4月26日
3.0.0+20220303 2022年3月8日
2.0.4+20210325 2021年4月14日
2.0.0+20210325 2021年4月2日

#35#json-input

Download history 37/week @ 2024-03-30 7/week @ 2024-04-06

62 每月下载次数

MIT 许可证

3.5MB
47K SLoC

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

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

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

有关Display Video API的所有其他信息,请参阅官方文档站点

安装和源代码

使用cargo安装命令行界面:

cargo install google-displayvideo1-cli

github上找到源代码

用法

此文档是根据修订版20220303的Display Video API生成的。CLI版本为3.1.0

displayvideo1 [options]
        advertisers
                assets-upload <advertiser-id> (-r <kv>)... (-u simple -f <file> [-m <mime>]) [-p <v>]... [-o <out>]
                audit <advertiser-id> [-p <v>]... [-o <out>]
                bulk-edit-advertiser-assigned-targeting-options <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                bulk-list-advertiser-assigned-targeting-options <advertiser-id> [-p <v>]... [-o <out>]
                campaigns-bulk-list-campaign-assigned-targeting-options <advertiser-id> <campaign-id> [-p <v>]... [-o <out>]
                campaigns-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                campaigns-delete <advertiser-id> <campaign-id> [-p <v>]... [-o <out>]
                campaigns-get <advertiser-id> <campaign-id> [-p <v>]... [-o <out>]
                campaigns-list <advertiser-id> [-p <v>]... [-o <out>]
                campaigns-patch <advertiser-id> <campaign-id> (-r <kv>)... [-p <v>]... [-o <out>]
                campaigns-targeting-types-assigned-targeting-options-get <advertiser-id> <campaign-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                campaigns-targeting-types-assigned-targeting-options-list <advertiser-id> <campaign-id> <targeting-type> [-p <v>]... [-o <out>]
                channels-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-get <advertiser-id> <channel-id> [-p <v>]... [-o <out>]
                channels-list <advertiser-id> [-p <v>]... [-o <out>]
                channels-patch <advertiser-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-sites-bulk-edit <advertiser-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-sites-create <advertiser-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-sites-delete <advertiser-id> <channel-id> <url-or-app-id> [-p <v>]... [-o <out>]
                channels-sites-list <advertiser-id> <channel-id> [-p <v>]... [-o <out>]
                channels-sites-replace <advertiser-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                create (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-delete <advertiser-id> <creative-id> [-p <v>]... [-o <out>]
                creatives-get <advertiser-id> <creative-id> [-p <v>]... [-o <out>]
                creatives-list <advertiser-id> [-p <v>]... [-o <out>]
                creatives-patch <advertiser-id> <creative-id> (-r <kv>)... [-p <v>]... [-o <out>]
                delete <advertiser-id> [-p <v>]... [-o <out>]
                get <advertiser-id> [-p <v>]... [-o <out>]
                insertion-orders-bulk-list-insertion-order-assigned-targeting-options <advertiser-id> <insertion-order-id> [-p <v>]... [-o <out>]
                insertion-orders-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                insertion-orders-delete <advertiser-id> <insertion-order-id> [-p <v>]... [-o <out>]
                insertion-orders-get <advertiser-id> <insertion-order-id> [-p <v>]... [-o <out>]
                insertion-orders-list <advertiser-id> [-p <v>]... [-o <out>]
                insertion-orders-patch <advertiser-id> <insertion-order-id> (-r <kv>)... [-p <v>]... [-o <out>]
                insertion-orders-targeting-types-assigned-targeting-options-get <advertiser-id> <insertion-order-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                insertion-orders-targeting-types-assigned-targeting-options-list <advertiser-id> <insertion-order-id> <targeting-type> [-p <v>]... [-o <out>]
                invoices-list <advertiser-id> [-p <v>]... [-o <out>]
                invoices-lookup-invoice-currency <advertiser-id> [-p <v>]... [-o <out>]
                line-items-bulk-edit-line-item-assigned-targeting-options <advertiser-id> <line-item-id> (-r <kv>)... [-p <v>]... [-o <out>]
                line-items-bulk-list-line-item-assigned-targeting-options <advertiser-id> <line-item-id> [-p <v>]... [-o <out>]
                line-items-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                line-items-delete <advertiser-id> <line-item-id> [-p <v>]... [-o <out>]
                line-items-generate-default <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                line-items-get <advertiser-id> <line-item-id> [-p <v>]... [-o <out>]
                line-items-list <advertiser-id> [-p <v>]... [-o <out>]
                line-items-patch <advertiser-id> <line-item-id> (-r <kv>)... [-p <v>]... [-o <out>]
                line-items-targeting-types-assigned-targeting-options-create <advertiser-id> <line-item-id> <targeting-type> (-r <kv>)... [-p <v>]... [-o <out>]
                line-items-targeting-types-assigned-targeting-options-delete <advertiser-id> <line-item-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                line-items-targeting-types-assigned-targeting-options-get <advertiser-id> <line-item-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                line-items-targeting-types-assigned-targeting-options-list <advertiser-id> <line-item-id> <targeting-type> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
                location-lists-assigned-locations-bulk-edit <advertiser-id> <location-list-id> (-r <kv>)... [-p <v>]... [-o <out>]
                location-lists-assigned-locations-create <advertiser-id> <location-list-id> (-r <kv>)... [-p <v>]... [-o <out>]
                location-lists-assigned-locations-delete <advertiser-id> <location-list-id> <assigned-location-id> [-p <v>]... [-o <out>]
                location-lists-assigned-locations-list <advertiser-id> <location-list-id> [-p <v>]... [-o <out>]
                location-lists-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                location-lists-get <advertiser-id> <location-list-id> [-p <v>]... [-o <out>]
                location-lists-list <advertiser-id> [-p <v>]... [-o <out>]
                location-lists-patch <advertiser-id> <location-list-id> (-r <kv>)... [-p <v>]... [-o <out>]
                manual-triggers-activate <advertiser-id> <trigger-id> (-r <kv>)... [-p <v>]... [-o <out>]
                manual-triggers-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                manual-triggers-deactivate <advertiser-id> <trigger-id> (-r <kv>)... [-p <v>]... [-o <out>]
                manual-triggers-get <advertiser-id> <trigger-id> [-p <v>]... [-o <out>]
                manual-triggers-list <advertiser-id> [-p <v>]... [-o <out>]
                manual-triggers-patch <advertiser-id> <trigger-id> (-r <kv>)... [-p <v>]... [-o <out>]
                negative-keyword-lists-create <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                negative-keyword-lists-delete <advertiser-id> <negative-keyword-list-id> [-p <v>]... [-o <out>]
                negative-keyword-lists-get <advertiser-id> <negative-keyword-list-id> [-p <v>]... [-o <out>]
                negative-keyword-lists-list <advertiser-id> [-p <v>]... [-o <out>]
                negative-keyword-lists-negative-keywords-bulk-edit <advertiser-id> <negative-keyword-list-id> (-r <kv>)... [-p <v>]... [-o <out>]
                negative-keyword-lists-negative-keywords-create <advertiser-id> <negative-keyword-list-id> (-r <kv>)... [-p <v>]... [-o <out>]
                negative-keyword-lists-negative-keywords-delete <advertiser-id> <negative-keyword-list-id> <keyword-value> [-p <v>]... [-o <out>]
                negative-keyword-lists-negative-keywords-list <advertiser-id> <negative-keyword-list-id> [-p <v>]... [-o <out>]
                negative-keyword-lists-negative-keywords-replace <advertiser-id> <negative-keyword-list-id> (-r <kv>)... [-p <v>]... [-o <out>]
                negative-keyword-lists-patch <advertiser-id> <negative-keyword-list-id> (-r <kv>)... [-p <v>]... [-o <out>]
                patch <advertiser-id> (-r <kv>)... [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-create <advertiser-id> <targeting-type> (-r <kv>)... [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-delete <advertiser-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-get <advertiser-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-list <advertiser-id> <targeting-type> [-p <v>]... [-o <out>]
        combined-audiences
                get <combined-audience-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
        custom-bidding-algorithms
                create (-r <kv>)... [-p <v>]... [-o <out>]
                get <custom-bidding-algorithm-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
                patch <custom-bidding-algorithm-id> (-r <kv>)... [-p <v>]... [-o <out>]
                scripts-create <custom-bidding-algorithm-id> (-r <kv>)... [-p <v>]... [-o <out>]
                scripts-get <custom-bidding-algorithm-id> <custom-bidding-script-id> [-p <v>]... [-o <out>]
                scripts-list <custom-bidding-algorithm-id> [-p <v>]... [-o <out>]
                upload-script <custom-bidding-algorithm-id> [-p <v>]... [-o <out>]
        custom-lists
                get <custom-list-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
        first-and-third-party-audiences
                create (-r <kv>)... [-p <v>]... [-o <out>]
                edit-customer-match-members <first-and-third-party-audience-id> (-r <kv>)... [-p <v>]... [-o <out>]
                get <first-and-third-party-audience-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
                patch <first-and-third-party-audience-id> (-r <kv>)... [-p <v>]... [-o <out>]
        floodlight-groups
                get <floodlight-group-id> [-p <v>]... [-o <out>]
                patch <floodlight-group-id> (-r <kv>)... [-p <v>]... [-o <out>]
        google-audiences
                get <google-audience-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
        inventory-source-groups
                assigned-inventory-sources-bulk-edit <inventory-source-group-id> (-r <kv>)... [-p <v>]... [-o <out>]
                assigned-inventory-sources-create <inventory-source-group-id> (-r <kv>)... [-p <v>]... [-o <out>]
                assigned-inventory-sources-delete <inventory-source-group-id> <assigned-inventory-source-id> [-p <v>]... [-o <out>]
                assigned-inventory-sources-list <inventory-source-group-id> [-p <v>]... [-o <out>]
                create (-r <kv>)... [-p <v>]... [-o <out>]
                delete <inventory-source-group-id> [-p <v>]... [-o <out>]
                get <inventory-source-group-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
                patch <inventory-source-group-id> (-r <kv>)... [-p <v>]... [-o <out>]
        inventory-sources
                get <inventory-source-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
        media
                download <resource-name> [-p <v>]... [-o <out>]
                upload <resource-name> (-r <kv>)... (-u simple -f <file> [-m <mime>]) [-p <v>]... [-o <out>]
        partners
                bulk-edit-partner-assigned-targeting-options <partner-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-create <partner-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-get <partner-id> <channel-id> [-p <v>]... [-o <out>]
                channels-list <partner-id> [-p <v>]... [-o <out>]
                channels-patch <partner-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-sites-bulk-edit <partner-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-sites-create <partner-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                channels-sites-delete <partner-id> <channel-id> <url-or-app-id> [-p <v>]... [-o <out>]
                channels-sites-list <partner-id> <channel-id> [-p <v>]... [-o <out>]
                channels-sites-replace <partner-id> <channel-id> (-r <kv>)... [-p <v>]... [-o <out>]
                get <partner-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-create <partner-id> <targeting-type> (-r <kv>)... [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-delete <partner-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-get <partner-id> <targeting-type> <assigned-targeting-option-id> [-p <v>]... [-o <out>]
                targeting-types-assigned-targeting-options-list <partner-id> <targeting-type> [-p <v>]... [-o <out>]
        sdfdownloadtasks
                create (-r <kv>)... [-p <v>]... [-o <out>]
                operations-get <name> [-p <v>]... [-o <out>]
        targeting-types
                targeting-options-get <targeting-type> <targeting-option-id> [-p <v>]... [-o <out>]
                targeting-options-list <targeting-type> [-p <v>]... [-o <out>]
                targeting-options-search <targeting-type> (-r <kv>)... [-p <v>]... [-o <out>]
        users
                bulk-edit-assigned-user-roles <user-id> (-r <kv>)... [-p <v>]... [-o <out>]
                create (-r <kv>)... [-p <v>]... [-o <out>]
                delete <user-id> [-p <v>]... [-o <out>]
                get <user-id> [-p <v>]... [-o <out>]
                list [-p <v>]... [-o <out>]
                patch <user-id> (-r <kv>)... [-p <v>]... [-o <out>]
  displayvideo1 --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文件中,文件名以displayvideo1-开头。您可以使用--config-dir标志在每次调用中更改用于存储配置的目录。

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

身份验证

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

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

第一次使用作用域时,用户将被要求授予权限。按照CLI提供的说明授予权限,或拒绝。

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

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

应用程序密钥

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

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

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

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

调试

尽管CLI尽最大努力提供可用的错误消息,但有时可能希望知道导致特定问题的确切原因。这是通过允许所有客户端-服务器通信直接输出到标准错误来完成的。

--debug标志将以Debug表示形式将错误打印到标准错误。

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

依赖关系

~18–30MB
~563K SLoC