All URIs are relative to /service/rest
| Method | HTTP request | Description |
|---|---|---|
| ListUsageHistory | Get /v1/usage-history | Get usage history for sparklines |
ListUsageHistory(ctx).Metric(metric).Period(period).Execute()
Get usage history for sparklines
package main
import (
"context"
"fmt"
"os"
sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)
func main() {
metric := "metric_example" // string | Metric type: 'requests' or 'components'
period := "period_example" // string | Period: 'daily' (last 7 days) or 'monthly' (last 12 months)
configuration := sonatyperepo.NewConfiguration()
apiClient := sonatyperepo.NewAPIClient(configuration)
r, err := apiClient.UsageHistoryAPI.ListUsageHistory(context.Background()).Metric(metric).Period(period).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsageHistoryAPI.ListUsageHistory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}Other parameters are passed through a pointer to a apiListUsageHistoryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| metric | string | Metric type: 'requests' or 'components' | |
| period | string | Period: 'daily' (last 7 days) or 'monthly' (last 12 months) |
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]