Add Rackspace to pkgcloud's storage providers (#37951)

This commit is contained in:
Cornelis Heuperman 2019-08-30 02:01:49 +01:00 committed by Ron Buckton
parent 022f8a9727
commit c88c21cfc9
2 changed files with 28 additions and 1 deletions

View File

@ -2,8 +2,9 @@
// Project: https://github.com/pkgcloud/pkgcloud#readme
// Definitions by: Daniel Friesen <https://github.com/dantman>
// Adam Smith <https://github.com/ScriptSmith>
// Cornelis Heuperman <https://github.com/heuperman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
// TypeScript Version: 2.7
/// <reference types="node" />
@ -70,11 +71,28 @@ export interface OpenstackProviderOptions {
keystoneAuthVersion?: string;
}
export type RackspaceRegions =
| 'DFW' // Dallas/Fort Worth, United States
| 'ORD' // Chicago, United States
| 'IAD' // Northern Virginia, United States
| 'LON' // London, United Kingdom
| 'HKG' // Hong Kong, China
| 'SYD'; // Sydney, Australia
export interface RackspaceProviderOptions {
provider: 'rackspace';
username: string;
apiKey: string;
region: RackspaceRegions;
useInternal?: boolean;
}
export type ProviderOptions = BaseProviderOptions & Partial<
| AmazonProviderOptions
| AzureProviderOptions
| GoogleProviderOptions
| OpenstackProviderOptions
| RackspaceProviderOptions
>;
/**

View File

@ -37,6 +37,15 @@ pkgcloud.storage.createClient({
password: 'password'
});
// Rackspace
pkgcloud.storage.createClient({
provider: 'rackspace',
username: 'username',
apiKey: 'apiKey',
region: 'DFW',
useInternal: false
});
// Upload a File
{
const client = pkgcloud.storage.createClient({