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

#License Commands# update-license needs fixing.

###create-license### Create a new License.

#####Required Parameters#####

  • Full Name: Full Name for the License to add.
  • Full Content: Content of the License.

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

  • Reference URL (-r / --ref-url): Reference URL of the new License.
  • Short Name (-sn / --short-name): Short name / abbreviation for the new License.
  • Project IDs (-pids / --projects-ids): Space separated list of Projects this License should be associated with.
[[thauser] [16:00:51] pnc-cli (master)]$pnc create-license 'test license' 'test content' 
{'full_content': 'test content',
 'full_name': 'test license',
 'id': 3,
 'projects_ids': [],
 'ref_url': None,
 'short_name': None}

###update-license### Updates an existing License with new values.

#####Required Parameters#####

  • License ID: ID of the License to update.

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

  • Full Name (-n / --full-name): New name for the License.
  • Full Content (-c / --full-content): New full content of the License.
  • Reference URL (-r / --ref-url): New Reference URL for the License.
  • Short Name (-sn / --short-name): New Short Name for the License.
  • Project IDs (-pids / --project-ids): Space separated list of Projects which are governed by this License.

###delete-license### Remove a License from PNC.

#####Required Parameters#####

  • License ID: ID of the License to retrieve.
[[thauser] [15:51:50] ~]$pnc delete-license 2
[[thauser] [15:51:56] ~]$pnc get-license -i 2
2016-03-03 15:52:19,832 ERROR No License with ID 2 exists.

###get-license### Get a JSON payload of a specific License.

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

  • ID (-i / --id): ID of the License to retrieve.
  • Name (-n / --name): Name of the License to retrieve.
[[thauser] [15:50:24] ~]$pnc get-license -i 1
{'full_content': 'test content',
 'full_name': 'test license',
 'id': 1,
 'projects_ids': [10],
 'ref_url': None,
 'short_name': None}

###list-licenses### Lists all Licenses in the PNC instance.

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

  • Page size (-p / --page-size): The maximum amount of Build Configurations that will be returned per "page". Default 200.
  • Sort (-s / --sort): RSQL query to define the order of returned Build Configurations
  • Query (-q): RSQL query to filter returned results
[[thauser] [15:47:32] ~]$pnc list-licenses
{'full_content': 'test content',
 'full_name': 'test license',
 'id': 1,
 'projects_ids': [10],
 'ref_url': None,
 'short_name': None}