(Metrics)
- GetMttx - Fetch infrastructure metrics based on custom query
- GetInfrastructure - Get metrics for a specific catalog entry
Fetch infrastructure metrics based on custom query
package main
import(
"firehydrant"
"context"
"firehydrant/types"
"firehydrant/models/operations"
"log"
)
func main() {
s := firehydrant.New(
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.Metrics.GetMttx(ctx, operations.GetV1MetricsMttxRequest{
StartDate: types.MustDateFromString("2024-12-27"),
EndDate: types.MustDateFromString("2024-02-03"),
})
if err != nil {
log.Fatal(err)
}
if res.MetricsMttxDataEntity != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetV1MetricsMttxRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetV1MetricsMttxResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.BadRequest | 400, 413, 414, 415, 422, 431, 510 | application/json |
sdkerrors.Unauthorized | 401, 403, 407, 511 | application/json |
sdkerrors.NotFound | 404, 501, 505 | application/json |
sdkerrors.Timeout | 408, 504 | application/json |
sdkerrors.RateLimited | 429 | application/json |
sdkerrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Return metrics for a specific component
package main
import(
"firehydrant"
"context"
"firehydrant/models/operations"
"log"
)
func main() {
s := firehydrant.New(
firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.Metrics.GetInfrastructure(ctx, operations.PathParamInfraTypeFunctionalities, "<id>", nil, nil)
if err != nil {
log.Fatal(err)
}
if res.MetricsInfrastructureMetricsEntity != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
infraType |
operations.PathParamInfraType | ✔️ | N/A |
infraID |
string | ✔️ | Component UUID |
startDate |
*types.Date | ➖ | The start date to return metrics from; defaults to 30 days ago |
endDate |
*types.Date | ➖ | The end date to return metrics from, defaults to today |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetInfrastructureMetricsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.BadRequest | 400, 413, 414, 415, 422, 431, 510 | application/json |
sdkerrors.Unauthorized | 401, 403, 407, 511 | application/json |
sdkerrors.NotFound | 404, 501, 505 | application/json |
sdkerrors.Timeout | 408, 504 | application/json |
sdkerrors.RateLimited | 429 | application/json |
sdkerrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |