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
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 name must not be longer than 50 characters and must be 'RFC 1123' compliant. 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
Name | Type |
---|---|
config.body*required | EdgeConnect |
Returns
Return type | Status code | Description |
---|---|---|
EdgeConnect | 201 | The EdgeConnect has been created successfully |
Throws
Error Type | Error Message |
---|---|
ErrorResponseError | Bad Request |
Code example
import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";
const data = await edgeConnectClient.createEdgeConnect({
body: {
name: {},
hostPatterns: ["*.internal.org"],
modificationInfo: {
lastModifiedBy: "12345678-abcd-efgh-1234-123456789",
lastModifiedTime: "2022-01-01T01:02:03.165Z",
},
},
});
deleteEdgeConnect
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
Name | Type | Description |
---|---|---|
config.edgeConnectId*required | string | Specify the ID of the EdgeConnect |
Returns
Return type | Status code | Description |
---|---|---|
void | 204 | The EdgeConnect configuration was deleted successfully |
Code example
import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";
const data = await edgeConnectClient.deleteEdgeConnect({
edgeConnectId: "11111111-2222-4444-3333-555555555555",
});
getEdgeConnect
Get an EdgeConnect
Required scope: app-engine:edge-connects:read
Parameters
Name | Type | Description |
---|---|---|
config.edgeConnectId*required | string | Specify the ID of the EdgeConnect |
Returns
Return type | Status code | Description |
---|---|---|
EdgeConnect | 200 | 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
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
Name | Type | Description |
---|---|---|
config.url*required | string | The 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
Return type | Status code | Description |
---|---|---|
MatchedResponse | 200 | The matched EdgeConnect and considered alternatives which are more general |
Throws
Error Type | Error Message |
---|---|
ErrorResponseError | Bad Request |
Code example
import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";
const data = await edgeConnectClient.getMatchedEdgeConnects(
{ url: "http://my.dynatrace.com" },
);
listEdgeConnects
List all EdgeConnects
Required scope: app-engine:edge-connects:read
Parameters
Name | Type | Description |
---|---|---|
config.addFields | string | Provide a comma separated list of additional properties to be included in the response. |
config.filter | string | 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 When using the operators The following fields are legal filtering parameters - any other field names will result in a HTTP 400 response:
The following constraints apply:
Examples:
|
config.page | number | The index of the page to return. The first page will be returned if this parameters isn't specified. |
config.pageSize | number | The number of resources to return in a single request. 1000 by default. |
Returns
Return type | Status code | Description |
---|---|---|
EdgeConnects | 200 | A list of all EdgeConnects |
Code example
import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";
const data = await edgeConnectClient.listEdgeConnects();
rotateOAuthClientSecret
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
Name | Type | Description |
---|---|---|
config.edgeConnectId*required | string | Specify the ID of the EdgeConnect |
Returns
Return type | Status code | Description |
---|---|---|
OAuthClientRotationResponse | 200 | 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
Update an EdgeConnect
Required scope: app-engine:edge-connects:write
Parameters
Name | Type | Description |
---|---|---|
config.body*required | EdgeConnect | |
config.edgeConnectId*required | string | Specify the ID of the EdgeConnect |
Returns
Return type | Status code | Description |
---|---|---|
void | 200 | The EdgeConnect has been update successfully |
Throws
Error Type | Error Message |
---|---|
ErrorResponseError | Bad Request |
Code example
import { edgeConnectClient } from "@dynatrace-sdk/client-app-engine-edge-connect";
const data = await edgeConnectClient.updateEdgeConnect({
edgeConnectId: "11111111-2222-4444-3333-555555555555",
body: {
name: {},
hostPatterns: ["*.internal.org"],
modificationInfo: {
lastModifiedBy: "12345678-abcd-efgh-1234-123456789",
lastModifiedTime: "2022-01-01T01:02:03.165Z",
},
},
});
Types
ConstraintViolation
Name | Type |
---|---|
message*required | string |
parameterLocation | string |
path | string |
EdgeConnect
Maps the specified host patterns to this EdgeConnect
Name | Type | Description |
---|---|---|
hostMappings | Array<HostMapping> | |
hostPatterns*required | Array<string> | |
id | string | |
managedByDynatraceOperator | boolean | Flag to identify if an EdgeConnect is managed by the Dynatrace operator. False by default! |
metadata | Metadata | |
modificationInfo | ModificationInfo | |
name*required | string | |
oauthClientId | string | Id of OAuth client used to connect by the EdgeConnect |
oauthClientResource | string | Resource of OAuth client used to connect by the EdgeConnect. Only provided when creating a new EdgeConnect. |
oauthClientSecret | string | Secret of OAuth client used to connect by the EdgeConnect. Only provided when creating a new EdgeConnect. |
EdgeConnectInstance
Name | Type |
---|---|
instanceId | string |
version | string |
EdgeConnects
Name | Type | Description |
---|---|---|
edgeConnects | Array<EdgeConnect> | |
totalCount | number | Total number of currently configured EdgeConnects |
Error
Name | Type |
---|---|
code*required | number |
details | ErrorDetails |
message*required | string |
ErrorDetails
Name | Type |
---|---|
constraintViolations | Array<ConstraintViolation> |
missingScopes | Array<string> |
ErrorResponse
Name | Type |
---|---|
error*required | Error |
HostMapping
Todo
Name | Type |
---|---|
from*required | string |
to*required | string |
MatchedEdgeConnect
Contains information about the EdgeConnect and the matched pattern
Name | Type |
---|---|
id*required | string |
matchedPattern*required | string |
metadata | Metadata |
name*required | string |
MatchedResponse
Name | Type | Description |
---|---|---|
matched | MatchedEdgeConnect | Contains information about the EdgeConnect and the matched pattern |
secondaryMatching | Array<MatchedEdgeConnect> |
Metadata
Name | Type | Description |
---|---|---|
instances | Array<EdgeConnectInstance> | |
oauthClientStatus | "ACTIVE" | "INACTIVE" | "PENDING_DELETION" | "DELETED" | The status of the OAuth client |
ModificationInfo
Name | Type |
---|---|
lastModifiedBy*required | string |
lastModifiedTime*required | Date |
OAuthClientRotationResponse
Name | Type |
---|---|
clientId*required | string |
clientSecret*required | string |