v6

latestOpenAPI 3.0.3raw.githubusercontent.com2025-11-28172255.4 KB
Mappings

Create a new mapping for a gateway

Creates a new path mapping within the specified gateway.

post/gateway/{gateway_topic}/mapping

Path parameters

gateway_topicstring required

Unique topic identifier of the gateway

Request body

pathstring required

URL path for the mapping

method'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD'

HTTP method for the mapping

is_publicboolean

Whether the mapping is publicly accessible

timeoutinteger

Timeout in milliseconds for mapping requests

traffic_distributionobject

Traffic distribution configuration for A/B testing

Example request

{
  "path": "/api/users",
  "method": "GET",
  "is_public": true,
  "limit": {
    "request": 5000,
    "time": 1000
  },
  "timeout": 30000,
  "traffic_distribution": {
    "1": 100
  }
}

Response

Mapping created successfully

Example response

{
  "body": {
    "subject": "ms.gateway.abcdef123456.mapping.get.api.users",
    "path": "/api/users",
    "method": "GET",
    "is_public": true,
    "limit": {
      "request": 5000,
      "time": 1000
    },
    "timeout": 30000,
    "traffic_distribution": {
      "1": 100
    },
    "modified": 1713531894,
    "type": "created"
  },
  "metadata": {
    "subject": "ms.gateway.abcdef123456.gateway"
  }
}