10 个稳定版本
3.1.0+20220104 | 2022年4月26日 |
---|---|
3.0.0+20220104 | 2022年3月8日 |
2.0.4+20210210 | 2021年4月15日 |
1.0.14+20200514 | 2020年7月10日 |
1.0.10+20190531 | 2019年7月6日 |
在 网络编程 中排名 2979
每月下载 71 次
5MB
65K SLoC
dfareporting3d3
命令行界面 (CLI) 允许您在终端中轻松使用 Google Dfareporting 服务的大多数功能。
默认情况下,所有输出都打印到标准输出,但可以通过设置标志将其直接定向到文件,而不依赖于您的shell功能。错误将打印到标准错误,并将导致程序退出代码非零。
如果请求数据结构,这些将以漂亮的打印 JSON 返回,作为其他工具的输入非常有用。
有关 Dfareporting API 的所有其他信息,请参阅 官方文档网站。
安装和源代码
使用 cargo 安装命令行界面
cargo install google-dfareporting3d3-cli
在 GitHub 上查找源代码。
用法
此文档是从 Dfareporting API 的修订版 20220104 生成的。CLI 的版本是 3.1.0。
dfareporting3d3 [options]
account-active-ad-summaries
get <profile-id> <summary-account-id> [-p <v>]... [-o <out>]
account-permission-groups
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
account-permissions
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
account-user-profiles
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
accounts
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
ads
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
advertiser-groups
delete <profile-id> <id> [-p <v>]...
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
advertiser-landing-pages
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
advertisers
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
browsers
list <profile-id> [-p <v>]... [-o <out>]
campaign-creative-associations
insert <profile-id> <campaign-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> <campaign-id> [-p <v>]... [-o <out>]
campaigns
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
change-logs
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
cities
list <profile-id> [-p <v>]... [-o <out>]
connection-types
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
content-categories
delete <profile-id> <id> [-p <v>]...
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
conversions
batchinsert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
batchupdate <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
countries
get <profile-id> <dart-id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
creative-assets
insert <profile-id> <advertiser-id> (-r <kv>)... (-u simple -f <file> [-m <mime>]) [-p <v>]... [-o <out>]
creative-field-values
delete <profile-id> <creative-field-id> <id> [-p <v>]...
get <profile-id> <creative-field-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> <creative-field-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> <creative-field-id> [-p <v>]... [-o <out>]
patch <profile-id> <creative-field-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> <creative-field-id> (-r <kv>)... [-p <v>]... [-o <out>]
creative-fields
delete <profile-id> <id> [-p <v>]...
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
creative-groups
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
creatives
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
dimension-values
query <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
directory-sites
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
dynamic-targeting-keys
delete <profile-id> <object-id> <name> <object-type> [-p <v>]...
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
event-tags
delete <profile-id> <id> [-p <v>]...
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
files
get <report-id> <file-id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
floodlight-activities
delete <profile-id> <id> [-p <v>]...
generatetag <profile-id> [-p <v>]... [-o <out>]
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
floodlight-activity-groups
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
floodlight-configurations
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
inventory-items
get <profile-id> <project-id> <id> [-p <v>]... [-o <out>]
list <profile-id> <project-id> [-p <v>]... [-o <out>]
languages
list <profile-id> [-p <v>]... [-o <out>]
metros
list <profile-id> [-p <v>]... [-o <out>]
mobile-apps
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
mobile-carriers
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
operating-system-versions
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
operating-systems
get <profile-id> <dart-id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
order-documents
get <profile-id> <project-id> <id> [-p <v>]... [-o <out>]
list <profile-id> <project-id> [-p <v>]... [-o <out>]
orders
get <profile-id> <project-id> <id> [-p <v>]... [-o <out>]
list <profile-id> <project-id> [-p <v>]... [-o <out>]
placement-groups
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
placement-strategies
delete <profile-id> <id> [-p <v>]...
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
placements
generatetags <profile-id> [-p <v>]... [-o <out>]
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
platform-types
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
postal-codes
get <profile-id> <code> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
projects
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
regions
list <profile-id> [-p <v>]... [-o <out>]
remarketing-list-shares
get <profile-id> <remarketing-list-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
remarketing-lists
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> <advertiser-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
reports
compatible-fields-query <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
delete <profile-id> <report-id> [-p <v>]...
files-get <profile-id> <report-id> <file-id> [-p <v>]... [-o <out>]
files-list <profile-id> <report-id> [-p <v>]... [-o <out>]
get <profile-id> <report-id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <report-id> (-r <kv>)... [-p <v>]... [-o <out>]
run <profile-id> <report-id> [-p <v>]... [-o <out>]
update <profile-id> <report-id> (-r <kv>)... [-p <v>]... [-o <out>]
sites
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
sizes
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
subaccounts
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
targetable-remarketing-lists
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> <advertiser-id> [-p <v>]... [-o <out>]
targeting-templates
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
user-profiles
get <profile-id> [-p <v>]... [-o <out>]
list [-p <v>]... [-o <out>]
user-role-permission-groups
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
user-role-permissions
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
user-roles
delete <profile-id> <id> [-p <v>]...
get <profile-id> <id> [-p <v>]... [-o <out>]
insert <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
patch <profile-id> <id> (-r <kv>)... [-p <v>]... [-o <out>]
update <profile-id> (-r <kv>)... [-p <v>]... [-o <out>]
video-formats
get <profile-id> <id> [-p <v>]... [-o <out>]
list <profile-id> [-p <v>]... [-o <out>]
dfareporting3d3 --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
目录中存储所有持久数据,该目录以 dfareporting3d3-
前缀的 JSON 文件开始。您可以使用 --config-dir
标志在每次调用的基础上更改用于存储配置的目录。
以下段落提供了有关各种持久数据的更多信息。
身份验证
大多数 API 需要用户对任何请求进行身份验证。如果是这种情况,则 作用域 确定了授予的权限集。这些的粒度通常不超过 只读 或 完全访问。
如果未设置,系统将自动选择最小的可行范围,例如调用只读方法时,它只会请求只读范围。您可以使用 --scope
标志直接指定范围。所有适用的范围都在相应方法的CLI文档中有记录。
第一次使用范围时,用户会被要求授权。按照CLI提供的指示授予权限或拒绝。
如果用户认证了某个范围,相关信息将作为 JSON 存储在配置目录中,例如 ~/.google-service-cli/dfareporting3d3-token-<scope-hash>.json
。无需手动管理这些令牌。
要撤销授予的认证,请参阅官方文档。
应用程序密钥
为了允许任何应用程序使用Google服务,需要使用Google开发者控制台进行注册。然后为应用程序逐一启用可能使用的API。大多数API可以免费使用,并且有每日配额。
为了在不强制任何人注册自己的应用程序的情况下,更方便地使用CLI,CLI自带了一个默认的应用程序密钥,并相应地进行了配置。这也意味着全球范围内的密集使用可能会耗尽每日配额。
您可以通过将您自己的密钥文件放置在此位置来解决这个问题:~/.google-service-cli/dfareporting3d3-secret.json
,假设已为它启用了所需的 dfareporting API。此类密钥文件可以从 Google开发者控制台 的 APIs & auth -> Credentials -> Download JSON 下载并直接使用。
有关如何设置Google项目和启用API的更多信息,请参阅官方文档。
调试
尽管CLI尽力提供可用的错误消息,但有时了解导致特定问题的确切原因可能是有用的。这是通过允许所有客户端-服务器通信以标准错误输出。
使用 --debug
标志将错误打印为标准错误的 Debug
表示。
您可以考虑将标准错误重定向到文件以方便使用,例如 dfareporting3d3 --debug <resource> <method> [options] 2>debug.txt
。
依赖项
~18–31MB
~574K SLoC