Class MetricsService
Represents a collection of functions to interact with the API endpoints
Inheritance
Implements
Namespace: InfluxDB.Client.Api.Service
Assembly: InfluxDB.Client.dll
Syntax
public class MetricsService : object, IMetricsService, IApiAccessor
Constructors
MetricsService(Configuration)
Initializes a new instance of the Metrics
Declaration
public MetricsService(Configuration configuration = null)
Parameters
Type | Name | Description |
---|---|---|
Influx |
configuration | An instance of Configuration |
MetricsService(String)
Initializes a new instance of the Metrics
Declaration
public MetricsService(string basePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
basePath |
Properties
Configuration
Gets or sets the configuration object
Declaration
public Configuration Configuration { get; set; }
Property Value
Type | Description |
---|---|
Influx |
An instance of the Configuration |
ExceptionFactory
Provides a factory method hook for the creation of exceptions.
Declaration
public ExceptionFactory ExceptionFactory { get; set; }
Property Value
Type | Description |
---|---|
Influx |
Methods
AddDefaultHeader(String, String)
Add default header.
Declaration
public void AddDefaultHeader(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Header field name. |
System. |
value | Header field value. |
DefaultHeader()
Gets the default header.
Declaration
public IDictionary<string, string> DefaultHeader()
Returns
Type | Description |
---|---|
IDictionary<System. |
Dictionary of HTTP header |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
System. |
The base path |
GetMetrics(String)
Get metrics of an instance
Declaration
public string GetMetrics(string zapTraceSpan = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Returns
Type | Description |
---|---|
System. |
string |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
GetMetricsAsync(String, CancellationToken)
Get metrics of an instance
Declaration
public async System.Threading.Tasks.Task<string> GetMetricsAsync(string zapTraceSpan = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Cancellation |
cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System. |
Task of string |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
GetMetricsAsyncWithHttpInfo(String, CancellationToken)
Get metrics of an instance
Declaration
public async System.Threading.Tasks.Task<ApiResponse<string>> GetMetricsAsyncWithHttpInfo(string zapTraceSpan = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Cancellation |
cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System. |
Task of ApiResponse (string) |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
GetMetricsAsyncWithIRestResponse(String, CancellationToken)
Get metrics of an instance
Declaration
public async System.Threading.Tasks.Task<RestResponse> GetMetricsAsyncWithIRestResponse(string zapTraceSpan = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Cancellation |
cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System. |
Task of RestResponse (string) |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
GetMetricsWithHttpInfo(String)
Get metrics of an instance
Declaration
public ApiResponse<string> GetMetricsWithHttpInfo(string zapTraceSpan = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Returns
Type | Description |
---|---|
Influx |
ApiResponse of string |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
GetMetricsWithIRestResponse(String)
Get metrics of an instance
Declaration
public RestResponse GetMetricsWithIRestResponse(string zapTraceSpan = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Returns
Type | Description |
---|---|
Rest |
ApiResponse of string |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
GetMetricsWithIRestResponseAsync(String, CancellationToken)
Get metrics of an instance
Declaration
public async System.Threading.Tasks.Task<RestResponse> GetMetricsWithIRestResponseAsync(string zapTraceSpan = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Cancellation |
cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System. |
ApiResponse of string |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
GetMetricsWithRestRequest(String)
Get metrics of an instance
Declaration
public RestRequest GetMetricsWithRestRequest(string zapTraceSpan = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
zapTraceSpan | OpenTracing span context (optional) |
Returns
Type | Description |
---|---|
Rest |
ApiResponse of string |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
SetBasePath(String)
Sets the base path of the API client.
Declaration
public void SetBasePath(string basePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
basePath |