Allow to specify target URI in PUT/PATCH/POST method
Change-Id: I57df4efb8233ca7ddfdb315b70b3d64bec0b88a6
This commit is contained in:
parent
4c755bec26
commit
3327195d0c
@ -120,17 +120,23 @@ class ResourceBase(base.ResourceBase):
|
||||
description = base.Field("Description")
|
||||
"""The resource description"""
|
||||
|
||||
def post(self, data):
|
||||
def post(self, path="", data=None):
|
||||
"""Issue HTTP POST request to this resource"""
|
||||
self._conn.post(self.path, data=data)
|
||||
if path == "":
|
||||
path = self.path
|
||||
self._conn.post(path, data=data)
|
||||
|
||||
def patch(self, data):
|
||||
def patch(self, path="", data=None):
|
||||
"""Issue HTTP PATCH request to this resource"""
|
||||
self._conn.patch(self.path, data=data)
|
||||
if path == "":
|
||||
path = self.path
|
||||
self._conn.patch(path, data=data)
|
||||
|
||||
def put(self, data):
|
||||
def put(self, path="", data=None):
|
||||
"""Issue HTTP PUT request to this resource"""
|
||||
self._conn.put(self.path, data=data)
|
||||
if path == "":
|
||||
path = self.path
|
||||
self._conn.put(path, data=data)
|
||||
|
||||
def delete(self):
|
||||
"""Delete this resource"""
|
||||
@ -145,17 +151,23 @@ class ResourceCollectionBase(base.ResourceCollectionBase):
|
||||
description = base.Field("Description")
|
||||
"""The resource collection description"""
|
||||
|
||||
def post(self, data):
|
||||
def post(self, path="", data=None):
|
||||
"""Issue HTTP POST request to this resource"""
|
||||
self._conn.post(self.path, data=data)
|
||||
if path == "":
|
||||
path = self.path
|
||||
self._conn.post(path, data=data)
|
||||
|
||||
def patch(self, data):
|
||||
def patch(self, path="", data=None):
|
||||
"""Issue HTTP PATCH request to this resource"""
|
||||
self._conn.patch(self.path, data=data)
|
||||
if path == "":
|
||||
path = self.path
|
||||
self._conn.patch(path, data=data)
|
||||
|
||||
def put(self, data):
|
||||
def put(self, path="", data=None):
|
||||
"""Issue HTTP PUT request to this resource"""
|
||||
self._conn.put(self.path, data=data)
|
||||
if path == "":
|
||||
path = self.path
|
||||
self._conn.put(path, data=data)
|
||||
|
||||
def delete(self):
|
||||
"""Delete this resource collection"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user