Skip to content

Latest commit

 

History

History
104 lines (81 loc) · 3.14 KB

MetricsApi.md

File metadata and controls

104 lines (81 loc) · 3.14 KB

Fermyon.Nomad.Api.MetricsApi

All URIs are relative to https://127.0.0.1:4646/v1

Method HTTP request Description
GetMetricsSummary GET /metrics

GetMetricsSummary

MetricsSummary GetMetricsSummary (string? format = null)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Fermyon.Nomad.Api;
using Fermyon.Nomad.Client;
using Fermyon.Nomad.Model;

namespace Example
{
    public class GetMetricsSummaryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://127.0.0.1:4646/v1";
            // Configure API key authorization: X-Nomad-Token
            config.AddApiKey("X-Nomad-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Nomad-Token", "Bearer");

            var apiInstance = new MetricsApi(config);
            var format = "format_example";  // string? | The format the user requested for the metrics summary (e.g. prometheus) (optional) 

            try
            {
                MetricsSummary result = apiInstance.GetMetricsSummary(format);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MetricsApi.GetMetricsSummary: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetMetricsSummaryWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    ApiResponse<MetricsSummary> response = apiInstance.GetMetricsSummaryWithHttpInfo(format);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MetricsApi.GetMetricsSummaryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
format string? The format the user requested for the metrics summary (e.g. prometheus) [optional]

Return type

MetricsSummary

Authorization

X-Nomad-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -
400 Bad request -
403 Forbidden -
405 Method not allowed -
500 Internal server error -

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