Module: Kongkit::Client::PluginObject
- Included in:
- Kongkit::Client
- Defined in:
- lib/kongkit/client/plugin_object.rb
Instance Method Summary collapse
-
#add_plugin(api_identifier, attributes) ⇒ Kongkit::Client::Resource
Add plugin.
-
#api_plugins(api_identifier, options = {}) ⇒ Kongkit::Client::Resource
List Plugins per API.
-
#edit_plugin(api_identifier, id, attributes) ⇒ Kongkit::Client::Resource
Edit plugin.
-
#enabled_plugins ⇒ Kongkit::Client::Resource
List enabled Plugins.
-
#plugin(id) ⇒ Kongkit::Client::Resource
Retrieve Plugin.
-
#plugin_schema(name) ⇒ Kongkit::Client::Resource
Retrieve Plugin Schema.
-
#plugins(options = {}) ⇒ Kongkit::Client::Resource
List all Plugins.
-
#remove_plugin(api_identifier, id) ⇒ Boolean
Remove plugin.
Instance Method Details
#add_plugin(api_identifier, attributes) ⇒ Kongkit::Client::Resource
Add plugin
73 74 75 |
# File 'lib/kongkit/client/plugin_object.rb', line 73 def add_plugin(api_identifier, attributes) post(api_plugins_path(api_identifier), body: attributes) end |
#api_plugins(api_identifier, options = {}) ⇒ Kongkit::Client::Resource
List Plugins per API
61 62 63 |
# File 'lib/kongkit/client/plugin_object.rb', line 61 def api_plugins(api_identifier, = {}) get(api_plugins_path(api_identifier), ) end |
#edit_plugin(api_identifier, id, attributes) ⇒ Kongkit::Client::Resource
Edit plugin
86 87 88 |
# File 'lib/kongkit/client/plugin_object.rb', line 86 def edit_plugin(api_identifier, id, attributes) patch(api_plugin_path(api_identifier, id), body: attributes) end |
#enabled_plugins ⇒ Kongkit::Client::Resource
List enabled Plugins
Retrieve a list of all installed plugins on the Kong node.
24 25 26 |
# File 'lib/kongkit/client/plugin_object.rb', line 24 def enabled_plugins get('/plugins/enabled') end |
#plugin(id) ⇒ Kongkit::Client::Resource
Retrieve Plugin
46 47 48 |
# File 'lib/kongkit/client/plugin_object.rb', line 46 def plugin(id) get("/plugins/#{id}") end |
#plugin_schema(name) ⇒ Kongkit::Client::Resource
Retrieve Plugin Schema
Retrieve the schema of a plugin’s configuration. This is useful to understand what fields a plugin accepts, and can be used for building third-party integrations to the Kong’s plugin system.
37 38 39 |
# File 'lib/kongkit/client/plugin_object.rb', line 37 def plugin_schema(name) get("/plugins/schema/#{name}") end |
#plugins(options = {}) ⇒ Kongkit::Client::Resource
List all Plugins
14 15 16 |
# File 'lib/kongkit/client/plugin_object.rb', line 14 def plugins( = {}) get('/plugins', ) end |
#remove_plugin(api_identifier, id) ⇒ Boolean
Remove plugin
96 97 98 |
# File 'lib/kongkit/client/plugin_object.rb', line 96 def remove_plugin(api_identifier, id) delete(api_plugin_path(api_identifier, id)) end |