通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Gateway Route Configs - Create Or Update

创建默认的 Spring Cloud 网关路由配置或更新现有的 Spring Cloud Gateway 路由配置。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}?api-version=2023-12-01

URI 参数

名称 必需 类型 说明
gatewayName
path True

string

pattern: ^[a-z][a-z0-9]*$

Spring Cloud Gateway 的名称。

resourceGroupName
path True

string

包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。

routeConfigName
path True

string

Spring Cloud Gateway 路由配置的名称。

serviceName
path True

string

pattern: ^[a-z][a-z0-9-]*[a-z0-9]$

服务资源的名称。

subscriptionId
path True

string

获取唯一标识 azure 订阅Microsoft的订阅 ID。 订阅 ID 构成了每个服务调用的 URI 的一部分。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

名称 类型 说明
properties

GatewayRouteConfigProperties

Spring Cloud 网关的 API 路由配置

响应

名称 类型 说明
200 OK

GatewayRouteConfigResource

成功。 响应描述更新的 Spring Cloud 网关路由配置。

201 Created

GatewayRouteConfigResource

创建。 响应描述新创建的 Spring Cloud Gateway 路由配置,并包含用于查询作结果的 Azure-AsyncOperation 标头。

Other Status Codes

CloudError

描述作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

GatewayRouteConfigs_CreateOrUpdate

示例请求

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/routeConfigs/myRouteConfig?api-version=2023-12-01

{
  "properties": {
    "appResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp",
    "openApi": {
      "uri": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"
    },
    "protocol": "HTTPS",
    "routes": [
      {
        "title": "myApp route config",
        "ssoEnabled": true,
        "predicates": [
          "Path=/api5/customer/**"
        ],
        "filters": [
          "StripPrefix=2",
          "RateLimit=1,1s"
        ]
      }
    ]
  }
}

示例响应

{
  "properties": {
    "provisioningState": "Succeeded",
    "appResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp",
    "protocol": "HTTPS",
    "openApi": {
      "uri": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"
    },
    "routes": [
      {
        "title": "myApp route config",
        "ssoEnabled": true,
        "predicates": [
          "Path=/api5/customer/**"
        ],
        "filters": [
          "StripPrefix=2",
          "RateLimit=1,1s"
        ]
      }
    ]
  },
  "systemData": {
    "createdBy": "sample-user",
    "createdByType": "User",
    "createdAt": "2021-08-11T03:16:03.944Z",
    "lastModifiedBy": "sample-user",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-08-11T03:17:03.944Z"
  },
  "type": "Microsoft.AppPlatform/Spring/gateways/routeConfigs",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/routeConfigs/myRouteConfig",
  "name": "myRouteConfig"
}
{
  "properties": {
    "appResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp",
    "protocol": "HTTPS",
    "openApi": {
      "uri": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"
    },
    "routes": [
      {
        "title": "myApp route config",
        "ssoEnabled": true,
        "predicates": [
          "Path=/api5/customer/**"
        ],
        "filters": [
          "StripPrefix=2",
          "RateLimit=1,1s"
        ]
      }
    ]
  },
  "systemData": {
    "createdBy": "sample-user",
    "createdByType": "User",
    "createdAt": "2021-08-11T03:16:03.944Z",
    "lastModifiedBy": "sample-user",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-08-11T03:17:03.944Z"
  },
  "type": "Microsoft.AppPlatform/Spring/gateways/routeConfigs",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/routeConfigs/myRouteConfig",
  "name": "myRouteConfig"
}

定义

名称 说明
CloudError

服务的错误响应。

CloudErrorBody

服务的错误响应。

createdByType

创建资源的标识的类型。

GatewayApiRoute

Spring Cloud 网关的 API 路由配置

GatewayProvisioningState

Spring Cloud 网关的状态。

GatewayRouteConfigOpenApiProperties

Spring Cloud Gateway 路由配置的 OpenAPI 属性。

GatewayRouteConfigProperties

Spring Cloud 网关的 API 路由配置

GatewayRouteConfigProtocol

路由的 Azure Spring Apps 应用程序的协议。

GatewayRouteConfigResource

Spring Cloud Gateway 路由配置资源

lastModifiedByType

上次修改资源的标识的类型。

SystemData

与创建和上次修改资源相关的元数据。

CloudError

服务的错误响应。

名称 类型 说明
error

CloudErrorBody

服务的错误响应。

CloudErrorBody

服务的错误响应。

名称 类型 说明
code

string

错误的标识符。 代码是固定的,旨在以编程方式使用。

details

CloudErrorBody[]

有关错误的其他详细信息的列表。

message

string

描述错误的消息,旨在适合在用户界面中显示。

target

string

特定错误的目标。 例如,错误属性的名称。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

GatewayApiRoute

Spring Cloud 网关的 API 路由配置

名称 类型 说明
description

string

说明将应用于生成的 OpenAPI 文档中的方法。

filters

string[]

在将请求发送到目标终结点或收到的响应之前修改请求。

order

integer (int32)

路由处理顺序。

predicates

string[]

要评估每个请求的路由的多个条件。 可以根据请求标头和参数值评估每个谓词。 与路由关联的所有谓词必须计算为 true,才能使路由与请求匹配。

ssoEnabled

boolean

启用 sso 验证。

tags

string[]

分类标记将应用于生成的 OpenAPI 文档中的方法。

title

string

游戏将应用于生成的 OpenAPI 文档中的方法。

tokenRelay

boolean

将当前经过身份验证的用户标识令牌传递给应用程序服务,默认值为“false”

uri

string

完整 URI,将替代 appName

GatewayProvisioningState

Spring Cloud 网关的状态。

说明
Creating
Updating
Succeeded
Failed
Deleting

GatewayRouteConfigOpenApiProperties

Spring Cloud Gateway 路由配置的 OpenAPI 属性。

名称 类型 说明
uri

string

OpenAPI 规范的 URI。

GatewayRouteConfigProperties

Spring Cloud 网关的 API 路由配置

名称 类型 默认值 说明
appResourceId

string

除非路由定义 uri,否则 Azure Spring Apps 应用的资源 ID 是必需的。

filters

string[]

在将请求发送到目标终结点之前修改请求,或在应用级别收到响应。

openApi

GatewayRouteConfigOpenApiProperties

Spring Cloud Gateway 路由配置的 OpenAPI 属性。

predicates

string[]

评估应用级别中每个请求的路由的多个条件。 可以根据请求标头和参数值评估每个谓词。 与路由关联的所有谓词必须计算为 true,才能使路由与请求匹配。

protocol

GatewayRouteConfigProtocol

HTTP

路由的 Azure Spring Apps 应用程序的协议。

provisioningState

GatewayProvisioningState

Spring Cloud Gateway 路由配置的状态。

routes

GatewayApiRoute[]

API 路由数组,每个路由都包含属性,例如 titleurissoEnabledpredicatesfilters

ssoEnabled

boolean

在应用级别启用单个 Sign-On。

GatewayRouteConfigProtocol

路由的 Azure Spring Apps 应用程序的协议。

说明
HTTP
HTTPS

GatewayRouteConfigResource

Spring Cloud Gateway 路由配置资源

名称 类型 说明
id

string

资源的完全限定资源 ID。

name

string

资源的名称。

properties

GatewayRouteConfigProperties

Spring Cloud 网关的 API 路由配置

systemData

SystemData

与创建和上次修改资源相关的元数据。

type

string

资源的类型。

lastModifiedByType

上次修改资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

SystemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

资源修改的时间戳(UTC)。

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

lastModifiedByType

上次修改资源的标识的类型。