npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dynatrace-sdk/client-filter-segment-management

v0.1.0

Published

[![npm](https://img.shields.io/badge/npm-v0.1.0-blue)](https://www.npmjs.com/package/@dynatrace-sdk/client-filter-segment-management/v/0.1.0) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0

Downloads

119

Readme

@dynatrace-sdk/client-filter-segment-management

npm License

Filter-Segment management for Grail.

Installation

npm install @dynatrace-sdk/client-filter-segment-management

Getting help

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

API reference

Full API reference for the latest version of the SDK is also available at the Dynatrace Developer.

filterSegmentsClient

import { filterSegmentsClient } from '@dynatrace-sdk/client-filter-segment-management';

createFilterSegment

Create a new filter-segment.

Parameters

| Name | Type | | --- | --- | |config.body*required|NewFilterSegment|

Returns

Filter-segment successfully created.

import { filterSegmentsClient } from "@dynatrace-sdk/client-filter-segment-management";

const data = await filterSegmentsClient.createFilterSegment(
  {
    body: {
      name: "dev_environment",
      description:
        "only includes data of the dev environment",
      variables: {
        type: "query",
        value: "fetch logs | limit 1",
      },
      isPublic: false,
      includes: [
        {
          filter: "here goes the filter",
          dataObject: "logs",
        },
        {
          filter: "here goes another filter",
          dataObject: "events",
        },
      ],
    },
  },
);

deleteFilterSegment

Delete a filter-segment.

Parameters

| Name | Type | Description | | --- | --- | --- | |config.filterSegmentUid*required|string|UID of the filter-segment |

import { filterSegmentsClient } from "@dynatrace-sdk/client-filter-segment-management";

const data = await filterSegmentsClient.deleteFilterSegment(
  { filterSegmentUid: "D82a1jdA23a" },
);

getFilterSegment

Get filter-segment by UID.

Parameters

| Name | Type | Description | | --- | --- | --- | |config.addFields|GetFilterSegmentQueryAddFields|Add additional fields. The following are supported: includes, variables | |config.filterSegmentUid*required|string|UID of the filter-segment |

Returns

Filter-segment successfully retrieved.

import { filterSegmentsClient } from "@dynatrace-sdk/client-filter-segment-management";

const data = await filterSegmentsClient.getFilterSegment({
  filterSegmentUid: "D82a1jdA23a",
});

getFilterSegments

Get all filter-segments.

Returns all filter-segments. If details like description are not needed then consider using the :lean endpoint.

Parameters

| Name | Type | Description | | --- | --- | --- | |config.addFields|Variables|Add additional fields. The following are supported: variables |

Returns

Filter-segments successfully retrieved.

import { filterSegmentsClient } from "@dynatrace-sdk/client-filter-segment-management";

const data = await filterSegmentsClient.getFilterSegments();

getLeanFilterSegments

Get all filter-segments in a minimal/lean form.

Returns all filter-segments in a minimal representational form. This endpoint saves resources and as a result quicker response times can be expected over the more detailed get-all endpoint.

Parameters

| Name | Type | Description | | --- | --- | --- | |config.addFields|Variables|Add additional fields. The following are supported: variables |

Returns

Filter-segments successfully retrieved.

import { filterSegmentsClient } from "@dynatrace-sdk/client-filter-segment-management";

const data =
  await filterSegmentsClient.getLeanFilterSegments();

partiallyUpdateFilterSegment

Partially update a filter-segment.

Parameters

| Name | Type | Description | | --- | --- | --- | |config.body*required|PartialUpdateFilterSegment| | |config.filterSegmentUid*required|string|UID of the filter-segment | |config.optimisticLockingVersion*required|number|version which should be updated. used for optimistic locking. |

import { filterSegmentsClient } from "@dynatrace-sdk/client-filter-segment-management";

const data =
  await filterSegmentsClient.partiallyUpdateFilterSegment({
    filterSegmentUid: "D82a1jdA23a",
    optimisticLockingVersion: 1,
    body: {
      description:
        "only includes data of the development environment",
    },
  });

updateFilterSegment

Update a filter-segment. All fields will be overwritten (also undefined or null fields).

Parameters

| Name | Type | Description | | --- | --- | --- | |config.body*required|UpdateFilterSegment| | |config.filterSegmentUid*required|string|UID of the filter-segment | |config.optimisticLockingVersion*required|number|version which should be updated. used for optimistic locking. |

import { filterSegmentsClient } from "@dynatrace-sdk/client-filter-segment-management";

const data = await filterSegmentsClient.updateFilterSegment(
  {
    filterSegmentUid: "D82a1jdA23a",
    optimisticLockingVersion: 1,
    body: {
      uid: "D82a1jdA23a",
      name: "dev_environment",
      description:
        "only includes data of the development environment",
      variables: {
        type: "query",
        value: "fetch logs | limit 1",
      },
      isPublic: false,
      owner: "john.doe",
      includes: [
        {
          filter: "here goes the filter",
          dataObject: "logs",
        },
        {
          filter: "here goes another filter",
          dataObject: "events",
        },
      ],
    },
  },
);

Types

DetailedFilterSegment

| Name | Type | Description | | --- | --- | --- | |description|string|Description of the filter-segment. | |includes|Array<Include>|List of includes of the filter-segment. | |isPublic|boolean|Indicates if the filter-segment is publicly accessible within the tenant. | |name*required|string|Name of the filter-segment. | |owner*required|string|Defines the owner of the filter-segment. | |uid*required|string|Unique identifier of the filter-segment. | |variables|FilterSegmentVariables| | |version|number|Used for optimistic locking. Update requests define with this on which version the data updated is based on. This must match with the version stored, otherwise the update will fail due to concurrent modification. |

ErrorEnvelope

| Name | Type | | --- | --- | |error|ExceptionalReturn|

ErrorInfo

| Name | Type | | --- | --- | |message|string|

ExceptionalReturn

| Name | Type | | --- | --- | |code|number| |errorDetails|Array<ErrorInfo>| |message|string|

FilterSegment

List of filter-segments.

| Name | Type | Description | | --- | --- | --- | |description|string|Description of the filter-segment. | |isPublic|boolean|Indicates if the filter-segment is publicly accessible within the tenant. | |name*required|string|Name of the filter-segment. | |owner*required|string|Defines the owner of the filter-segment. | |uid*required|string|Unique identifier of the filter-segment. | |variables|FilterSegmentVariables| | |version|number|Used for optimistic locking. Update requests define with this on which version the data updated is based on. This must match with the version stored, otherwise the update will fail due to concurrent modification. |

FilterSegmentVariables

Variables of the filter-segment.

| Name | Type | Description | | --- | --- | --- | |type*required|string|Type of the variable. | |value*required|string|Value of the variable. |

FilterSegments

| Name | Type | Description | | --- | --- | --- | |filterSegments*required|Array<FilterSegment>|List of filter-segments. |

Include

List of includes of the filter-segment.

| Name | Type | Description | | --- | --- | --- | |dataObject*required|string|The data object that the filter will be applied to. | |filter*required|string|Data will be filtered by this value. |

LeanFilterSegment

List of filter-segments.

| Name | Type | Description | | --- | --- | --- | |isPublic|boolean|Indicates if the filter-segment is publicly accessible within the tenant. | |name*required|string|Name of the filter-segment. | |uid*required|string|Unique identifier of the filter-segment. | |variables|FilterSegmentVariables| |

LeanFilterSegments

| Name | Type | Description | | --- | --- | --- | |filterSegments*required|Array<LeanFilterSegment>|List of filter-segments. |

NewFilterSegment

| Name | Type | Description | | --- | --- | --- | |description|string|Description of the filter-segment. | |includes|Array<NewInclude>|List of includes of the filter-segment. | |isPublic*required|boolean|Indicates if the filter-segment is publicly accessible within the tenant. | |name*required|string|Name of the filter-segment. | |variables|FilterSegmentVariables| |

NewInclude

List of includes of the filter-segment.

| Name | Type | Description | | --- | --- | --- | |dataObject*required|string|The data object that the filter will be applied to. | |filter*required|string|Data will be filtered by this value. |

PartialUpdateFilterSegment

| Name | Type | Description | | --- | --- | --- | |description|string|Description of the filter-segment. | |includes|Array<NewInclude>|List of includes of the filter-segment. | |isPublic|boolean|Indicates if the filter-segment is publicly accessible within the tenant. | |variables|FilterSegmentVariables| |

UpdateFilterSegment

| Name | Type | Description | | --- | --- | --- | |description|string|Description of the filter-segment. | |includes|Array<NewInclude>|List of includes of the filter-segment. | |isPublic*required|boolean|Indicates if the filter-segment is publicly accessible within the tenant. | |name*required|string|Name of the filter-segment. | |owner*required|string|Defines the owner of the filter-segment. | |uid*required|string|Unique identifier of the filter-segment. | |variables|FilterSegmentVariables| |

Enums

GetFilterSegmentQueryAddFields

Enum keys

Includes | Variables

GetFilterSegmentsQueryAddFields

Enum keys

Variables

GetLeanFilterSegmentsQueryAddFields

Enum keys

Variables