Skip to content

Latest commit

 

History

History
138 lines (88 loc) · 3.92 KB

ComponentVulnerabilityReportsAPI.md

File metadata and controls

138 lines (88 loc) · 3.92 KB

\ComponentVulnerabilityReportsAPI

All URIs are relative to https://ossindex.sonatype.org

Method HTTP request Description
Post Post /api/v3/component-report Request vulnerability reports for components
Post1 Post /api/v3/authorized/component-report Request vulnerability reports for components

Post

[]ComponentReport Post(ctx).Body(body).Execute()

Request vulnerability reports for components

Example

package main

import (
	"context"
	"fmt"
	"os"
	ossindex "github.com/sonatype-nexus-community/ossindex-api-client-go"
)

func main() {
	body := *ossindex.NewComponentReportRequest([]string{"Coordinates_example"}) // ComponentReportRequest |  (optional)

	configuration := ossindex.NewConfiguration()
	apiClient := ossindex.NewAPIClient(configuration)
	resp, r, err := apiClient.ComponentVulnerabilityReportsAPI.Post(context.Background()).Body(body).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComponentVulnerabilityReportsAPI.Post``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `Post`: []ComponentReport
	fmt.Fprintf(os.Stdout, "Response from `ComponentVulnerabilityReportsAPI.Post`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostRequest struct via the builder pattern

Name Type Description Notes
body ComponentReportRequest

Return type

[]ComponentReport

Authorization

apiToken, basicAuth

HTTP request headers

  • Content-Type: application/json, application/vnd.ossindex.component-report-request.v1+json
  • Accept: application/json, application/vnd.ossindex.component-report-request.v1+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Post1

[]ComponentReport Post1(ctx).Body(body).Execute()

Request vulnerability reports for components

Example

package main

import (
	"context"
	"fmt"
	"os"
	ossindex "github.com/sonatype-nexus-community/ossindex-api-client-go"
)

func main() {
	body := *ossindex.NewComponentReportRequest([]string{"Coordinates_example"}) // ComponentReportRequest |  (optional)

	configuration := ossindex.NewConfiguration()
	apiClient := ossindex.NewAPIClient(configuration)
	resp, r, err := apiClient.ComponentVulnerabilityReportsAPI.Post1(context.Background()).Body(body).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComponentVulnerabilityReportsAPI.Post1``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `Post1`: []ComponentReport
	fmt.Fprintf(os.Stdout, "Response from `ComponentVulnerabilityReportsAPI.Post1`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPost1Request struct via the builder pattern

Name Type Description Notes
body ComponentReportRequest

Return type

[]ComponentReport

Authorization

apiToken, basicAuth

HTTP request headers

  • Content-Type: application/json, application/vnd.ossindex.component-report-request.v1+json
  • Accept: application/json, application/vnd.ossindex.component-report-request.v1+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]