zaepho.zohobooks.zohobooks_item_info module – Retrieve ZohoBooks items information
Note
This module is part of the zaepho.zohobooks collection (version 0.3.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install zaepho.zohobooks.
To use it in a playbook, specify: zaepho.zohobooks.zohobooks_item_info.
New in zaepho.zohobooks 0.2.0
Synopsis
Retrieve information about items in ZohoBooks
Can retrieve a specific item by name or ID, or list all items
Parameters
Parameter |
Comments |
|---|---|
ZohoBooks API access token Can also be set via ZOHO_ACCESS_TOKEN environment variable |
|
ZohoBooks API domain Can also be set via ZOHO_API_DOMAIN environment variable Default: |
|
Filter items by status Choices:
|
|
ID of the item to retrieve Mutually exclusive with name |
|
Name of the item to retrieve Mutually exclusive with item_id |
|
ZohoBooks organization ID Can also be set via ZOHO_ORGANIZATION_ID environment variable |
|
SKU of the item to retrieve Mutually exclusive with name and item_id |
Examples
- name: Get all items
zaepho.zohobooks.zohobooks_item_info:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
register: all_items
- name: Get item by name
zaepho.zohobooks.zohobooks_item_info:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Hard Drive"
register: item
- name: Get item by ID
zaepho.zohobooks.zohobooks_item_info:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
item_id: "987654321"
register: item
- name: Get item by SKU
zaepho.zohobooks.zohobooks_item_info:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
sku: "HD-500GB-001"
register: item
- name: Get all active items
zaepho.zohobooks.zohobooks_item_info:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
filter_by: "Status.Active"
register: active_items
- name: Get items using environment variables
zaepho.zohobooks.zohobooks_item_info:
name: "Software License"
environment:
ZOHO_ORGANIZATION_ID: "123456789"
ZOHO_ACCESS_TOKEN: "your_access_token"
ZOHO_API_DOMAIN: "https://www.zohoapis.com"
register: item
- name: Display item information
debug:
var: item.zohobooks_items
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Number of items returned Returned: always Sample: |
|
List of items matching the criteria Returned: always Sample: |