Skip to main content

AppEngine - EdgeConnect

Overview

EdgeConnect API manages EdgeConnect configurations that specify which HTTP requests matching what URL host patterns will be forwarded to and executed by that EdgeConnect. This enables forwarding of HTTP requests done in the Dynatrace runtime to resources in private networks secured by a deployed EdgeConnect.

npm install @dynatrace-sdk/client-app-engine-edge-connect

edgeConnectClient

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

createEdgeConnect

edgeConnectClient.createEdgeConnect(config): Promise<EdgeConnect>

Create a new EdgeConnect.

Required scope: app-engine:edge-connects:write

You can either specify a UUID in the request body or a random UUID will be assigned to the created EdgeConnect configuration.

The OAuth client ID is optional. If no OAuth client ID is provided an OAuth client must be generated for that EdgeConnect. This additionally requires the oauth2:clients:manage scope allowing generation of OAuth clients with the app-engine:edge-connects:connect scope, e.g. via the following policy statement: ALLOW oauth2:clients:manage where oauth2:scopes='app-engine:edge-connects:connect' The oauth2:clients:manage scope is not required if you provide an OAuth client ID.

The OAuth client ID, secret and resource will be returned in the response. The OAuth client secret is not retrievable later on.

Parameters

NameType
config.body*requiredEdgeConnect

Returns

The EdgeConnect has been created successfully

Code example

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

const data = await edgeConnectClient.createEdgeConnect({
body: {
hostPatterns: ["*.internal.org"],
modificationInfo: {
lastModifiedBy: "12345678-abcd-efgh-1234-123456789",
lastModifiedTime: "2022-01-01T01:02:03.165Z",
},
},
});

deleteEdgeConnect

edgeConnectClient.deleteEdgeConnect(config): Promise<void>

Delete an EdgeConnect

Required scope: app-engine:edge-connects:delete

Deletes the specified EdgeConnect configuration. If the configuration used an autogenerated OAuth client, then the oauth2:clients:manage for the app-engine:edge-connects:connect scope is required (e.g. via a policy statement like ALLOW oauth2:clients:manage where oauth2:scopes='app-engine:edge-connects:connect') in order to allow the deletion of the corresponding OAuth client.

Parameters

NameTypeDescription
config.edgeConnectId*requiredstringSpecify the ID of the EdgeConnect

Code example

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

const data = await edgeConnectClient.deleteEdgeConnect({
edgeConnectId: "11111111-2222-4444-3333-555555555555",
});

getEdgeConnect

edgeConnectClient.getEdgeConnect(config): Promise<EdgeConnect>

Get an EdgeConnect

Required scope: app-engine:edge-connects:read

Parameters

NameTypeDescription
config.edgeConnectId*requiredstringSpecify the ID of the EdgeConnect

Returns

The EdgeConnect configuration

Code example

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

const data = await edgeConnectClient.getEdgeConnect({
edgeConnectId: "11111111-2222-4444-3333-555555555555",
});

getMatchedEdgeConnects

edgeConnectClient.getMatchedEdgeConnects(config): Promise<MatchedResponse>

Gets the matching EdgeConnect including alternatives for a URL.

Required scope: app-engine:edge-connects:read

Provides the EdgeConnect which matches the URL due to its configured host patterns. This EdgeConnect would receive a corresponding fetch request if done in the context of the Dynatrace runtime. In addition, this endpoint also provides other EdgeConnects which have matching host patterns that are not as specific (due to wildcard pattern usage) as the matched EdgeConnect

Parameters

NameTypeDescription
config.url*requiredstringThe URL which is used to check if there are any EdgeConnects with matching host patterns configured. Must be RFC 2396 compliant and use "http" or "https" as its scheme

Returns

The matched EdgeConnect and considered alternatives which are more general

Code example

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

const data = await edgeConnectClient.getMatchedEdgeConnects({
url: "http://my.dynatrace.com",
});

listEdgeConnects

edgeConnectClient.listEdgeConnects(config): Promise<EdgeConnects>

List all EdgeConnects

Required scope: app-engine:edge-connects:read

Parameters

NameTypeDescription
config.addFieldsstringProvide a comma separated list of additional properties to be included in the response.
config.filterstring

The filter parameter for filtering the set of returned resources If this parameter is omitted, no filtering is applied and all states will be returned.

Filtering by string type parameters name, modificationInfo.lastModifiedBy when using one of the operators contains, starts-with and ends-with is case insensitive.

When using the operators =and !=, filtering is case sensitive.

