MCPcopy Index your code
hub / github.com/algorithmiaio/algorithmia-python / create

Method create

Algorithmia/datadirectory.py:42–50  ·  view source on GitHub ↗

Creates a directory, optionally include Acl argument to set permissions

(self, acl=None)

Source from the content-addressed store, hash-verified

40 return (response.status_code == 200)
41
42 def create(self, acl=None):
43 '''Creates a directory, optionally include Acl argument to set permissions'''
44 parent, name = getParentAndBase(self.path)
45 json = {'name': name}
46 if acl is not None:
47 json['acl'] = acl.to_api_param()
48 response = self.client.postJsonHelper(DataDirectory._getUrl(parent), json, False)
49 if (response.status_code != 200):
50 raise DataApiError("Directory creation failed: " + str(response.content))
51
52 def delete(self, force=False):
53 # Delete from data api

Calls 5

getParentAndBaseFunction · 0.90
DataApiErrorClass · 0.90
to_api_paramMethod · 0.80
postJsonHelperMethod · 0.80
_getUrlMethod · 0.80