Ana içeriğe geç

Endpoint

Endpoint Features

Path

The URL path of the endpoint. For example: /api/v1/products

Method

HTTP method. GET, POST, PUT, DELETE, PATCH, etc.

Operation

The operation performed by the endpoint. For example: "Get product list"

Backend Mapping

The corresponding endpoint in the backend

Endpoint Processing Flow

The following diagram shows how the endpoint works in the request and response flow and the path rewriting process:

sequenceDiagram
participant Client as 👤 Client
participant Gateway as 🚪 API Gateway
participant ClientRoute as 🔀 Client Route
participant Endpoint as 📍 Endpoint
participant Policies as 🛡️ Endpoint Policies
participant PathRewrite as 🔄 Path Rewriting
participant Routing as ⚙️ Routing Logic
participant Upstream as 🎯 Upstream Target
participant Backend as 🖥️ Backend API

Client->>Gateway: HTTP Request<br/>GET /api/v1/products

Note over Gateway: Request Reached Gateway

Gateway->>ClientRoute: Route to Client Route<br/>Path: /api/v1/*

Note over ClientRoute: Client Route Evaluation<br/>Path, Host, Header, Method

ClientRoute->>Endpoint: Appropriate Endpoint Found<br/>GET /api/v1/products

Note over Endpoint: Endpoint Processing Started

Endpoint->>Policies: Endpoint-Based Policies<br/>Applied

Note over Policies: Endpoint-Specific Policies:<br/>Security, Rate Limiting,<br/>Validation, Transformation

Policies->>PathRewrite: Path Rewriting<br/>Process

Note over PathRewrite: Path Transformation:<br/>Client Path: /api/v1/products<br/>↓ (Path Rewrite)<br/>Backend Path: /products<br/>or<br/>Backend Path: /v2/products

PathRewrite->>Routing: Transformed Path<br/>Forwarded to Routing Logic

Note over Routing: Routing Operations:<br/>Load Balancing<br/>Failover<br/>Path Rewrite Applied

Routing->>Upstream: Upstream Target Selected<br/>With Backend Path

Note over Upstream: Backend Mapping:<br/>Backend Path: /products<br/>Backend Method: GET

Upstream->>Backend: Request Forwarded to Backend<br/>GET http://backend:8080/products

Backend->>Upstream: Response Returns<br/>200 OK

Upstream->>Routing: Processed Response

Routing->>Endpoint: Routing Completed

Endpoint->>Policies: Post-flow Policies<br/>(For Response)

Policies->>ClientRoute: Endpoint Processing Completed

ClientRoute->>Gateway: Processed Response

Gateway->>Client: HTTP Response<br/>200 OK

Note over Client,Gateway: Process Completed

Note over PathRewrite,Backend: Path Rewriting:<br/>Transforms Client Path to Backend Path<br/>and Provides<br/>API Versioning,<br/>Path Simplification

Endpoint Structure

An endpoint contains the following information:

GET /api/v1/products
│ │ │ │
│ │ │ └─ Resource
│ │ └─ Version
│ └─ Base Path
└─ HTTP Method

Example Endpoints

GET /api/v1/products

Get product list

GET /api/v1/products/{id}

Get single product detail

POST /api/v1/products

Create new product

PUT /api/v1/products/{id}

Update product

DELETE /api/v1/products/{id}

Delete product

Endpoint and Client Route Relationship

Endpoints are defined under Client Route:

Client Route: /api/v1/*

├─ GET /api/v1/products
├─ GET /api/v1/products/{id}
├─ POST /api/v1/products
├─ PUT /api/v1/products/{id}
└─ DELETE /api/v1/products/{id}
bilgi

Client Route is the top-level configuration for endpoints. Multiple endpoints can be defined under a Client Route. Endpoints are specific path and method combinations within the Client Route's path.

Endpoint Configuration

When creating an endpoint, the following information is defined:

Basic Information
  • Path: The URL path of the endpoint
  • Method: HTTP method (GET, POST, PUT, DELETE, etc.)
  • Operation ID: Unique identifier of the endpoint
  • Description: Description of the endpoint
Parameters
  • Query Parameters: Query string parameters in the URL
  • Path Parameters: Dynamic parameters in the URL path (e.g., {id})
  • Header Parameters: HTTP header parameters
Request and Response
  • Request Body: Request body schema (JSON, XML, etc.)
  • Response: Response schema and status codes
  • Content-Type: Request and response content types
Backend Mapping
  • Backend Path: Corresponding path in the backend
  • Backend Method: HTTP method in the backend
  • Path Rewrite: Path transformation rules

Endpoint Types

REST Endpoint

Endpoints for REST APIs

Data exchange in JSON format. Endpoints compliant with RESTful design principles.

SOAP Endpoint

Endpoints for SOAP Web Services

Data exchange in XML format. Configured with WSDL definitions.

gRPC Endpoint

Endpoints for gRPC services

Data exchange in Protobuf format. High-performance RPC calls.

WebSocket Endpoint

Endpoints for WebSocket connections

Real-time communication. Provides bidirectional data exchange.

Endpoint and Policy Relationship

Endpoint-specific policies can be applied:

Endpoint-Based Security

Different security policies for each endpoint

Security mechanisms such as OAuth2, JWT, API Key can be configured at the endpoint level.

Endpoint-Based Rate Limiting

Different rate limit for each endpoint

Request count and bandwidth limits can be defined at the endpoint level.

Endpoint-Based Transformation

Different transformation rules for each endpoint

JSON ↔ XML conversion, data mapping and transformation can be performed at the endpoint level.

Endpoint-Based Validation

Different validation rules for each endpoint

Request/Response validation, schema validation can be configured at the endpoint level.

Endpoint Versioning

Endpoints can be versioned:

Version 1

/api/v1/products

First version. Basic functionality.

Version 2

/api/v2/products

Enhanced version. New features.

Version 3

/api/v3/products

Latest version. Current API.

Backward Compatibility

Backward compatibility is maintained. Old versions continue to work and new versions do not affect old versions.

Gradual Migration

Gradual migration can be performed. Clients can migrate to the new version at their own pace.

Version Management

Different versions can be deployed to different environments and can run simultaneously. Versioning enables API lifecycle management.

Endpoint and Routing Relationship

Endpoints serve as a bridge between Client Route and Upstream Target:

Client Request


Client Route (/api/v1/*)


Endpoint (GET /api/v1/products)

│ Routing Logic
│ (Load Balancing, Failover)


Upstream Target (http://backend:8080/products)


Backend API
bilgi

While routing requests from Client Route to Upstream Target, the endpoint applies routing logic and policies.

Next Steps