thousandeyes-sdk-python/thousandeyes-sdk-labels/docs/AllLabelsApi.md
Shahid Hussain Khan 745e74afc4
CP-2189 Update SDK names for admin and monitors modules (#9)
* CP-2189 Update SDK names for admin and monitors modules

* CP-2189 Move client to core

* CP-2189 Change client to core
2024-06-04 16:09:40 +01:00

3.4 KiB

thousandeyes_sdk.labels.AllLabelsApi

All URIs are relative to https://api.thousandeyes.com

Method HTTP request Description
get_labels GET /v7/labels Get list of Labels

get_labels

Labels get_labels(aid=aid)

Get list of Labels

Returns a list of all labels (formerly called groups) configured in ThousandEyes.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.labels
from thousandeyes_sdk.labels.models.labels import Labels
from thousandeyes_sdk.labels.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = thousandeyes_sdk.core.Configuration(
    host = "https://api.thousandeyes.com"
)

# 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 Bearer authorization: BearerAuth
configuration = thousandeyes_sdk.core.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with thousandeyes_sdk.labels.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = thousandeyes_sdk.labels.AllLabelsApi(api_client)
    aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)

    try:
        # Get list of Labels
        api_response = api_instance.get_labels(aid=aid)
        print("The response of AllLabelsApi->get_labels:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AllLabelsApi->get_labels: %s\n" % e)

Parameters

Name Type Description Notes
aid str A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. [optional]

Return type

Labels

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/hal+json, application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Insufficient permissions to query endpoint -
404 Not found -
429 Exhausted rate limit for the organization -
500 Internal server error -

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