MCPcopy Index your code
hub / github.com/docker/docker-py / create_plugin

Method create_plugin

docker/api/plugin.py:28–51  ·  view source on GitHub ↗

Create a new plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. plugin_data_dir (string): Path to the plugin data directory. Plugin data

(self, name, plugin_data_dir, gzip=False)

Source from the content-addressed store, hash-verified

26
27 @utils.minimum_version('1.25')
28 def create_plugin(self, name, plugin_data_dir, gzip=False):
29 """
30 Create a new plugin.
31
32 Args:
33 name (string): The name of the plugin. The ``:latest`` tag is
34 optional, and is the default if omitted.
35 plugin_data_dir (string): Path to the plugin data directory.
36 Plugin data directory must contain the ``config.json``
37 manifest file and the ``rootfs`` directory.
38 gzip (bool): Compress the context using gzip. Default: False
39
40 Returns:
41 ``True`` if successful
42 """
43 url = self._url('/plugins/create')
44
45 with utils.create_archive(
46 root=plugin_data_dir, gzip=gzip,
47 files=set(utils.build.walk(plugin_data_dir, []))
48 ) as archv:
49 res = self._post(url, params={'name': name}, data=archv)
50 self._raise_for_status(res)
51 return True
52
53 @utils.minimum_version('1.25')
54 def disable_plugin(self, name, force=False):

Callers 2

test_create_pluginMethod · 0.80
createMethod · 0.80

Calls 4

_urlMethod · 0.80
walkMethod · 0.80
_postMethod · 0.80
_raise_for_statusMethod · 0.80

Tested by 1

test_create_pluginMethod · 0.64