このページは、まだ日本語ではご利用いただけません。翻訳中です。
基本構成例
以下の例では、oas-validation
プラグインをserviceで有効にするための一般的な設定をご紹介します。
次のリクエストを行います。
curl -X POST http://localhost:8001/services/{serviceName|Id}/plugins \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "oas-validation",
"config": {
"api_spec": "openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"
}
}
'
SERVICE_NAME | IDを、このプラグイン構成の対象となるサービスの idまたはnameに置き換えてください。 |
独自のアクセストークン、リージョン、コントロールプレーンID、サービスIDを代入して、次のリクエストを行ってください。
curl -X POST \
https://{us|eu}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/services/{serviceId}/plugins \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer TOKEN" \
--data '{"name":"oas-validation","config":{"api_spec":"openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"}}'
地域固有のURLと個人アクセストークンの詳細については、 Konnect API referenceをご参照ください。
まず、KongPlugin リソースを作成します:
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: oas-validation-example
plugin: oas-validation
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
" | kubectl apply -f -
次に、次のようにserviceに注釈を付けて、KongPluginリソースをイングレスに適用します。
kubectl annotate service SERVICE_NAME konghq.com/plugins=oas-validation-example
SERVICE_NAMEを、このプラグイン構成が対象とするサービスの名前に置き換えます。 kubectl get serviceを実行すると、利用可能なイングレスを確認できます。
注: KongPluginリソースは一度だけ定義するだけで、ネームスペース内の任意のサービス、コンシューマー、またはルートに適用できます。プラグインをクラスター全体で利用可能にしたい場合は、KongPlugin
の代わりにKongClusterPlugin
としてリソースを作成してください。
このセクションを宣言型構成ファイルに追加します。
plugins:
- name: oas-validation
service: SERVICE_NAME|ID
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
SERVICE_NAME | IDを、このプラグイン構成の対象となるサービスの idまたはnameに置き換えてください。 |
前提条件: パーソナルアクセストークンの設定
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "kpat_YOUR_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Kong Konnectゲートウェイプラグインを作成するには、Terraform 構成に以下を追加します。
resource "konnect_gateway_plugin_oas_validation" "my_oas_validation" {
enabled = true
config = {
api_spec = <<EOF
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
EOF
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
service = {
id = konnect_gateway_service.my_service.id
}
}
以下の例では、oas-validation
プラグインをrouteで有効にするための一般的な設定をご紹介します。
次のリクエストを行います。
curl -X POST http://localhost:8001/routes/{routeName|Id}/plugins \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "oas-validation",
"config": {
"api_spec": "openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"
}
}
'
ROUTE_NAME | IDを、このプラグイン構成が対象とするルートのid またはnameに置き換えてください。 |
独自のアクセストークン、リージョン、コントロールプレーン(CP)ID、ルートIDを代入して、次のリクエストをしてください。
curl -X POST \
https://{us|eu}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/routes/{routeId}/plugins \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer TOKEN" \
--data '{"name":"oas-validation","config":{"api_spec":"openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"}}'
地域固有のURLと個人アクセストークンの詳細については、 Konnect API referenceをご参照ください。
まず、KongPlugin リソースを作成します:
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: oas-validation-example
plugin: oas-validation
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
" | kubectl apply -f -
次に、次のようにingressに注釈を付けて、KongPluginリソースをイングレスに適用します。
kubectl annotate ingress INGRESS_NAME konghq.com/plugins=oas-validation-example
INGRESS_NAMEを、このプラグイン構成がターゲットとするイングレス名に置き換えます。 kubectl get ingressを実行すると、利用可能なイングレスを確認できます。
注: KongPluginリソースは一度だけ定義するだけで、ネームスペース内の任意のサービス、コンシューマー、またはルートに適用できます。プラグインをクラスター全体で利用可能にしたい場合は、KongPlugin
の代わりにKongClusterPlugin
としてリソースを作成してください。
このセクションを宣言型構成ファイルに追加します。
plugins:
- name: oas-validation
route: ROUTE_NAME|ID
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
ROUTE_NAME | IDを、このプラグイン構成が対象とするルートのid またはnameに置き換えてください。 |
前提条件: パーソナルアクセストークンの設定
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "kpat_YOUR_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Kong Konnectゲートウェイプラグインを作成するには、Terraform 構成に以下を追加します。
resource "konnect_gateway_plugin_oas_validation" "my_oas_validation" {
enabled = true
config = {
api_spec = <<EOF
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
EOF
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
route = {
id = konnect_gateway_route.my_route.id
}
}
以下の例では、oas-validation
プラグインをconsumerで有効にするための一般的な設定をご紹介します。
次のリクエストを行います。
curl -X POST http://localhost:8001/consumers/{consumerName|Id}/plugins \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "oas-validation",
"config": {
"api_spec": "openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"
}
}
'
CONSUMER_NAME | IDを、このプラグイン構成の対象となるコンシューマのidまたはnameに置き換えてください。 |
独自のアクセストークン、リージョン、コントロールプレーンID、コンシューマーIDを代入して、次のリクエストをしてください。
curl -X POST \
https://{us|eu}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/consumers/{consumerId}/plugins \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer TOKEN" \
--data '{"name":"oas-validation","config":{"api_spec":"openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"}}'
地域固有のURLと個人アクセストークンの詳細については、 Konnect API referenceをご参照ください。
まず、KongPlugin リソースを作成します:
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: oas-validation-example
plugin: oas-validation
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
" | kubectl apply -f -
次に、次のようにKongConsumerオブジェクトに注釈を付けて、KongPluginリソースをイングレスに適用します。
kubectl annotate KongConsumer CONSUMER_NAME konghq.com/plugins=oas-validation-example
CONSUMER_NAMEを、このプラグイン構成が対象とするコンシューマーの名前に置き換えます。 kubectl get KongConsumerを実行すると、利用可能なコンシューマを確認できます。
KongConsumerオブジェクトの詳細については、 コンシューマと認証情報のプロビジョニングをご参照ください。
注: KongPluginリソースは一度だけ定義するだけで、ネームスペース内の任意のサービス、コンシューマー、またはルートに適用できます。プラグインをクラスター全体で利用可能にしたい場合は、KongPlugin
の代わりにKongClusterPlugin
としてリソースを作成してください。
このセクションを宣言型構成ファイルに追加します。
plugins:
- name: oas-validation
consumer: CONSUMER_NAME|ID
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
CONSUMER_NAME | IDを、このプラグイン構成の対象となるコンシューマのidまたはnameに置き換えてください。 |
前提条件: パーソナルアクセストークンの設定
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "kpat_YOUR_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Kong Konnectゲートウェイプラグインを作成するには、Terraform 構成に以下を追加します。
resource "konnect_gateway_plugin_oas_validation" "my_oas_validation" {
enabled = true
config = {
api_spec = <<EOF
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
EOF
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
consumer = {
id = konnect_gateway_consumer.my_consumer.id
}
}
どのサービス、ルート、コンシューマー、コンシューマーグループにも関連しないプラグインは_global_とみなされ、 すべてのリクエストで実行されます。
- 自己管理型のKong Gateway Enterpriseでは、プラグインは特定のワークスペース内のすべてのエンティティに適用されます。
- セルフマネージドKong Gateway (OSS)では、プラグインは環境全体に適用されます。
- Konnectでは、プラグインは特定のコントロールプレーン(CP)内のすべてのエンティティに適用されます。
詳しくはプラグインリファレンスとプラグインの優先順位の セクションをご覧ください。
以下の例では、OAS Validation
プラグインをグローバルに有効にするための典型的な設定をいくつかご紹介します。
次のリクエストを行います。
curl -X POST http://localhost:8001/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "oas-validation",
"config": {
"api_spec": "openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"
}
}
'
独自のアクセストークン、リージョン、コントロールプレーン(CP)IDを代入して、次のリクエストをしてください。
curl -X POST \
https://{us|eu}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer TOKEN" \
--data '{"name":"oas-validation","config":{"api_spec":"openapi: 3.0.0\ninfo:\n version: \"2.19.3\"\n title: Xero Finance API\n description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.\n termsOfService: \"https://developer.xero.com/xero-developer-platform-terms-conditions/\"\n contact:\n name: \"Xero Platform Team\"\n email: \"api@xero.com\"\n url: \"https://developer.xero.com\"\n license:\n name: MIT\n url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'\nservers:\n - description: Xero API servers\n url: https://api.xero.com/finance.xro/1.0\npaths:\n /CashValidation:\n get:\n security:\n - OAuth2: [finance.cashvalidation.read]\n tags:\n - Finance\n summary: Get cash validation\n operationId: getCashValidation\n description: Summarizes the total cash position for each account for an org\n"}}'
地域固有のURLと個人アクセストークンの詳細については、 Konnect API referenceをご参照ください。
KongClusterPlugin作成する リソースを作成し、グローバルとしてラベル付けします。
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: <global-oas-validation>
annotations:
kubernetes.io/ingress.class: kong
labels:
global: "true"
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
plugin: oas-validation
宣言型構成ファイルにplugins
エントリを追加します。
plugins:
- name: oas-validation
config:
api_spec: |
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
前提条件: パーソナルアクセストークンの設定
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "kpat_YOUR_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Kong Konnectゲートウェイプラグインを作成するには、Terraform 構成に以下を追加します。
resource "konnect_gateway_plugin_oas_validation" "my_oas_validation" {
enabled = true
config = {
api_spec = <<EOF
openapi: 3.0.0
info:
version: "2.19.3"
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "api@xero.com"
url: "https://developer.xero.com"
license:
name: MIT
url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE'
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
get:
security:
- OAuth2: [finance.cashvalidation.read]
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
EOF
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
}