boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
8.93k stars 1.86k forks source link

boto3 s3 obj.storage_class documentation missing possible values #795

Open kingb opened 7 years ago

kingb commented 7 years ago

Request: Add S3 Object.storage_class possible values to documentation (relevant boto3 docs) Reason: Guessing possible values and meaning is not fun and prone to errors.

Context:

import boto3

s3 = boto3.resource('s3')
bucket = s3.Bucket('glacier_test')
for obj_sum in bucket.objects.all():
    obj = s3.Object(obj_sum.bucket_name, obj_sum.key)
    storage_class = obj.storage_class
    restore = obj.restore
    print(obj.key, obj.storage_class, obj.restore)

In the example above, obj.storage_class seems to return None or 'GLACIER', but I don't see anywhere in the documentation about the possible values?

I assume obj.storage_class is None means 'On normal S3 storage, not transitioned to glacier'?

kyleknap commented 7 years ago

Makes sense. Since storage_class is backed by an enumerated value, we should be able to add all of the different values. With the example syntax for client and resource calls that return a dictionary, we specify the enum values. Take the response syntax for list_objects for example. We just need to put these enum values in the parameter description.

mdavis-xyz commented 2 years ago

The same thing happens with Format in S3 Control create_job arguments.

boto docs

API docs

RyanFitzSimmonsAK commented 1 year ago

The boto3 team has recently announced that the Resource interface has entered a feature freeze and won’t be accepting new changes at this time: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html. We’ll be closing existing feature requests, such as this issue, to avoid any confusion on current implementation status. We do appreciate your feedback and will ensure it’s considered in future feature decisions.

We’d like to highlight that all existing code using resources is supported and will continue to work in Boto3. No action is needed from users of the library.