Run ZOQL queries through AQuA from the command line
Project description
zuora-aqua-client-cli
Run ZOQL queries through AQuA from the command line
Installation
Mac
pip3 install zuora-aqua-client-cli
The executable will be installed to /usr/local/bin/zacc
Linux
pip3 install zuora-aqua-client-cli
The executable will be installed to ~/.local/bin/zacc
Make sure ~/.local/bin/
is added to your $PATH
Configuration
Configuration should be provided by the -c /path/to/file
option.
If option is not provided, will be read from ~/.zacc.ini
Example config
[zacc]
# When environement option is ommited the default environment will be used
default_environment = preprod
[prod]
# Use production Zuora endpoints, defaults to `false`
production = true
client_id = <oauth_client_id>
client_secret = <oauth_client_secret>
[mysandbox]
client_id = <oauth_client_id>
client_secret = <oauth_client_secret>
Usage
Cheatsheet
# List fiels for resource
$ zacc describe Account
Account
AccountNumber - Account Number
AdditionalEmailAddresses - Additional Email Addresses
AllowInvoiceEdit - Allow Invoice Editing
AutoPay - Auto Pay
Balance - Account Balance
...
Related Objects
BillToContact<Contact> - Bill To
DefaultPaymentMethod<PaymentMethod> - Default Payment Method
ParentAccount<Account> - Parent Account
SoldToContact<Contact> - Sold To
# Request a bearer token, then exit
$ zacc bearer
Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaa
# Execute an AQuA job
$ zacc query -z "select Account.Name from Account where Account.CreatedDate > '2019-01-10'"
Account.Name
John Doe
Jane Doe
# Save results to CSV file instead of printing it
$ zacc query -z ~/query_names.zoql -o account_names.csv
# Execute an AQuA job from a ZOQL query file
$ zacc query -z ~/query_names.zoql
Account.Name
John Doe
Jane Doe
# Use different configurations than default
$ zacc -c ~/.myotherzaccconfig.ini -e notdefualtenv query -z ~/query_names.zoql
Commands
zacc
Usage: zacc [OPTIONS] COMMAND [ARGS]...
Sets up an API client, passes to commands in context
Options:
-c, --config-filename PATH Config file containing Zuora ouath credentials
[default: /Users/prezi/.zacc.ini]
-e, --environment TEXT Zuora environment to execute on
--help Show this message and exit.
Commands:
bearer Prints bearer than exits
describe List available fields of Zuora resource
query Run ZOQL Query
zacc query
Usage: zacc query [OPTIONS]
Run ZOQL Query
Options:
-z, --zoql TEXT ZOQL file or query to be executed
-o, --output PATH Where to write the output to, default is STDOUT
-m, --max-retries FLOAT Maximum retries for query
--help Show this message and exit.
zacc describe
zacc describe --help 932ms Thu Feb 6 14:58:13 2020
Usage: zacc describe [OPTIONS] RESOURCE
List available fields of Zuora resource
Options:
--help Show this message and exit.
zacc bearer
Usage: zacc bearer [OPTIONS]
Prints bearer than exits
Options:
--help Show this message and exit.
Useful stuff
Has a lot of graphs on Resource relationships: https://community.zuora.com/t5/Engineering-Blog/AQUA-An-Introduction-to-Join-Processing/ba-p/13262
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for zuora-aqua-client-cli-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 856d6d192881d07dd2d13f5c83a8c44803ac71b21601d1a2a24d0f22994b26a2 |
|
MD5 | 5fe85fb59459194cd308d6c3b5a791dd |
|
BLAKE2b-256 | 4e8426a9bdce2e73ec5321d5d1eb547429222c66632b92cdafc8cee7291b0149 |
Close
Hashes for zuora_aqua_client_cli-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fe5272564cec0a4e2ed4956bcc5abdfe6d0b531376ed4b57325bf4ec0aef718 |
|
MD5 | f59f3f6f19ca96a260e7756957619aa3 |
|
BLAKE2b-256 | 17c7ad9ce090817c875a6b5ead12ca0777e502cbbcc8f42f4178ab188cabb5f1 |