The Rackspace provider in pkgcloud supports the following services:
- Compute (Cloud Servers)
- Storage (Cloud Files)
- Databases (Cloud Databases)
- DNS (Cloud DNS) (beta)
- Block Storage (Cloud Block Storage) (beta)
- Orchestration (Cloud Orchestration) (beta)
- Load Balancers (Cloud Load Balancers) (beta)
- Network (Cloud Networks) (beta)
- CDN (Rackspace CDN) (beta)
We've provided a simple compute example where it creates a couple of compute instances.
For all of the Rackspace services, you create a client with the same options:
var client = require('pkgcloud').compute.createClient({
provider: 'rackspace',
username: 'your-user-name',
apiKey: 'your-api-key'
});
In addition to your apiKey
, you could alternately provide your password
as an option to createClient
.
All of the Rackspace createClient
calls have a few options that can be provided:
region
specifies which region of a service to use. Different services have different regions enabled, and DNS doesn't require a region at all. The current list of regions is:
DFW
(Dallas, Texas)ORD
(Chicago, Illinois)IAD
(Washington, DC)LON
(London, UK)SYD
(Sydney, Austrailia)HKG
(Hong Kong, China)
var client = require('pkgcloud').compute.createClient({
provider: 'rackspace',
username: 'your-user-name',
apiKey: 'your-api-key',
region: 'ORD'
});
authUrl
specifies the authentication endpoint used to create a token for your Rackspace client. By default, this is set to the Global endpoint: https://identity.api.rackspacecloud.com.
var client = require('pkgcloud').compute.createClient({
provider: 'rackspace',
username: 'your-user-name',
apiKey: 'your-api-key',
authUrl: 'https://lon.identity.api.rackspacecloud.com'
});
When you make your first call to a Rackspace provider, your client is authenticated transparent to your API call. Rackspace will issue you a token, with an expiration. When that token expires, the client will automatically re-authenticate and retrieve a new token. The caller shouldn't have to worry about this happening.
As part of the options, you can tell pkgcloud
to use the Internal (Service Net) URLs for a service, if possible.
var client = require('pkgcloud').storage.createClient({
provider: 'rackspace',
username: 'your-user-name',
apiKey: 'your-api-key',
useInternal: true
});
This setting is explicit. If you set it to true, and you have no connectivity to the internal URL for a service, your connections will timeout.