问题标签 [pkgcloud]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1149 浏览

node.js - NodeJS 中的 pkgcloud 中的“支持流和管道”是什么意思

我的问题是让图像上传到亚马逊工作。我正在寻找一种不将文件保存在服务器上然后将其上传到亚马逊的解决方案。

谷歌搜索我找到了pkgcloud并且在 README.md 上它说:

已经特别注意了方法是流和管道能力的。

有人可以解释这意味着什么,如果它是我要找的吗?

0 投票
0 回答
814 浏览

node.js - Node.js worker memory spike Error R14 when using request & pkgcloud

This one has me totally baffled because it occurs seemingly at random. I have a Node.js app that streams tweets (using ntwitter), adding hundreds of rows per second to a mongodb. This part always works fine and memory use is steady. BUT recently I've started getting the URL of twitter avatars and saving them to our rackspace CDN (using "request" and "pkgcloud" modules). I cycle thru a max of 10 at a time (but usually way less) every 20 seconds and run this code:

Everything works okay for a while, but then I get the following madness in Nodetime:

Memory spike!!!!

And here's the output of "heroku logs -p worker -t" when things suddenly go haywire (notice how it's going along fine at around 600 MB then leaps to over 1GB after one particular image--and BTW all the images are standard twitter dimensions of 73x73, so it can't be a file size issue):

So I ask you, ladies and gentlemen: WTF!!!

0 投票
1 回答
251 浏览

node.js - createClient 时如何在 pkgcloud 中为 aws 指定区域?

我正在使用 pkgcloud npm 进行多云访问。我想列出所有区域的所有实例(如美国东部(弗吉尼亚北部)、美国西部(俄勒冈)、美国西部(加利福尼亚北部)、欧盟(爱尔兰))等。

这是我的代码

我还需要问你一件事是我可以在生产中使用 pkgcloud 吗?我也读过 apache libcloud 那么哪个更适合用于生产?pkgcloud 或 libcloud ?

0 投票
1 回答
393 浏览

node.js - 使用 openstack 为许多客户端进行令牌身份验证

我的问题是可以仅基于nodejs 的 pkgcloud 库中的令牌创建客户端。

因为我看到的是那种直截了当的方法:

允许使用用户名、密码凭据创建客户端。但是假设有很多客户端,我想对它们进行一次身份验证,然后只使用令牌在对象存储上进行操作,就像允许 OpenStack 一样。我不想将他们的凭据仅保留在我的服务器端他们的令牌上。那么从另一方面来说,我如何才能通过使用 pkgcloud 来进行操作(如上传、列出、创建容器等),并且只为经过身份验证的客户端提供令牌?

所以场景如下所示:

  1. 我通过用户名、密码验证 user1
  2. 我从 OpenStack 为 user1 收到 token1
  3. 我将该 token1 存储在我的数据库中
  4. 我通过用户名、密码验证 user2
  5. 我从 OpenStack 为 user2 收到 token2
  6. 我将该 token2 存储在我的数据库中
  7. 现在我想使用来自 user1 的 token1 在对象存储上进行下一个操作(如列表容器)

非常感谢您的回答 !

0 投票
1 回答
132 浏览

node.js - 如何使用 pkgcloud 获取 aws 的公共图像列表?

我正在尝试使用 pkgcloud 在 aws 上启动实例,因此必须使用该图像选项,因此我使用以下代码获取图像列表。

但上面的 API 返回空数组。那么如何获取 AWS 上可用的所有公共图像的列表?

有什么建议吗?

0 投票
1 回答
134 浏览

node.js - pkgcloud 和 GCE(谷歌计算引擎)

是否可以使用 pkgcloud for Node.js 控制 GCE(谷歌计算引擎)?

此页面显示“GCE API 被实现为 OpenStack Compute 的一等公民”: http ://www.cloudscaling.com/blog/cloud-computing/why-google-compute-engine-for-openstack/

...并且 pkgcloud 支持 OpenStack。但是我还没有看到任何地方明确确认了对 GCE 的支持,并且如果 OAuth 是由 pkgcloud 处理的(这里说得有点不知情),并且没有看到任何专门针对 GCE 的示例代码。

0 投票
1 回答
2404 浏览

node.js - 在 Node.js 中,如何从处理程序/回调方法向客户端发送消息

我是 node.js 的初学者。我正在尝试使用 node.js 创建一个 webapp,它将在云中创建服务器并管理它们。在做了一些研究之后,我决定使用 node.js、socket.io、express 和 pkgcloud 模块来创建 webapp。现在,我面临的问题是在创建服务器时我无法将消息发送到前端/客户端。服务器已成功创建,但我不知道如何将服务器状态发送到浏览器屏幕。

这是代码:index.js

ex_rackspace.js:

page.html(客户端):

0 投票
1 回答
164 浏览

node.js - 从nodejs中的回调获取列表

我正在尝试获取 Rackspace 中特定“堆栈”的“服务器”列表。由于某些服务器位于资源组(嵌套)中,因此我必须对 Stack 资源进行一些处理以获取服务器列表。我通过异步调用一一获取每台服务器。如何将它们捆绑在一起并一次性发送给客户?下面是代码:

实际上,问题是 pkgcloud 有一个方法“getResources”,它给定堆栈名称返回资源。从中我得到不在组中的服务器的“physical_resource_id”(server_id),但对于通过“OS::Heat::ResourceGroup”创建的服务器,因为资源列表只有一个“嵌套的'链接。所以我从嵌套的“链接”中获取 stack_name 并获取它的 server-id var stack_name = nestedlink.substr(nestedlink.indexOf('stacks/')+7, nestedlink.lastIndexOf('/'));。如果 pkgcloud 有类似给定堆栈名称的东西,它会返回其中的服务器列表,生活会很容易。

0 投票
2 回答
209 浏览

node.js - 使用 pkgcloud 为 Rackspace 定制 Skipper 适配器

我已经开始为 Sails.js 中的 Skipper 构建自定义适配器,使用 pkgcloud 上传到 Rackspace 云文件,但我被卡住了。看起来文件实际上并没有被上传,并且试图捕获错误似乎不起作用。也许我错过了一些东西。

我在这里发布了我的代码: https ://github.com/ccoppenbarger/skipper-rackspace

您需要在 api/adapters/rackspace 中检查它才能使用它。

我现在只研究接收器部分。pkgcloud api 在这里:https ://developer.rackspace.com/docs/cloud-files/getting-started/

我的控制器代码如下:

有人可以看看我在 index.js 中可能缺少什么吗?

0 投票
0 回答
677 浏览

sails.js - 船长在使用适配器上传之前调整图像大小

我有一个与此类似的问题。我怎样才能将此上传到我的 RackSpace 适配器?

这是代码: