Push Staged CGW Module

The push-staged-cgw is a target entrypoint for Push Staged which will be invoked through Red Hat’s internal service called rcm-pub.

All the user credentials will be received through the argument target_settings consisting of server_name, username and password. It shares the same YAML file structure except downloadURL user need to pass pushItemPath.

class pubtools._content_gateway.push_staged_cgw.PushStagedCGW(source_urls, target_name, target_settings)[source]

Bases: PushBase

Handle push staged CGW workflow.

pulp_item_push_finished(pulp_units, push_item)[source]

Invoked during task execution after successful completion of all Pulp publishes.

This hook is invoked for every push item, to indicate that all Pulp content associated with the task is considered fully up-to-date. The intended usage is to flush Pulp-derived caches or to notify systems that Pulp content may have recently changed.

Parameters:
  • pulp_push_item (Pulp object) – push item from the pulp.

  • push_item (list) – push item.

push_staged_operations()[source]

Initiate the CGW operations for push staged. Operations such as create, update or delete on products, versions and files would be performed.

pubtools._content_gateway.push_staged_cgw.entry_point(source_urls, target_name, target_settings)[source]

Entrypoint for CGW push stage.

YAML file formats

The user can pass a single or multiple records of product, version and files in a single YAML file. A typical YAML format for Product, version and file looks like this:

# YAML file formats for File
- type: file                                                # MANDATORY
  state: create                                             # MANDATORY
  metadata:
    type: "FILE"                                            # MANDATORY
    productName: "Test Product"                             # MANDATORY
    productCode: "TestProduct"                              # MANDATORY
    productVersionName: "TestProductVersion"                # MANDATORY
    description: "Test description"                         # OPTIONAL
    label: "Release Info"                                   # OPTIONAL
    order: 0                                                # OPTIONAL
    hidden: false                                           # OPTIONAL
    pushItemPath: "/content/origin/files/TestProduct/"      # MANDATORY
    shortURL: "/test-1/example-v4/testing/"                 # OPTIONAL
    differentProductThankYouPage: "Any Thank You Page"      # OPTIONAL

... # other records