Compartilhar via


Gateway - List Trace

Fetches trace collected by gateway.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listTrace?api-version=2024-05-01

URI Parameters

Name In Required Type Description
gatewayId
path True

string

Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

serviceName
path True

string

The name of the API Management service.

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

uuid

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Type Description
traceId

string

Trace id.

Responses

Name Type Description
200 OK

GatewayTraceContract

The response body contains trace collected by gateway.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

ApiManagementGatewayListTrace

Sample request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/listTrace?api-version=2024-05-01

{
  "traceId": "CrDvXXXXXXXXXXXXXVU3ZA2-1"
}

Sample response

{
  "serviceName": "apimService1",
  "traceId": "1e0447d4-XXXX-XXXX-XXXX-dbdb8098a0d3",
  "traceEntries": {
    "inbound": [
      {
        "source": "api-inspector",
        "timestamp": "2023-05-03T12:03:04.6899436Z",
        "elapsed": "00:00:00.2983315",
        "data": {
          "request": {
            "method": "GET",
            "url": "https://proxy.msitesting.net/6452XXXXXXXXXXXX9c2facb1/64524dXXXXXXXXXXXX2facb3?subscription-key=117313e70XXXXXXXXXXXX38ba4658ca3",
            "headers": [
              {
                "name": "Host",
                "value": "proxy.msitesting.net"
              }
            ]
          }
        }
      },
      {
        "source": "api-inspector",
        "timestamp": "2023-05-03T12:03:04.6969650Z",
        "elapsed": "00:00:00.3046329",
        "data": {
          "configuration": {
            "api": {
              "from": "/6452XXXXXXXXXXXX9c2facb1",
              "to": {
                "scheme": "http",
                "host": "msitesting.net",
                "port": 80,
                "path": "/",
                "queryString": "",
                "query": {},
                "isDefaultPort": true
              },
              "version": null,
              "revision": "1"
            },
            "operation": {
              "method": "GET",
              "uriTemplate": "/64524dXXXXXXXXXXXX2facb3"
            },
            "user": "-",
            "product": "-"
          }
        }
      },
      {
        "source": "cors",
        "timestamp": "2023-05-03T12:03:04.9901631Z",
        "elapsed": "00:00:00.5972352",
        "data": "Origin header was missing or empty and the request was classified as not cross-domain. CORS policy was not applied."
      },
      {
        "source": "set-status",
        "timestamp": "2023-05-03T12:03:05.0031202Z",
        "elapsed": "00:00:00.6107970",
        "data": {
          "message": [
            "Response status code was set to 200",
            "Response status reason was set to 'OK'"
          ]
        }
      },
      {
        "source": "return-response",
        "timestamp": "2023-05-03T12:03:05.0086543Z",
        "elapsed": "00:00:00.6164228",
        "data": {
          "message": "Return response was applied",
          "response": {
            "status": {
              "code": "OK",
              "reason": "OK"
            },
            "headers": []
          }
        }
      }
    ],
    "outbound": [
      {
        "source": "transfer-response",
        "timestamp": "2023-05-03T12:03:05.0438287Z",
        "elapsed": "00:00:00.6510195",
        "data": {
          "message": "Response has been sent to the caller in full"
        }
      }
    ]
  }
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

GatewayListTraceContract

List trace properties.

GatewayTraceContract

Trace collected in gateway.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

GatewayListTraceContract

List trace properties.

Name Type Description
traceId

string

Trace id.

GatewayTraceContract

Trace collected in gateway.