### Get Project Summary and Administration Info Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieve summary and administration details for a project using a GET request. This example shows the cURL command. ```bash curl -X GET "http://localhost:8081/sw360/api/v1/projects/6070171a7370727361626162/summary" -H "accept: application/json" ``` -------------------------------- ### Install Highlight.js via npm Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/highlight/README.md Install the Highlight.js library using npm for use in your Node.js project. ```bash npm install highlight.js --save ``` -------------------------------- ### Install Thrift Runtime Source: https://github.com/eclipse/sw360/blob/main/README.md Run this script if you cannot install the thrift 0.20 runtime directly. It requires a C++ dev environment and cmake. ```bash ./third-party/thrift/install-thrift.sh ``` -------------------------------- ### Get Project with Dependencies Network Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieve a single project along with its dependencies network using a GET request. This example shows the cURL command. ```bash curl -X GET "http://localhost:8081/sw360/api/v1/projects/6070171a7370727361626162?dependency_network=true" -H "accept: application/json" ``` -------------------------------- ### Get Components by Type Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Example cURL request to retrieve components by their type. Ensure the content type is set to 'application/json'. ```bash curl -X GET \ 'http://localhost:8081/sw360/api/v1/components?type=library' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Define GET request with URL Source: https://github.com/eclipse/sw360/blob/main/clients/http-support/src/site/markdown/index_http.md Example of defining a simple GET request by setting only the URI using the RequestBuilder. ```java httpClient.execute(builder -> builder.uri("https://www.google.com"), ... ``` -------------------------------- ### Get Resources Using a Project Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves a list of all projects that utilize the specified project. This is a GET request. ```http GET /sw360/resource/api/v1/projects/6341114351295507717/usedby HTTP/1.1 Host: localhost:8080 Accept: application/json ``` -------------------------------- ### Get License Info Header Text Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Fetch the default license info header text using a GET request. This example demonstrates the cURL command. ```bash curl -X GET "http://localhost:8081/sw360/api/v1/projects/licenseheader" -H "accept: application/json" ``` -------------------------------- ### Example Search Response Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/search.adoc This is an example of a successful HTTP response when listing search results. It contains a list of found items. ```json { "count": 1, "limit": 20, "offset": 0, "result": [ { "id": "a1b2c3d4e5f67890a1b2c3d4e5f67890", "name": "test", "type": "component", "link": "http://localhost:8080/sw360/api/v1/components/a1b2c3d4e5f67890a1b2c3d4e5f67890" } ] } ``` -------------------------------- ### Download Project Report Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Download a project report using a GET request. Query parameters can be used to specify report details. This example shows the cURL command. ```bash curl -X GET "http://localhost:8081/sw360/api/v1/projects/6070171a7370727361626162/report?format=pdf" -H "accept: application/octet-stream" ``` -------------------------------- ### Get Download License Info with All Attachments Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves license information for a project, including all associated attachments. This is a GET request. ```http GET /sw360/resource/api/v1/projects/6341114351295507717/downloadLicenseInfo?allAttachments=true HTTP/1.1 Host: localhost:8080 Accept: application/json ``` -------------------------------- ### Get Resources Using a Release Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Retrieve a list of all resources where a specific release is utilized. This is a GET request. ```curl curl -X GET \ -H "Accept: application/json" \ -u "{username}:{password}" \ "https://{host}/sw360/api/v1/releases/{release_id}/usedby" ``` -------------------------------- ### GET /configurations Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/configurations.adoc Retrieves a list of all configurations available in the SW360 system. ```APIDOC ## GET /configurations ### Description Lists all configurations of SW360. ### Method GET ### Endpoint /configurations ``` -------------------------------- ### Example Request for Attachment Cleanup Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/attachmentCleanUp.adoc This is an example of a curl request to clean up all attachments. Ensure the correct endpoint is used. ```bash curl -X DELETE "http://localhost:8080/sw360/attachment/cleanup" ``` -------------------------------- ### Get Project Dependencies Network List View Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Use a GET request to retrieve a list view of a project's dependencies network. This operation does not require a request body. ```bash curl -X GET http://localhost:8080/sw360/api/v1/projects//dependencies/list ``` -------------------------------- ### Example Response for Attachment Cleanup Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/attachmentCleanUp.adoc This is an example of an HTTP response received after a successful attachment cleanup. It indicates that the operation was successful. ```http HTTP/1.1 200 Content-Length: 0 Date: Tue, 14 Nov 2023 10:00:00 GMT ``` -------------------------------- ### GET /api/projects?all_details=true Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves a list of all projects with all available details. ```APIDOC ## GET /api/projects?all_details=true ### Description A `GET` request will list all of the service's projects with all details. ### Method GET ### Endpoint /api/projects?all_details=true ### Parameters #### Query Parameters - **query_parameters** (string) - Optional - Parameters for filtering the project list. ### Response #### Success Response (200) - **response_fields** (object) - Structure detailing the fields returned in the response. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /components (with details) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Retrieves a list of all components including all available details. ```APIDOC ## GET /components ### Description Lists all of the service's components with all details. ### Method GET ### Endpoint /components ``` -------------------------------- ### GET /fossology/configuration Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/fossology.adoc Checks the current server configuration for Fossology. ```APIDOC ## GET /fossology/configuration ### Description Retrieves and checks the current server configuration for the Fossology resource. ### Method GET ### Endpoint /fossology/configuration ### Request Example curl -X GET /fossology/configuration ### Response #### Success Response (200) - **configuration** (object) - The current server configuration details. ``` -------------------------------- ### GET /components Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Retrieves a list of all components available in the service. ```APIDOC ## GET /components ### Description Lists all of the service's components. ### Method GET ### Endpoint /components ``` -------------------------------- ### Get Linked Resources in Project Dependency Network Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Use a GET request to retrieve linked resources (projects, releases) within a project's dependency network. This operation may require specific request parameters. ```bash curl -X GET http://localhost:8080/sw360/api/v1/projects//dependencies/resources?resourceType=PROJECT ``` -------------------------------- ### GET /licenses Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/licenses.adoc Lists all available licenses in the service. ```APIDOC ## GET /licenses ### Description A GET request will list all of the service's licenses. ### Method GET ### Endpoint /licenses ``` -------------------------------- ### Prepare SW360 Source Code Source: https://github.com/eclipse/sw360/blob/main/README.md Clone the SW360 repository, navigate into the directory, install pre-commit hooks, and set them up for development. ```bash git clone https://github.com/eclipse-sw360/sw360.git cd sw360 pip install pre-commit pre-commit install ``` -------------------------------- ### Constructing an HttpClientConfig and HttpClient Source: https://github.com/eclipse/sw360/blob/main/clients/http-support/src/site/markdown/index_http.md Demonstrates creating a verbose HttpClientConfig instance and initializing a new HttpClient using the HttpClientFactory. ```java HttpClientConfig config = HttpClientConfig.basicConfig() .withObjectMapper(new ObjectMapper()) .withProxySettings(ProxySettings.useProxy("proxy.example.com", 8080)); HttpClient client = HttpClientFactory.newHttpClient(config); ``` -------------------------------- ### Get Project Count Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieve the count of projects associated with a user via a GET request. This example shows the cURL command. ```bash curl -X GET "http://localhost:8081/sw360/api/v1/projects/count" -H "accept: application/json" ``` -------------------------------- ### Initialize Highlight.js on a web page Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/highlight/README.md Include the library and a stylesheet, then call initHighlightingOnLoad to automatically process code blocks. ```html ``` -------------------------------- ### Create New Project Source: https://context7.com/eclipse/sw360/llms.txt Creates a new project with specified metadata. The request body must be JSON, including at least the project 'name'. Use 'Authorization' and 'Content-Type' headers. ```bash curl -X POST "https://sw360.example.com/api/projects" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "My Software Project", "version": "1.0.0", "description": "A sample software project", "projectType": "PRODUCT", "visibility": "EVERYONE", "businessUnit": "Engineering", "tag": "backend,microservice" }' ``` -------------------------------- ### Get Single Component Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Example cURL request to fetch a single component by its ID. The response includes detailed information about the component. ```bash curl -X GET \ 'http://localhost:8081/sw360/api/v1/components/5a323895e4b0722770123456' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` -------------------------------- ### POST /api/projects/{projectId}/components/prepare-import-sbom Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Prepares to import an SBOM in SPDX format for a project. ```APIDOC ## POST /api/projects/{projectId}/components/prepare-import-sbom ### Description Prepares to import an SBOM in SPDX format for a project. ### Method POST ### Endpoint /api/projects/{projectId}/components/prepare-import-sbom ### Parameters #### Query Parameters - **type** (string) - Required - File type of SBOM. ### Request Body - **file** (file) - Required - Path of the SBOM file. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "SBOM preparation initiated successfully." } ``` ``` -------------------------------- ### GET /api/resources/importExport/download/release/sample Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/importExport.adoc Downloads the release link sample in CSV format. ```APIDOC ## GET /api/resources/importExport/download/release/sample ### Description A GET request to download the release link sample in csv format. ### Method GET ### Endpoint /api/resources/importExport/download/release/sample ### Response #### Success Response (200) - **file** (file) - The release link sample CSV file. #### Response Example (CSV file content) ``` -------------------------------- ### Get Component Attachment Info Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Example cURL request to retrieve attachment information for a specific component. The Accept header should be set to 'application/json'. ```bash curl -X GET \ 'http://localhost:8081/sw360/api/v1/components/5a323895e4b0722770123456/attachment-info' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` -------------------------------- ### License Header for New Files (Configuration Files) Source: https://github.com/eclipse/sw360/blob/main/CONTRIBUTING.md Use this format for license headers in configuration files. Adapt the comment style based on the file type. This example uses shell-style comments. ```shell # # Copyright Your Orgnisation, 202X. Part of the SW360 Portal Project. # # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 # ``` -------------------------------- ### GET /project/summary Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves the summary and administration page information for a project. ```APIDOC ## GET /project/summary ### Description A GET request will get summary and administration page of project tab. ### Method GET ### Endpoint /project/summary ``` -------------------------------- ### GET /vulnerabilities/status Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/vulnerabilities.adoc Get the vulnerability tracking status for a project. ```APIDOC ## GET /vulnerabilities/status ### Description Get a vulnerability tracking status for project. ### Method GET ### Endpoint /vulnerabilities/status ``` -------------------------------- ### Create Project with Dependencies Network Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Use a POST request to create a project along with its dependencies network. This operation requires a specific request structure. ```bash curl -X POST \ -H "Content-Type: application/json" \ -d "{\"name\":\"new-project\",\"description\":\"A new project with dependencies\"}" \ http://localhost:8080/sw360/api/v1/projects?dependenciesNetwork=true ``` -------------------------------- ### Retrieve All Project Details Source: https://context7.com/eclipse/sw360/llms.txt Fetches comprehensive details for all projects. Set 'allDetails' to true and include necessary authentication and accept headers. ```bash curl -X GET "https://sw360.example.com/api/projects?allDetails=true" \ -H "Authorization: Bearer " \ -H "Accept: application/hal+json" ``` -------------------------------- ### Get attachment information Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/attachments.adoc Retrieves details for a specific attachment using a GET request. ```bash $ curl 'http://localhost:8080/resource/attachments/1' -i -X GET -H 'Accept: application/json' ``` ```http HTTP/1.1 200 OK Content-Type: application/json { "id" : "1", "filename" : "test.txt", "_links" : { "self" : { "href" : "http://localhost:8080/resource/attachments/1" } } } ``` -------------------------------- ### Create Project Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Creates a new project using a POST request. ```bash include::{snippets}/should_document_create_project/curl-request.adoc[] ``` ```http include::{snippets}/should_document_create_project/http-response.adoc[] ``` -------------------------------- ### Get Attachment Usages of a Project Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves all attachment usages associated with a specific project. This is a GET request. ```http GET /sw360/resource/api/v1/projects/6341114351295507717/attachmentUsages?limit=100&offset=0 HTTP/1.1 Host: localhost:8080 Accept: application/json ``` -------------------------------- ### Build SW360 Docker Images Source: https://github.com/eclipse/sw360/blob/main/README_DOCKER.md Use the provided script to build the Thrift, binaries, and runtime images. ```sh ./docker_build.sh ``` ```sh ./docker_build.sh --cvesearch-host ``` ```sh DOCKER_IMAGE_ROOT=myregistry.com/sw360 ./docker_build.sh ``` -------------------------------- ### Create Component Source: https://context7.com/eclipse/sw360/llms.txt Creates a new software component in the catalogue. Requires details such as name, description, component type, categories, homepage, and programming languages. ```bash curl -X POST "https://sw360.example.com/api/components" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Apache Commons Lang", "description": "Apache Commons Lang provides helper utilities for java.lang API", "componentType": "OSS", "categories": ["library"], "homepage": "https://commons.apache.org/proper/commons-lang/", "languages": ["Java"] }' ``` -------------------------------- ### GET /myprojects Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves a list of all projects associated with the authenticated user. ```APIDOC ## GET /myprojects ### Description A `GET` request will list all projects associated to the user. ### Method GET ### Endpoint /myprojects ### Response #### Success Response (200) - **projects** (array) - A list of project objects associated with the user. #### Response Example ```json { "projects": [ { "id": "60d5ecf1b37f0c1234567890", "name": "My Project", "version": "1.0.0" } ] } ``` ``` -------------------------------- ### License Header for New Files (Java/C-style) Source: https://github.com/eclipse/sw360/blob/main/CONTRIBUTING.md Include this license header in all newly created files. Adapt the comment style based on the file type. This example uses C-style block comments. ```java /* * Copyright Your Orgnisation, 202X. Part of the SW360 Portal Project. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 */ ``` -------------------------------- ### Get License Clearing Count Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves the license clearing count for a specific project via a GET request. ```bash include::{snippets}/should_document_get_license_clearing_information/curl-request.adoc[] ``` ```http include::{snippets}/should_document_get_license_clearing_information/http-response.adoc[] ``` -------------------------------- ### List all users (curl) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/users.adoc Use this command to list all users in the service. No specific setup is required beyond having access to the API. ```bash curl -X GET https://localhost:8080/sw360/api/v1/users ``` -------------------------------- ### Build SW360 Keycloak SPI JARs with Maven Source: https://github.com/eclipse/sw360/blob/main/keycloak/README.md Use this Maven command to build the Keycloak SPI JARs, skipping tests and using the 'deploy' profile. Specify the Keycloak providers directory with the 'listener.deploy.dir' property. ```bash mvn clean install -DskipTests -Pdeploy -Dlistener.deploy.dir=/path/to/keycloak/providers ``` -------------------------------- ### GET /projects/download-license-info Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Downloads license information for the project, with optional template selection. ```APIDOC ## GET /projects/download-license-info ### Description A GET request is used to download license info for the project. Please set the request parameter `&template=` for variant `REPORT` to choose specific template. ### Method GET ### Endpoint /projects/download-license-info ### Parameters #### Query Parameters - **template** (string) - Optional - The name of the template to use for the report. ``` -------------------------------- ### List Releases for Multiple Projects Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Fetch releases for multiple projects by sending a GET request with an array of project IDs in the request body. ```bash curl -u "{user}:{password}" -X GET -H "Content-Type: text/uri-list" "{host}/sw360/api/projects/releases" --data-binary "{host}/sw360/api/projects/{projectId1} {host}/sw360/api/projects/{projectId2}" ``` -------------------------------- ### Execute a simplified GET request Source: https://github.com/eclipse/sw360/blob/main/clients/http-support/src/site/markdown/index_http.md Uses HttpUtils.get to perform a simple GET request without manual RequestBuilder configuration. ```java httpClient.execute(HttpUtils.get("https://my-server.com/endpoint"), ... ``` -------------------------------- ### List Releases with All Details (cURL) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc To retrieve releases along with all their associated details, append the `&allDetails=true` parameter to your GET request. This provides a comprehensive view of each release. ```bash curl -X GET \n http://localhost:8081/sw360/api/v1/releases?allDetails=true ``` -------------------------------- ### List All Releases (cURL) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Use this cURL command to list all releases available in the service. No specific parameters are required for a basic listing. ```bash curl -X GET \n http://localhost:8081/sw360/api/v1/releases ``` -------------------------------- ### List all configurations Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/configurations.adoc Retrieves a complete list of all SW360 configurations. ```bash $ curl 'http://localhost:8080/api/configurations' -i -X GET ``` ```http HTTP/1.1 200 OK Content-Type: application/json { "_embedded" : { "configurations" : [ { "key" : "sw360.test.key", "value" : "testValue", "changeable" : true }, { "key" : "sw360.test.key2", "value" : "testValue2", "changeable" : false } ] } } ``` -------------------------------- ### Get transitive linked releases via cURL Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Retrieves linked releases transitively for a specific release using a GET request. ```bash include::{snippets}/should_document_get_linked_releases_transitively/curl-request.adoc[] ``` ```http include::{snippets}/should_document_get_linked_releases_transitively/http-response.adoc[] ``` -------------------------------- ### Download license archive Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/licenses.adoc Retrieve the license archive via a GET request. ```curl include::{snippets}/should_document_get_download_license_archive/curl-request.adoc[] ``` ```http include::{snippets}/should_document_get_download_license_archive/http-response.adoc[] ``` -------------------------------- ### Get direct linked releases via cURL Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Retrieves direct linked releases for a specific release using a GET request. ```bash include::{snippets}/should_document_get_direct_linked_releases/curl-request.adoc[] ``` ```http include::{snippets}/should_document_get_direct_linked_releases/http-response.adoc[] ``` -------------------------------- ### Create a component Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Creates a new component using a POST request. ```asciidoc include::{snippets}/should_document_create_component/request-fields.adoc[] ``` ```asciidoc include::{snippets}/should_document_create_component/curl-request.adoc[] ``` ```asciidoc include::{snippets}/should_document_create_component/http-response.adoc[] ``` -------------------------------- ### List All Components Source: https://context7.com/eclipse/sw360/llms.txt Retrieves a paginated list of all software components. Supports filtering by name, categories, type, languages, vendors, and licenses using exact match or Lucene search. ```bash # List all components curl -X GET "https://sw360.example.com/api/components?page=0&size=20" \ -H "Authorization: Bearer " \ -H "Accept: application/hal+json" ``` ```bash # Search components with filters curl -X GET "https://sw360.example.com/api/components?name=log4j&type=OSS&luceneSearch=true" \ -H "Authorization: Bearer " \ -H "Accept: application/hal+json" ``` -------------------------------- ### Example Response for Duplicate Identifiers Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/databaseSanitation.adoc This is an example of the HTTP response you can expect when fetching duplicate identifiers. It shows the structure of the returned data. ```json { "duplicates": [ { "id": "67890", "name": "duplicate_resource_name" } ] } ``` -------------------------------- ### Get Release Assessment Summary Info Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Retrieve the assessment summary information for a release. This is a GET request and assumes a single CLI file. ```curl curl -X GET \ -H "Accept: application/json" \ -u "{username}:{password}" \ "https://{host}/sw360/api/v1/releases/{release_id}/assessmentSummary" ``` -------------------------------- ### POST /users Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/users.adoc Create a new user in the system. ```APIDOC ## POST /users ### Description A POST request will create a user (not in Liferay). ### Method POST ### Endpoint /users ``` -------------------------------- ### Optimize with Almond and r.js Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/highlight/README.md When using Almond as an AMD loader, you need to use the r.js optimizer to properly name and configure Highlight.js modules. ```bash r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js ``` -------------------------------- ### Example Healthy Service Response Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/health.adoc A successful health check returns a status of 'UP'. This example shows a typical response for a healthy service. ```json { "status": "UP" } ``` -------------------------------- ### Download Release Link Sample Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/importExport.adoc Retrieves the release link sample in CSV format via a GET request. ```bash $ curl 'http://localhost:8080/api/importExport/releaseSample' -i -X GET ``` ```http HTTP/1.1 200 OK Content-Type: text/csv;charset=UTF-8 Content-Length: 14 name,version,id ``` -------------------------------- ### Fetch Duplicate Identifiers via GET Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/databaseSanitation.adoc Use this GET request to retrieve duplicate identifiers from the database. Ensure the request is properly formatted. ```curl curl -X GET "http://localhost:8080/sw360/api/v1/resources/duplicates?resourceId=12345" ``` -------------------------------- ### List All Projects with Pagination Source: https://context7.com/eclipse/sw360/llms.txt Retrieves a paginated list of projects. Use the 'Authorization' header for authentication and 'Accept' for response format. ```bash curl -X GET "https://sw360.example.com/api/projects?page=0&size=10" \ -H "Authorization: Bearer " \ -H "Accept: application/hal+json" ``` -------------------------------- ### SW360 REST API - Error Response Example Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/api-guide.adoc This snippet shows an example of a 404 Not Found Error response body, which is returned when a requested resource does not exist. ```APIDOC ### Errors Whenever an error response (status code >= 400) is returned, the body will contain a JSON object that describes the problem. The error object has the following structure: // include::{snippets}/should_document_error_internal_error/response-fields.adoc[] For example, a request that attempts to get a non-existent project will produce a `404 Not Found Error` response: // include::{snippets}/should_document_error_internal_error/http-response.adoc[] ```json { "timestamp": "2023-10-27T10:00:00Z", "status": 404, "error": "Not Found", "message": "Project with id 'non-existent-project-id' not found.", "path": "/api/projects/non-existent-project-id" } ``` ``` -------------------------------- ### Get Download License Info without Release Version Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Downloads license information for a project, omitting component versions by setting `excludeReleaseVersion` to true. This is a GET request. ```http GET /sw360/resource/api/v1/projects/6341114351295507717/downloadLicenseInfo?excludeReleaseVersion=true HTTP/1.1 Host: localhost:8080 Accept: application/json ``` -------------------------------- ### Create Release Source: https://context7.com/eclipse/sw360/llms.txt Creates a new release (version) for an existing component. Requires the component ID, release name, version, main license IDs, source code download URL, and vendor ID. ```bash curl -X POST "https://sw360.example.com/api/releases" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Apache Commons Lang", "version": "3.12.0", "componentId": "{componentId}", "mainLicenseIds": ["Apache-2.0"], "sourceCodeDownloadurl": "https://archive.apache.org/dist/commons/lang/source/commons-lang3-3.12.0-src.tar.gz", "vendorId": "{vendorId}" }' ``` -------------------------------- ### Run FOSSology Container Source: https://github.com/eclipse/sw360/blob/main/README_DOCKER.md Command to start a FOSSology container connected to the sw360net network. ```sh docker run \ --network sw360net \ -p 8081:80 \ --name fossology \ -e FOSSOLOGY_DB_HOST= \ -e FOSSOLOGY_DB_USER= \ -e FOSSOLOGY_DB_PASSWORD= \ -d fossology/fossology ``` -------------------------------- ### Get SPDX License Info from Release Attachment (ISR) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Retrieve SPDX License Information from a release attachment of the Initial Scan Report (ISR) type. This is a GET request. ```curl curl -X GET \ -H "Accept: application/json" \ -u "{username}:{password}" \ "https://{host}/sw360/api/v1/releases/{release_id}/licenses/isr" ``` -------------------------------- ### Get Linked Releases in Project Dependency Network Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Use a GET request to retrieve linked releases within a project's dependency network. This operation does not require a request body. ```bash curl -X GET http://localhost:8080/sw360/api/v1/projects//dependencies/releases ``` -------------------------------- ### List Projects with All Details (cURL) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc This cURL command retrieves a list of all projects, including comprehensive details for each project. It's useful when detailed project information is needed. ```bash curl \ -i \ -X GET \ "http://localhost:8080/sw360/api/0.1/projects?details=true" ``` -------------------------------- ### Get SPDX License Info from Release Attachment (CLX/CLI) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Retrieve SPDX License Information from a release attachment of the Component license information (CLX or CLI) type. This is a GET request. ```curl curl -X GET \ -H "Accept: application/json" \ -u "{username}:{password}" \ "https://{host}/sw360/api/v1/releases/{release_id}/licenses/clx_cli" ``` -------------------------------- ### POST /api/projects Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Creates a new project with its dependencies network. ```APIDOC ## POST /api/projects ### Description Creates a new project with its dependencies network. ### Method POST ### Endpoint /api/projects ### Request Body (Fields to be documented from request-fields.adoc) ### Request Example (Example request from curl-request.adoc) ### Response #### Success Response (200) (Fields to be documented from http-response.adoc) #### Response Example (Example response from http-response.adoc) ``` -------------------------------- ### List All Components Source: https://context7.com/eclipse/sw360/llms.txt Retrieves a paginated list of all software components with optional filtering. ```APIDOC ## List All Components ### Description Retrieves a paginated list of all software components with optional filtering by name, categories, type, languages, vendors, and licenses. Supports both exact match and Lucene search modes. ### Method GET ### Endpoint /api/components ### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **size** (integer) - Optional - The number of items per page. - **name** (string) - Optional - Filter by component name. - **categories** (string) - Optional - Filter by component categories. - **type** (string) - Optional - Filter by component type. - **languages** (string) - Optional - Filter by component languages. - **vendors** (string) - Optional - Filter by component vendors. - **licenses** (string) - Optional - Filter by component licenses. - **luceneSearch** (boolean) - Optional - Enable Lucene search mode. ### Request Example ```bash curl -X GET "https://sw360.example.com/api/components?page=0&size=20" \ -H "Authorization: Bearer " \ -H "Accept: application/hal+json" curl -X GET "https://sw360.example.com/api/components?name=log4j&type=OSS&luceneSearch=true" \ -H "Authorization: Bearer " \ -H "Accept: application/hal+json" ``` ``` -------------------------------- ### Get Service Health Status Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/health.adoc Send a GET request to the health endpoint to retrieve the current health status of the service. The response structure mirrors the Spring Boot Actuator health object. ```http GET /health HTTP/1.1 Host: localhost:8080 Accept: application/json ``` -------------------------------- ### Execute GET Request with JSON Deserialization Source: https://github.com/eclipse/sw360/blob/main/clients/http-support/src/site/markdown/index_http.md Use this to execute a GET request and automatically deserialize the JSON response into a specified Java object. Ensure a Json object mapper is available and the target class is defined. ```java CompletableFuture response = httpClient.execute(HttpUtils.get(endpointUri()), HttpUtils.checkResponse(HttpUtils.jsonResult(mapper, JsonBean.class))); ``` -------------------------------- ### Import SPDX SBOM Request Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Import an SPDX SBOM file using a POST request. This example demonstrates the cURL command. ```bash curl -X POST "http://localhost:8081/sw360/api/v1/import/sbom?type=spdx" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/your/sbom.spdx" ``` -------------------------------- ### GET /users Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/users.adoc List all users in the service. ```APIDOC ## GET /users ### Description A GET request will list all of the service's users. ### Method GET ### Endpoint /users ``` -------------------------------- ### Get Indirect Linked Releases by Index Path Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Use a GET request to retrieve indirect linked releases of a project in its dependency network, specified by the release's index path. This operation may require specific request parameters. ```bash curl -X GET http://localhost:8080/sw360/api/v1/projects//dependencies/releases/indirect?indexPath=/path/to/release ``` -------------------------------- ### GET /project/report Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Downloads the report for a specific project. ```APIDOC ## GET /project/report ### Description A GET request help to download the projects report. ### Method GET ### Endpoint /project/report ``` -------------------------------- ### GET /projects/obligations Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Lists the license obligations of a project. ```APIDOC ## GET /projects/obligations ### Description A GET request will get license obligations of a project. ### Method GET ### Endpoint /projects/obligations ``` -------------------------------- ### POST /api/projects/{projectId}/components/import-sbom Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Imports an SBOM in SPDX format for a project. ```APIDOC ## POST /api/projects/{projectId}/components/import-sbom ### Description Imports an SBOM in SPDX format for a project. ### Method POST ### Endpoint /api/projects/{projectId}/components/import-sbom ### Parameters #### Query Parameters - **type** (string) - Required - File type of SBOM. ### Request Body - **file** (file) - Required - Path of the SBOM file. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "SBOM imported successfully." } ``` ``` -------------------------------- ### Download Project License Clearing Report Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Use a GET request to download a project's license clearing report. This operation may require specific query parameters. ```bash curl -X GET "http://localhost:8080/sw360/api/v1/projects//licenseclearing/report?format=xlsx" ``` -------------------------------- ### GET /components/externalIds Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Retrieves components by external IDs. ```APIDOC ## GET /components/externalIds ### Description A GET request will get all components corresponding to external ids. The request parameter supports MultiValueMap. Query parameter values must be URL encoded. ### Method GET ### Endpoint /components/externalIds ``` -------------------------------- ### GET /components Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Retrieves components filtered by type. ```APIDOC ## GET /components ### Description Retrieves a list of components filtered by their type. ### Method GET ### Endpoint /components ``` -------------------------------- ### GET /projects or /releases (allDetails parameter) Source: https://github.com/eclipse/sw360/blob/main/CHANGELOG.md Retrieves a list of projects or releases with all associated details in a single request. ```APIDOC ## GET /projects?allDetails=true ## GET /releases?allDetails=true ### Description Fetches a list of records with all details included in the response, reducing the need for multiple API calls. ### Method GET ### Endpoint /projects or /releases ### Parameters #### Query Parameters - **allDetails** (boolean) - Optional - If set to true, returns records with all associated details. ``` -------------------------------- ### List My Components API Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Lists all components associated with the user. ```APIDOC ## GET /api/mycomponents ### Description Lists all components associated with the user. ### Method GET ### Endpoint /api/mycomponents ### Response #### Success Response (200) - **components** (array) - A list of components associated with the user. - **id** (string) - The ID of the component. - **name** (string) - The name of the component. #### Response Example ```json { "components": [ { "id": "compA", "name": "My Component A" }, { "id": "compB", "name": "My Component B" } ] } ``` ``` -------------------------------- ### GET /vulnerabilities Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/vulnerabilities.adoc List all vulnerabilities available in the service. ```APIDOC ## GET /vulnerabilities ### Description List all of the service's vulnerabilities. ### Method GET ### Endpoint /vulnerabilities ``` -------------------------------- ### Create Release Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Creates a new release using a POST request. ```text include::{snippets}/should_document_create_release/request-fields.adoc[] ``` ```bash include::{snippets}/should_document_create_release/curl-request.adoc[] ``` ```http include::{snippets}/should_document_create_release/http-response.adoc[] ``` -------------------------------- ### GET /licenseTypes Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/licenses.adoc Lists all available license types. ```APIDOC ## GET /licenseTypes ### Description A GET request will list all of the service's licenseTypes. ### Method GET ### Endpoint /licenseTypes ``` -------------------------------- ### List Projects (cURL) Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Use this cURL command to list all projects in the SW360 service. No specific parameters are required for a basic listing. ```bash curl \ -i \ -X GET \ "http://localhost:8080/sw360/api/0.1/projects" ``` -------------------------------- ### POST /fossology/configuration Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/fossology.adoc Saves the Fossology configuration. ```APIDOC ## POST /fossology/configuration ### Description Saves the configuration for the Fossology resource. ### Method POST ### Endpoint /fossology/configuration ### Request Example curl -X POST /fossology/configuration ### Response #### Success Response (200) - **status** (string) - Indicates the success of the configuration save operation. ``` -------------------------------- ### GET /vendors Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/vendors.adoc List all vendors available in the service. ```APIDOC ## GET /vendors ### Description A GET request will list all of the service's vendors. ### Method GET ### Endpoint /vendors ``` -------------------------------- ### GET /components/recentComponents Source: https://github.com/eclipse/sw360/blob/main/CHANGELOG.md Retrieve a list of recently added components. ```APIDOC ## GET /components/recentComponents ### Description Returns a list of the most recently created components. ### Method GET ### Endpoint /components/recentComponents ``` -------------------------------- ### GET /releases/recentReleases Source: https://github.com/eclipse/sw360/blob/main/CHANGELOG.md Retrieve a list of recently added releases. ```APIDOC ## GET /releases/recentReleases ### Description Returns a list of the most recently created releases. ### Method GET ### Endpoint /releases/recentReleases ``` -------------------------------- ### List resources using a component Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/components.adoc Retrieves all resources where a specific component is used. ```asciidoc include::{snippets}/should_document_get_usedbyresource_for_components/response-fields.adoc[] ``` ```asciidoc include::{snippets}/should_document_get_usedbyresource_for_components/curl-request.adoc[] ``` ```asciidoc include::{snippets}/should_document_get_usedbyresource_for_components/http-response.adoc[] ``` -------------------------------- ### GET /projects/license-clearing Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves all releases of license clearing for a project. ```APIDOC ## GET /projects/license-clearing ### Description A GET request will get all releases of license clearing. ### Method GET ### Endpoint /projects/license-clearing ``` -------------------------------- ### POST /licenses Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/licenses.adoc Creates a new license. ```APIDOC ## POST /licenses ### Description A POST request will create a license. ### Method POST ### Endpoint /licenses ``` -------------------------------- ### POST /projects Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Creates a new project or a duplicate project. ```APIDOC ## POST /projects ### Description A POST request is used to create a project or a duplicate project. ### Method POST ### Endpoint /projects ``` -------------------------------- ### GET /projects/clearing-count Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves the license clearing count for a project. ```APIDOC ## GET /projects/clearing-count ### Description A GET request will get license clearing count of a project. ### Method GET ### Endpoint /projects/clearing-count ``` -------------------------------- ### GET /projects/{projectId} Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves details for a single project. ```APIDOC ## GET /projects/{projectId} ### Description A `GET` request will get a single project. ### Method GET ### Endpoint /projects/{projectId} ### Parameters #### Path Parameters - **projectId** (string) - Required - The ID of the project. ### Response #### Success Response (200) - **project** (object) - The project object with its details. #### Response Example ```json { "id": "60d5ecf1b37f0c1234567890", "name": "Example Project", "version": "1.0.0", "description": "This is an example project." } ``` ``` -------------------------------- ### List changeable configurations Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/configurations.adoc Retrieves configurations stored in the database that can be modified. ```text | Parameter | Description | |---|---| | changeable | true | ``` ```bash $ curl 'http://localhost:8080/api/configurations?changeable=true' -i -X GET ``` ```http HTTP/1.1 200 OK Content-Type: application/json { "_embedded" : { "configurations" : [ { "key" : "sw360.test.key", "value" : "testValue", "changeable" : true } ] } } ``` -------------------------------- ### GET /api/projects Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/projects.adoc Retrieves a list of all projects available in the service. ```APIDOC ## GET /api/projects ### Description A `GET` request will list all of the service's projects. ### Method GET ### Endpoint /api/projects ### Parameters #### Query Parameters - **query_parameters** (string) - Optional - Parameters for filtering the project list. ### Response #### Success Response (200) - **response_fields** (object) - Structure detailing the fields returned in the response. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Project Details by ID Source: https://context7.com/eclipse/sw360/llms.txt Retrieves detailed information for a specific project using its ID. Requires 'Authorization' header and 'Accept' for response format. ```bash curl -X GET "https://sw360.example.com/api/projects/{projectId}" \ -H "Authorization: Bearer " \ -H "Accept: application/hal+json" ``` -------------------------------- ### Create Package Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/packages.adoc Creates a new package using a POST request. ```APIDOC ## POST /api/packages ### Description Creates a new package. ### Method POST ### Endpoint /api/packages ### Request Body - **field** (type) - Required/Optional - Description include::{snippets}/should_document_create_package/request-fields.adoc[] ### Request Example ```bash curl -X POST \ '/api/packages' \ -H 'Content-Type: application/json' \ -d '{ "example": "request body" }' ``` ### Response #### Success Response (200) - **field** (type) - Description include::{snippets}/should_document_create_package/http-response.adoc[] ``` -------------------------------- ### Get a Single Release Source: https://github.com/eclipse/sw360/blob/main/rest/resource-server/src/docs/asciidoc/releases.adoc Retrieves details for a single release. ```APIDOC ## GET /api/releases/{releaseId} ### Description Retrieves the details of a single release. ### Method GET ### Endpoint /api/releases/{releaseId} ### Parameters #### Path Parameters - **releaseId** (string) - Required - The ID of the release to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the release. - **name** (string) - The name of the release. - **version** (string) - The version of the release. #### Response Example ```json { "id": "release123", "name": "Example Release", "version": "1.0.0" } ``` ```