Giter VIP home page Giter VIP logo

pubtools-content-gateway's Introduction

Overview

Set of scripts used for operating with the Content Gateway (CGW) service

Details

content-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.

The internal service which utilizes this library is called rcm-pub.


Requirements

  • Python 3.9+

Setup

$ pip install -r requirements.txt
$ pip install .
or
$ python setup.py install

Steps to use

  1. Setup
  2. Create a YAML file with required entries for Products, Versions or Files (See :doc:`entrypoints_reference` for more details)
  3. Use push-cgw-metadata entrypoint to do the push operation

Example

Example YAML file

In this example we are creating one product. We have created this cgw_example.yaml file with the following content

- type: product                                             # MANDATORY
  state: create                                             # MANDATORY
  metadata:
    name: "Test Product"                                    # MANDATORY
    productCode: "TestProduct"                              # MANDATORY
    homepage: "https://test.com/"                           # OPTIONAL
    downloadpage: "https://test.com/"                       # OPTIONAL
    thankYouPage: "https://test.com/"                       # OPTIONAL
    eloquaCode: "NOT_SET"                                   # OPTIONAL
    featuredArtifactType: "Server"                          # OPTIONAL
    thankYouTimeout: 5

Use of entrypoint

push-cgw-metadata (:doc:`entrypoints_reference`) entrypoint needs to be invoked to do the pushes. The below is an example of its invocation

push-cgw-metadata -host https://content-gateway/example.com \
                  -p XXXXX \
                  -u username \
                  -f full_path_to_yaml_file/cgw_example.yaml

2022-09-21 12:29:01,508 [INFO    ] Data validation successful for product: TestProduct
2022-09-21 12:29:01,508 [DEBUG   ] Fetching for product_id of product_name:- Test Product and product_code:- TestProduct

2022-09-21 12:29:01,515 [DEBUG   ] Starting new HTTPS connection (1): content-gateway/example.com:443
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
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
2022-09-21 12:29:03,808 [INFO    ] Created a new product with product_id:- 4009801

2022-09-21 12:29:03,808 [DEBUG   ] Updating the invisible attribute of the created records
2022-09-21 12:29:03,808 [DEBUG   ] Enabling the created records if required

2022-09-21 12:29:03,808 [INFO    ]
All CGW operations are successfully completed...!

We can see in the logs that the product is created with some ID.

pubtools-content-gateway's People

Contributors

jalam453 avatar midnightercz avatar emilyzheng avatar sdaley1234 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.