@@ -892,6 +892,23 @@ def remove_image(self, image, force=False, noprune=False):
892
892
res = self ._delete (self ._url ("/images/" + image ), params = params )
893
893
self ._raise_for_status (res )
894
894
895
+ def rename (self , container , name ):
896
+ if isinstance (container , dict ):
897
+ container = container .get ('Id' )
898
+ url = self ._url ("/containers/{0}/rename" .format (container ))
899
+ params = {'name' : name }
900
+ res = self ._post (url , None , params = params )
901
+ self ._raise_for_status (res )
902
+
903
+ def resize (self , container , height , width ):
904
+ if isinstance (container , dict ):
905
+ container = container .get ('Id' )
906
+
907
+ params = {'h' : height , 'w' : width }
908
+ url = self ._url ("/containers/{0}/resize" .format (container ))
909
+ res = self ._post (url , params = params )
910
+ self ._raise_for_status (res )
911
+
895
912
def restart (self , container , timeout = 10 ):
896
913
if isinstance (container , dict ):
897
914
container = container .get ('Id' )
@@ -939,15 +956,6 @@ def start(self, container, binds=None, port_bindings=None, lxc_conf=None,
939
956
res = self ._post_json (url , data = start_config )
940
957
self ._raise_for_status (res )
941
958
942
- def resize (self , container , height , width ):
943
- if isinstance (container , dict ):
944
- container = container .get ('Id' )
945
-
946
- params = {'h' : height , 'w' : width }
947
- url = self ._url ("/containers/{0}/resize" .format (container ))
948
- res = self ._post (url , params = params )
949
- self ._raise_for_status (res )
950
-
951
959
def stop (self , container , timeout = 10 ):
952
960
if isinstance (container , dict ):
953
961
container = container .get ('Id' )
0 commit comments