コード例 #1
0
 def __init__(self):
     super(get_bucket_list, self).__init__()
     self.auth = authenticate.authenticate().get_access_token
     self.header = {
         'Authorization': self.auth,
         'Content-Type': 'application/json'
     }
     self.method = 'get'
     self.url = 'https://developer.api.autodesk.com/oss/v2/buckets'
コード例 #2
0
 def __init__(self, bucketKey, objectKey):
     super(get_object_from_bucket_detail, self).__init__()
     self.url = 'https://developer.api.autodesk.com/oss/v2/buckets/{bucketKey}/objects/{objectKey}/details'.format(
         bucketKey=bucketKey, objectKey=objectKey)
     self.auth = authenticate.authenticate().get_access_token
     self.header = {
         'Authorization': self.auth,
         'Content-Type': 'application/json'
     }
     self.method = 'get'
コード例 #3
0
 def __init__(self, bucketname, policyKey='transient'):
     super(create_bucket, self).__init__()
     _data = {'bucketKey': bucketname, 'policyKey': policyKey}
     self.data = json.dumps(_data)
     self.auth = authenticate.authenticate().get_access_token
     self.header = {
         'Authorization': self.auth,
         'Content-Type': 'application/json'
     }
     self.method = 'post'
     self.url = 'https://developer.api.autodesk.com/oss/v2/buckets'
コード例 #4
0
 def __init__(self, bucketname, filename):
     super(download_file_from_bucket, self).__init__()
     self.bucketname = bucketname
     self.filename = filename
     self.url = 'https://developer.api.autodesk.com/oss/v2/buckets/%s/objects/%s' % (
         self.bucketname, self.filename)
     self.auth = authenticate.authenticate().get_access_token
     self.header = {
         'Authorization': self.auth,
         'Content-Type': 'application/octet-stream',
     }
     self.method = 'put'
コード例 #5
0
 def __init__(self, bucketname, filepath, filename):
     super(upload_file_to_bucket, self).__init__()
     self.bucketname = bucketname
     self.filename = filename
     with open(filepath, 'rb') as f:
         self.data = f.read()
     print(self.data.__len__())
     self.url = 'https://developer.api.autodesk.com/oss/v2/buckets/%s/objects/%s' % (
         self.bucketname, self.filename)
     self.auth = authenticate.authenticate().get_access_token
     self.header = {
         'Authorization': self.auth,
         'Content-Type': 'application/octet-stream',
     }
     self.method = 'put'