Skip to content

Latest commit

 

History

History
522 lines (396 loc) · 23.1 KB

MetricsBetaApi.md

File metadata and controls

522 lines (396 loc) · 23.1 KB

launchdarkly_api.MetricsBetaApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
create_metric_group POST /api/v2/projects/{projectKey}/metric-groups Create metric group
delete_metric_group DELETE /api/v2/projects/{projectKey}/metric-groups/{metricGroupKey} Delete metric group
get_metric_group GET /api/v2/projects/{projectKey}/metric-groups/{metricGroupKey} Get metric group
get_metric_groups GET /api/v2/projects/{projectKey}/metric-groups List metric groups
patch_metric_group PATCH /api/v2/projects/{projectKey}/metric-groups/{metricGroupKey} Patch metric group

create_metric_group

MetricGroupRep create_metric_group(project_key, metric_group_post)

Create metric group

Create a new metric group in the specified project

Example

  • Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import metrics_beta_api
from launchdarkly_api.model.metric_group_post import MetricGroupPost
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.method_not_allowed_error_rep import MethodNotAllowedErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.metric_group_rep import MetricGroupRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
    host = "https://app.launchdarkly.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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

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

# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metrics_beta_api.MetricsBetaApi(api_client)
    project_key = "projectKey_example" # str | The project key
    metric_group_post = MetricGroupPost(
        key="metric-group-key-123abc",
        name="My metric group",
        kind="funnel",
        description="Description of the metric group",
        maintainer_id="569fdeadbeef1644facecafe",
        tags=["ops"],
        metrics=[
            MetricInMetricGroupInput(
                key="metric-key-123abc",
                name_in_group="Step 1",
            ),
        ],
    ) # MetricGroupPost | 

    # example passing only required values which don't have defaults set
    try:
        # Create metric group
        api_response = api_instance.create_metric_group(project_key, metric_group_post)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling MetricsBetaApi->create_metric_group: %s\n" % e)

Parameters

Name Type Description Notes
project_key str The project key
metric_group_post MetricGroupPost

Return type

MetricGroupRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Metric group response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
429 Rate limited -

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

delete_metric_group

delete_metric_group(project_key, metric_group_key)

Delete metric group

Delete a metric group by key.

Example

  • Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import metrics_beta_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.method_not_allowed_error_rep import MethodNotAllowedErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
    host = "https://app.launchdarkly.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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

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

# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metrics_beta_api.MetricsBetaApi(api_client)
    project_key = "projectKey_example" # str | The project key
    metric_group_key = "metricGroupKey_example" # str | The metric group key

    # example passing only required values which don't have defaults set
    try:
        # Delete metric group
        api_instance.delete_metric_group(project_key, metric_group_key)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling MetricsBetaApi->delete_metric_group: %s\n" % e)

Parameters

Name Type Description Notes
project_key str The project key
metric_group_key str The metric group key

Return type

void (empty response body)

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Action succeeded -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
429 Rate limited -

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

get_metric_group

MetricGroupRep get_metric_group(project_key, metric_group_key)

Get metric group

Get information for a single metric group from the specific project. ### Expanding the metric group response LaunchDarkly supports two fields for expanding the "Get metric group" response. By default, these fields are not included in the response. To expand the response, append the expand query parameter and add a comma-separated list with either or both of the following fields: - experiments includes all experiments from the specific project that use the metric group - experimentCount includes the number of experiments from the specific project that use the metric group For example, expand=experiments includes the experiments field in the response.

Example

  • Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import metrics_beta_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.method_not_allowed_error_rep import MethodNotAllowedErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.metric_group_rep import MetricGroupRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
    host = "https://app.launchdarkly.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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

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

# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metrics_beta_api.MetricsBetaApi(api_client)
    project_key = "projectKey_example" # str | The project key
    metric_group_key = "metricGroupKey_example" # str | The metric group key
    expand = "expand_example" # str | A comma-separated list of properties that can reveal additional information in the response. (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get metric group
        api_response = api_instance.get_metric_group(project_key, metric_group_key)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling MetricsBetaApi->get_metric_group: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get metric group
        api_response = api_instance.get_metric_group(project_key, metric_group_key, expand=expand)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling MetricsBetaApi->get_metric_group: %s\n" % e)

Parameters

Name Type Description Notes
project_key str The project key
metric_group_key str The metric group key
expand str A comma-separated list of properties that can reveal additional information in the response. [optional]

Return type

MetricGroupRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Metric group response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
429 Rate limited -

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

get_metric_groups

MetricGroupCollectionRep get_metric_groups(project_key)

List metric groups

