Update Plugin Associated to a Specific Consumer
PATCH {{gateway}}/consumers/:consumerUsernameOrd}/plugins/:pluginId
Update Plugin Associated to a Specific Consumer konghq
Attributes | Mandatory | Description |
---|
consumer username or id | required | The unique identifier or the username of the Consumer to update. |
plugin id | required | The unique identifier of the Plugin to update. |
Request Body
Attributes | Mandatory | Description |
---|
name | required | The name of the Plugin that’s going to be added. Currently the Plugin must be installed in every Kong instance separately. |
route | optional | If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the Route being used. Defaults to null.With form-encoded, the notation is route.id= or route.name=. With JSON, use “"route":{"id":""} or "route":{"name":""}. |
service | optional | If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched. Defaults to null.With form-encoded, the notation is service.id= or service.name=. With JSON, use “"service":{"id":""} or "service":{"name":""}. |
consumer | optional | If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated consumer. Defaults to null.With form-encoded, the notation is consumer.id= or consumer.username=. With JSON, use “"consumer":{"id":""} or "consumer":{"username":""}. |
config | optional | The configuration properties for the Plugin which can be found on the plugins documentation page in the Kong Hub. |
protocols | required | A list of the request protocols that will trigger this plugin. The default value, as well as the possible values allowed on this field, may change depending on the plugin type. For example, plugins that only work in stream mode will only support "tcp" and "tls". Defaults to ["grpc", "grpcs", "http", "https"]. |
enabled | optional | Whether the plugin is applied. Defaults to true. |
tags | optional | An optional set of strings associated with the Plugin, for grouping and filtering. |
Request Body
{"config"=>{"minute"=>20, "policy"=>"cluster", "month"=>nil, "redis_timeout"=>2000, "limit_by"=>"consumer", "hide_client_headers"=>false, "second"=>nil, "day"=>nil, "redis_password"=>nil, "year"=>nil, "redis_database"=>0, "hour"=>500, "redis_port"=>6379, "redis_host"=>nil, "fault_tolerant"=>true}, "service"=>nil, "enabled"=>true, "protocols"=>["https", "http"], "name"=>"rate-limiting", "consumer"=>nil, "route"=>{"id"=>"875973fd-ba3f-4c7b-8301-e9263013e6d2"}, "tags"=>["admin", "high-priority", "critical"]}
Key | Datatype | Required | Description |
---|
Content-Type | string | | |