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

Method pull_plugin

docker/api/plugin.py:106–141  ·  view source on GitHub ↗

Pull and install a plugin. After the plugin is installed, it can be enabled using :py:meth:`~enable_plugin`. Args: remote (string): Remote reference for the plugin to install. The ``:latest`` tag is optional, and is the defaul

(self, remote, privileges, name=None)

Source from the content-addressed store, hash-verified

104
105 @utils.minimum_version('1.25')
106 def pull_plugin(self, remote, privileges, name=None):
107 """
108 Pull and install a plugin. After the plugin is installed, it can be
109 enabled using :py:meth:`~enable_plugin`.
110
111 Args:
112 remote (string): Remote reference for the plugin to install.
113 The ``:latest`` tag is optional, and is the default if
114 omitted.
115 privileges (:py:class:`list`): A list of privileges the user
116 consents to grant to the plugin. Can be retrieved using
117 :py:meth:`~plugin_privileges`.
118 name (string): Local name for the pulled plugin. The
119 ``:latest`` tag is optional, and is the default if omitted.
120
121 Returns:
122 An iterable object streaming the decoded API logs
123 """
124 url = self._url('/plugins/pull')
125 params = {
126 'remote': remote,
127 }
128 if name:
129 params['name'] = name
130
131 headers = {}
132 registry, repo_name = auth.resolve_repository_name(remote)
133 header = auth.get_config_header(self, registry)
134 if header:
135 headers['X-Registry-Auth'] = header
136 response = self._post_json(
137 url, params=params, headers=headers, data=privileges,
138 stream=True
139 )
140 self._raise_for_status(response)
141 return self._stream_helper(response, decode=True)
142
143 @utils.minimum_version('1.25')
144 def plugins(self):

Callers 3

test_install_pluginMethod · 0.80
installMethod · 0.80

Calls 4

_urlMethod · 0.80
_post_jsonMethod · 0.80
_raise_for_statusMethod · 0.80
_stream_helperMethod · 0.80

Tested by 2

test_install_pluginMethod · 0.64