Product Commands - project-ncl/pnc-cli GitHub Wiki

###create-product### Create a new Product in PNC. #####Required Parameters#####

  • Product name: Name for the new Product

#####Optional Parameters#####

  • Description (-d / --description): Description of the new Product.
  • Abbreviation (-a / --abbreviation): Official abbreviation or short name of the new Product.
  • Product Code (-p / --product-code): Product Code for the new Product.
  • PGM System Name (-sn / --pgm-system-name): PGM System Name for the new Product.
  • Product version IDs (-pvids / --product-version-ids): Space separated list of Product Version IDs to associate with the new Product. Example: -pvids 1 2 3 4 would associate the new Product with Product Version IDs 1 through 4.
[[thauser] [16:54:47] ~]$pnc create-product 'test_product_name' -d 'test-description here' -a 'tp' -p 'tpp' -sn 'test'
{'abbreviation': 'tp',
 'description': 'test-description here',
 'id': 2,
 'name': 'test_product_name',
 'pgm_system_name': 'test',
 'product_code': 'tpp',
 'product_version_ids': []}

###update-product### Update an existing product with new values for the given fields. #####Required Parameters#####

  • Product id: ID of the product to modify

#####Optional Parameters#####

  • Description (-d / --description): New description.
  • Abbreviation (-a / --abbreviation): New abbreviation.
  • Product code (-p / --product-code): New product code.
  • PGM System Name (-sn / --pgm-system-name): New PGM system name.

###get-product### Retrieve JSON payload about a specific product. #####Required Parameters##### This command requires one of the following:

  • Product ID (-i /--id)
  • Product Name (-n / --name)
[[thauser] [17:10:48] ~]$pnc get-product -i 2
{'abbreviation': 'tp',
 'description': 'test-description here',
 'id': 2,
 'name': 'test_product_name',
 'pgm_system_name': 'test',
 'product_code': 'tpp',
 'product_version_ids': []}

###list-products### Lists all products in this PNC instance.

#####Optional Parameters#####

  • Page size (-p / --page-size): The maximum amount of Products that will be returned per "page". Default 200.
  • Sort (-s / --sort): RSQL query to define the order of returned Products
  • Query (-q): RSQL query to filter returned results
[[thauser] [17:11:38] ~]$pnc list-products
{'abbreviation': 'PNC',
 'description': 'Example Product for Project Newcastle Demo',
 'id': 1,
 'name': 'Project Newcastle Demo Product',
 'pgm_system_name': 'newcastle',
 'product_code': 'PNC',
 'product_version_ids': [1]}
{'abbreviation': 'tp',
 'description': 'test-description here',
 'id': 2,
 'name': 'test_product_name',
 'pgm_system_name': 'test',
 'product_code': 'tpp',
 'product_version_ids': []}

###list-versions-for-product### List all ProductVersions for the given Product

#####Required Parameters##### This command requires one of the following (but not both):

  • Product ID: ID of the Product to list ProductVersions of.
  • Product name: Name of the Product to list ProductVersions of.

#####Optional Parameters##### TODO no working in code atm.

[[thauser] [16:31:48] ~]$pnc list-versions-for-product -i 1
{'build_configuration_sets': [{'build_configuration_ids': [4],
                               'id': 2,
                               'name': 'Fabric Build Group',
                               'product_version_id': 1},
                              {'build_configuration_ids': [1, 2, 3],
                               'id': 1,
                               'name': 'Example Build Group 1',
                               'product_version_id': 1}],
 'build_configurations': [],
 'current_product_milestone_id': 1,
 'id': 1,
 'product_id': 1,
 'product_milestones': [{'distributed_build_record_set_id': 1,
                         'download_url': None,
                         'end_date': None,
                         'id': 1,
                         'performed_build_record_set_id': 2,
                         'planned_end_date': None,
                         'product_release_id': 1,
                         'product_version_id': 1,
                         'starting_date': None,
                         'version': '1.0.0.Build1'}],
 'product_releases': [{'download_url': None,
                       'id': 1,
                       'product_milestone_id': 1,
                       'product_version_id': 1,
                       'release_date': None,
                       'support_level': 'EARLYACCESS',
                       'version': '1.0.0.GA'}],
 'version': '1.0'}