无法与非 AWS 服务对话

问题描述

我已经使用 Swift soto 包成功实现了一个 Amazon Web Service S3 存储应用程序。

我像这样创建 S3 服务对象:

func s3Maker() -> S3
{
    return S3(client: client,region: Region(rawValue: awsConfiguration.region),endpoint: awsConfiguration.endpoint,timeout: commandTimeout)
}

使用 AWS 时,awsConfiguration.region 是 AWS 的标准区域名称之一(在本例中为 "us-west-2"),而 .endpointnil(它告诉 soto 使用标准“amazonaws.com”域)。

一切都很好。

我现在想重用此代码与模拟 AWS S3 API 的非 AWS 提供商(从 BackBlaze 开始)进行通信。我的理解是,您只需在服务对象创建期间更改端点和区域即可。

我有一个 awsConfiguration 对象的子类,它只是具有不同的 region ("us-west-000") 和 endpoint ("backblazeb2.com") 属性值,但它没有不行。

代码运行时,它无法获取存储桶中的对象列表,返回错误:“无法读取存储桶内容

为了调试这个,我运行 fiddler Everywhere 来监控从我的机器发送的 HTTP 请求。当我运行 AWS 版本时,我看到两个 HTTPS 请求:http://qr3dev1.s3.us-west-2.amazonaws.com:443https://qr3dev1.s3.us-west-2.amazonaws.com/?list-type=2,它们都成功了。

但是当我将区域和端点更改为 BackBlaze 时,代码什么也不做。 soto 从不发送任何 HTTP 请求。代码只是返回错误

有没有人遇到过这种情况,知道如何调试它,或者知道让 soto 与非 AWS 服务通信的秘诀吗?

解决方法

事实证明,“问题”只是我的大脑、soto 文档和代码之间的阻抗不匹配。

感谢 Adam Fowler(soto 的作者之一),他用一些示例代码帮助我解决了正确使用 <script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js">. </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react- dom.production.min.js"></script> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <meta name="viewport" content="width=device-width,initial-scale=1" /> <meta name="theme-color" content="#000000" /> <meta name="description" content="Web site created using create-react-app" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <!-- manifest.json provides metadata used when your web app is installed on a user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ --> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <!-- Notice the use of %PUBLIC_URL% in the tags above. It will be replaced with the URL of the `public` folder during the build. Only files inside the `public` folder can be referenced from the HTML. Unlike "/favicon.ico" or "favicon.ico","%PUBLIC_URL%/favicon.ico" will work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> <title>React App</title> </head> <body> <noscript>You need to enable JavaScript to run this app.</noscript> <div id="root"></div> <!-- div with id="rootr" is where I was hoping the splash screen will show --> <div id="rootr"></div> <!-- This HTML file is a template. If you open it directly in the browser,you will see an empty page. You can add webfonts,meta tags,or analytics to this file. The build step will place the bundled scripts into the <body> tag. To begin the development,run `npm start` or `yarn start`. To create a production bundle,use `npm run build` or `yarn build`. --> </body> </html> 的问题。

cols = [(x,y) for x in df.columns for y in df.columns if x.strip('_a') == y.strip('_b')] diffs = [] for idx,row in df.iterrows(): for c in col: if row[c[0]] != row[c[1]]: # difference found! 属性必须是 URL 片段,而不仅仅是服务的域名(这是我的假设):

endpoint

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...