Uh oh!
There was an error while loading. Please reload this page.
Add 'Blob.update_storage_class' API method. - #3051
Conversation
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # pylint: disable=too-many-lines |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # pylint: disable=too-many-lines |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| """Number (256 KB, in bytes) that must divide the chunk size.""" | ||
| _STORAGE_CLASSES = ( | ||
| 'STANDARD', 'NEARLINE', 'MULTI_REGIONAL', 'REGIONAL', 'COLDLINE') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| return api_response['rewriteToken'], rewritten, size | ||
| def update_storage_class(self, new_class, client=None): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| return api_response['rewriteToken'], rewritten, size | ||
| def update_storage_class(self, new_class, client=None): | ||
| """Rewrite source blob into this one. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| :param new_class: new storage class for the object | ||
| :type client: :class:`~google.cloud.storage.client.Client` or | ||
| ``NoneType`` |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self._encryption_key, source=True)) | ||
| api_response = client._connection.api_request( | ||
| method='POST', path=self.path + '/rewriteTo' + self.path, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| api_response = client._connection.api_request( | ||
| method='POST', path=self.path + '/rewriteTo' + self.path, | ||
| data={'storageClass': new_class}, headers=headers, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self.assertNotIn('X-Goog-Copy-Source-Encryption-Key-Sha256', headers) | ||
| self.assertNotIn('X-Goog-Encryption-Algorithm', headers) | ||
| self.assertNotIn('X-Goog-Encryption-Key', headers) | ||
| self.assertNotIn('X-Goog-Encryption-Key-Sha256', headers) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
commented
Feb 23, 2017
Two remaining sticking points:
|
tseaver
commented
Feb 23, 2017
The two sets aren't identical: in particular, the DRA class is only documented for Buckets, although it is deprecated, while the 'STANDARD' class isn't documented for POSC at all (although it happens to work). |
Is one a strict superset of the other? If so, the module with the larger set could import the smaller one and If neither set is a strict superset of the other, I agree with @tseaver that they should just be separate (rather than, say, having a base set that is the intersection). |
tseaver
commented
Feb 23, 2017
@lukesneeringer By inspection of the documented values at point-of-last-reading, yes: however, the docs don't specify that: they just describe the two sets which happen to overlap:
We could perhaps coalesce the two lists if we dropped support for setting the DRA type on buckets, or if we could get the storage back-end folks to document the possible values definitively for both buckets and objects. |
lukesneeringer
commented
Feb 24, 2017
Okay, got it. Based on that, I think I am going to say that we stick with @tseaver's approach as implemented for now (while acknowledging that it is a close call). |
dhermes
commented
Feb 24, 2017
@lukesneeringer@tseaver We should
|
Re-order to match canonical order in docs. Add docstrings with links to relevant docs. Explain why the two lists differ.
tseaver
commented
Feb 27, 2017
@dhermes, @lukesneeringer Any further issues? |
…ct_storage_class Add 'Blob.update_storage_class' API method.
…_class Add 'Blob.update_storage_class' API method.
Closes#2991.