Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Update License

view on GitHub

Update License is available as both a pgutil command and an HTTP Request, and will update a specified license using the License object properties defined in the request body.

Command Specification (CLI)

The licenses detection command set is used to update a license by adding or removing detection types. There are two commands available:

Command Description
add Adds a spdx, url, packagename or purl detection type
remove Removes a spdx, url, packagename or purl detection type`

The --code, --type, and --value options are always required.

Adding a PUrl detection type to a license requires the license code (e.g. ABC-1.0), the detection type (e.g purl), and the value (e.g. pkg:nuget/myNugetPackage@1.2.3):

pgutil licenses detection add --code=ABC-1.0 --type=purl --value=pkg:nuget/myNugetPackage@1.2.3

Removing an SPDX detection type to a license requires the license code (e.g. ABC-1.0), the detection type (e.g spdx), and the value (e.g. MIT):

pgutil licenses detection remove --code=ABC-1.0 --type=spdx --value=MIT

Updating License Files

The licenses files command set is used to add, remove, or view license files in a license. There are two commands available:

Command Description Required Options
add Uploads a license file to ProGet --code, --file
delete Removes a license file from ProGet --hash

Adding a license file to a license requires the license code (e.g. ABC-1.0) and the file (e.g. C:\documents\license-files\abc-1.0-license-file.txt):

pgutil licenses files add --code=ABC-1.0 --file=C:\documents\license-files\abc-1.0-license-file.txt

Deleting a license file requires the license file's hash (e.g. 00462de3d7b6f3e5551a69ae84344bc69d23c02e1353be3e8445d16f025e523b):

pgutil licenses files delete --hash=00462de3d7b6f3e5551a69ae84344bc69d23c02e1353be3e8445d16f025e523b

HTTP Request Specification

To update a license, simply POST to the URL with the license id, an appropriate API Key and a License object as the request body.

This endpoint supports partial updating by only updating the properties that are supplied in the request.

POST /api/licenses/update

HTTP Response Specification

A successful (200) response body will be empty.

Response Details
200 (Success) update succeeded
400 (Invalid Input) indicates invalid or missing properties in the request; the body will provide some details as text
403 (Unauthorized API Key) indicates a missing, unknown, or unauthorized API Key; the body will be empty
404 (License Not Found) indicates that the specified license does not exist