Skip to content

Commit

Permalink
Merge branch 'master' of github.com:aio-libs/aiodocker
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Barra committed Feb 16, 2018
2 parents 2f3df43 + 5a451bf commit e3140f3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
22 changes: 11 additions & 11 deletions aiodocker/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ async def history(self, name: str) -> Mapping:

async def pull(self, from_image: str, *,
auth: Optional[Union[MutableMapping, str, bytes]]=None,
tag: Optional[str]=None,
repo: Optional[str]=None,
tag: str=None,
repo: str=None,
stream: bool=False) -> Mapping:
"""
Similar to `docker pull`, pull an image locally
Expand Down Expand Up @@ -81,7 +81,7 @@ async def pull(self, from_image: str, *,

async def push(self, name: str, *,
auth: Union[MutableMapping, str, bytes]=None,
tag: Optional[str]=None,
tag: str=None,
stream: bool=False) -> Mapping:
params = {}
headers = {
Expand All @@ -105,7 +105,7 @@ async def push(self, name: str, *,
return (await json_stream_result(response, stream=stream))

async def tag(self, name: str, repo: str, *,
tag: Optional[str]=None) -> bool:
tag: str=None) -> bool:
"""
Tag the given image so that it becomes part of a repository.
Expand Down Expand Up @@ -150,19 +150,19 @@ async def delete(self, name: str, *, force: bool=False,
return response

async def build(self, *,
remote: Optional[str]=None,
fileobj: Optional[BinaryIO]=None,
path_dockerfile: Optional[str]=None,
tag: Optional[str]=None,
remote: str=None,
fileobj: BinaryIO=None,
path_dockerfile: str=None,
tag: str=None,
quiet: bool=False,
nocache: bool=False,
buildargs: Optional[Mapping]=None,
buildargs: Mapping=None,
pull: bool=False,
rm: bool=True,
forcerm: bool=False,
labels: Optional[Mapping]=None,
labels: Mapping=None,
stream: bool=False,
encoding: Optional[str]=None) -> Mapping:
encoding: str=None) -> Mapping:
"""
Build an image given a remote Dockerfile
or a file object with a Dockerfile inside
Expand Down
12 changes: 6 additions & 6 deletions aiodocker/nodes.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Any, Dict, List
from typing import Any, List, Mapping
from .utils import clean_filters


class DockerSwarmNodes(object):
def __init__(self, docker):
self.docker = docker

async def list(self, *, filters: Dict=None) -> List[Dict]:
async def list(self, *, filters: Mapping=None) -> List[Mapping]:
"""
Return a list of swarm's nodes.
Expand All @@ -31,7 +31,7 @@ async def list(self, *, filters: Dict=None) -> List[Dict]:

return response

async def inspect(self, *, node_id: str) -> Dict[str, Any]:
async def inspect(self, *, node_id: str) -> Mapping[str, Any]:
"""
Inspect a node
Expand All @@ -46,8 +46,8 @@ async def inspect(self, *, node_id: str) -> Dict[str, Any]:
return response

async def update(
self, *, node_id: str, version: int, spec: Dict[str, Any]
) -> Dict[str, Any]:
self, *, node_id: str, version: int, spec: Mapping[str, Any]
) -> Mapping[str, Any]:
"""
Update the spec of a node.
Expand Down Expand Up @@ -78,7 +78,7 @@ async def remove(
*,
node_id: str,
force: bool=False
) -> Dict[str, Any]:
) -> Mapping[str, Any]:
"""
Remove a node from a swarm.
Expand Down
24 changes: 12 additions & 12 deletions aiodocker/services.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from typing import Optional, Dict, List, Any, Union, AsyncIterator
from typing import Mapping, List, Any, Union, AsyncIterator
from .multiplexed import multiplexed_result
from .utils import clean_map, clean_networks, clean_filters, format_env

Expand All @@ -8,7 +8,7 @@ class DockerServices(object):
def __init__(self, docker):
self.docker = docker

async def list(self, *, filters: Optional[Dict]=None) -> List[Dict]:
async def list(self, *, filters: Mapping=None) -> List[Mapping]:
"""
Return a list of services
Expand All @@ -32,16 +32,16 @@ async def list(self, *, filters: Optional[Dict]=None) -> List[Dict]:
return response

async def create(self,
task_template: Dict[str, Any],
task_template: Mapping[str, Any],
*,
name: Optional[str]=None,
labels: Optional[List]=None,
mode: Optional[Dict]=None,
update_config: Optional[Dict]=None,
rollback_config: Optional[Dict]=None,
networks: Optional[List]=None,
endpoint_spec: Optional[Dict]=None
) -> Dict[str, Any]:
name: str=None,
labels: List=None,
mode: Mapping=None,
update_config: Mapping=None,
rollback_config: Mapping=None,
networks: List=None,
endpoint_spec: Mapping=None
) -> Mapping[str, Any]:
"""
Create a service
Expand Down Expand Up @@ -152,7 +152,7 @@ async def delete(self, service_id: str) -> bool:
)
return True

async def inspect(self, service_id: str) -> Dict[str, Any]:
async def inspect(self, service_id: str) -> Mapping[str, Any]:
"""
Inspect a service
Expand Down
6 changes: 3 additions & 3 deletions aiodocker/tasks.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Optional, List, Any, Dict
from typing import List, Any, Mapping
from .utils import clean_filters


class DockerTasks(object):
def __init__(self, docker):
self.docker = docker

async def list(self, *, filters: Optional[Dict]=None) -> List[Dict]:
async def list(self, *, filters: Mapping=None) -> List[Mapping]:
"""
Return a list of tasks
Expand All @@ -32,7 +32,7 @@ async def list(self, *, filters: Optional[Dict]=None) -> List[Dict]:
)
return response

async def inspect(self, task_id: str) -> Dict[str, Any]:
async def inspect(self, task_id: str) -> Mapping[str, Any]:
"""
Return info about a task
Expand Down
6 changes: 3 additions & 3 deletions aiodocker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def format_env(key, value: Union[None, bytes, str]) -> str:
return "{key}={value}".format(key=key, value=value)


def clean_networks(networks: Optional[Iterable[str]]=None) -> Iterable[str]:
def clean_networks(networks: Iterable[str]=None) -> Iterable[str]:
"""
Cleans the values inside `networks`
Returns a new list
Expand All @@ -202,7 +202,7 @@ def clean_networks(networks: Optional[Iterable[str]]=None) -> Iterable[str]:
return result


def clean_filters(filters: Optional[dict]=None) -> str:
def clean_filters(filters: Mapping=None) -> str:
"""
Checks the values inside `filters`
https://docs.docker.com/engine/api/v1.29/#operation/ServiceList
Expand Down Expand Up @@ -245,7 +245,7 @@ def mktar_from_dockerfile(fileobject: BinaryIO) -> IO:


def compose_auth_header(auth: Union[MutableMapping, str, bytes],
registry_addr: Optional[str]=None) -> str:
registry_addr: str=None) -> str:
"""
Validate and compose base64-encoded authentication header
with an optional support for parsing legacy-style "user:password"
Expand Down

0 comments on commit e3140f3

Please sign in to comment.