Configure a plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. options (dict): A key-value mapping of options Returns: ``True``
(self, name, options)
| 5 | @utils.minimum_version('1.25') |
| 6 | @utils.check_resource('name') |
| 7 | def configure_plugin(self, name, options): |
| 8 | """ |
| 9 | Configure a plugin. |
| 10 | |
| 11 | Args: |
| 12 | name (string): The name of the plugin. The ``:latest`` tag is |
| 13 | optional, and is the default if omitted. |
| 14 | options (dict): A key-value mapping of options |
| 15 | |
| 16 | Returns: |
| 17 | ``True`` if successful |
| 18 | """ |
| 19 | url = self._url('/plugins/{0}/set', name) |
| 20 | data = options |
| 21 | if isinstance(data, dict): |
| 22 | data = [f'{k}={v}' for k, v in data.items()] |
| 23 | res = self._post_json(url, data=data) |
| 24 | self._raise_for_status(res) |
| 25 | return True |
| 26 | |
| 27 | @utils.minimum_version('1.25') |
| 28 | def create_plugin(self, name, plugin_data_dir, gzip=False): |