[英]Does Google Cloud Storage Bucket use Amazon S3?
I did set up a Google Cloud Storage Bucket with index.html and test.html and what I see, when I go to my domain:我确实使用 index.html 和 test.html 以及我在访问我的域时看到的内容设置了一个Google Cloud Storage Bucket :
See: doc.s3.amazonaws.com/2006-03-01 in:请参阅: doc.s3.amazonaws.com/2006-03-01在:
<?xml version='1.0' encoding='UTF-8'?>
<ListBucketResult xmlns='http://doc.s3.amazonaws.com/2006-03-01'>
<Name>my-domain.com</Name>
<Prefix></Prefix>
<Marker></Marker>
<IsTruncated>false</IsTruncated>
<Contents><Key>index.html</Key>
<Generation>1555969892676799</Generation>
<MetaGeneration>1</MetaGeneration>
<LastModified>2019-04-22T21:51...</LastModified>
<ETag>"...."</ETag>
<Size>25</Size></Contents><Contents>
<Key>test.html</Key>
etc..等等..
I do not have amazon account.我没有亚马逊账户。
Despite that string being present in the namespace, the response to that request is not coming from AWS.尽管命名空间中存在该字符串,但对该请求的响应并非来自 AWS。
Google Cloud Storage (GCS) has two APIs. Google Cloud Storage (GCS) 有两个 API。 One is JSON-based and looks like most of Google's APIs (called the JSON API), and the other is XML-based and is designed to be interoperable with some cloud storage tools and libraries that work with S3.
一个是基于 JSON 的,看起来像 Google 的大多数 API(称为 JSON API),另一个是基于 XML 的,旨在与一些使用 S3 的云存储工具和库互操作。 The idea is that, if you already use such a tool, such as the Python boto library, using GCS can be accomplished by changing the URL and credentials.
这个想法是,如果您已经使用了这样的工具,例如 Python boto 库,则可以通过更改 URL 和凭据来使用 GCS。 Clients parsing XML responses likely validate XML namespaces, and so they expect to see something like the string " http://doc.s3.amazonaws.com/2006-03-01 " as part of the protocol.
解析 XML 响应的客户端可能会验证 XML 名称空间,因此他们希望看到类似于字符串“ http://doc.s3.amazonaws.com/2006-03-01 ”的内容作为协议的一部分。
You're sending a request to the XML API (either via storage.googleapis.com, BUCKET_NAME.storage.googleapis.com, or via a CNAME DNS redirect to Cloud Storage) , and so the resulting message tries to provide an interoperable response.您正在向 XML API 发送请求(通过 storage.googleapis.com、BUCKET_NAME.storage.googleapis.com 或通过 CNAME DNS 重定向到 Cloud Storage),因此生成的消息会尝试提供可互操作的响应。
If we look at the documentation for the XML API found here we see that everything here is as expected.如果我们查看 此处找到的 XML API 文档,我们会发现 此处的所有内容都符合预期。 What we are seeing is an XML document which has an XML namespace called
http://doc.s3.amazonaws.com/2006-03-01
.我们看到的是一个 XML 文档,它有一个名为
http://doc.s3.amazonaws.com/2006-03-01
的 XML 命名空间。 Think of this as a declaration of the usage of a named data type.将此视为使用命名数据类型的声明。 It appears that this data type (a
ListBucketResult
) was specified by AWS (Amazon) and GCP decided to re-use this specification in its own implementation rather than just implement a completely new specification which likely would have been semantically identical to that which already existed.这种数据类型(一个
ListBucketResult
)似乎是由 AWS(亚马逊)指定的,GCP 决定在自己的实现中重新使用这个规范,而不是仅仅实现一个全新的规范,该规范可能在语义上与已经存在的规范相同. The re-use of interfaces is normally a good thing for all.接口的重用通常对所有人来说都是一件好事。 It would likely mean easier portability and less vendor lock-in to be able to choose a different cloud provider should you need.
如果您需要,这可能意味着更易于移植和更少的供应商锁定,以便能够选择不同的云提供商。
I'm going to guess that AWS was the first to provide cloud blob storage and had set precedent.我猜想 AWS 是第一个提供云 blob 存储的公司,并且开创了先河。 It is quite common to see XML Namespaces that describe open standards.
经常看到描述开放标准的 XML 命名空间。 I am going to also guess that there is no current open-standards specification for what a cloud storage provider should provide.
我还将猜测当前没有关于云存储提供商应该提供什么的开放标准规范。 So Amazon has S3, Google has Google Cloud Storage and Azure has Azure Blob Storage.
所以 Amazon 有 S3,Google 有 Google Cloud Storage,Azure 有 Azure Blob Storage。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.