このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインはDBレスモードに対応しています。
Use the
api_specification
config for DB-less or hybrid mode. The API spec is configured directly in the plugin.
互換性のあるプロトコル
Mockingプラグインは以下のプロトコルに対応しています:
grpc
, grpcs
, http
, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
string required
プラグイン名。この場合は
mocking
。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
name
です。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
plugin
です。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
string
プラグインが対象とするサービス名または ID。最上位の
/plugins
エンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするルート名または ID。最上位の
/plugins
エンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするコンシューマーの名前または ID。 最上位の
/plugins
エンドポイント. からコンシューマーにプラグインを追加する場合は、これらのパラメーターのいずれかを設定してください/consumers/{consumerName|Id}/plugins
を使用する場合は必要ありません。 -
boolean default:
true
このプラグインが適用されるかどうか。
-
record required
-
string
The path and name of the specification file loaded into Kong Gateway’s database. You cannot use this option for DB-less or hybrid mode.
-
string
The contents of the specification file. You must use this option for hybrid or DB-less mode. With this configuration option, you can include the full specification as part of the configuration, instead of referring to a separate file with
api_specification_filename
that lives next to the Kong Gateway. In Kong Manager, you can copy and paste the contents of the spec directly into theConfig.Api Specification
text field.
-
boolean default:
false
Enables a random delay in the mocked response. Introduces delays to simulate real-time response times by APIs.
-
number default:
1
The maximum value in seconds of delay time. Set this value when
random_delay
is enabled and you want to adjust the default. The value must be greater than themin_delay_time
.
-
number default:
0.001
The minimum value in seconds of delay time. Set this value when
random_delay
is enabled and you want to adjust the default. The value must be less than themax_delay_time
.
-
boolean default:
false
Randomly selects one example and returns it. This parameter requires the spec to have multiple examples configured.
-
array of type
integer
A global list of the HTTP status codes that can only be selected and returned.
-
boolean required default:
false
Determines whether to randomly select an HTTP status code from the responses of the corresponding API method. The default value is
false
, which means the minimum HTTP status code is always selected and returned.
-