The following fields are legal filtering parameters - any other field names will result in a HTTP 400 response:

  • name, supported operators: =, !=, contains, starts-with, ends-with

  • hostPatterns, supported operators: =, !=, contains, starts-with, ends-with

  • oauthClientId, supported operators: =, !=, contains, starts-with, ends-with

  • modificationInfo.lastModifiedTime, supported operators: =, !=, <, <=, >, >=

  • modificationInfo.lastModifiedBy, supported operators: =, !=, contains, starts-with, ends-with

The following constraints apply:

  • Field names are case-sensitive.

  • Conditions can be connected via operators and and or. A single condition can be negated by not.

  • Strings must be enclosed in single quotes. e.g. name contains 'my-string'

  • Single quotes within a string must be escaped with a backslash: e.g. name starts-with 'it\'s a string'

  • Maximum nesting depth (via brackets) is 2.

  • Maximum length is 256 characters.

Examples:

  • name starts-with 'game-'

  • modificationInfo.lastModifiedTime >= '2022-07-01T00:10:05.000Z' and not (name contains 'new')

config.pagenumberThe index of the page to return. The first page will be returned if this parameters isn't specified.
config.pageSizenumberThe number of resources to return in a single request. 1000 by default.

Returns

A list of all EdgeConnects

Code example

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

const data = await edgeConnectClient.listEdgeConnects();

rotateOAuthClientSecret

edgeConnectClient.rotateOAuthClientSecret(config): Promise<OAuthClientRotationResponse>

Rotate the secret of the autogenerated OAuth client of the given EdgeConnect.

Required scope: oauth2:clients:manage

The secret rotation can only be used if the configured OAuth client is an autogenerated OAuth client. The scope oauth2:clients:manage for the app-engine:edge-connects:connect scope is required (e.g. via a policy like ALLOW oauth2:clients:manage where oauth2:scopes='app-engine:edge-connects:connect').

Parameters

NameTypeDescription
config.edgeConnectId*requiredstringSpecify the ID of the EdgeConnect

Returns

The OAuth client secret was rotated successfully

Code example

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

const data = await edgeConnectClient.rotateOAuthClientSecret({
edgeConnectId: "11111111-2222-4444-3333-555555555555",
});

updateEdgeConnect

edgeConnectClient.updateEdgeConnect(config): Promise<void>

Update an EdgeConnect

Required scope: app-engine:edge-connects:write

Parameters

NameTypeDescription
config.body*requiredEdgeConnect
config.edgeConnectId*requiredstringSpecify the ID of the EdgeConnect

Code example

import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";

const data = await edgeConnectClient.updateEdgeConnect({
edgeConnectId: "11111111-2222-4444-3333-555555555555",
body: {
hostPatterns: ["*.internal.org"],
modificationInfo: {
lastModifiedBy: "12345678-abcd-efgh-1234-123456789",
lastModifiedTime: "2022-01-01T01:02:03.165Z",
},
},
});

Types

ConstraintViolation

NameType
message*requiredstring
parameterLocationstring
pathstring

EdgeConnect

Maps the specified host patterns to this EdgeConnect

NameTypeDescription
hostPatterns*requiredArray<string>
idstring
managedByDynatraceOperatorbooleanFlag to identify if an EdgeConnect is managed by the Dynatrace operator. False by default!
metadataMetadata
modificationInfoModificationInfo
name*requiredstring
oauthClientIdstringId of OAuth client used to connect by the EdgeConnect
oauthClientResourcestringResource of OAuth client used to connect by the EdgeConnect. Only provided when creating a new EdgeConnect.
oauthClientSecretstringSecret of OAuth client used to connect by the EdgeConnect. Only provided when creating a new EdgeConnect.

EdgeConnectInstance

NameType
instanceIdstring
versionstring

EdgeConnects

NameTypeDescription
edgeConnectsArray<EdgeConnect>
totalCountnumberTotal number of currently configured EdgeConnects

Error

NameType
code*requirednumber
detailsErrorDetails
message*requiredstring

ErrorDetails

NameType
constraintViolationsArray<ConstraintViolation>
missingScopesArray<string>

ErrorResponse

NameType
error*requiredError

MatchedEdgeConnect

Contains information about the EdgeConnect and the matched pattern

NameType
id*requiredstring
matchedPattern*requiredstring
metadataMetadata
name*requiredstring

MatchedResponse

NameType
matchedMatchedEdgeConnect
secondaryMatchingArray<MatchedEdgeConnect>

Metadata

NameType
instancesArray<EdgeConnectInstance>
oauthClientStatusMetadataOauthClientStatus

ModificationInfo

NameType
lastModifiedBy*requiredstring
lastModifiedTime*requiredDate

OAuthClientRotationResponse

NameType
clientId*requiredstring
clientSecret*requiredstring

Enums

MetadataOauthClientStatus

The status of the OAuth client

Enum keys

Active | Deleted | Inactive | PendingDeletion

Still have questions?
Find answers in the Dynatrace Community