Skip to content

Latest commit

 

History

History
100 lines (68 loc) · 3.83 KB

File metadata and controls

100 lines (68 loc) · 3.83 KB

instana_client.InfrastructureMetricsApi

All URIs are relative to https://unit-tenant.instana.io

Method HTTP request Description
get_infrastructure_metrics POST /api/infrastructure-monitoring/metrics Get infrastructure metrics

get_infrastructure_metrics

InfrastructureMetricResult get_infrastructure_metrics(offline=offline, get_combined_metrics=get_combined_metrics)

Get infrastructure metrics

For more information on Infrastructure Metrics please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Infrastructure#infrastructure-metrics.

Request Validation Rules:

  • At least one metric name must be defined in the 'metrics' field
  • Either 'snapshotIds' or 'query' must be provided (both cannot be empty)
  • When using 'query' without 'snapshotIds', the query cannot be empty or a wildcard ('*') unless a 'plugin' is specified
  • The rollup value must be valid for the given time window (see API documentation for valid rollups)
  • The ratio of windowSize to rollup must not exceed 600 data points (windowSize / rollup <= 600)

Example

  • Api Key Authentication (ApiKeyAuth):
import instana_client
from instana_client.models.get_combined_metrics import GetCombinedMetrics
from instana_client.models.infrastructure_metric_result import InfrastructureMetricResult
from instana_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://unit-tenant.instana.io
# See configuration.py for a list of all supported configuration parameters.
configuration = instana_client.Configuration(
    host = "https://unit-tenant.instana.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with instana_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = instana_client.InfrastructureMetricsApi(api_client)
    offline = True # bool |  (optional)
    get_combined_metrics = instana_client.GetCombinedMetrics() # GetCombinedMetrics |  (optional)

    try:
        # Get infrastructure metrics
        api_response = api_instance.get_infrastructure_metrics(offline=offline, get_combined_metrics=get_combined_metrics)
        print("The response of InfrastructureMetricsApi->get_infrastructure_metrics:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InfrastructureMetricsApi->get_infrastructure_metrics: %s\n" % e)

Parameters

Name Type Description Notes
offline bool [optional]
get_combined_metrics GetCombinedMetrics [optional]

Return type

InfrastructureMetricResult

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request - Invalid request parameters. Possible error messages: -

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