{"id":20314494,"url":"https://github.com/release-engineering/pubtools-content-gateway","last_synced_at":"2025-09-13T22:16:32.291Z","repository":{"id":38451579,"uuid":"478854952","full_name":"release-engineering/pubtools-content-gateway","owner":"release-engineering","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-29T08:38:42.000Z","size":3138,"stargazers_count":1,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T09:54:30.347Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/release-engineering.png","metadata":{"files":{"readme":"docs/README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-07T06:27:14.000Z","updated_at":"2024-10-29T08:37:33.000Z","dependencies_parsed_at":"2024-04-08T17:43:51.157Z","dependency_job_id":"6d6e1adf-9f7a-4f50-b7d8-a668859df2e2","html_url":"https://github.com/release-engineering/pubtools-content-gateway","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpubtools-content-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpubtools-content-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpubtools-content-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpubtools-content-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/release-engineering","download_url":"https://codeload.github.com/release-engineering/pubtools-content-gateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447600,"owners_count":21105140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:15:35.081Z","updated_at":"2025-04-11T17:17:28.069Z","avatar_url":"https://github.com/release-engineering.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===============\n    Overview\n===============\n\nSet of scripts used for operating with the Content Gateway (CGW) service\n\nDetails\n============\n\ncontent-gateway is a library used for performing various content workflows related work. The library is utilized by Red Hat's internal tooling or release engineers for pushing and managing the contents of products, versions and files on the content gateway server.\n\nThe internal service which utilizes this library is called `rcm-pub`.\n\n--------------------------------\n\n\nRequirements\n============\n\n- Python 3.9+\n\n--------------------------------\n\n\nSetup\n=====\n\n::\n\n  $ pip install -r requirements.txt\n  $ pip install .\n  or\n  $ python setup.py install\n\n-----------------------------\n\n\nSteps to use\n============\n\n1) Setup\n2) Create a YAML file with required entries for Products, Versions or Files (See :doc:`entrypoints_reference` for more details)\n3) Use *push-cgw-metadata* entrypoint to do the push operation\n3a) CGW password must be provided as an argument or set as the 'CGW_PASSWORD' environment variable.\n\n\nExample\n--------------\n\nExample YAML file\n....................\nIn this example we are creating one product.\nWe have created this `cgw_example.yaml` file with the following content\n\n.. code-block::\n\n    - type: product                                             # MANDATORY\n      state: create                                             # MANDATORY\n      metadata:\n        name: \"Test Product\"                                    # MANDATORY\n        productCode: \"TestProduct\"                              # MANDATORY\n        homepage: \"https://test.com/\"                           # OPTIONAL\n        downloadpage: \"https://test.com/\"                       # OPTIONAL\n        thankYouPage: \"https://test.com/\"                       # OPTIONAL\n        eloquaCode: \"NOT_SET\"                                   # OPTIONAL\n        featuredArtifactType: \"Server\"                          # OPTIONAL\n        thankYouTimeout: 5\n\n\nUse of entrypoint\n....................\n``push-cgw-metadata`` (:doc:`entrypoints_reference`) entrypoint needs to be invoked to do the pushes.\nThe below is an example of its invocation\n\n.. code-block::\n\n  push-cgw-metadata -host https://content-gateway/example.com \\\n                    -p XXXXX \\\n                    -u username \\\n                    -f full_path_to_yaml_file/cgw_example.yaml\n\n  2022-09-21 12:29:01,508 [INFO    ] Data validation successful for product: TestProduct\n  2022-09-21 12:29:01,508 [DEBUG   ] Fetching for product_id of product_name:- Test Product and product_code:- TestProduct\n\n  2022-09-21 12:29:01,515 [DEBUG   ] Starting new HTTPS connection (1): content-gateway/example.com:443\n  2022-09-21 12:29:03,183 [DEBUG   ] https://content-gateway/example.com:443 \"GET /content-gateway/rest/admin/products HTTP/1.1\" 200 None\n  2022-09-21 12:29:03,808 [DEBUG   ] https://content-gateway/example.com:443 \"PUT /content-gateway/rest/admin/products/ HTTP/1.1\" 201 7\n  2022-09-21 12:29:03,808 [INFO    ] Created a new product with product_id:- 4009801\n\n  2022-09-21 12:29:03,808 [DEBUG   ] Updating the invisible attribute of the created records\n  2022-09-21 12:29:03,808 [DEBUG   ] Enabling the created records if required\n\n  2022-09-21 12:29:03,808 [INFO    ]\n  All CGW operations are successfully completed...!\n\nWe can see in the logs that the product is created with some ID.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-engineering%2Fpubtools-content-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelease-engineering%2Fpubtools-content-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-engineering%2Fpubtools-content-gateway/lists"}