Delen via


Gateway Route Configs - Create Or Update

Maak de standaardconfiguraties van de Spring Cloud Gateway-route of werk de bestaande Configuraties van de Spring Cloud Gateway-route bij.

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

URI-parameters

Name In Vereist Type Description
gatewayName
path True

string

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

De naam van Spring Cloud Gateway.

resourceGroupName
path True

string

De naam van de resourcegroep die de resource bevat. U kunt deze waarde verkrijgen via de Azure Resource Manager-API of de portal.

routeConfigName
path True

string

De naam van de configuratie van de Spring Cloud Gateway-route.

serviceName
path True

string

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

De naam van de serviceresource.

subscriptionId
path True

string

Hiermee haalt u de abonnements-id op waarmee het Microsoft Azure-abonnement uniek wordt geïdentificeerd. De abonnements-id maakt deel uit van de URI voor elke serviceoproep.

api-version
query True

string

minLength: 1

De API-versie die voor deze bewerking moet worden gebruikt.

Aanvraagbody

Name Type Description
properties

GatewayRouteConfigProperties

API-routeconfiguratie van de Spring Cloud Gateway

Antwoorden

Name Type Description
200 OK

GatewayRouteConfigResource

Succes. In het antwoord worden de bijgewerkte configuraties van de Spring Cloud Gateway-route beschreven.

201 Created

GatewayRouteConfigResource

Geschapen. In het antwoord worden de configuraties van de nieuwe Spring Cloud Gateway-route beschreven en bevat een Azure-AsyncOperation header om het bewerkingsresultaat op te vragen.

Other Status Codes

CloudError

Foutreactie waarin wordt beschreven waarom de bewerking is mislukt.

Beveiliging

azure_auth

Azure Active Directory OAuth2-stroom

Type: oauth2
Stroom: implicit
Autorisatie-URL: https://login.microsoftonline.com/common/oauth2/authorize

Bereiken

Name Description
user_impersonation Uw gebruikersaccount imiteren

Voorbeelden

GatewayRouteConfigs_CreateOrUpdate

Voorbeeldaanvraag

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"
        ]
      }
    ]
  }
}

Voorbeeldrespons

{
  "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"
}

Definities

Name Description
CloudError

Een foutreactie van de service.

CloudErrorBody

Een foutreactie van de service.

createdByType

Het type identiteit waarmee de resource is gemaakt.

GatewayApiRoute

API-routeconfiguratie van de Spring Cloud Gateway

GatewayProvisioningState

Status van de Spring Cloud-gateway.

GatewayRouteConfigOpenApiProperties

OpenAPI-eigenschappen van de routeconfiguratie van Spring Cloud Gateway.

GatewayRouteConfigProperties

API-routeconfiguratie van de Spring Cloud Gateway

GatewayRouteConfigProtocol

Protocol van gerouteerde Azure Spring Apps-toepassingen.

GatewayRouteConfigResource

Configuratieresource voor Spring Cloud Gateway-route

lastModifiedByType

Het type identiteit dat de resource voor het laatst heeft gewijzigd.

SystemData

Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.

CloudError

Een foutreactie van de service.

Name Type Description
error

CloudErrorBody

Een foutreactie van de service.

CloudErrorBody

Een foutreactie van de service.

Name Type Description
code

string

Een id voor de fout. Codes zijn invariant en zijn bedoeld om programmatisch te worden gebruikt.

details

CloudErrorBody[]

Een lijst met aanvullende informatie over de fout.

message

string

Een bericht met een beschrijving van de fout, bedoeld om te worden weergegeven in een gebruikersinterface.

target

string

Het doel van de specifieke fout. Bijvoorbeeld de naam van de eigenschap in fout.

createdByType

Het type identiteit waarmee de resource is gemaakt.

Waarde Description
User
Application
ManagedIdentity
Key

GatewayApiRoute

API-routeconfiguratie van de Spring Cloud Gateway

Name Type Description
description

string