Get a list of all metric groups for the specified project. ### Expanding the metric groups response LaunchDarkly supports one field for expanding the "Get metric groups" response. By default, these fields are not included in the response. To expand the response, append the expand query parameter and add a comma-separated list with the following field: - experiments includes all experiments from the specific project that use the metric group For example, expand=experiments includes the experiments field in the response. ### Filtering metric groups The filter parameter supports the following operators: contains, equals, anyOf. #### Supported fields and operators You can only filter certain fields in metrics when using the filter parameter. Additionally, you can only filter some fields with certain operators. When you search for metrics, the filter parameter supports the following fields and operators: |<div style="width:120px">Field |Description |Supported operators | |---|---|---| | experimentStatus | The experiment's status. One of not_started, running, stopped, started. | equals | | hasConnections | Whether the metric group has connections to experiments or guarded rollouts. One of true, false. | equals | | kind | The metric group kind. One of funnel, standard. | equals | | maintainerIds | The metric maintainer IDs. | anyOf | | maintainerTeamKey | The metric maintainer team key. | equals | | query | A "fuzzy" search across metric group key and name. Supply a string or list of strings to the operator. | equals | ### Sorting metric groups LaunchDarkly supports the following fields for sorting: - name sorts by metric group name. - createdAt sorts by the creation date of the metric group. - connectionCount sorts by the number of connections to experiments the metric group has. By default, the sort is in ascending order. Use - to sort in descending order. For example, ?sort=name sorts the response by metric group name in ascending order, and ?sort=-name sorts in descending order. #### Sample query filter=experimentStatus equals 'not_started' and query equals 'metric name'

Example

  • Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import metrics_beta_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.method_not_allowed_error_rep import MethodNotAllowedErrorRep
from launchdarkly_api.model.metric_group_collection_rep import MetricGroupCollectionRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
    host = "https://app.launchdarkly.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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

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

# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metrics_beta_api.MetricsBetaApi(api_client)
    project_key = "projectKey_example" # str | The project key
    filter = "filter_example" # str | Accepts filter by `experimentStatus`, `query`, `kind`, `hasConnections`, `maintainerIds`, and `maintainerTeamKey`. Example: `filter=experimentStatus equals 'running' and query equals 'test'`. (optional)
    sort = "sort_example" # str | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields. (optional)
    expand = "expand_example" # str | A comma-separated list of properties that can reveal additional information in the response. (optional)
    limit = 1 # int | The number of metric groups to return in the response. Defaults to 20. Maximum limit is 50. (optional)
    offset = 1 # int | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items. (optional)

    # example passing only required values which don't have defaults set
    try:
        # List metric groups
        api_response = api_instance.get_metric_groups(project_key)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling MetricsBetaApi->get_metric_groups: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # List metric groups
        api_response = api_instance.get_metric_groups(project_key, filter=filter, sort=sort, expand=expand, limit=limit, offset=offset)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling MetricsBetaApi->get_metric_groups: %s\n" % e)

Parameters

Name Type Description Notes
project_key str The project key
filter str Accepts filter by `experimentStatus`, `query`, `kind`, `hasConnections`, `maintainerIds`, and `maintainerTeamKey`. Example: `filter=experimentStatus equals 'running' and query equals 'test'`. [optional]
sort str A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields. [optional]
expand str A comma-separated list of properties that can reveal additional information in the response. [optional]
limit int The number of metric groups to return in the response. Defaults to 20. Maximum limit is 50. [optional]
offset int Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items. [optional]

Return type

MetricGroupCollectionRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Metric group collection response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
429 Rate limited -

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

patch_metric_group

MetricGroupRep patch_metric_group(project_key, metric_group_key, json_patch)

Patch metric group

Patch a metric group by key. Updating a metric group uses a JSON patch representation of the desired changes.

Example

  • Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import metrics_beta_api
from launchdarkly_api.model.json_patch import JSONPatch
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.method_not_allowed_error_rep import MethodNotAllowedErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.metric_group_rep import MetricGroupRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
    host = "https://app.launchdarkly.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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

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

# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metrics_beta_api.MetricsBetaApi(api_client)
    project_key = "projectKey_example" # str | The project key
    metric_group_key = "metricGroupKey_example" # str | The metric group key
    json_patch = JSONPatch([
        PatchOperation(
            op="replace",
            path="/exampleField",
            value=None,
        ),
    ]) # JSONPatch | 

    # example passing only required values which don't have defaults set
    try:
        # Patch metric group
        api_response = api_instance.patch_metric_group(project_key, metric_group_key, json_patch)
        pprint(api_response)
    except launchdarkly_api.ApiException as e:
        print("Exception when calling MetricsBetaApi->patch_metric_group: %s\n" % e)

Parameters

Name Type Description Notes
project_key str The project key
metric_group_key str The metric group key
json_patch JSONPatch

Return type

MetricGroupRep

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Metric group response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
405 Method not allowed -
429 Rate limited -

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