| OLD | NEW |
| 1 # Copyright 2013 The Swarming Authors. All rights reserved. | 1 # Copyright 2013 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Accesses files on Google Cloud Storage via Google Cloud Storage Client API. | 5 """Accesses files on Google Cloud Storage via Google Cloud Storage Client API. |
| 6 | 6 |
| 7 References: | 7 References: |
| 8 https://developers.google.com/appengine/docs/python/googlecloudstorageclient/ | 8 https://developers.google.com/appengine/docs/python/googlecloudstorageclient/ |
| 9 https://developers.google.com/storage/docs/accesscontrol#Signed-URLs | 9 https://developers.google.com/storage/docs/accesscontrol#Signed-URLs |
| 10 """ | 10 """ |
| 11 | 11 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 def get_download_url(self, filename, expiration=DEFAULT_EXPIRATION): | 324 def get_download_url(self, filename, expiration=DEFAULT_EXPIRATION): |
| 325 """Returns signed URL that can be used to download a file.""" | 325 """Returns signed URL that can be used to download a file.""" |
| 326 return self.get_signed_url(filename, 'GET', expiration=expiration) | 326 return self.get_signed_url(filename, 'GET', expiration=expiration) |
| 327 | 327 |
| 328 def get_upload_url(self, filename, expiration=DEFAULT_EXPIRATION, | 328 def get_upload_url(self, filename, expiration=DEFAULT_EXPIRATION, |
| 329 content_type='', content_md5=''): | 329 content_type='', content_md5=''): |
| 330 """Returns signed URL that can be used to upload a file.""" | 330 """Returns signed URL that can be used to upload a file.""" |
| 331 return self.get_signed_url(filename, 'PUT', expiration=expiration, | 331 return self.get_signed_url(filename, 'PUT', expiration=expiration, |
| 332 content_type=content_type, content_md5=content_md5) | 332 content_type=content_type, content_md5=content_md5) |
| OLD | NEW |