Push CGW Module
Content Gateway (CGW) is a library used for performing various content workflows related work. The push-cgw-metadata entrypoint will be utilized by users for pushing and managing the contents of products, versions and files on the content gateway server.
- class pubtools._content_gateway.push_cgw.PushCGW(cgw_hostname, cgw_username, cgw_password, cgw_filepath)[source]
Bases:
PushBaseHandle push CGW workflow.
- __init__(cgw_hostname, cgw_username, cgw_password, cgw_filepath)[source]
Initialize.
- Parameters
cgw_hostname (str) – CGW registry URL
cgw_username (str) – username for CGW HTTP API
cgw_password (str) – password for CGW HTTP API
cgw_filepath (str) – filepath of the yaml file
- cgw_operations()[source]
Initiate the CGW operations such as create, update or delete on products, versions and files.
- pubtools._content_gateway.push_cgw.main()[source]
Entrypoint for CGW Push.
The main() method will be invoked when entrypoint is called and it will pass all required received credentials to the PushCGW class for the CGW operations.
CGW environment
usage: push-cgw-metadata [-h] -host CGW-hostname -u CGW-username [-p CGW-password] -f CGW-filepath
optional arguments:
-h, --help show this help message and exit
-host CGW-hostname, --CGW_hostname CGW-hostname
Hostname of the server
-u CGW-username, --CGW_username CGW-username
Username of Content Gateway
-p CGW-password, --CGW_password CGW-password
Password for Content Gateway
-f CGW-filepath, --CGW_filepath CGW-filepath
File path to read metadata
--hostor--CGW_hostnameHostname of the server
-uor--CGW_usernameUsername of Content Gateway
-Por--CGW_passwordPassword for Content Gateway
-for--CGW_filepathFile path to read metadata
Example
A typical invocation to push a metadata would look like this:
push-cgw-metadata \
--CGW_hostname https://content-gateway/example.com \
--CGW_username admin \
--CGW_password XXXXX \
--CGW_filepath Users/example/cgw/cgw_push.yaml
YAML file formats
One can Add, Update and Delete the contents from CGW The YAML file can consist details of Products, Versions and Files. Please refer YAML file entities formats for more details.