Skip to content

Latest commit

 

History

History
472 lines (290 loc) · 12.4 KB

ReportsAPI.md

File metadata and controls

472 lines (290 loc) · 12.4 KB

\ReportsAPI

All URIs are relative to http://localhost

Method HTTP request Description
GetAll1 Get /api/v2/reports/applications
GetByApplicationId Get /api/v2/reports/applications/{applicationId}
GetComponentsInQuarantine Get /api/v2/reports/components/quarantined
GetComponentsWithWaivers Get /api/v2/reports/components/waivers
GetMetrics Post /api/v2/reports/metrics
GetReportHistoryForApplication Get /api/v2/reports/applications/{applicationId}/history
GetStaleWaivers Get /api/v2/reports/waivers/stale

GetAll1

[]ApiApplicationReportDTOV2 GetAll1(ctx).Execute()

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]ApiApplicationReportDTOV2

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetByApplicationId

[]ApiApplicationReportDTOV2 GetByApplicationId(ctx, applicationId).Execute()

Example

package main

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

func main() {
	applicationId := "applicationId_example" // string | Enter the internal application Id. You can use the Applications REST API to get the internal application Id. 

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.ReportsAPI.GetByApplicationId(context.Background(), applicationId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetByApplicationId``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetByApplicationId`: []ApiApplicationReportDTOV2
	fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetByApplicationId`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
applicationId string Enter the internal application Id. You can use the Applications REST API to get the internal application Id.

Other Parameters

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

Name Type Description Notes

Return type

[]ApiApplicationReportDTOV2

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetComponentsInQuarantine

ApiComponentsInQuarantineDTO GetComponentsInQuarantine(ctx).Execute()

Example

package main

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

func main() {

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.ReportsAPI.GetComponentsInQuarantine(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetComponentsInQuarantine``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetComponentsInQuarantine`: ApiComponentsInQuarantineDTO
	fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetComponentsInQuarantine`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ApiComponentsInQuarantineDTO

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetComponentsWithWaivers

ApiComponentWaiversDTO GetComponentsWithWaivers(ctx).Format(format).Execute()

Example

package main

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

func main() {
	format := "format_example" // string | Enter the format/ecosystem of the component (optional)

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.ReportsAPI.GetComponentsWithWaivers(context.Background()).Format(format).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetComponentsWithWaivers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetComponentsWithWaivers`: ApiComponentWaiversDTO
	fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetComponentsWithWaivers`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
format string Enter the format/ecosystem of the component

Return type

ApiComponentWaiversDTO

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetMetrics

GetMetrics(ctx).ApiMetricsReportingQueryDTOV2(apiMetricsReportingQueryDTOV2).Execute()

Example

package main

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

func main() {
	apiMetricsReportingQueryDTOV2 := *sonatypeiq.NewApiMetricsReportingQueryDTOV2() // ApiMetricsReportingQueryDTOV2 |  (optional)

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	r, err := apiClient.ReportsAPI.GetMetrics(context.Background()).ApiMetricsReportingQueryDTOV2(apiMetricsReportingQueryDTOV2).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetMetrics``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

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

Name Type Description Notes
apiMetricsReportingQueryDTOV2 ApiMetricsReportingQueryDTOV2

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/csv

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

GetReportHistoryForApplication

ApiReportHistoryDTO GetReportHistoryForApplication(ctx, applicationId).Stage(stage).Limit(limit).Execute()

Example

package main

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

func main() {
	applicationId := "applicationId_example" // string | Enter the internal application Id. You can use the Applications REST API to get the internal application Id. 
	stage := "stage_example" // string | Enter the specific stage, for which you want retrieve the scan history, e.g. 'build'  (optional)
	limit := int32(56) // int32 | Enter the exact no. of most recent reports to retrieve. (optional)

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.ReportsAPI.GetReportHistoryForApplication(context.Background(), applicationId).Stage(stage).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetReportHistoryForApplication``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetReportHistoryForApplication`: ApiReportHistoryDTO
	fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetReportHistoryForApplication`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
applicationId string Enter the internal application Id. You can use the Applications REST API to get the internal application Id.

Other Parameters

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

Name Type Description Notes

stage | string | Enter the specific stage, for which you want retrieve the scan history, e.g. 'build' | limit | int32 | Enter the exact no. of most recent reports to retrieve. |

Return type

ApiReportHistoryDTO

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetStaleWaivers

ApiStaleWaiversResponseDTO GetStaleWaivers(ctx).Execute()

Example

package main

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

func main() {

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.ReportsAPI.GetStaleWaivers(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetStaleWaivers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetStaleWaivers`: ApiStaleWaiversResponseDTO
	fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetStaleWaivers`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ApiStaleWaiversResponseDTO

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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