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 |
[]ComponentReport Post(ctx).Body(body).Execute()
Request vulnerability reports for components
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)
}
Other parameters are passed through a pointer to a apiPostRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
body | ComponentReportRequest |
- 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]
[]ComponentReport Post1(ctx).Body(body).Execute()
Request vulnerability reports for components
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)
}
Other parameters are passed through a pointer to a apiPost1Request struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
body | ComponentReportRequest |
- 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]