Obligations REST API
Use this REST API to manage the Obligations for a component.
Methods Supported:
GET
POST
DELETE
GET a Component Obligation
Use this method to retrieve the Obligation details for a component, by specifying the obligation name (e.g. “Inclusion of Copyright”) and the component identifier.
GET /api/experimental/licenseLegalMetadata/{ownerType: application|organization}/{ownerId}/component/obligation
Example:
curl -u username:password 'http://localhost:8070/api/experimental/licenseLegalMetadata/application/client-frameworks/component/obligation?componentIdentifier=%7B%22format%22%3A%22pypi%22%2C%22coordinates%22%3A%7B%22extension%22%3A%22whl%22%2C%22name%22%3A%22anyio%22%2C%22qualifier%22%3A%22py3-none-any%22%2C%22version%22%3A%223.6.1%22%7D%7D&obligationName=Inclusion%20of%20Copyright' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.9,es;q=0.8'
The response contains the obligation status, comment, and last modification details (date and user).
Update Component Obligation Status
Use the POST method modify the obligation status and comments for a component by specifying the obligation name and the component identifier.
POST /api/experimental/licenseLegalMetadata/{ownerType: application|organization}/{ownerId}/component/obligation
Example:
curl -u username:password -H 'Accept: application/json, text/plain, */*' -H 'Content-Type: application/json' 'http://localhost:8070/api/experimental/licenseLegalMetadata/organization/ROOT_ORGANIZATION_ID/component/obligation' --data-raw '{"componentIdentifier":{"format":"pypi","coordinates":{"extension":"whl","name":"anyio","qualifier":"py3-none-any","version":"3.6.1"}},"name":"Inclusion of Copyright","comment":"","status":"IGNORED"}'
Bulk Update of Legal Obligations for Multiple Components
Use the POST method to update the legal obligation status and comments for multiple components in a single call, by specifying the component identifier and obligation name for each component.
POST /api/experimental/licenseLegalMetadata/{ownerType: application|organization}/{ownerId}/component/obligations
Example:
curl -u username:password 'http://localhost:8070/api/experimental/licenseLegalMetadata/application/client-frameworks/component/obligations' -H 'Accept: application/json, text/plain, */*' -H 'Content-Type: application/json' --data-raw '[{"id":null,"componentIdentifier":{"format":"pypi","coordinates":{"extension":"whl","name":"anyio","qualifier":"py3-none-any","version":"3.6.1"}},"name":"Inclusion of Copyright","comment":"This is a comment.","status":"FULFILLED"},{"id":null,"componentIdentifier":{"format":"pypi","coordinates":{"extension":"whl","name":"anyio","qualifier":"py3-none-any","version":"3.6.1"}},"name":"Inclusion of Notice","comment":"This is a comment.","status":"FULFILLED"},{"id":null,"componentIdentifier":{"format":"pypi","coordinates":{"extension":"whl","name":"anyio","qualifier":"py3-none-any","version":"3.6.1"}},"name":"Inclusion of License","comment":"This is a comment.","status":"FULFILLED"},{"id":null,"componentIdentifier":{"format":"pypi","coordinates":{"extension":"whl","name":"anyio","qualifier":"py3-none-any","version":"3.6.1"}},"name":"Existing Liability","comment":"This is a comment.","status":"FULFILLED"}]'
Delete Obligation Status
Use this method to delete the obligation status for a component, by specifying the component obligation ID.
DELETE /api/experimental/licenseLegalMetadata/component/obligation
Example:
curl -u username:password 'http://localhost:8070/api/experimental/licenseLegalMetadata/component/obligation?componentObligationId=dc804e75a1914a9191ea594b175433b9' -X 'DELETE' -H 'Accept: application/json, text/plain, */*'