in aliyun/log/logclient.py [0:0]
def create_topostore(self, topostore):
"""create topostore
Unsuccessful operation will cause an LogException.
:type topostore: Topostore
:param topostore: instance of Topostore
"""
if not isinstance(topostore, Topostore):
raise TypeError("topostore must be instance of Topostore ")
params = {}
topostore.check_for_create()
body = {
"name": topostore.get_name(),
}
tag = topostore.get_tag()
description = topostore.get_description()
schema = topostore.get_schema()
acl = topostore.get_acl()
ext_info = topostore.get_ext_info()
if description:
body["description"] = description
if schema:
body["schema"] = json.dumps(schema)
if tag:
body["tag"] = json.dumps(tag)
if acl:
body["acl"] = json.dumps(acl)
if ext_info:
body["extInfo"] = ext_info
body_str = six.b(json.dumps(body))
headers = {'x-log-bodyrawsize': str(len(body_str))}
resource = "/topostores"
(resp, header) = self._send("POST", None, body_str, resource, params, headers)
return CreateTopostoreResponse(header, resp)