receptor-catalog
Receptor Catalog Worker Plugin
This plugin allows the receptor node to send HTTP GET and POST requests to Ansible Tower.
The config file on the receptor for this plugin should have the following values defined in the receptor.conf
[plugin_receptor_catalog]
debug=True
username=admin
password=******
url=https://your_ansible_tower/
verify_ssl=False
The payload supported by the plugin contains
- method: GET|POST
- href_slug: the href to the resource or collection e.g api/v2/job_templates/
- accept_encoding {Optional}: gzip
- fetch_all_pages {Optional}: True|False
- params: Extra query or post parameters as a hash/dictionary
- apply_filter {Optional}: A JMESPath search string to limit the amount of data that is returned. The filter can be specified as a hash/dictionary or as a string. The hash is used when filtering responses from a list call when the response contains an array of objects. The string filter is used when dealing with a single object.
The response payload coming back will have the following keys
- status: The HTTP Status code
- body: The response body received from the Ansible Tower if Accept-Encoding was gzip, the body will be compressed and the caller would have to uncompress the data. The first 2 bytes of the payload can be checked to see if the data has been gzip compressed. A valid gzip'ed buffer would start with 0x1f 0x8B
To install the plugin in your local dev environment
python setup.py install
To run the tests
python setup.py test
Filtering Examples
Filters are based on JMESPath which allows us to search and filter out sections of JSON. https://jmespath.org
When fetching an array of objects you have to specific the filter as a dictionary with the key name containing the name of the attribute. e.g apply_filter ={results='results[].{catalog_id:id, url:url,created:created,name:name, modified:modified, playbook:playbook}'}
Here we are filtering the results key so we have to specify the filter as a dictionary. The plugin will swap out the contents of the key with the filtered results. The filtered response will contain
{
"count": 28,
"next": "/api/v2/job_templates/?page=2",
"previous": null,
"results": [
{
"catalog_id": 5,
"url": "/api/v2/job_templates/5/",
"created": "2019-05-29T15:17:05.466994Z",
"name": "Demo Job Template",
"modified": "2019-05-29T15:17:05.467018Z",
"playbook": "hello_world.yml"
},
{
"catalog_id": 58,
"url": "/api/v2/job_templates/58/",
"created": "2020-03-06T21:56:55.134663Z",
"name": "Ephemeral Template",
"modified": "2020-03-06T22:15:15.655800Z",
"playbook": "hello_world.yml"
},
When a single object needs to be filtered we specify the filter as a string
apply_filter = '{id:id, url:url, name:name, description:descripti on, playbook:playbook}'
The response contains
{
"id": 6565,
"url": "/api/v2/jobs/6565/",
"name": "Hello World",
"description": "Test Description",
"playbook": "hello_world.yml"
}
Metadata
Release files for receptor-catalog 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| receptor-catalog-0.6.3.tar.gz | 9.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| receptor_catalog-0.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / receptor-catalog-0.6.3.tar.gz
| Download URL | receptor-catalog-0.6.3.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffa10395a4ff13a7b3777288b158f0a75ac6c041873eca8abb8ee5431410ae03
|
|
BLAKE2b-256 checksum How to use checksums |
2719b765a87b4ac7b9c01c0ec4dca5e416ce7a793eaee4c928d897f39c30395a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6
|
Release files / receptor_catalog-0.6.3-py3-none-any.whl
| Download URL | receptor_catalog-0.6.3-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
549fe94941a9131b704ad381135909df794d4a1857333e95d76e195374bacc0c
|
|
BLAKE2b-256 checksum How to use checksums |
52af1f78a29198c4a0aae48c8f4dc85e1bff0776916968de0fac5ae676b0c0e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6
|
Security for receptor-catalog 0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.