License Override REST API
Use the endpoints on this page to manage the license overrides for a component.
Methods Supported:
Change the License Override
You can update the license override using the POST method.
Permissions required: Change Licenses
POST /api/v2/licenseOverride/{ownerType}/{ownerId}
The JSON payload consists of:
Field | Description |
---|---|
ownerID | The ID for the application, organization or repository. |
comment | The comment for license override. |
licenseIds | A list of all license IDs to be updated. |
componentIdentifier | The component identifier consisting of format and coordinates. |
status | The status to be assigned to the component license. Allowed values for status are |
Example:
curl --location 'http://localhost:8070/api/v2/licenseOverride/application/apptest' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <USER_PASS_BASIC_TOKEN>' \ --data-raw '{ "componentIdentifier": { "format": "a-name", "coordinates": { "name": "@microsoft/applicationinsights-teechannel-js", "qualifier": "", "version": "3.0.0-beta.2304-07" } }, "comment": "sañañañañañaññañañañ", "licenseIds": ["123-OSO-MIT-PL-2.0", "42-Unlicense"], "status": "OVERRIDDEN" }'
Response:
The response contains the updated license override status and the licenseOverrideID as id.
{ "id": "a2449b221c394553865b93d276b0d2fc", "ownerId": "f575f8cec94445b29c564e2cec617e7f", "comment": "sañañañañañaññañañañ", "licenseIds": [ "42-Unlicense", "123-OSO-MIT-PL-2.0" ], "componentIdentifier": { "format": "a-name", "coordinates": { "name": "@microsoft/applicationinsights-teechannel-js", "qualifier": "", "version": "3.0.0-beta.2304-07" } }, "status": "OVERRIDDEN" }
Retrieve the Override for Component License
Use the GET method to retrieve the license override for the component license, by specifying the component identifier.
Permissions required: View IQ Elements
GET /api/v2/licenseOverride/{ownerType}/{ownerId}
Example:
curl --location --globoff 'http://localhost:8070/api/v2/licenseOverride/application/apptest?componentIdentifier={%22format%22%3A%20%22a-name%22%2C%0A%20%20%20%20%20%22coordinates%22%3A%20{%0A%20%20%20%20%20%20%20%20%22name%22%3A%20%22%40microsoft%2Fapplicationinsights-teechannel-js%22%2C%0A%20%20%20%20%20%20%20%20%22qualifier%22%3A%20%22%22%2C%0A%20%20%20%20%20%20%20%20%22version%22%3A%20%223.0.0-beta.2304-07%22%0A%20%20%20%20%20%20}%0A%20%20%20}' \ --header 'Authorization: Basic <BASIC_TOKEN>'
Response
The response contains details for the overrides that were applied to the component license.
{ "licenseOverridesByOwner": [ { "ownerId": "apptest", "ownerName": "apptest", "ownerType": "application", "licenseOverride": { "id": "a2449b221c394553865b93d276b0d2fc", "ownerId": "f575f8cec94445b29c564e2cec617e7f", "status": "OVERRIDDEN", "comment": "sañañañañañaññañañañ", "licenseIds": [ "123-OSO-MIT-PL-2.0", "42-Unlicense" ], "componentIdentifier": { "format": "a-name", "coordinates": { "name": "@microsoft/applicationinsights-teechannel-js", "qualifier": "", "version": "3.0.0-beta.2304-07" } } } }, { "ownerId": "86d4db175f67424b99a2a7adc83df79e", "ownerName": "org3", "ownerType": "organization", "licenseOverride": null }, { "ownerId": "ROOT_ORGANIZATION_ID", "ownerName": "Root Organization", "ownerType": "organization", "licenseOverride": { "id": "f15c58e5636044ceb6ef765a7d2bb35b", "ownerId": "ROOT_ORGANIZATION_ID", "status": "OVERRIDDEN", "comment": "sañañañañañaññañañañ", "licenseIds": [ "123-OSO-MIT-PL-2.0", "42-Unlicense" ], "componentIdentifier": { "format": "a-name", "coordinates": { "name": "@microsoft/applicationinsights-teechannel-js", "qualifier": "", "version": "3.0.0-beta.2304-07" } } } } ] }
Delete a License Override
Use the DELETE method to remove a license override for a component by specifying the licenseOverrideID
. The licenseOverrideID
can be retrieved using the GET method above.
Permisisons required: Change Licenses
DELETE /api/v2/licenseOverride/{ownerType}/{ownerId}/{licenseOverrideId}
Example:
curl --location --request DELETE 'http://localhost:8070/api/v2/licenseOverride/application/apptest/<LICENSE_OVERRIDE_ID>' \ --header 'Authorization: Basic <BASIC_TOKEN>'
Response
The response code 204 indicates that the license override was deleted successfully.