【问题标题】:what attributes are available on key in django boto amazon s3django boto amazon s3 中的键有哪些属性可用
【发布时间】:2013-06-26 20:48:59
【问题描述】:

我正在使用 boto 从亚马逊获取密钥列表。 我使用key.name 来获取密钥的名称

我想知道键上还有哪些其他属性

亚马逊上是否提到了任何密钥都可用的信息

【问题讨论】:

    标签: python django amazon-s3 boto


    【解决方案1】:

    查看boto参考文档:boto API reference

    您还可以使用内置的dir() 函数获取对象的属性列表,在使用 Python CLI 中不熟悉的库时非常方便快速属性搜索:

    >>> import boto.s3.key
    >>> k = boto.s3.key.Key('somebucket')
    >>> dir(k)
    ['BufferSize', 'DefaultContentType', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'add_email_grant', 'add_user_grant', 'base64md5', 'bucket', 'cache_control', 'change_storage_class', 'close', 'closed', 'compute_md5', 'content_disposition', 'content_encoding', 'content_language', 'content_type', 'copy', 'delete', 'delete_marker', 'encrypted', 'endElement', 'etag', 'exists', 'filename', 'generate_url', 'get_acl', 'get_contents_as_string', 'get_contents_to_file', 'get_contents_to_filename', 'get_file', 'get_md5_from_hexdigest', 'get_metadata', 'get_torrent_file', 'get_xml_acl', 'handle_encryption_headers', 'handle_version_headers', 'is_latest', 'last_modified', 'make_public', 'md5', 'metadata', 'mode', 'name', 'next', 'open', 'open_read', 'open_write', 'owner', 'path', 'provider', 'read', 'resp', 'send_file', 'set_acl', 'set_canned_acl', 'set_contents_from_file', 'set_contents_from_filename', 'set_contents_from_stream', 'set_contents_from_string', 'set_metadata', 'set_xml_acl', 'size', 'source_version_id', 'startElement', 'storage_class', 'update_metadata', 'version_id']
    

    【讨论】:

      猜你喜欢
      • 2014-09-15
      • 2013-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-30
      • 1970-01-01
      • 1970-01-01
      • 2011-01-22
      相关资源
      最近更新 更多