Een beschrijving wordt toegepast op methoden in de gegenereerde OpenAPI-documentatie.

filters

string[]

Als u de aanvraag wilt wijzigen voordat u deze verzendt naar het doeleindpunt of het ontvangen antwoord.

order

integer (int32)

Routeverwerkingsorder.

predicates

string[]

Een aantal voorwaarden om een route voor elke aanvraag te evalueren. Elk predicaat kan worden geëvalueerd op basis van aanvraagheaders en parameterwaarden. Alle predicaten die aan een route zijn gekoppeld, moeten waar zijn om de route te laten overeenkomen met de aanvraag.

ssoEnabled

boolean

Sso-validatie inschakelen.

tags

string[]

Classificatietags worden toegepast op methoden in de gegenereerde OpenAPI-documentatie.

title

string

Een titel wordt toegepast op methoden in de gegenereerde OpenAPI-documentatie.

tokenRelay

boolean

Pass currently-authenticated user's identity token token to application service, default is 'false'

uri

string

Volledige URI, overschrijft appName.

GatewayProvisioningState

Status van de Spring Cloud-gateway.

Waarde Description
Creating
Updating
Succeeded
Failed
Deleting

GatewayRouteConfigOpenApiProperties

OpenAPI-eigenschappen van de routeconfiguratie van Spring Cloud Gateway.

Name Type Description
uri

string

De URI van openAPI-specificatie.

GatewayRouteConfigProperties

API-routeconfiguratie van de Spring Cloud Gateway

Name Type Default value Description
appResourceId

string

De resource-id van de Azure Spring Apps-app, vereist, tenzij de route uridefinieert.

filters

string[]

Als u de aanvraag wilt wijzigen voordat u deze verzendt naar het doeleindpunt of het ontvangen antwoord op app-niveau.

openApi

GatewayRouteConfigOpenApiProperties

OpenAPI-eigenschappen van de routeconfiguratie van Spring Cloud Gateway.

predicates

string[]

Een aantal voorwaarden om een route te evalueren voor elke aanvraag op app-niveau. Elk predicaat kan worden geëvalueerd op basis van aanvraagheaders en parameterwaarden. Alle predicaten die aan een route zijn gekoppeld, moeten waar zijn om de route te laten overeenkomen met de aanvraag.

protocol

GatewayRouteConfigProtocol

HTTP

Protocol van gerouteerde Azure Spring Apps-toepassingen.

provisioningState

GatewayProvisioningState

Status van de configuratie van de Spring Cloud Gateway-route.

routes

GatewayApiRoute[]

Matrix van API-routes, elke route bevat eigenschappen zoals title, uri, ssoEnabled, predicates, filters.

ssoEnabled

boolean

Schakel single Sign-On in op app-niveau.

GatewayRouteConfigProtocol

Protocol van gerouteerde Azure Spring Apps-toepassingen.

Waarde Description
HTTP
HTTPS

GatewayRouteConfigResource

Configuratieresource voor Spring Cloud Gateway-route

Name Type Description
id

string

Volledig gekwalificeerde resource-id voor de resource.

name

string

De naam van de resource.

properties

GatewayRouteConfigProperties

API-routeconfiguratie van de Spring Cloud Gateway

systemData

SystemData

Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.

type

string

Het type resource.

lastModifiedByType

Het type identiteit dat de resource voor het laatst heeft gewijzigd.

Waarde Description
User
Application
ManagedIdentity
Key

SystemData

Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.

Name Type Description
createdAt

string (date-time)

De tijdstempel van het maken van resources (UTC).

createdBy

string

De identiteit waarmee de resource is gemaakt.

createdByType

createdByType

Het type identiteit waarmee de resource is gemaakt.

lastModifiedAt

string (date-time)

De tijdstempel van resourcewijziging (UTC).

lastModifiedBy

string

De identiteit die de resource voor het laatst heeft gewijzigd.

lastModifiedByType

lastModifiedByType

Het type identiteit dat de resource voor het laatst heeft gewijzigd.