Merge pull request #1 from d-oliveros/master

Fixed .gitignore / Removed the node_modules from the repo
This commit is contained in:
amark 2014-07-31 19:35:03 -06:00
commit f63760b81b
582 changed files with 2 additions and 129064 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
node_modules/
npm-debug.log
node_modules/*
npm-debug.log

0
node_modules/.gitkeep generated vendored
View File

19
node_modules/aws-sdk/.eslintrc generated vendored
View File

@ -1,19 +0,0 @@
{
"env": {
"browser": true,
"node": true
},
"globals": {
"Buffer": true,
"escape": true
},
"rules": {
"quotes": [2, "single"],
"strict": 0,
"curly": 0,
"no-underscore-dangle": 0,
"new-cap": 0,
"dot-notation": 0,
"no-require-in-service": 2
}
}

17
node_modules/aws-sdk/.npmignore generated vendored
View File

@ -1,17 +0,0 @@
.yard*
.jshintrc
.travis.yml
apis/source
configuration
configuration.sample
dist
dist-tools
doc
doc-src
Gemfile
Gemfile.lock
features
Rakefile
test
tasks
vendor

12
node_modules/aws-sdk/LICENSE.txt generated vendored
View File

@ -1,12 +0,0 @@
Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You
may not use this file except in compliance with the License. A copy of
the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.

113
node_modules/aws-sdk/README.md generated vendored
View File

@ -1,113 +0,0 @@
# AWS SDK for JavaScript [![Version](https://badge.fury.io/js/aws-sdk.png)](http://badge.fury.io/js/aws-sdk) [![Build Status](https://travis-ci.org/aws/aws-sdk-js.png?branch=master)](https://travis-ci.org/aws/aws-sdk-js)
The official AWS SDK for JavaScript, available for browsers and mobile devices,
or Node.js backends
Release notes can be found at http://aws.amazon.com/releasenotes/SDK/JavaScript
## Installing
### In the Browser
To use the SDK in the browser, simply add the following script tag to your
HTML pages:
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.0.0-rc13.min.js"></script>
### In Node.js
The preferred way to install the AWS SDK for Node.js is to use the
[npm](http://npmjs.org) package manager for Node.js. Simply type the following
into a terminal window:
```sh
npm install aws-sdk
```
## Usage and Getting Started
You can find a getting started guide at:
http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/
## Supported Services
<p class="note"><strong>Note</strong>:
Although all services are supported in the browser version of the SDK,
not all of the services are available in the default hosted build (using the
script tag provided above). A list of services in the hosted build are provided
in the "<a href="http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/browser-services.html">Working With Services</a>"
section of the browser SDK guide, including instructions on how to build a
custom version of the SDK with extra services.
</p>
The SDK currently supports the following services:
<table>
<thead>
<th>Service Name</th>
<th>Class Name</th>
<th>API Version</th>
</thead>
<tbody>
<tr><td rowspan="2">Amazon CloudFront</td><td rowspan="2">AWS.CloudFront</td><td>2012-05-05</td></tr>
<tr><td>2013-11-11</td></tr>
<tr><td rowspan="2">Amazon CloudSearch</td><td rowspan="2">AWS.CloudSearch</td><td>2011-02-01</td></tr>
<tr><td>2013-01-01</td></tr>
<tr><td>Amazon CloudWatch</td><td>AWS.CloudWatch</td><td>2010-08-01</td></tr>
<tr><td rowspan="2">Amazon DynamoDB</td><td rowspan="2">AWS.DynamoDB</td><td>2011-12-05</td></tr>
<tr><td>2012-08-10</td></tr>
<tr><td>Amazon Elastic Compute Cloud</td><td>AWS.EC2</td><td>2014-02-01</td></tr>
<tr><td>Amazon Elastic MapReduce</td><td>AWS.EMR</td><td>2009-03-31</td></tr>
<tr><td>Amazon Elastic Transcoder</td><td>AWS.ElasticTranscoder</td><td>2012-09-25</td></tr>
<tr><td>Amazon ElastiCache</td><td>AWS.ElastiCache</td><td>2013-06-15</td></tr>
<tr><td>Amazon Glacier</td><td>AWS.Glacier</td><td>2012-06-01</td></tr>
<tr><td>Amazon Kinesis</td><td>AWS.Kinesis</td><td>2013-12-02</td></tr>
<tr><td>Amazon Redshift</td><td>AWS.Redshift</td><td>2012-12-01</td></tr>
<tr><td rowspan="3">Amazon Relational Database Service</td><td rowspan="3">AWS.RDS</td><td>2013-01-10</td></tr>
<tr><td>2013-02-12</td></tr>
<tr><td>2013-09-09</td></tr>
<tr><td>Amazon Route 53</td><td>AWS.Route53</td><td>2013-04-01</td></tr>
<tr><td>Amazon Simple Email Service</td><td>AWS.SES</td><td>2010-12-01</td></tr>
<tr><td>Amazon Simple Notification Service</td><td>AWS.SNS</td><td>2010-03-31</td></tr>
<tr><td>Amazon Simple Queue Service</td><td>AWS.SQS</td><td>2012-11-05</td></tr>
<tr><td>Amazon Simple Storage Service</td><td>AWS.S3</td><td>2006-03-01</td></tr>
<tr><td>Amazon Simple Workflow Service</td><td>AWS.SimpleWorkflow</td><td>2012-01-25</td></tr>
<tr><td>Amazon SimpleDB</td><td>AWS.SimpleDB</td><td>2009-04-15</td></tr>
<tr><td>Auto Scaling</td><td>AWS.AutoScaling</td><td>2011-01-01</td></tr>
<tr><td>AWS CloudFormation</td><td>AWS.CloudFormation</td><td>2010-05-15</td></tr>
<tr><td>AWS CloudTrail</td><td>AWS.CloudTrail</td><td>2013-11-01</td></tr>
<tr><td>AWS Data Pipeline</td><td>AWS.DataPipeline</td><td>2012-10-29</td></tr>
<tr><td>AWS Direct Connect</td><td>AWS.DirectConnect</td><td>2012-10-25</td></tr>
<tr><td>AWS Elastic Beanstalk</td><td>AWS.ElasticBeanstalk</td><td>2010-12-01</td></tr>
<tr><td>AWS Identity and Access Management</td><td>AWS.IAM</td><td>2010-05-08</td></tr>
<tr><td>AWS Import/Export</td><td>AWS.ImportExport</td><td>2010-06-01</td></tr>
<tr><td>AWS OpsWorks</td><td>AWS.OpsWorks</td><td>2013-02-18</td></tr>
<tr><td>AWS Security Token Service</td><td>AWS.STS</td><td>2011-06-15</td></tr>
<tr><td rowspan="2">AWS Storage Gateway</td><td rowspan="2">AWS.StorageGateway</td><td>2012-06-30</td></tr>
<tr><td>2013-06-30</td></tr>
<tr><td>AWS Support</td><td>AWS.Support</td><td>2013-04-15</td></tr>
<tr><td>Elastic Load Balancing</td><td>AWS.ELB</td><td>2012-06-01</td></tr>
</tbody>
</table>
## License
This SDK is distributed under the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
```no-highlight
Copyright 2012-2014. Amazon Web Services, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

8
node_modules/aws-sdk/bower.json generated vendored
View File

@ -1,8 +0,0 @@
{
"name": "aws-sdk",
"ignore": [
"doc-src", "features", "lib", "scripts", "tasks", "test",
"Gemfile*", "configuration*", "Rakefile", "*.json", ".*"
],
"main": "dist/aws-sdk.js"
}

View File

@ -1,10 +0,0 @@
module.exports = function(context) {
return {
CallExpression: function(node) {
if (!context.getFilename().match(/^lib\/services\//)) return;
if (node.callee.name === 'require' && node.arguments[0].value !== '../core') {
context.report(node, 'require() is disallowed in service files');
}
}
};
};

46
node_modules/aws-sdk/lib/aws.js generated vendored
View File

@ -1,46 +0,0 @@
var AWS = require('./core');
module.exports = AWS;
// Load the xml2js XML parser
require('./xml/node_parser');
// Load Node HTTP client
require('./http/node');
// Load all service classes
require('./services');
// Load custom credential providers
require('./credentials/ec2_metadata_credentials');
require('./credentials/environment_credentials');
require('./credentials/file_system_credentials');
// Setup default chain providers
AWS.CredentialProviderChain.defaultProviders = [
function () { return new AWS.EnvironmentCredentials('AWS'); },
function () { return new AWS.EnvironmentCredentials('AMAZON'); },
function () { return new AWS.EC2MetadataCredentials(); }
];
// Update configuration keys
AWS.util.update(AWS.Config.prototype.keys, {
credentials: function () {
var credentials = null;
new AWS.CredentialProviderChain([
function () { return new AWS.EnvironmentCredentials('AWS'); },
function () { return new AWS.EnvironmentCredentials('AMAZON'); }
]).resolve(function(err, creds) {
if (!err) credentials = creds;
});
return credentials;
},
credentialProvider: function() {
return new AWS.CredentialProviderChain();
},
region: function() {
return process.env.AWS_REGION || process.env.AMAZON_REGION;
}
});
// Reset configuration
AWS.config = new AWS.Config();

View File

@ -1,7 +0,0 @@
window.AWS = module.exports = require('./core');
// Load the DOMParser XML parser
require('./xml/browser_parser');
// Load the XHR HttpClient
require('./http/xhr');

346
node_modules/aws-sdk/lib/config.js generated vendored
View File

@ -1,346 +0,0 @@
var AWS = require('./core');
require('./credentials');
require('./credentials/credential_provider_chain');
/**
* The main configuration class used by all service objects to set
* the region, credentials, and other options for requests.
*
* By default, credentials and region settings are left unconfigured.
* This should be configured by the application before using any
* AWS service APIs.
*
* In order to set global configuration options, properties should
* be assigned to the global {AWS.config} object.
*
* @see AWS.config
*
* @!attribute credentials
* @return [AWS.Credentials] the AWS credentials to sign requests with.
*
* @!attribute region
* @example Set the global region setting to us-west-2
* AWS.config.update({region: 'us-west-2'});
* @return [AWS.Credentials] The region to send service requests to.
* @see http://docs.amazonwebservices.com/general/latest/gr/rande.html
* A list of available endpoints for each AWS service
*
* @!attribute maxRetries
* @return [Integer] the maximum amount of retries to perform for a
* service request. By default this value is calculated by the specific
* service object that the request is being made to.
*
* @!attribute maxRedirects
* @return [Integer] the maximum amount of redirects to follow for a
* service request. Defaults to 10.
*
* @!attribute paramValidation
* @return [Boolean] whether input parameters should be validated against
* the operation description before sending the request. Defaults to true.
*
* @!attribute computeChecksums
* @return [Boolean] whether to compute checksums for payload bodies when
* the service accepts it (currently supported in S3 only).
*
* @!attribute sslEnabled
* @return [Boolean] whether SSL is enabled for requests
*
* @!attribute s3ForcePathStyle
* @return [Boolean] whether to force path style URLs for S3 objects
*
* @!attribute httpOptions
* @return [map] A set of options to pass to the low-level HTTP request.
* Currently supported options are:
*
* * **proxy** [String] &mdash; the URL to proxy requests through
* * **agent** [http.Agent, https.Agent] &mdash; the Agent object to perform
* HTTP requests with. Used for connection pooling. Defaults to the global
* agent (`http.globalAgent`) for non-SSL connections. Note that for
* SSL connections, a special Agent object is used in order to enable
* peer certificate verification. This feature is only supported in the
* Node.js environment.
* * **timeout** [Integer] &mdash; The number of milliseconds to wait before
* giving up on a connection attempt. Defaults to no timeout.
*
* @!attribute logger
* @return [#write,#log] an object that responds to .write() (like a stream)
* or .log() (like the console object) in order to log information about
* requests
*
* @!attribute signatureVersion
* @return [String] the signature version to sign requests with (overriding
* the API configuration). Possible values are: 'v2', 'v3', 'v4'.
*/
AWS.Config = AWS.util.inherit({
/**
* Creates a new configuration object. This is the object that passes
* option data along to service requests, including credentials, security,
* region information, and some service specific settings.
*
* @example Creating a new configuration object with credentials and region
* var config = new AWS.Config({
* accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2'
* });
* @option options accessKeyId [String] your AWS access key ID.
* @option options secretAccessKey [String] your AWS secret access key.
* @option options sessionToken [AWS.Credentials] the optional AWS
* session token to sign requests with.
* @option options credentials [AWS.Credentials] the AWS credentials
* to sign requests with. You can either specify this object, or
* specify the accessKeyId and secretAccessKey options directly.
* @option options credentialProvider [AWS.CredentialProviderChain] the
* provider chain used to resolve credentials if no static `credentials`
* property is set.
* @option options region [String] the region to send service requests to.
* See {region} for more information.
* @option options maxRetries [Integer] the maximum amount of retries to
* attempt with a request. See {maxRetries} for more information.
* @option options maxRedirects [Integer] the maximum amount of redirects to
* follow with a request. See {maxRedirects} for more information.
* @option options sslEnabled [Boolean] whether to enable SSL for
* requests.
* @option options paramValidation [Boolean] whether parameter validation
* is on.
* @option options computeChecksums [Boolean] whether to compute checksums
* for payload bodies when the service accepts it (currently supported
* in S3 only)
* @option options s3ForcePathStyle [Boolean] whether to force path
* style URLs for S3 objects.
* @option options httpOptions [map] A set of options to pass to the low-level
* HTTP request. Currently supported options are:
*
* * **proxy** [String] &mdash; the URL to proxy requests through
* * **agent** [http.Agent, https.Agent] &mdash; the Agent object to perform
* HTTP requests with. Used for connection pooling. Defaults to the global
* agent (`http.globalAgent`) for non-SSL connections. Note that for
* SSL connections, a special Agent object is used in order to enable
* peer certificate verification. This feature is only available in the
* Node.js environment.
* * **timeout** [Integer] &mdash; Sets the socket to timeout after timeout
* milliseconds of inactivity on the socket. Defaults to no timeout.
* @option options apiVersion [String, Date] a String in YYYY-MM-DD format
* (or a date) that represents the latest possible API version that can be
* used in all services (unless overridden by `apiVersions`). Specify
* 'latest' to use the latest possible version.
* @option options apiVersions [map<String, String|Date>] a map of service
* identifiers (the lowercase service class name) with the API version to
* use when instantiating a service. Specify 'latest' for each individual
* that can use the latest available version.
* @option options logger [#write,#log] an object that responds to .write()
* (like a stream) or .log() (like the console object) in order to log
* information about requests
* @option options signatureVersion [String] the signature version to sign
* requests with (overriding the API configuration). Possible values are:
* 'v2', 'v3', 'v4'.
*/
constructor: function Config(options) {
if (options === undefined) options = {};
options = this.extractCredentials(options);
AWS.util.each.call(this, this.keys, function (key, value) {
this.set(key, options[key], value);
});
},
/**
* @overload update(options, allowUnknownKeys = false)
* Updates the current configuration object with new options.
*
* @example Update maxRetries property of a configuration object
* config.update({maxRetries: 10});
* @param [Object] options a map of option keys and values.
* @param [Boolean] allowUnknownKeys whether unknown keys can be set on
* the configuration object. Defaults to `false`.
* @see constructor
*/
update: function update(options, allowUnknownKeys) {
allowUnknownKeys = allowUnknownKeys || false;
options = this.extractCredentials(options);
AWS.util.each.call(this, options, function (key, value) {
if (allowUnknownKeys || this.keys.hasOwnProperty(key)) this[key] = value;
});
},
/**
* Loads credentials from the configuration object. This is used internally
* by the SDK to ensure that refreshable {Credentials} objects are properly
* refreshed and loaded when sending a request. If you want to ensure that
* your credentials are loaded prior to a request, you can use this method
* directly to provide accurate credential data stored in the object.
*
* @note If you configure the SDK with static or environment credentials,
* the credential data should already be present in {credentials} attribute.
* This method is primarily necessary to load credentials from asynchronous
* sources, or sources that can refresh credentials periodically.
* @example Getting your access key
* AWS.config.getCredentials(function(err) {
* if (err) console.log(err.stack); // credentials not loaded
* else console.log("Access Key:", AWS.config.credentials.accessKeyId);
* })
* @callback callback function(err)
* Called when the {credentials} have been properly set on the configuration
* object.
*
* @param err [Error] if this is set, credentials were not successfuly
* loaded and this error provides information why.
* @see credentials
* @see Credentials
*/
getCredentials: function getCredentials(callback) {
var self = this;
function finish(err) {
callback(err, err ? null : self.credentials);
}
function credError(msg, err) {
return new AWS.util.error(err || new Error(), {
code: 'CredentialsError', message: msg
});
}
function getAsyncCredentials() {
self.credentials.get(function(err) {
if (err) {
var msg = 'Could not load credentials from ' +
self.credentials.constructor.name;
err = credError(msg, err);
}
finish(err);
});
}
function getStaticCredentials() {
var err = null;
if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) {
err = credError('Missing credentials');
}
finish(err);
}
if (self.credentials) {
if (typeof self.credentials.get === 'function') {
getAsyncCredentials();
} else { // static credentials
getStaticCredentials();
}
} else if (self.credentialProvider) {
self.credentialProvider.resolve(function(err, creds) {
if (err) {
err = credError('Could not load credentials from any providers', err);
}
self.credentials = creds;
finish(err);
});
} else {
finish(credError('No credentials to load'));
}
},
/**
* Loads configuration data from a JSON file into this config object.
* @note Loading configuration will reset all existing configuration
* on the object.
* @!macro nobrowser
* @param path [String] the path to load configuration from
* @return [AWS.Config] the same configuration object
*/
loadFromPath: function loadFromPath(path) {
this.clear();
var options = JSON.parse(AWS.util.readFileSync(path));
var fileSystemCreds = new AWS.FileSystemCredentials(path);
var chain = new AWS.CredentialProviderChain();
chain.providers.unshift(fileSystemCreds);
chain.resolve(function (err, creds) {
if (err) throw err;
else options.credentials = creds;
});
this.constructor(options);
return this;
},
/**
* Clears configuration data on this object
*
* @api private
*/
clear: function clear() {
/*jshint forin:false */
AWS.util.each.call(this, this.keys, function (key) {
delete this[key];
});
// reset credential provider
this.set('credentials', undefined);
this.set('credentialProvider', undefined);
},
/**
* Sets a property on the configuration object, allowing for a
* default value
* @api private
*/
set: function set(property, value, defaultValue) {
if (value === undefined) {
if (defaultValue === undefined) {
defaultValue = this.keys[property];
}
if (typeof defaultValue === 'function') {
this[property] = defaultValue.call(this);
} else {
this[property] = defaultValue;
}
} else {
this[property] = value;
}
},
/**
* All of the keys with their default values.
*
* @constant
* @api private
*/
keys: {
credentials: null,
credentialProvider: null,
region: null,
logger: null,
apiVersions: {},
apiVersion: null,
endpoint: undefined,
httpOptions: {},
maxRetries: undefined,
maxRedirects: 10,
paramValidation: true,
sslEnabled: true,
s3ForcePathStyle: false,
computeChecksums: true,
dynamoDbCrc32: true
},
/**
* Extracts accessKeyId, secretAccessKey and sessionToken
* from a configuration hash.
*
* @api private
*/
extractCredentials: function extractCredentials(options) {
if (options.accessKeyId && options.secretAccessKey) {
options = AWS.util.copy(options);
options.credentials = new AWS.Credentials(options);
}
return options;
}
});
/**
* @return [AWS.Config] The global configuration object singleton instance
* @readonly
* @see AWS.Config
*/
AWS.config = new AWS.Config();

75
node_modules/aws-sdk/lib/core.js generated vendored
View File

@ -1,75 +0,0 @@
/**
* The main AWS namespace
*/
var AWS = {};
/**
* @api private
* @!macro [new] nobrowser
* @note This feature is not supported in the browser environment of the SDK.
*/
var _hidden = {}; _hidden = {}; // hack to parse macro
module.exports = AWS;
require('./util');
AWS.util.update(AWS, {
/**
* @constant
*/
VERSION: '2.0.0-rc13',
/**
* @api private
*/
ServiceInterface: {},
/**
* @api private
*/
Signers: {},
/**
* @api private
*/
XML: {}
});
require('./service');
require('./credentials');
require('./credentials/credential_provider_chain');
require('./credentials/temporary_credentials');
require('./credentials/web_identity_credentials');
require('./credentials/saml_credentials');
require('./config');
require('./http');
require('./sequential_executor');
require('./event_listeners');
require('./request');
require('./response');
require('./resource_waiter');
require('./signers/request_signer');
require('./param_validator');
/**
* @readonly
* @return [AWS.SequentialExecutor] a collection of global event listeners that
* are attached to every sent request.
* @see AWS.Request AWS.Request for a list of events to listen for
* @example Logging the time taken to send a request
* AWS.events.on('send', function startSend(resp) {
* resp.startTime = new Date().getTime();
* }).on('complete', function calculateTime(resp) {
* var time = (new Date().getTime() - resp.startTime) / 1000;
* console.log('Request took ' + time + ' seconds');
* });
*
* new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds'
*/
AWS.events = new AWS.SequentialExecutor();
if (typeof window !== 'undefined') window.AWS = AWS;

View File

@ -1,150 +0,0 @@
var AWS = require('./core');
/**
* Represents your AWS security credentials, specifically the
* {accessKeyId}, {secretAccessKey}, and optional {sessionToken}.
* Creating a `Credentials` object allows you to pass around your
* security information to configuration and service objects.
*
* Note that this class typically does not need to be constructed manually,
* as the {AWS.Config} and {AWS.Service} classes both accept simple
* options hashes with the three keys. These structures will be converted
* into Credentials objects automatically.
*
* ## Expiring and Refreshing Credentials
*
* Occasionally credentials can expire in the middle of a long-running
* application. In this case, the SDK will automatically attempt to
* refresh the credentials from the storage location if the Credentials
* class implements the {refresh} method.
*
* If you are implementing a credential storage location, you
* will want to create a subclass of the `Credentials` class and
* override the {refresh} method. This method allows credentials to be
* retrieved from the backing store, be it a file system, database, or
* some network storage. The method should reset the credential attributes
* on the object.
*
* @!attribute expired
* @return [Boolean] whether the credentials have been expired and
* require a refresh. Used in conjunction with {expireTime}.
* @!attribute expireTime
* @return [Date] a time when credentials should be considered expired. Used
* in conjunction with {expired}.
* @!attribute accessKeyId
* @return [String] the AWS access key ID
* @!attribute secretAccessKey
* @return [String] the AWS secret access key
* @!attribute sessionToken
* @return [String] an optional AWS session token
*/
AWS.Credentials = AWS.util.inherit({
/**
* A credentials object can be created using positional arguments or an options
* hash.
*
* @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null)
* Creates a Credentials object with a given set of credential information
* as positional arguments.
* @param accessKeyId [String] the AWS access key ID
* @param secretAccessKey [String] the AWS secret access key
* @param sessionToken [String] the optional AWS session token
* @example Create a credentials object with AWS credentials
* var creds = new AWS.Credentials('akid', 'secret', 'session');
* @overload AWS.Credentials(options)
* Creates a Credentials object with a given set of credential information
* as an options hash.
* @option options accessKeyId [String] the AWS access key ID
* @option options secretAccessKey [String] the AWS secret access key
* @option options sessionToken [String] the optional AWS session token
* @example Create a credentials object with AWS credentials
* var creds = new AWS.Credentials({
* accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session'
* });
*/
constructor: function Credentials() {
// hide secretAccessKey from being displayed with util.inspect
AWS.util.hideProperties(this, ['secretAccessKey']);
this.expired = false;
this.expireTime = null;
if (arguments.length === 1 && typeof arguments[0] === 'object') {
var creds = arguments[0].credentials || arguments[0];
this.accessKeyId = creds.accessKeyId;
this.secretAccessKey = creds.secretAccessKey;
this.sessionToken = creds.sessionToken;
} else {
this.accessKeyId = arguments[0];
this.secretAccessKey = arguments[1];
this.sessionToken = arguments[2];
}
},
/**
* @return [Integer] the window size in seconds to attempt refreshhing of
* credentials before the expireTime occurs.
*/
expiryWindow: 15,
/**
* @return [Boolean] whether the credentials object should call {refresh}
* @note Subclasses should override this method to provide custom refresh
* logic.
*/
needsRefresh: function needsRefresh() {
var currentTime = AWS.util.date.getDate().getTime();
var adjustedTime = new Date(currentTime + this.expiryWindow * 1000);
if (this.expireTime && adjustedTime > this.expireTime) {
return true;
} else {
return this.expired || !this.accessKeyId || !this.secretAccessKey;
}
},
/**
* Gets the existing credentials, refreshing them if they are not yet loaded
* or have expired. Users should call this method before using {refresh},
* as this will not attempt to reload credentials when they are already
* loaded into the object.
*
* @callback callback function(err)
* Called when the instance metadata service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
*/
get: function get(callback) {
var self = this;
if (this.needsRefresh()) {
this.refresh(function(err) {
if (!err) self.expired = false; // reset expired flag
if (callback) callback(err);
});
} else if (callback) {
callback();
}
},
/**
* Refreshes the credentials. Users should call {get} before attempting
* to forcibly refresh credentials.
*
* @callback callback function(err)
* Called when the instance metadata service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
* @note Subclasses should override this class to reset the
* {accessKeyId}, {secretAccessKey} and optional {sessionToken}
* on the credentials object and then call the callback with
* any error information.
* @see get
*/
refresh: function refresh(callback) {
this.expired = false;
callback();
}
});

View File

@ -1,113 +0,0 @@
var AWS = require('../core');
/**
* Creates a credential provider chain that searches for AWS credentials
* in a list of credential providers specified by the {providers} property.
*
* By default, the chain will use the {defaultProviders} to resolve credentials.
* These providers will look in the environment using the
* {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes.
*
* ## Setting Providers
*
* Each provider in the {providers} list should be a function that returns
* a {AWS.Credentials} object, or a hardcoded credentials object. The function
* form allows for delayed execution of the credential construction.
*
* ## Resolving Credentials from a Chain
*
* Call {resolve} to return the first valid credential object that can be
* loaded by the provider chain.
*
* For example, to resolve a chain with a custom provider that checks a file
* on disk after the set of {defaultProviders}:
*
* ```javascript
* var diskProvider = new AWS.FileSystemCredentials('./creds.json');
* var chain = new AWS.CredentialProviderChain();
* chain.providers.push(diskProvider);
* chain.resolve();
* ```
*
* The above code will return the `diskProvider` object if the
* file contains credentials and the `defaultProviders` do not contain
* any credential settings.
*
* @!attribute providers
* @return [Array<AWS.Credentials, Function>]
* a list of credentials objects or functions that return credentials
* objects. If the provider is a function, the function will be
* executed lazily when the provider needs to be checked for valid
* credentials. By default, this object will be set to the
* {defaultProviders}.
* @see defaultProviders
*/
AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, {
/**
* Creates a new CredentialProviderChain with a default set of providers
* specified by {defaultProviders}.
*/
constructor: function CredentialProviderChain(providers) {
if (providers) {
this.providers = providers;
} else {
this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0);
}
},
/**
* Resolves the provider chain by searching for the first set of
* credentials in {providers}.
*
* @callback callback function(err, credentials)
* Called when the provider resolves the chain to a credentials object
* or null if no credentials can be found.
*
* @param err [Error] the error object returned if no credentials are
* found.
* @param credentials [AWS.Credentials] the credentials object resolved
* by the provider chain.
* @return [AWS.CredentialProviderChain] the provider, for chaining.
*/
resolve: function resolve(callback) {
if (this.providers.length === 0) {
callback(new Error('No providers'));
return this;
}
var index = 0;
var providers = this.providers.slice(0);
function resolveNext(err, creds) {
if ((!err && creds) || index === providers.length) {
callback(err, creds);
return;
}
var provider = providers[index++];
if (typeof provider === 'function') {
creds = provider.call();
} else {
creds = provider;
}
if (creds.get) {
creds.get(function(err) {
resolveNext(err, err ? null : creds);
});
} else {
resolveNext(null, creds);
}
}
resolveNext();
return this;
}
});
/**
* The default set of providers used by a vanilla CredentialProviderChain.
*/
AWS.CredentialProviderChain.defaultProviders = [];

View File

@ -1,48 +0,0 @@
var AWS = require('../core');
require('../metadata_service');
/**
* Represents credentials recieved from the metadata service on an EC2 instance.
*
* By default, this class will connect to the metadata service using
* {AWS.MetadataService} and attempt to load any available credentials. If it
* can connect, and credentials are available, these will be used with zero
* configuration.
*
* @!macro nobrowser
*/
AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, {
constructor: function EC2MetadataCredentials(options) {
AWS.Credentials.call(this);
this.metadataService = new AWS.MetadataService(options);
this.metadata = {};
},
/**
* Loads the credentials from the instance metadata service
*
* @callback callback function(err)
* Called when the instance metadata service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
* @see get
*/
refresh: function refresh(callback) {
var self = this;
if (!callback) callback = function(err) { if (err) throw err; };
self.metadataService.loadCredentials(function (err, creds) {
if (!err) {
self.expired = false;
self.metadata = creds;
self.accessKeyId = creds.AccessKeyId;
self.secretAccessKey = creds.SecretAccessKey;
self.sessionToken = creds.Token;
self.expireTime = new Date(creds.Expiration);
}
callback(err);
});
}
});

View File

@ -1,84 +0,0 @@
var AWS = require('../core');
/**
* Represents credentials from the environment.
*
* By default, this class will look for the matching environment variables
* prefixed by a given {envPrefix}. The un-prefixed environment variable names
* for each credential value is listed below:
*
* ```javascript
* accessKeyId: ACCESS_KEY_ID
* secretAccessKey: SECRET_ACCESS_KEY
* sessionToken: SESSION_TOKEN
* ```
*
* With the default prefix of 'AWS', the environment variables would be:
*
* AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
*
* @!attribute envPrefix
* @readonly
* @return [String] the prefix for the environment variable names excluding
* the separating underscore ('_').
*/
AWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, {
/**
* Creates a new EnvironmentCredentials class with a given variable
* prefix {envPrefix}. For example, to load credentials using the 'AWS'
* prefix:
*
* ```javascript
* var creds = new AWS.EnvironmentCredentials('AWS');
* creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var
* ```
*
* @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment
* variables. Do not include the separating underscore.
*/
constructor: function EnvironmentCredentials(envPrefix) {
AWS.Credentials.call(this);
this.envPrefix = envPrefix;
this.get(function() {});
},
/**
* Loads credentials from the environment using the prefixed
* environment variables.
*
* @callback callback function(err)
* Called when the instance metadata service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
* @see get
*/
refresh: function refresh(callback) {
if (!callback) callback = function(err) { if (err) throw err; };
if (process === undefined) {
callback(new Error('No process info available'));
return;
}
var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN'];
var values = [];
for (var i = 0; i < keys.length; i++) {
var prefix = '';
if (this.envPrefix) prefix = this.envPrefix + '_';
values[i] = process.env[prefix + keys[i]];
if (!values[i] && keys[i] !== 'SESSION_TOKEN') {
callback(new Error('Variable ' + prefix + keys[i] + ' not set.'));
return;
}
}
this.expired = false;
AWS.Credentials.apply(this, values);
callback();
}
});

View File

@ -1,65 +0,0 @@
var AWS = require('../core');
/**
* Represents credentials from a JSON file on disk.
* If the credentials expire, the SDK can {refresh} the credentials
* from the file.
*
* The format of the file should be similar to the options passed to
* {AWS.Config}:
*
* ```javascript
* {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'}
* ```
*
* @example Loading credentials from disk
* var creds = new AWS.FileSystemCredentials('./configuration.json');
* creds.accessKeyId == 'AKID'
*
* @!attribute filename
* @readonly
* @return [String] the path to the JSON file on disk containing the
* credentials.
* @!macro nobrowser
*/
AWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, {
/**
* @overload AWS.FileSystemCredentials(filename)
* Creates a new FileSystemCredentials object from a filename
*
* @param filename [String] the path on disk to the JSON file to load.
*/
constructor: function FileSystemCredentials(filename) {
AWS.Credentials.call(this);
this.filename = filename;
this.get(function() {});
},
/**
* Loads the credentials from the {filename} on disk.
*
* @callback callback function(err)
* Called when the instance metadata service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
* @see get
*/
refresh: function refresh(callback) {
if (!callback) callback = function(err) { if (err) throw err; };
try {
var creds = JSON.parse(AWS.util.readFileSync(this.filename));
AWS.Credentials.call(this, creds);
if (!this.accessKeyId || !this.secretAccessKey) {
throw new Error('Credentials not set in ' + this.filename);
}
this.expired = false;
callback();
} catch (err) {
callback(err);
}
}
});

View File

@ -1,80 +0,0 @@
var AWS = require('../core');
/**
* Represents credentials retrieved from STS SAML support.
*
* By default this provider gets credentials using the
* {AWS.STS.assumeRoleWithSAML} service operation. This operation
* requires a `RoleArn` containing the ARN of the IAM trust policy for the
* application for which credentials will be given, as well as a `PrincipalArn`
* representing the ARN for the SAML identity provider. In addition, the
* `SAMLAssertion` must be set to the token provided by the identity
* provider. See {constructor} for an example on creating a credentials
* object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values.
*
* ## Refreshing Credentials from Identity Service
*
* In addition to AWS credentials expiring after a given amount of time, the
* login token from the identity provider will also expire. Once this token
* expires, it will not be usable to refresh AWS credentials, and another
* token will be needed. The SDK does not manage refreshing of the token value,
* but this can be done through a "refresh token" supported by most identity
* providers. Consult the documentation for the identity provider for refreshing
* tokens. Once the refreshed token is acquired, you should make sure to update
* this new token in the credentials object's {params} property. The following
* code will update the SAMLAssertion, assuming you have retrieved an updated
* token from the identity provider:
*
* ```javascript
* AWS.config.credentials.params.SAMLAssertion = updatedToken;
* ```
*
* Future calls to `credentials.refresh()` will now use the new token.
*
* @!attribute params
* @return [map] the map of params passed to
* {AWS.STS.assumeRoleWithSAML}. To update the token, set the
* `params.SAMLAssertion` property.
*/
AWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, {
/**
* Creates a new credentials object.
* @param (see AWS.STS.assumeRoleWithSAML)
* @example Creating a new credentials object
* AWS.config.credentials = new AWS.SAMLCredentials({
* RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole',
* PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal',
* SAMLAssertion: 'base64-token', // base64-encoded token from IdP
* });
* @see AWS.STS.assumeRoleWithSAML
*/
constructor: function SAMLCredentials(params) {
AWS.Credentials.call(this);
this.expired = true;
this.service = new AWS.STS();
this.params = params;
},
/**
* Refreshes credentials using {AWS.STS.assumeRoleWithSAML}
*
* @callback callback function(err)
* Called when the STS service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
* @see get
*/
refresh: function refresh(callback) {
var self = this;
if (!callback) callback = function(err) { if (err) throw err; };
self.service.assumeRoleWithSAML(self.params, function (err, data) {
if (!err) {
self.service.credentialsFrom(data, self);
}
callback(err);
});
}
});

View File

@ -1,103 +0,0 @@
var AWS = require('../core');
/**
* Represents temporary credentials retrieved from {AWS.STS}. Without any
* extra parameters, credentials will be fetched from the
* {AWS.STS.getSessionToken} operation. If an IAM role is provided, the
* {AWS.STS.assumeRole} operation will be used to fetch credentials for the
* role instead.
*
* To setup temporary credentials, configure a set of master credentials
* using the standard credentials providers (environment, EC2 instance metadata,
* or from the filesystem), then set the global credentials to a new
* temporary credentials object:
*
* ```javascript
* // Note that environment credentials are loaded by default,
* // the following line is shown for clarity:
* AWS.config.credentials = new AWS.EnvironmentCredentials('AWS');
*
* // Now set temporary credentials seeded from the master credentials
* AWS.config.credentials = new AWS.TemporaryCredentials();
*
* // subsequent requests will now use temporary credentials from AWS STS.
* new AWS.S3().listBucket(function(err, data) { ... });
* ```
*
* @!attribute masterCredentials
* @return [AWS.Credentials] the master (non-temporary) credentials used to
* get and refresh temporary credentials from AWS STS.
* @note (see constructor)
*/
AWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, {
/**
* Creates a new temporary credentials object.
*
* @note In order to create temporary credentials, you first need to have
* "master" credentials configured in {AWS.Config.credentials}. These
* master credentials are necessary to retrieve the temporary credentials,
* as well as refresh the credentials when they expire.
* @param params [map] a map of options that are passed to the
* {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations.
* If a `RoleArn` parameter is passed in, credentials will be based on the
* IAM role.
* @example Creating a new credenials object for generic temporary credentials
* AWS.config.credentials = new AWS.TemporaryCredentials();
* @example Creating a new credentials object for an IAM role
* AWS.config.credentials = new AWS.TemporaryCredentials({
* RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials',
* });
* @see AWS.STS.assumeRole
* @see AWS.STS.getSessionToken
*/
constructor: function TemporaryCredentials(params) {
AWS.Credentials.call(this);
this.loadMasterCredentials();
this.service = new AWS.STS();
this.expired = true;
this.params = params || {};
if (this.params.RoleArn) {
this.params.RoleSessionName =
this.params.RoleSessionName || 'temporary-credentials';
}
},
/**
* Refreshes credentials using {AWS.STS.assumeRole} or
* {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed
* to the credentials {constructor}.
*
* @callback callback function(err)
* Called when the STS service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
* @see get
*/
refresh: function refresh(callback) {
var self = this;
if (!callback) callback = function(err) { if (err) throw err; };
self.service.config.credentials = self.masterCredentials;
var operation = self.params.RoleArn ?
self.service.assumeRole : self.service.getSessionToken;
operation.call(self.service, self.params, function (err, data) {
if (!err) {
self.service.credentialsFrom(data, self);
}
callback(err);
});
},
/**
* @api private
*/
loadMasterCredentials: function loadMasterCredentials() {
this.masterCredentials = AWS.config.credentials;
while (this.masterCredentials.masterCredentials) {
this.masterCredentials = this.masterCredentials.masterCredentials;
}
}
});

View File

@ -1,80 +0,0 @@
var AWS = require('../core');
/**
* Represents credentials retrieved from STS Web Identity Federation support.
*
* By default this provider gets credentials using the
* {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation
* requires a `RoleArn` containing the ARN of the IAM trust policy for the
* application for which credentials will be given. In addition, the
* `WebIdentityToken` must be set to the token provided by the identity
* provider. See {constructor} for an example on creating a credentials
* object with proper `RoleArn` and `WebIdentityToken` values.
*
* ## Refreshing Credentials from Identity Service
*
* In addition to AWS credentials expiring after a given amount of time, the
* login token from the identity provider will also expire. Once this token
* expires, it will not be usable to refresh AWS credentials, and another
* token will be needed. The SDK does not manage refreshing of the token value,
* but this can be done through a "refresh token" supported by most identity
* providers. Consult the documentation for the identity provider for refreshing
* tokens. Once the refreshed token is acquired, you should make sure to update
* this new token in the credentials object's {params} property. The following
* code will update the WebIdentityToken, assuming you have retrieved an updated
* token from the identity provider:
*
* ```javascript
* AWS.config.credentials.params.WebIdentityToken = updatedToken;
* ```
*
* Future calls to `credentials.refresh()` will now use the new token.
*
* @!attribute params
* @return [map] the map of params passed to
* {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the
* `params.WebIdentityToken` property.
*/
AWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, {
/**
* Creates a new credentials object.
* @param (see AWS.STS.assumeRoleWithWebIdentity)
* @example Creating a new credentials object
* AWS.config.credentials = new AWS.WebIdentityCredentials({
* RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity',
* WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service
* RoleSessionName: 'web' // optional name, defaults to web-identity
* });
* @see AWS.STS.assumeRoleWithWebIdentity
*/
constructor: function WebIdentityCredentials(params) {
AWS.Credentials.call(this);
this.expired = true;
this.service = new AWS.STS();
this.params = params;
this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity';
},
/**
* Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity}
*
* @callback callback function(err)
* Called when the STS service responds (or fails). When
* this callback is called with no error, it means that the credentials
* information has been loaded into the object (as the `accessKeyId`,
* `secretAccessKey`, and `sessionToken` properties).
* @param err [Error] if an error occurred, this value will be filled
* @see get
*/
refresh: function refresh(callback) {
var self = this;
if (!callback) callback = function(err) { if (err) throw err; };
self.service.assumeRoleWithWebIdentity(self.params, function (err, data) {
if (!err) {
self.service.credentialsFrom(data, self);
}
callback(err);
});
}
});

View File

@ -1,385 +0,0 @@
var AWS = require('./core');
require('./sequential_executor');
require('./service_interface/json');
require('./service_interface/query');
require('./service_interface/rest');
require('./service_interface/rest_json');
require('./service_interface/rest_xml');
/**
* The namespace used to register global event listeners for request building
* and sending.
*/
AWS.EventListeners = {
/**
* @!attribute VALIDATE_CREDENTIALS
* A request listener that validates whether the request is being
* sent with credentials.
* Handles the {AWS.Request~validate 'validate' Request event}
* @example Sending a request without validating credentials
* var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS;
* request.removeListener('validate', listener);
* @readonly
* @return [Function]
* @!attribute VALIDATE_REGION
* A request listener that validates whether the region is set
* for a request.
* Handles the {AWS.Request~validate 'validate' Request event}
* @example Sending a request without validating region configuration
* var listener = AWS.EventListeners.Core.VALIDATE_REGION;
* request.removeListener('validate', listener);
* @readonly
* @return [Function]
* @!attribute VALIDATE_PARAMETERS
* A request listener that validates input parameters in a request.
* Handles the {AWS.Request~validate 'validate' Request event}
* @example Sending a request without validating parameters
* var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS;
* request.removeListener('validate', listener);
* @example Disable parameter validation globally
* AWS.EventListeners.Core.removeListener('validate',
* AWS.EventListeners.Core.VALIDATE_REGION);
* @readonly
* @return [Function]
* @!attribute SEND
* A request listener that initiates the HTTP connection for a
* request being sent. Handles the {AWS.Request~send 'send' Request event}
* @example Replacing the HTTP handler
* var listener = AWS.EventListeners.Core.SEND;
* request.removeListener('send', listener);
* request.on('send', function(response) {
* customHandler.send(response);
* });
* @return [Function]
* @readonly
* @!attribute HTTP_DATA
* A request listener that reads data from the HTTP connection in order
* to build the response data.
* Handles the {AWS.Request~httpData 'httpData' Request event}.
* Remove this handler if you are overriding the 'httpData' event and
* do not want extra data processing and buffering overhead.
* @example Disabling default data processing
* var listener = AWS.EventListeners.Core.HTTP_DATA;
* request.removeListener('httpData', listener);
* @return [Function]
* @readonly
*/
Core: {} /* doc hack */
};
AWS.EventListeners = {
Core: new AWS.SequentialExecutor().addNamedListeners(function(add, addAsync) {
addAsync('VALIDATE_CREDENTIALS', 'validate',
function VALIDATE_CREDENTIALS(req, done) {
req.service.config.getCredentials(function(err) {
if (err) {
req.response.err = AWS.util.error(err,
{code: 'SigningError', message: 'Missing credentials in config'});
}
done();
});
});
add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) {
if (!req.service.config.region && !req.service.hasGlobalEndpoint()) {
req.response.error = AWS.util.error(new Error(),
{code: 'SigningError', message: 'Missing region in config'});
}
});
add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) {
var rules = req.service.api.operations[req.operation].input;
new AWS.ParamValidator().validate(rules, req.params);
});
add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) {
if (req.httpRequest.headers['Content-Length'] === undefined) {
var length = AWS.util.string.byteLength(req.httpRequest.body);
req.httpRequest.headers['Content-Length'] = length;
}
});
add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) {
req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host;
});
addAsync('SIGN', 'sign', function SIGN(req, done) {
if (!req.service.api.signatureVersion) return done(); // none
req.service.config.getCredentials(function (err, credentials) {
if (err) {
req.response.error = err;
return done();
}
try {
var date = AWS.util.date.getDate();
var SignerClass = req.service.getSignerClass(req);
var signer = new SignerClass(req.httpRequest,
req.service.api.signingName || req.service.api.endpointPrefix);
// clear old authorization headers
delete req.httpRequest.headers['Authorization'];
delete req.httpRequest.headers['Date'];
delete req.httpRequest.headers['X-Amz-Date'];
// add new authorization
signer.addAuthorization(credentials, date);
req.signedAt = date;
} catch (e) {
req.response.error = e;
}
done();
});
});
add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) {
if (this.service.successfulResponse(resp, this)) {
resp.data = {};
resp.error = null;
} else {
resp.data = null;
resp.error = AWS.util.error(new Error(),
{code: 'UnknownError', message: 'An unknown error occurred.'});
}
});
addAsync('SEND', 'send', function SEND(resp, done) {
resp.httpResponse._abortCallback = done;
resp.error = null;
resp.data = null;
function callback(httpResp) {
resp.httpResponse.stream = httpResp;
httpResp.on('headers', function onHeaders(statusCode, headers) {
resp.request.emit('httpHeaders', [statusCode, headers, resp]);
if (!resp.request.httpRequest._streaming) {
if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check
httpResp.on('readable', function onReadable() {
var data = httpResp.read();
if (data !== null) {
resp.request.emit('httpData', [data, resp]);
}
});
} else { // legacy streams API
httpResp.on('data', function onData(data) {
resp.request.emit('httpData', [data, resp]);
});
}
}
});
httpResp.on('end', function onEnd() {
resp.request.emit('httpDone');
done();
});
}
function progress(httpResp) {
httpResp.on('sendProgress', function onSendProgress(progress) {
resp.request.emit('httpUploadProgress', [progress, resp]);
});
httpResp.on('receiveProgress', function onReceiveProgress(progress) {
resp.request.emit('httpDownloadProgress', [progress, resp]);
});
}
function error(err) {
resp.error = AWS.util.error(err, {
code: 'NetworkingError',
region: resp.request.httpRequest.region,
hostname: resp.request.httpRequest.endpoint.hostname,
retryable: true
});
resp.request.emit('httpError', [resp.error, resp], function() {
done();
});
}
function executeSend() {
var http = AWS.HttpClient.getInstance();
var httpOptions = resp.request.service.config.httpOptions || {};
var stream = http.handleRequest(resp.request.httpRequest, httpOptions,
callback, error);
progress(stream);
}
var timeDiff = (AWS.util.date.getDate() - this.signedAt) / 1000;
if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign
this.emit('sign', [this], function(err) {
if (err) done(err);
else executeSend();
});
} else {
executeSend();
}
});
add('HTTP_HEADERS', 'httpHeaders',
function HTTP_HEADERS(statusCode, headers, resp) {
resp.httpResponse.statusCode = statusCode;
resp.httpResponse.headers = headers;
resp.httpResponse.body = new AWS.util.Buffer('');
resp.httpResponse.buffers = [];
resp.httpResponse.numBytes = 0;
});
add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) {
if (chunk) {
if (AWS.util.isNode()) {
resp.httpResponse.numBytes += chunk.length;
var total = resp.httpResponse.headers['content-length'];
var progress = { loaded: resp.httpResponse.numBytes, total: total };
resp.request.emit('httpDownloadProgress', [progress, resp]);
}
resp.httpResponse.buffers.push(new AWS.util.Buffer(chunk));
}
});
add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) {
// convert buffers array into single buffer
if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) {
var body = AWS.util.buffer.concat(resp.httpResponse.buffers);
resp.httpResponse.body = body;
}
delete resp.httpResponse.numBytes;
delete resp.httpResponse.buffers;
});
add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) {
if (resp.httpResponse.statusCode) {
resp.error.statusCode = resp.httpResponse.statusCode;
if (resp.error.retryable === undefined) {
resp.error.retryable = this.service.retryableError(resp.error, this);
}
}
});
add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) {
switch (resp.error.code) {
case 'RequestExpired': // EC2 only
case 'ExpiredTokenException':
case 'ExpiredToken':
resp.error.retryable = true;
resp.request.service.config.credentials.expired = true;
}
});
add('REDIRECT', 'retry', function REDIRECT(resp) {
if (resp.error && resp.error.statusCode >= 300 &&
resp.error.statusCode < 400 && resp.httpResponse.headers['location']) {
this.httpRequest.endpoint =
new AWS.Endpoint(resp.httpResponse.headers['location']);
resp.error.redirect = true;
resp.error.retryable = true;
}
});
add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) {
if (resp.error) {
if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) {
resp.error.retryDelay = 0;
resp.redirectCount++;
resp.error._willRetry = true;
} else if (resp.error.retryable && resp.retryCount < resp.maxRetries) {
var delays = this.service.retryDelays();
resp.error.retryDelay = delays[resp.retryCount] || 0;
resp.retryCount++;
resp.error._willRetry = true;
} else {
resp.error._willRetry = false;
}
}
});
addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) {
if (resp.error && resp.error._willRetry) {
var delay = resp.error.retryDelay || 0;
resp.error = null;
setTimeout(done, delay);
} else {
done();
}
});
}),
CorePost: new AWS.SequentialExecutor().addNamedListeners(function(add) {
add('EXTRACT_REQUEST_ID', 'extractData', function EXTRACT_REQUEST_ID(resp) {
resp.requestId = resp.httpResponse.headers['x-amz-request-id'] ||
resp.httpResponse.headers['x-amzn-requestid'];
});
}),
Logger: new AWS.SequentialExecutor().addNamedListeners(function(add) {
add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) {
var req = resp.request;
var logger = req.service.config.logger;
if (!logger) return;
function buildMessage() {
var time = AWS.util.date.getDate().getTime();
var delta = (time - req.startTime.getTime()) / 1000;
var ansi = logger.isTTY ? true : false;
var status = resp.httpResponse.statusCode;
var params = require('util').inspect(req.params, true, true);
var message = '';
if (ansi) message += '\x1B[33m';
message += '[AWS ' + req.service.serviceIdentifier + ' ' + status;
message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]';
if (ansi) message += '\x1B[0;1m';
message += ' ' + req.operation + '(' + params + ')';
if (ansi) message += '\x1B[0m';
return message;
}
var line = buildMessage();
if (typeof logger.log === 'function') {
logger.log(line);
} else if (typeof logger.write === 'function') {
logger.write(line + '\n');
}
});
}),
Json: new AWS.SequentialExecutor().addNamedListeners(function(add) {
var svc = AWS.ServiceInterface.Json;
add('BUILD', 'build', svc.buildRequest);
add('EXTRACT_DATA', 'extractData', svc.extractData);
add('EXTRACT_ERROR', 'extractError', svc.extractError);
}),
Rest: new AWS.SequentialExecutor().addNamedListeners(function(add) {
var svc = AWS.ServiceInterface.Rest;
add('BUILD', 'build', svc.buildRequest);
add('EXTRACT_DATA', 'extractData', svc.extractData);
add('EXTRACT_ERROR', 'extractError', svc.extractError);
}),
RestJson: new AWS.SequentialExecutor().addNamedListeners(function(add) {
var svc = AWS.ServiceInterface.RestJson;
add('BUILD', 'build', svc.buildRequest);
add('EXTRACT_DATA', 'extractData', svc.extractData);
add('EXTRACT_ERROR', 'extractError', svc.extractError);
}),
RestXml: new AWS.SequentialExecutor().addNamedListeners(function(add) {
var svc = AWS.ServiceInterface.RestXml;
add('BUILD', 'build', svc.buildRequest);
add('EXTRACT_DATA', 'extractData', svc.extractData);
add('EXTRACT_ERROR', 'extractError', svc.extractError);
}),
Query: new AWS.SequentialExecutor().addNamedListeners(function(add) {
var svc = AWS.ServiceInterface.Query;
add('BUILD', 'build', svc.buildRequest);
add('EXTRACT_DATA', 'extractData', svc.extractData);
add('EXTRACT_ERROR', 'extractError', svc.extractError);
})
};

166
node_modules/aws-sdk/lib/http.js generated vendored
View File

@ -1,166 +0,0 @@
var AWS = require('./core');
var inherit = AWS.util.inherit;
/**
* The endpoint that a service will talk to, for example,
* `'https://ec2.ap-southeast-1.amazonaws.com'`. If
* you need to override an endpoint for a service, you can
* set the endpoint on a service by passing the endpoint
* object with the `endpoint` option key:
*
* ```javascript
* var ep = new AWS.Endpoint('awsproxy.example.com');
* var s3 = new AWS.S3({endpoint: ep});
* s3.service.endpoint.hostname == 'awsproxy.example.com'
* ```
*
* Note that if you do not specify a protocol, the protocol will
* be selected based on your current {AWS.config} configuration.
*
* @!attribute protocol
* @return [String] the protocol (http or https) of the endpoint
* URL
* @!attribute hostname
* @return [String] the host portion of the endpoint, e.g.,
* example.com
* @!attribute host
* @return [String] the host portion of the endpoint including
* the port, e.g., example.com:80
* @!attribute port
* @return [Integer] the port of the endpoint
* @!attribute href
* @return [String] the full URL of the endpoint
*/
AWS.Endpoint = inherit({
/**
* @overload Endpoint(endpoint)
* Constructs a new endpoint given an endpoint URL. If the
* URL omits a protocol (http or https), the default protocol
* set in the global {AWS.config} will be used.
* @param endpoint [String] the URL to construct an endpoint from
*/
constructor: function Endpoint(endpoint, config) {
AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']);
if (typeof endpoint === 'undefined' || endpoint === null) {
throw new Error('Invalid endpoint: ' + endpoint);
} else if (typeof endpoint !== 'string') {
return AWS.util.copy(endpoint);
}
if (!endpoint.match(/^http/)) {
var useSSL = config && config.sslEnabled !== undefined ?
config.sslEnabled : AWS.config.sslEnabled;
endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint;
}
AWS.util.update(this, AWS.util.urlParse(endpoint));
// Ensure the port property is set as an integer
if (this.port) {
this.port = parseInt(this.port, 10);
} else {
this.port = this.protocol === 'https:' ? 443 : 80;
}
}
});
/**
* The low level HTTP request object, encapsulating all HTTP header
* and body data sent by a service request.
*
* @!attribute method
* @return [String] the HTTP method of the request
* @!attribute path
* @return [String] the path portion of the URI, e.g.,
* "/list/?start=5&num=10"
* @!attribute headers
* @return [map<String,String>]
* a map of header keys and their respective values
* @!attribute body
* @return [String] the request body payload
* @!attribute endpoint
* @return [AWS.Endpoint] the endpoint for the request
* @!attribute region
* @api private
* @return [String] the region, for signing purposes only.
*/
AWS.HttpRequest = inherit({
/**
* @api private
*/
constructor: function HttpRequest(endpoint, region) {
endpoint = new AWS.Endpoint(endpoint);
this.method = 'POST';
this.path = endpoint.path || '/';
this.headers = {};
this.body = '';
this.endpoint = endpoint;
this.region = region;
this.setUserAgent();
},
/**
* @api private
*/
setUserAgent: function setUserAgent() {
var prefix = AWS.util.isBrowser() ? 'X-Amz-' : '';
this.headers[prefix + 'User-Agent'] = AWS.util.userAgent();
},
/**
* @return [String] the part of the {path} excluding the
* query string
*/
pathname: function pathname() {
return this.path.split('?', 1)[0];
},
/**
* @return [String] the query string portion of the {path}
*/
search: function search() {
return this.path.split('?', 2)[1] || '';
}
});
/**
* The low level HTTP response object, encapsulating all HTTP header
* and body data returned from the request.
*
* @!attribute statusCode
* @return [Integer] the HTTP status code of the response (e.g., 200, 404)
* @!attribute headers
* @return [map<String,String>]
* a map of response header keys and their respective values
* @!attribute body
* @return [String] the response body payload
*/
AWS.HttpResponse = inherit({
/**
* @api private
*/
constructor: function HttpResponse() {
this.statusCode = undefined;
this.headers = {};
this.body = undefined;
}
});
AWS.HttpClient = inherit({});
/**
* @api private
*/
AWS.HttpClient.getInstance = function getInstance() {
if (this.singleton === undefined) {
this.singleton = new this();
}
return this.singleton;
};

147
node_modules/aws-sdk/lib/http/node.js generated vendored
View File

@ -1,147 +0,0 @@
var AWS = require('../core');
var Stream = AWS.util.nodeRequire('stream').Stream;
var WritableStream = AWS.util.nodeRequire('stream').Writable;
var ReadableStream = AWS.util.nodeRequire('stream').Readable;
require('../http');
/**
* @api private
*/
AWS.NodeHttpClient = AWS.util.inherit({
handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) {
var endpoint = httpRequest.endpoint;
var pathPrefix = '';
if (!httpOptions) httpOptions = {};
if (httpOptions.proxy) {
pathPrefix = endpoint.protocol + '//' + endpoint.hostname;
if (endpoint.port !== 80 && endpoint.port !== 443) {
pathPrefix += ':' + endpoint.port;
}
endpoint = new AWS.Endpoint(httpOptions.proxy);
}
var useSSL = endpoint.protocol === 'https:';
var http = useSSL ? require('https') : require('http');
var options = {
host: endpoint.hostname,
port: endpoint.port,
method: httpRequest.method,
headers: httpRequest.headers,
path: pathPrefix + httpRequest.path
};
if (useSSL && !httpOptions.agent) {
options.agent = this.sslAgent();
}
AWS.util.update(options, httpOptions);
delete options.proxy; // proxy isn't an HTTP option
delete options.timeout; // timeout isn't an HTTP option
var stream = http.request(options, function (httpResp) {
callback(httpResp);
httpResp.emit('headers', httpResp.statusCode, httpResp.headers);
});
httpRequest.stream = stream; // attach stream to httpRequest
// timeout support
stream.setTimeout(httpOptions.timeout || 0);
stream.once('timeout', function() {
var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms';
errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'}));
// HACK - abort the connection without tripping our error handler
// since we already raised our TimeoutError. Otherwise the connection
// comes back with ECONNRESET, which is not a helpful error message
stream.removeListener('error', errCallback);
stream.on('error', function() { });
stream.abort();
});
stream.on('error', errCallback);
this.writeBody(stream, httpRequest);
return stream;
},
writeBody: function writeBody(stream, httpRequest) {
var body = httpRequest.body;
if (body && WritableStream && ReadableStream) { // progress support
if (!(body instanceof Stream)) body = this.bufferToStream(body);
body.pipe(this.progressStream(stream, httpRequest));
}
if (body instanceof Stream) {
body.pipe(stream);
} else if (body) {
stream.end(body);
} else {
stream.end();
}
},
sslAgent: function sslAgent() {
var https = require('https');
if (!AWS.NodeHttpClient.sslAgent) {
AWS.NodeHttpClient.sslAgent = new https.Agent({rejectUnauthorized: true});
AWS.NodeHttpClient.sslAgent.setMaxListeners(0);
// delegate maxSockets to globalAgent
Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', {
enumerable: true,
get: function() { return https.globalAgent.maxSockets; }
});
}
return AWS.NodeHttpClient.sslAgent;
},
progressStream: function progressStream(stream, httpRequest) {
var numBytes = 0;
var totalBytes = httpRequest.headers['Content-Length'];
var writer = new WritableStream();
writer._write = function(chunk, encoding, callback) {
if (chunk) {
numBytes += chunk.length;
stream.emit('sendProgress', {
loaded: numBytes, total: totalBytes
});
}
callback();
};
return writer;
},
bufferToStream: function bufferToStream(buffer) {
if (!AWS.util.Buffer.isBuffer(buffer)) buffer = new AWS.util.Buffer(buffer);
var readable = new ReadableStream();
var pos = 0;
readable._read = function(size) {
if (pos >= buffer.length) return readable.push(null);
var end = pos + size;
if (end > buffer.length) end = buffer.length;
readable.push(buffer.slice(pos, end));
pos = end;
};
return readable;
},
emitter: null
});
/**
* @!ignore
*/
/**
* @api private
*/
AWS.HttpClient.prototype = AWS.NodeHttpClient.prototype;
/**
* @api private
*/
AWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1;

112
node_modules/aws-sdk/lib/http/xhr.js generated vendored
View File

@ -1,112 +0,0 @@
var AWS = require('../core');
var EventEmitter = require('events').EventEmitter;
require('../http');
/**
* @api private
*/
AWS.XHRClient = AWS.util.inherit({
handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) {
var self = this;
var endpoint = httpRequest.endpoint;
var emitter = new EventEmitter();
var href = endpoint.protocol + '//' + endpoint.hostname;
if (endpoint.port !== 80 && endpoint.port !== 443) {
href += ':' + endpoint.port;
}
href += httpRequest.path;
var xhr = new XMLHttpRequest();
httpRequest.stream = xhr;
if (httpOptions.timeout) {
xhr.timeout = httpOptions.timeout;
}
xhr.addEventListener('readystatechange', function() {
try {
if (xhr.status === 0) return; // 0 code is invalid
} catch (e) { return; }
if (this.readyState === this.HEADERS_RECEIVED) {
try { xhr.responseType = 'arraybuffer'; } catch (e) {}
emitter.statusCode = xhr.status;
emitter.headers = self.parseHeaders(xhr.getAllResponseHeaders());
emitter.emit('headers', emitter.statusCode, emitter.headers);
} else if (this.readyState === this.DONE) {
self.finishRequest(xhr, emitter);
}
}, false);
xhr.upload.addEventListener('progress', function (evt) {
emitter.emit('sendProgress', evt);
});
xhr.addEventListener('progress', function (evt) {
emitter.emit('receiveProgress', evt);
}, false);
xhr.addEventListener('timeout', function () {
errCallback(AWS.util.error(new Error('Timeout'), {code: 'TimeoutError'}));
}, false);
xhr.addEventListener('error', function () {
errCallback(AWS.util.error(new Error('Network Failure'), {
code: 'NetworkingError'
}));
}, false);
callback(emitter);
xhr.open(httpRequest.method, href, true);
AWS.util.each(httpRequest.headers, function (key, value) {
if (key !== 'Content-Length' && key !== 'User-Agent' && key !== 'Host') {
xhr.setRequestHeader(key, value);
}
});
if (httpRequest.body && typeof httpRequest.body.buffer === 'object') {
xhr.send(httpRequest.body.buffer); // typed arrays sent as ArrayBuffer
} else {
xhr.send(httpRequest.body);
}
return emitter;
},
parseHeaders: function parseHeaders(rawHeaders) {
var headers = {};
AWS.util.arrayEach(rawHeaders.split(/\r?\n/), function (line) {
var key = line.split(':', 1)[0];
var value = line.substring(key.length + 2);
if (key.length > 0) headers[key] = value;
});
return headers;
},
finishRequest: function finishRequest(xhr, emitter) {
var buffer;
if (xhr.responseType === 'arraybuffer' && xhr.response) {
var ab = xhr.response;
buffer = new AWS.util.Buffer(ab.byteLength);
var view = new Uint8Array(ab);
for (var i = 0; i < buffer.length; ++i) {
buffer[i] = view[i];
}
}
try {
if (!buffer && typeof xhr.responseText === 'string') {
buffer = new AWS.util.Buffer(xhr.responseText);
}
} catch (e) {}
if (buffer) emitter.emit('data', buffer);
emitter.emit('end');
}
});
/**
* @api private
*/
AWS.HttpClient.prototype = AWS.XHRClient.prototype;
/**
* @api private
*/
AWS.HttpClient.streamsApiVersion = 1;

View File

@ -1,76 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.JSON = {};
/**
* @api private
*/
AWS.JSON.Builder = inherit({
constructor: function JSONBuilder(rules, options) {
this.rules = rules;
this.timestampFormat = options.timestampFormat;
},
build: function build(params) {
return JSON.stringify(this.translate(this.rules, params));
},
translate: function translate(rules, value) {
if (value === null || value === undefined) return undefined;
if (rules.type === 'structure') {
// translate structures (hashes with pre-defined keys)
var struct = {};
AWS.util.each.call(this, value, function (memberName, memberValue) {
var memberRules = rules.members[memberName] || {};
var result = this.translate(memberRules, memberValue);
if (result !== undefined) struct[memberName] = result;
});
return struct;
} else if (rules.type === 'list') {
// translate each member of the list
var list = [];
AWS.util.arrayEach.call(this, value, function (memberValue) {
var memberRules = rules.members || {};
var result = this.translate(memberRules, memberValue);
if (result !== undefined) list.push(result);
});
return list;
} else if (rules.type === 'map') {
// translate maps (hashes with user supplied keys)
var map = {};
AWS.util.each.call(this, value, function (memberName, memberValue) {
var memberRules = rules.members || {};
var result = this.translate(memberRules, memberValue);
if (result !== undefined) map[memberName] = result;
});
return map;
} else if (rules.type === 'timestamp') {
var timestampFormat = rules.format || this.timestampFormat;
return AWS.util.date.format(value, timestampFormat);
} else if (rules.type === 'integer') {
return parseInt(value, 10);
} else if (rules.type === 'float') {
return parseFloat(value);
} else {
// all other shapes
return value;
}
}
});

View File

@ -1,98 +0,0 @@
var AWS = require('./core');
require('./http');
var inherit = AWS.util.inherit;
/**
* Represents a metadata service available on EC2 instances. Using the
* {request} method, you can receieve metadata about any available resource
* on the metadata service.
*
* @!attribute [r] httpOptions
* @return [map] a map of options to pass to the underlying HTTP request
* @!macro nobrowser
*/
AWS.MetadataService = inherit({
/**
* @return [String] the hostname of the instance metadata service
*/
host: '169.254.169.254',
/**
* @!ignore
*/
/**
* Options
*/
httpOptions: { timeout: 1000 },
/**
* Creates a new MetadataService object with a given set of options.
*
* @option options host [String] the hostname of the instance metadata
* service
* @option options httpOptions [map] a map of options to pass to the
* underlying HTTP request
*/
constructor: function MetadataService(options) {
AWS.util.update(this, options);
},
/**
* Sends a request to the instance metadata service for a given resource.
*
* @param path [String] the path of the resource to get
* @callback callback function(err, data)
* Called when a response is available from the service.
* @param err [Error, null] if an error occurred, this value will be set
* @param data [String, null] if the request was successful, the body of
* the response
*/
request: function request(path, callback) {
path = path || '/';
var data = '';
var http = AWS.HttpClient.getInstance();
var httpRequest = new AWS.HttpRequest('http://' + this.host + path);
httpRequest.method = 'GET';
http.handleRequest(httpRequest, this.httpOptions, function(httpResponse) {
httpResponse.on('data', function(chunk) { data += chunk.toString(); });
httpResponse.on('end', function() { callback(null, data); });
}, callback);
},
/**
* Loads a set of credentials stored in the instance metadata service
*
* @api private
* @callback callback function(err, credentials)
* Called when credentials are loaded from the resource
* @param err [Error] if an error occurred, this value will be set
* @param credentials [Object] the raw JSON object containing all
* metadata from the credentials resource
*/
loadCredentials: function loadCredentials(callback) {
var self = this;
var basePath = '/latest/meta-data/iam/security-credentials/';
self.request(basePath, function (err, roleName) {
if (err) callback(err);
else {
roleName = roleName.split('\n')[0]; // grab first (and only) role
self.request(basePath + roleName, function (credErr, credData) {
if (credErr) callback(credErr);
else {
try {
var credentials = JSON.parse(credData);
callback(null, credentials);
} catch (parseError) {
callback(parseError);
}
}
});
}
});
}
});
module.exports = AWS.MetadataService;

View File

@ -1,168 +0,0 @@
var AWS = require('./core');
/**
* @api private
*/
AWS.ParamValidator = AWS.util.inherit({
validate: function validate(rules, params, context) {
var cRules = (rules || {}).members || {};
var payload = rules ? rules.xml : null;
if (payload) {
cRules = AWS.util.merge(cRules, (cRules[payload] || {}).members || {});
delete cRules[payload];
}
return this.validateStructure(cRules, params || {}, context || 'params');
},
validateStructure: function validateStructure(rules, params, context) {
this.validateType(context, params, ['object'], 'structure');
for (var paramName in rules) {
if (!rules.hasOwnProperty(paramName)) continue;
var value = params[paramName];
var notSet = value === undefined || value === null;
if (rules[paramName].required && notSet) {
this.fail('MissingRequiredParameter',
'Missing required key \'' + paramName + '\' in ' + context);
}
}
// validate hash members
for (paramName in params) {
if (!params.hasOwnProperty(paramName)) continue;
var paramValue = params[paramName],
paramRules = rules[paramName];
if (paramRules !== undefined) {
var memberContext = [context, paramName].join('.');
this.validateMember(paramRules, paramValue, memberContext);
} else {
this.fail('UnexpectedParameter',
'Unexpected key \'' + paramName + '\' found in ' + context);
}
}
return true;
},
validateMember: function validateMember(rules, param, context) {
var memberRules = rules.members || {};
switch(rules.type) {
case 'structure':
return this.validateStructure(memberRules, param, context);
case 'list':
return this.validateList(memberRules, param, context);
case 'map':
return this.validateMap(memberRules, param, context);
default:
return this.validateScalar(rules, param, context);
}
},
validateList: function validateList(rules, params, context) {
this.validateType(context, params, [Array]);
// validate array members
for (var i = 0; i < params.length; i++) {
this.validateMember(rules, params[i], context + '[' + i + ']');
}
},
validateMap: function validateMap(rules, params, context) {
this.validateType(context, params, ['object'], 'map');
for (var param in params) {
if (!params.hasOwnProperty(param)) continue;
this.validateMember(rules, params[param],
context + '[\'' + param + '\']');
}
},
validateScalar: function validateScalar(rules, value, context) {
switch (rules.type) {
case null:
case undefined:
case 'string':
return this.validateType(context, value, ['string']);
case 'base64':
case 'binary':
return this.validatePayload(context, value);
case 'integer':
case 'float':
return this.validateNumber(context, value);
case 'boolean':
return this.validateType(context, value, ['boolean']);
case 'timestamp':
return this.validateType(context, value, [Date,
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'number'],
'Date object, ISO-8601 string, or a UNIX timestamp');
default:
return this.fail('UnkownType', 'Unhandled type ' +
rules.type + ' for ' + context);
}
},
fail: function fail(code, message) {
throw AWS.util.error(new Error(message), {code: code});
},
validateType: function validateType(context, value, acceptedTypes, type) {
if (value === null || value === undefined) return;
var foundInvalidType = false;
for (var i = 0; i < acceptedTypes.length; i++) {
if (typeof acceptedTypes[i] === 'string') {
if (typeof value === acceptedTypes[i]) return;
} else if (acceptedTypes[i] instanceof RegExp) {
if ((value || '').toString().match(acceptedTypes[i])) return;
} else {
if (value instanceof acceptedTypes[i]) return;
if (AWS.util.isType(value, acceptedTypes[i])) return;
if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice();
acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]);
}
foundInvalidType = true;
}
var acceptedType = type;
if (!acceptedType) {
acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1');
}
var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : '';
this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' +
vowel + ' ' + acceptedType);
},
validateNumber: function validateNumber(context, value) {
if (value === null || value === undefined) return;
if (typeof value === 'string') {
var castedValue = parseFloat(value);
if (castedValue.toString() === value) value = castedValue;
}
this.validateType(context, value, ['number']);
},
validatePayload: function validatePayload(context, value) {
if (value === null || value === undefined) return;
if (typeof value === 'string') return;
if (value && typeof value.byteLength === 'number') return; // typed arrays
if (AWS.util.isNode()) { // special check for buffer/stream in Node.js
var Stream = AWS.util.nodeRequire('stream').Stream;
if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return;
}
var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView'];
if (value) {
for (var i = 0; i < types.length; i++) {
if (AWS.util.isType(value, types[i])) return;
if (AWS.util.typeName(value.constructor) === types[i]) return;
}
}
this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' +
'string, Buffer, Stream, Blob, or typed array object');
}
});

602
node_modules/aws-sdk/lib/request.js generated vendored
View File

@ -1,602 +0,0 @@
var AWS = require('./core');
var AcceptorStateMachine = require('./state_machine');
var inherit = AWS.util.inherit;
var fsm = new AcceptorStateMachine();
fsm.setupStates = function() {
var hardErrorStates = {success:1, error:1, complete:1};
var transition = function transition(err, done) {
try {
var self = this;
var origError = self.response.error;
self.emit(self._asm.currentState, function() {
function isTerminalState() {
return hardErrorStates[self._asm.currentState] === 1;
}
var nextError = self.response.error;
if (self.response.error && origError !== self.response.error) {
if (isTerminalState()) self._hardError = true;
}
if (self.response.error && !self._hardError && isTerminalState()) {
// error did not change to complete, no need to pass this as an
// uncaughtException
nextError = null;
}
done(nextError);
});
} catch (e) {
this.response.error = e;
if (this._hardError) {
throw e;
}
else if (hardErrorStates.indexOf(this._asm.currentState) >= 0) {
this._hardError = true;
}
done(e);
}
};
this.addState('validate', 'build', 'error', transition);
this.addState('restart', 'build', 'error', function(err, done) {
err = this.response.error;
if (!err) return done();
if (!err.retryable) return done(err);
if (this.response.retryCount < this.service.config.maxRetries) {
this.response.retryCount++;
done();
} else {
done(err);
}
});
this.addState('build', 'afterBuild', 'restart', transition);
this.addState('afterBuild', 'sign', 'restart', transition);
this.addState('sign', 'send', 'retry', transition);
this.addState('retry', 'afterRetry', 'afterRetry', transition);
this.addState('afterRetry', 'sign', 'error', transition);
this.addState('send', 'validateResponse', 'retry', transition);
this.addState('validateResponse', 'extractData', 'extractError', transition);
this.addState('extractError', 'extractData', 'retry', transition);
this.addState('extractData', 'success', 'retry', transition);
this.addState('success', 'complete', 'complete', transition);
this.addState('error', 'complete', 'complete', transition);
this.addState('complete', null, 'uncaughtException', transition);
this.addState('uncaughtException', function(err, done) {
try {
AWS.SequentialExecutor.prototype.unhandledErrorCallback.call(this, err);
} catch (e) {
if (this._hardError) {
e._hardError = true;
throw e;
}
}
done(err);
});
};
fsm.setupStates();
/**
* ## Asynchronous Requests
*
* All requests made through the SDK are asynchronous and use a
* callback interface. Each service method that kicks off a request
* returns an `AWS.Request` object that you can use to register
* callbacks.
*
* For example, the following service method returns the request
* object as "request", which can be used to register callbacks:
*
* ```javascript
* // request is an AWS.Request object
* var request = ec2.describeInstances();
*
* // register callbacks on request to retrieve response data
* request.on('success', function(response) {
* console.log(response.data);
* });
* ```
*
* When a request is ready to be sent, the {send} method should
* be called:
*
* ```javascript
* request.send();
* ```
*
* ## Removing Default Listeners for Events
*
* Request objects are built with default listeners for the various events,
* depending on the service type. In some cases, you may want to remove
* some built-in listeners to customize behaviour. Doing this requires
* access to the built-in listener functions, which are exposed through
* the {AWS.EventListeners.Core} namespace. For instance, you may
* want to customize the HTTP handler used when sending a request. In this
* case, you can remove the built-in listener associated with the 'send'
* event, the {AWS.EventListeners.Core.SEND} listener and add your own.
*
* ## Multiple Callbacks and Chaining
*
* You can register multiple callbacks on any request object. The
* callbacks can be registered for different events, or all for the
* same event. In addition, you can chain callback registration, for
* example:
*
* ```javascript
* request.
* on('success', function(response) {
* console.log("Success!");
* }).
* on('error', function(response) {
* console.log("Error!");
* }).
* on('complete', function(response) {
* console.log("Always!");
* }).
* send();
* ```
*
* The above example will print either "Success! Always!", or "Error! Always!",
* depending on whether the request succeeded or not.
*
* @!attribute httpRequest
* @readonly
* @!group HTTP Properties
* @return [AWS.HttpRequest] the raw HTTP request object
* containing request headers and body information
* sent by the service.
*
* @!attribute startTime
* @readonly
* @!group Operation Properties
* @return [Date] the time that the request started
*
* @!group Request Building Events
*
* @!event validate(request)
* Triggered when a request is being validated. Listeners
* should throw an error if the request should not be sent.
* @param request [Request] the request object being sent
* @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS
* @see AWS.EventListeners.Core.VALIDATE_REGION
*
* @!event build(request)
* Triggered when the request payload is being built. Listeners
* should fill the necessary information to send the request
* over HTTP.
* @param (see AWS.Request~validate)
*
* @!event sign(request)
* Triggered when the request is being signed. Listeners should
* add the correct authentication headers and/or adjust the body,
* depending on the authentication mechanism being used.
* @param (see AWS.Request~validate)
*
* @!group Request Sending Events
*
* @!event send(response)
* Triggered when the request is ready to be sent. Listeners
* should call the underlying transport layer to initiate
* the sending of the request.
* @param response [Response] the response object
* @context [Request] the request object that was sent
* @see AWS.EventListeners.Core.SEND
*
* @!event retry(response)
* Triggered when a request failed and might need to be retried.
* Listeners are responsible for checking to see if the request
* is retryable, and if so, re-signing and re-sending the request.
* Information about the failure is set in the `response.error`
* property.
*
* If a listener decides that a request should not be retried,
* that listener should `throw` an error to cancel the event chain.
* Unsetting `response.error` will have no effect.
*
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!group Data Parsing Events
*
* @!event extractError(response)
* Triggered on all non-2xx requests so that listeners can extract
* error details from the response body. Listeners to this event
* should set the `response.error` property.
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!event extractData(response)
* Triggered in successful requests to allow listeners to
* de-serialize the response body into `response.data`.
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!group Completion Events
*
* @!event success(response)
* Triggered when the request completed successfully.
* `response.data` will contain the response data and
* `response.error` will be null.
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!event error(error, response)
* Triggered when an error occurs at any point during the
* request. `response.error` will contain details about the error
* that occurred. `response.data` will be null.
* @param error [Error] the error object containing details about
* the error that occurred.
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!event complete(response)
* Triggered whenever a request cycle completes. `response.error`
* should be checked, since the request may have failed.
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!group HTTP Events
*
* @!event httpHeaders(statusCode, headers, response)
* Triggered when headers are sent by the remote server
* @param statusCode [Integer] the HTTP response code
* @param headers [map<String,String>] the response headers
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!event httpData(chunk, response)
* Triggered when data is sent by the remote server
* @param chunk [Buffer] the buffer data containing the next data chunk
* from the server
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
* @see AWS.EventListeners.Core.HTTP_DATA
*
* @!event httpUploadProgress(progress, response)
* Triggered when the HTTP request has uploaded more data
* @param progress [map] An object containing the `loaded` and `total` bytes
* of the request.
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
* @note This event will not be emitted in Node.js 0.8.x.
*
* @!event httpDownloadProgress(progress, response)
* Triggered when the HTTP request has downloaded more data
* @param progress [map] An object containing the `loaded` and `total` bytes
* of the request.
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
* @note This event will not be emitted in Node.js 0.8.x.
*
* @!event httpError(error, response)
* Triggered when the HTTP request failed
* @param error [Error] the error object that was thrown
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @!event httpDone(response)
* Triggered when the server is finished sending data
* @param (see AWS.Request~send)
* @context (see AWS.Request~send)
*
* @see AWS.Response
*/
AWS.Request = inherit({
/**
* Creates a request for an operation on a given service with
* a set of input parameters.
*
* @param service [AWS.Service] the service to perform the operation on
* @param operation [String] the operation to perform on the service
* @param params [Object] parameters to send to the operation.
* See the operation's documentation for the format of the
* parameters.
*/
constructor: function Request(service, operation, params) {
var endpoint = service.endpoint;
var region = service.config.region;
// global endpoints sign as us-east-1
if (service.hasGlobalEndpoint()) region = 'us-east-1';
this.service = service;
this.operation = operation;
this.params = params || {};
this.httpRequest = new AWS.HttpRequest(endpoint, region);
this.startTime = AWS.util.date.getDate();
this.response = new AWS.Response(this);
this.restartCount = 0;
this._asm = new AcceptorStateMachine(fsm.states, 'validate');
AWS.SequentialExecutor.call(this);
this.emit = this.emitEvent;
},
/**
* @!group Sending a Request
*/
/**
* @overload send(callback = null)
* Sends the request object.
*
* @callback callback function(err, data)
* If a callback is supplied, it is called when a response is returned
* from the service.
* @param err [Error] the error object returned from the request.
* Set to `null` if the request is successful.
* @param data [Object] the de-serialized data returned from
* the request. Set to `null` if a request error occurs.
* @example Sending a request with a callback
* request = s3.putObject({Bucket: 'bucket', Key: 'key'});
* request.send(function(err, data) { console.log(err, data); });
* @example Sending a request with no callback (using event handlers)
* request = s3.putObject({Bucket: 'bucket', Key: 'key'});
* request.on('complete', function(response) { ... }); // register a callback
* request.send();
*/
send: function send(callback) {
if (callback) {
this.on('complete', function (resp) {
try {
callback.call(resp, resp.error, resp.data);
} catch (e) {
resp.request._hardError = true;
throw e;
}
});
}
this.runTo();
return this.response;
},
build: function build(callback) {
this._hardError = callback ? false : true;
return this.runTo('send', callback);
},
runTo: function runTo(state, done) {
this._asm.runTo(state, done, this);
return this;
},
/**
* Aborts a request, emitting the error and complete events.
*
* @!macro nobrowser
* @example Aborting a request after sending
* var params = {
* Bucket: 'bucket', Key: 'key',
* Body: new Buffer(1024 * 1024 * 5) // 5MB payload
* };
* var request = s3.putObject(params);
* request.send(function (err, data) {
* if (err) console.log("Error:", err.code, err.message);
* else console.log(data);
* });
*
* // abort request in 1 second
* setTimeout(request.abort.bind(request), 1000);
*
* // prints "Error: RequestAbortedError Request aborted by user"
* @return [AWS.Request] the same request object, for chaining.
* @since v1.4.0
*/
abort: function abort() {
this.removeAllListeners('validateResponse');
this.removeAllListeners('extractError');
this.on('validateResponse', function addAbortedError(resp) {
resp.error = AWS.util.error(new Error('Request aborted by user'), {
code: 'RequestAbortedError', retryable: false
});
});
if (this.httpRequest.stream) { // abort HTTP stream
this.httpRequest.stream.abort();
if (this.httpRequest._abortCallback) {
this.httpRequest._abortCallback();
} else {
this.removeAllListeners('send'); // haven't sent yet, so let's not
}
}
return this;
},
/**
* Iterates over each page of results given a pageable request, calling
* the provided callback with each page of data. After all pages have been
* retrieved, the callback is called with `null` data.
*
* @note This operation can generate multiple requests to a service.
* @example Iterating over multiple pages of objects in an S3 bucket
* var pages = 1;
* s3.listObjects().eachPage(function(err, data) {
* if (err) return;
* console.log("Page", pages++);
* console.log(data);
* });
* @callback callback function(err, data)
* Called with each page of resulting data from the request.
*
* @param err [Error] an error object, if an error occurred.
* @param data [Object] a single page of response data. If there is no
* more data, this object will be `null`.
* @return [Boolean] if the callback returns `false`, pagination will
* stop.
*
* @api experimental
* @see AWS.Request.eachItem
* @see AWS.Response.nextPage
* @since v1.4.0
*/
eachPage: function eachPage(callback) {
function wrappedCallback(response) {
var result = callback.call(response, response.error, response.data);
if (result === false) return;
if (response.hasNextPage()) {
response.nextPage().on('complete', wrappedCallback).send();
} else {
callback.call(response, null, null);
}
}
this.on('complete', wrappedCallback).send();
},
/**
* Enumerates over individual items of a request, paging the responses if
* necessary.
*
* @api experimental
* @since v1.4.0
*/
eachItem: function eachItem(callback) {
function wrappedCallback(err, data) {
if (err) return callback(err, null);
if (data === null) return callback(null, null);
var config = this.request.service.paginationConfig(this.request.operation);
var resultKey = config.resultKey;
if (Array.isArray(resultKey)) resultKey = resultKey[0];
var results = AWS.util.jamespath.query(resultKey, data);
AWS.util.arrayEach(results, function(result) {
AWS.util.arrayEach(result, function(item) { callback(null, item); });
});
}
this.eachPage(wrappedCallback);
},
/**
* @return [Boolean] whether the operation can return multiple pages of
* response data.
* @api experimental
* @see AWS.Response.eachPage
* @since v1.4.0
*/
isPageable: function isPageable() {
return this.service.paginationConfig(this.operation) ? true : false;
},
/**
* Converts the request object into a readable stream that
* can be read from or piped into a writable stream.
*
* @note The data read from a readable stream contains only
* the raw HTTP body contents.
* @example Manually reading from a stream
* request.createReadStream().on('data', function(data) {
* console.log("Got data:", data.toString());
* });
* @example Piping a request body into a file
* var out = fs.createWriteStream('/path/to/outfile.jpg');
* s3.service.getObject(params).createReadStream().pipe(out);
* @return [Stream] the readable stream object that can be piped
* or read from (by registering 'data' event listeners).
* @!macro nobrowser
*/
createReadStream: function createReadStream() {
var streams = AWS.util.nodeRequire('stream');
var req = this;
var stream = null;
var legacyStreams = false;
if (AWS.HttpClient.streamsApiVersion === 2) {
stream = new streams.Readable();
stream._read = function() { stream.push(''); };
} else {
stream = new streams.Stream();
stream.readable = true;
}
stream.sent = false;
stream.on('newListener', function(event) {
if (!stream.sent && (event === 'data' || event === 'readable')) {
if (event === 'data') legacyStreams = true;
stream.sent = true;
process.nextTick(function() { req.send(function() { }); });
}
});
this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) {
if (statusCode < 300) {
this.httpRequest._streaming = true;
req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA);
req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR);
req.on('httpError', function streamHttpError(error, resp) {
resp.error = error;
resp.error.retryable = false;
});
var httpStream = resp.httpResponse.stream;
stream.response = resp;
stream._read = function() {
var data;
do {
data = httpStream.read();
if (data) stream.push(data);
} while (data);
stream.push('');
};
var events = ['end', 'error', (legacyStreams ? 'data' : 'readable')];
AWS.util.arrayEach(events, function(event) {
httpStream.on(event, function(arg) {
stream.emit(event, arg);
});
});
}
});
this.on('error', function(err) {
stream.emit('error', err);
});
return stream;
},
/**
* @param [Array,Response] args This should be the response object,
* or an array of args to send to the event.
* @api private
*/
emitEvent: function emit(eventName, args, done) {
if (typeof args === 'function') { done = args; args = null; }
if (!done) done = this.unhandledErrorCallback;
if (!args) args = this.eventParameters(eventName, this.response);
var origEmit = AWS.SequentialExecutor.prototype.emit;
origEmit.call(this, eventName, args, function (err) {
if (err) this.response.error = err;
done.call(this, err);
});
},
/**
* @api private
*/
eventParameters: function eventParameters(eventName) {
switch (eventName) {
case 'validate':
case 'sign':
case 'build':
case 'afterBuild':
return [this];
case 'error':
return [this.response.error, this.response];
default:
return [this.response];
}
}
});
AWS.util.mixin(AWS.Request, AWS.SequentialExecutor);

View File

@ -1,200 +0,0 @@
/**
* Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You
* may not use this file except in compliance with the License. A copy of
* the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
var AWS = require('./core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.ResourceWaiter = inherit({
/**
* Waits for a given state on a service object
* @param service [Service] the service object to wait on
* @param state [String] the state (defined in waiter configuration) to wait
* for.
* @example Create a waiter for running EC2 instances
* var ec2 = new AWS.EC2;
* var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning');
*/
constructor: function constructor(service, state) {
this.service = service;
this.state = state;
this.config = {};
if (typeof this.state === 'object') {
AWS.util.each.call(this, this.state, function (key, value) {
this.state = key;
this.expectedValue = value;
});
}
this.loadWaiterConfig(this.state);
if (!this.expectedValue) {
this.expectedValue = this.config.successValue;
}
this.config.operation = AWS.util.string.lowerFirst(this.config.operation);
},
service: null,
state: null,
expectedValue: null,
config: null,
waitDone: false,
Listeners: {
retry: new AWS.SequentialExecutor().addNamedListeners(function(add) {
add('RETRY_CHECK', 'retry', function(resp) {
var waiter = resp.request._waiter;
if (resp.error && resp.error.code === 'ResourceNotReady') {
resp.error.retryDelay = waiter.config.interval * 1000;
}
});
}),
output: new AWS.SequentialExecutor().addNamedListeners(function(add) {
add('CHECK_OUT_ERROR', 'extractError', function CHECK_OUT_ERROR(resp) {
if (resp.error) {
resp.request._waiter.setError(resp, true);
}
});
add('CHECK_OUTPUT', 'extractData', function CHECK_OUTPUT(resp) {
var waiter = resp.request._waiter;
var success = waiter.checkSuccess(resp);
if (!success) {
waiter.setError(resp, success === null ? false : true);
} else {
resp.error = null;
}
});
}),
error: new AWS.SequentialExecutor().addNamedListeners(function(add) {
add('CHECK_ERROR', 'extractError', function CHECK_ERROR(resp) {
var waiter = resp.request._waiter;
var success = waiter.checkError(resp);
if (!success) {
waiter.setError(resp, success === null ? false : true);
} else {
resp.error = null;
resp.request.removeAllListeners('extractData');
}
});
add('CHECK_ERR_OUTPUT', 'extractData', function CHECK_ERR_OUTPUT(resp) {
resp.request._waiter.setError(resp, true);
});
})
},
/**
* @return [AWS.Request]
*/
wait: function wait(params, callback) {
if (typeof params === 'function') {
callback = params; params = undefined;
}
var request = this.service.makeRequest(this.config.operation, params);
var listeners = this.Listeners[this.config.successType];
request._waiter = this;
request.response.maxRetries = this.config.maxAttempts;
request.addListeners(this.Listeners.retry);
if (listeners) request.addListeners(listeners);
if (callback) request.send(callback);
return request;
},
setError: function setError(resp, retryable) {
resp.data = null;
resp.error = AWS.util.error(resp.error || new Error(), {
code: 'ResourceNotReady',
message: 'Resource is not in the state ' + this.state,
retryable: retryable
});
},
/**
* Checks if the terminal expected success state has been met
* @return [Boolean]
*/
checkSuccess: function checkSuccess(resp) {
if (!this.config.successPath) {
return resp.httpResponse.statusCode < 300;
}
var r = AWS.util.jamespath.find(this.config.successPath, resp.data);
if (this.config.failureValue &&
this.config.failureValue.indexOf(r) >= 0) {
return null; // fast fail
}
if (this.expectedValue) {
return r === this.expectedValue;
} else {
return r ? true : false;
}
},
/**
* Checks if the terminal expected error state has been met
* @return [Boolean]
*/
checkError: function checkError(resp) {
return resp.httpResponse.statusCode === this.config.successValue;
},
/**
* Loads waiter configuration from API configuration and deals with inherited
* properties.
*
* @api private
*/
loadWaiterConfig: function loadWaiterConfig(state, noException) {
if (!this.service.api.waiters[state]) {
if (noException) return;
throw new AWS.util.error(new Error(), {
code: 'StateNotFoundError',
message: 'State ' + state + ' not found.'
});
}
if (state !== '__default__') {
var superState = this.service.api.waiters[state]['extends'];
superState = superState || '__default__';
this.loadWaiterConfig(superState, true);
}
var config = this.config;
AWS.util.update(config, this.service.api.waiters[state]);
// inherit acceptor data
(function () { // anonymous function to avoid max complexity count
config.successType = config.successType || config.acceptorType;
config.successPath = config.successPath || config.acceptorPath;
config.successValue = config.successValue || config.acceptorValue;
config.failureType = config.failureType || config.acceptorType;
config.failurePath = config.failurePath || config.acceptorPath;
config.failureValue = config.failureValue || config.acceptorValue;
})();
}
});

195
node_modules/aws-sdk/lib/response.js generated vendored
View File

@ -1,195 +0,0 @@
var AWS = require('./core');
var inherit = AWS.util.inherit;
/**
* This class encapsulates the the response information
* from a service request operation sent through {AWS.Request}.
* The response object has two main properties for getting information
* back from a request:
*
* ## The `data` property
*
* The `response.data` property contains the serialized object data
* retrieved from the service request. For instance, for an
* Amazon DynamoDB `listTables` method call, the response data might
* look like:
*
* ```
* > resp.data
* { TableNames:
* [ 'table1', 'table2', ... ] }
* ```
*
* The `data` property can be null if an error occurs (see below).
*
* ## The `error` property
*
* In the event of a service error (or transfer error), the
* `response.error` property will be filled with the given
* error data in the form:
*
* ```
* { code: 'SHORT_UNIQUE_ERROR_CODE',
* message: 'Some human readable error message' }
* ```
*
* In the case of an error, the `data` property will be `null`.
* Note that if you handle events that can be in a failure state,
* you should always check whether `response.error` is set
* before attempting to access the `response.data` property.
*
* @!attribute data
* @readonly
* @!group Data Properties
* @note Inside of a {AWS.Request~httpData} event, this
* property contains a single raw packet instead of the
* full de-serialized service response.
* @return [Object] the de-serialized response data
* from the service.
*
* @!attribute error
* An structure containing information about a service
* or networking error.
* @readonly
* @!group Data Properties
* @note This attribute is only filled if a service or
* networking error occurs.
* @return [Object]
* * code [String] a unique short code representing the
* error that was emitted.
* * message [String] a longer human readable error message
* * retryable [Boolean] whether the error message is
* retryable.
*
* @!attribute requestId
* @readonly
* @!group Data Properties
* @return [String] the unique request ID associated with the response.
* Log this value when debugging requests for AWS support.
*
* @!attribute retryCount
* @readonly
* @!group Operation Properties
* @return [Integer] the number of retries that were
* attempted before the request was completed.
*
* @!attribute redirectCount
* @readonly
* @!group Operation Properties
* @return [Integer] the number of redirects that were
* followed before the request was completed.
*
* @!attribute httpResponse
* @readonly
* @!group HTTP Properties
* @return [AWS.HttpResponse] the raw HTTP response object
* containing the response headers and body information
* from the server.
*
* @see AWS.Request
*/
AWS.Response = inherit({
/**
* @api private
*/
constructor: function Response(request) {
this.request = request;
this.data = null;
this.error = null;
this.retryCount = 0;
this.redirectCount = 0;
this.httpResponse = new AWS.HttpResponse();
if (request) {
this.maxRetries = request.service.numRetries();
this.maxRedirects = request.service.config.maxRedirects;
}
},
/**
* Creates a new request for the next page of response data, calling the
* callback with the page data if a callback is provided.
*
* @callback callback function(err, data)
* Called when a page of data is returned from the next request.
*
* @param err [Error] an error object, if an error occurred in the request
* @param data [Object] the next page of data, or null, if there are no
* more pages left.
* @return [AWS.Request] the request object for the next page of data
* @return [null] if no callback is provided and there are no pages left
* to retrieve.
* @api experimental
* @since v1.4.0
*/
nextPage: function nextPage(callback) {
var config;
var service = this.request.service;
var operation = this.request.operation;
try {
config = service.paginationConfig(operation, true);
} catch (e) { this.error = e; }
if (!this.hasNextPage()) {
if (callback) callback(this.error, null);
else if (this.error) throw this.error;
return null;
}
var params = AWS.util.copy(this.request.params);
if (!this.nextPageTokens) {
return callback ? callback(null, null) : null;
} else {
var inputTokens = config.inputToken;
if (typeof inputTokens === 'string') inputTokens = [inputTokens];
for (var i = 0; i < inputTokens.length; i++) {
params[inputTokens[i]] = this.nextPageTokens[i];
}
return service.makeRequest(this.request.operation, params, callback);
}
},
/**
* @return [Boolean] whether more pages of data can be returned by further
* requests
* @api experimental
* @since v1.4.0
*/
hasNextPage: function hasNextPage() {
this.cacheNextPageTokens();
if (this.nextPageTokens) return true;
if (this.nextPageTokens === undefined) return undefined;
else return false;
},
/**
* @api private
*/
cacheNextPageTokens: function cacheNextPageTokens() {
if (this.hasOwnProperty('nextPageTokens')) return this.nextPageTokens;
this.nextPageTokens = undefined;
var config = this.request.service.paginationConfig(this.request.operation);
if (!config) return this.nextPageTokens;
this.nextPageTokens = null;
if (config.moreResults) {
if (!AWS.util.jamespath.find(config.moreResults, this.data)) {
return this.nextPageTokens;
}
}
var exprs = config.outputToken;
if (typeof exprs === 'string') exprs = [exprs];
AWS.util.arrayEach.call(this, exprs, function (expr) {
var output = AWS.util.jamespath.find(expr, this.data);
if (output) {
this.nextPageTokens = this.nextPageTokens || [];
this.nextPageTokens.push(output);
}
});
return this.nextPageTokens;
}
});

View File

@ -1,255 +0,0 @@
var AWS = require('./core');
var domain = AWS.util.nodeRequire('domain');
/**
* @!method on(eventName, callback)
* Registers an event listener callback for the event given by `eventName`.
* Parameters passed to the callback function depend on the individual event
* being triggered. See the event documentation for those parameters.
*
* @param eventName [String] the event name to register the listener for
* @param callback [Function] the listener callback function
* @return [AWS.SequentialExecutor] the same object for chaining
*/
AWS.SequentialExecutor = AWS.util.inherit({
constructor: function SequentialExecutor() {
this.domain = domain && domain.active;
this._events = {};
},
/**
* @api private
*/
listeners: function listeners(eventName) {
return this._events[eventName] ? this._events[eventName].slice(0) : [];
},
on: function on(eventName, listener) {
if (this._events[eventName]) {
this._events[eventName].push(listener);
} else {
this._events[eventName] = [listener];
}
return this;
},
/**
* @api private
*/
onAsync: function onAsync(eventName, listener) {
listener._isAsync = true;
return this.on(eventName, listener);
},
removeListener: function removeListener(eventName, listener) {
var listeners = this._events[eventName];
if (listeners) {
var length = listeners.length;
var position = -1;
for (var i = 0; i < length; ++i) {
if (listeners[i] === listener) {
position = i;
}
}
if (position > -1) {
listeners.splice(position, 1);
}
}
return this;
},
removeAllListeners: function removeAllListeners(eventName) {
if (eventName) {
delete this._events[eventName];
} else {
this._events = {};
}
return this;
},
/**
* @api private
*/
emit: function emit(eventName, eventArgs, doneCallback) {
if (!doneCallback) doneCallback = this.unhandledErrorCallback;
if (domain && this.domain instanceof domain.Domain)
this.domain.enter();
var listeners = this.listeners(eventName);
var count = listeners.length;
this.callListeners(listeners, eventArgs, doneCallback);
return count > 0;
},
/**
* @api private
*/
callListeners: function callListeners(listeners, args, doneCallback) {
if (listeners.length === 0) {
doneCallback.call(this);
if (domain && this.domain instanceof domain.Domain)
this.domain.exit();
} else {
var listener = listeners.shift();
if (listener._isAsync) {
// asynchronous listener
var self = this;
var callNextListener = function(err) {
if (err) {
doneCallback.call(self, err);
if (domain && self.domain instanceof domain.Domain)
self.domain.exit();
} else {
self.callListeners(listeners, args, doneCallback);
}
};
listener.apply(this, args.concat([callNextListener]));
} else {
// synchronous listener
try {
listener.apply(this, args);
this.callListeners(listeners, args, doneCallback);
} catch (err) {
if (err._hardError) throw err;
doneCallback.call(this, err);
if (domain && this.domain instanceof domain.Domain)
this.domain.exit();
}
}
}
},
/**
* Adds or copies a set of listeners from another list of
* listeners or SequentialExecutor object.
*
* @param listeners [map<String,Array<Function>>, AWS.SequentialExecutor]
* a list of events and callbacks, or an event emitter object
* containing listeners to add to this emitter object.
* @return [AWS.SequentialExecutor] the emitter object, for chaining.
* @example Adding listeners from a map of listeners
* emitter.addListeners({
* event1: [function() { ... }, function() { ... }],
* event2: [function() { ... }]
* });
* emitter.emit('event1'); // emitter has event1
* emitter.emit('event2'); // emitter has event2
* @example Adding listeners from another emitter object
* var emitter1 = new AWS.SequentialExecutor();
* emitter1.on('event1', function() { ... });
* emitter1.on('event2', function() { ... });
* var emitter2 = new AWS.SequentialExecutor();
* emitter2.addListeners(emitter1);
* emitter2.emit('event1'); // emitter2 has event1
* emitter2.emit('event2'); // emitter2 has event2
*/
addListeners: function addListeners(listeners) {
var self = this;
// extract listeners if parameter is an SequentialExecutor object
if (listeners._events) listeners = listeners._events;
AWS.util.each(listeners, function(event, callbacks) {
if (typeof callbacks === 'function') callbacks = [callbacks];
AWS.util.arrayEach(callbacks, function(callback) {
self.on(event, callback);
});
});
return self;
},
/**
* Registers an event with {on} and saves the callback handle function
* as a property on the emitter object using a given `name`.
*
* @param name [String] the property name to set on this object containing
* the callback function handle so that the listener can be removed in
* the future.
* @param (see on)
* @return (see on)
* @example Adding a named listener DATA_CALLBACK
* var listener = function() { doSomething(); };
* emitter.addNamedListener('DATA_CALLBACK', 'data', listener);
*
* // the following prints: true
* console.log(emitter.DATA_CALLBACK == listener);
*/
addNamedListener: function addNamedListener(name, eventName, callback) {
this[name] = callback;
this.addListener(eventName, callback);
return this;
},
/**
* @api private
*/
addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback) {
callback._isAsync = true;
return this.addNamedListener(name, eventName, callback);
},
/**
* Helper method to add a set of named listeners using
* {addNamedListener}. The callback contains a parameter
* with a handle to the `addNamedListener` method.
*
* @callback callback function(add)
* The callback function is called immediately in order to provide
* the `add` function to the block. This simplifies the addition of
* a large group of named listeners.
* @param add [Function] the {addNamedListener} function to call
* when registering listeners.
* @example Adding a set of named listeners
* emitter.addNamedListeners(function(add) {
* add('DATA_CALLBACK', 'data', function() { ... });
* add('OTHER', 'otherEvent', function() { ... });
* add('LAST', 'lastEvent', function() { ... });
* });
*
* // these properties are now set:
* emitter.DATA_CALLBACK;
* emitter.OTHER;
* emitter.LAST;
*/
addNamedListeners: function addNamedListeners(callback) {
var self = this;
callback(
function() {
self.addNamedListener.apply(self, arguments);
},
function() {
self.addNamedAsyncListener.apply(self, arguments);
}
);
return this;
},
/**
* @api private
*/
unhandledErrorCallback: function unhandledErrorCallback(err) {
if (err) {
if (domain && this.domain instanceof domain.Domain) {
err.domainEmitter = this;
err.domain = this.domain;
err.domainThrown = false;
this.domain.emit('error', err);
} else {
throw err;
}
}
}
});
/**
* {on} is the prefered method.
* @api private
*/
AWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on;

519
node_modules/aws-sdk/lib/service.js generated vendored
View File

@ -1,519 +0,0 @@
var AWS = require('./core');
var Translator = require('aws-sdk-apis/lib/translator');
var inherit = AWS.util.inherit;
/**
* The service class representing an AWS service.
*
* @abstract
*
* @!attribute apiVersions
* @return [Array<String>] the list of API versions supported by this service.
* @readonly
*/
AWS.Service = inherit({
/**
* Create a new service object with a configuration object
*
* @param config [map] a map of configuration options
*/
constructor: function Service(config) {
if (!this.loadServiceClass) {
throw AWS.util.error(new Error(),
'Service must be constructed with `new\' operator');
}
var ServiceClass = this.loadServiceClass(config || {});
if (ServiceClass) return new ServiceClass(config);
this.initialize(config);
},
/**
* @api private
*/
initialize: function initialize(config) {
AWS.util.hideProperties(this, ['client']);
this.client = this; // backward compatibility with client property
this.config = new AWS.Config(AWS.config);
if (config) this.config.update(config, true);
this.setEndpoint(this.config.endpoint);
},
/**
* @api private
*/
loadServiceClass: function loadServiceClass(serviceConfig) {
var config = serviceConfig;
if (!AWS.util.isEmpty(this.api)) {
return null;
} else if (config.apiConfig) {
return AWS.Service.defineServiceApi(this.constructor, config.apiConfig);
} else if (!this.constructor.services) {
return null;
} else {
config = new AWS.Config(AWS.config);
config.update(serviceConfig, true);
var version = config.apiVersions[this.constructor.serviceIdentifier];
version = version || config.apiVersion;
return this.getLatestServiceClass(version);
}
},
/**
* @api private
*/
getLatestServiceClass: function getLatestServiceClass(version) {
version = this.getLatestServiceVersion(version);
if (this.constructor.services[version] === null) {
AWS.Service.defineServiceApi(this.constructor, version);
}
return this.constructor.services[version];
},
/**
* @api private
*/
getLatestServiceVersion: function getLatestServiceVersion(version) {
if (!this.constructor.services || this.constructor.services.length === 0) {
throw new Error('No services defined on ' +
this.constructor.serviceIdentifier);
}
if (!version) {
version = 'latest';
} else if (AWS.util.isType(version, Date)) {
version = AWS.util.date.iso8601(version).split('T')[0];
}
if (Object.hasOwnProperty(this.constructor.services, version)) {
return version;
}
var keys = Object.keys(this.constructor.services).sort();
var selectedVersion = null;
for (var i = keys.length - 1; i >= 0; i--) {
// versions that end in "*" are not available on disk and can be
// skipped, so do not choose these as selectedVersions
if (keys[i][keys[i].length - 1] !== '*') {
selectedVersion = keys[i];
}
if (keys[i].substr(0, 10) <= version) {
return selectedVersion;
}
}
throw new Error('Could not find ' + this.constructor.serviceIdentifier +
' API to satisfy version constraint `' + version + '\'');
},
/**
* @api private
*/
api: {},
/**
* @api private
*/
defaultRetryCount: 3,
/**
* Calls an operation on a service with the given input parameters.
*
* @param operation [String] the name of the operation to call on the service.
* @param params [map] a map of input options for the operation
* @callback callback function(err, data)
* If a callback is supplied, it is called when a response is returned
* from the service.
* @param err [Error] the error object returned from the request.
* Set to `null` if the request is successful.
* @param data [Object] the de-serialized data returned from
* the request. Set to `null` if a request error occurs.
*/
makeRequest: function makeRequest(operation, params, callback) {
if (typeof params === 'function') {
callback = params;
params = null;
}
params = params || {};
if (this.config.params) { // copy only toplevel bound params
var rules = this.api.operations[operation];
if (rules) {
params = AWS.util.copy(params);
AWS.util.each(this.config.params, function(key, value) {
if (rules.input.members[key]) {
if (params[key] === undefined || params[key] === null) {
params[key] = value;
}
}
});
}
}
var request = new AWS.Request(this, operation, params);
this.addAllRequestListeners(request);
if (callback) request.send(callback);
return request;
},
/**
* Calls an operation on a service with the given input parameters, without
* any authentication data. This method is useful for "public" API operations.
*
* @param operation [String] the name of the operation to call on the service.
* @param params [map] a map of input options for the operation
* @callback callback function(err, data)
* If a callback is supplied, it is called when a response is returned
* from the service.
* @param err [Error] the error object returned from the request.
* Set to `null` if the request is successful.
* @param data [Object] the de-serialized data returned from
* the request. Set to `null` if a request error occurs.
*/
makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) {
if (typeof params === 'function') {
callback = params;
params = {};
}
var request = this.makeRequest(operation, params);
request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS);
request.removeListener('sign', AWS.EventListeners.Core.SIGN);
if (this.api.format === 'query') { // query services turn into GET requests
request.addListener('build', function convertToGET(request) {
request.httpRequest.method = 'GET';
request.httpRequest.path = '/?' + request.httpRequest.body;
request.httpRequest.body = '';
// don't need these headers on a GET request
delete request.httpRequest.headers['Content-Length'];
delete request.httpRequest.headers['Content-Type'];
});
}
return callback ? request.send(callback) : request;
},
/**
* Waits for a given state
*
* @param state [String] the state on the service to wait for
* @param params [map] a map of parameters to pass with each request
* @callback callback function(err, data)
* If a callback is supplied, it is called when a response is returned
* from the service.
* @param err [Error] the error object returned from the request.
* Set to `null` if the request is successful.
* @param data [Object] the de-serialized data returned from
* the request. Set to `null` if a request error occurs.
*/
waitFor: function waitFor(state, params, callback) {
var waiter = new AWS.ResourceWaiter(this, state);
return waiter.wait(params, callback);
},
/**
* @api private
*/
addAllRequestListeners: function addAllRequestListeners(request) {
var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(),
AWS.EventListeners.CorePost];
for (var i = 0; i < list.length; i++) {
if (list[i]) request.addListeners(list[i]);
}
// disable parameter validation
if (!this.config.paramValidation) {
request.removeListener('validate',
AWS.EventListeners.Core.VALIDATE_PARAMETERS);
}
if (this.config.logger) { // add logging events
request.addListeners(AWS.EventListeners.Logger);
}
this.setupRequestListeners(request);
},
/**
* Override this method to setup any custom request listeners for each
* new request to the service.
*
* @abstract
*/
setupRequestListeners: function setupRequestListeners() {
},
/**
* Gets the signer class for a given request
* @api private
*/
getSignerClass: function getSignerClass() {
var version = this.api.signatureVersion;
if (this.config.signatureVersion) version = this.config.signatureVersion;
else if (this.isRegionV4()) version = 'v4';
return AWS.Signers.RequestSigner.getVersion(version);
},
/**
* @api private
*/
serviceInterface: function serviceInterface() {
switch (this.api.format) {
case 'query': return AWS.EventListeners.Query;
case 'json': return AWS.EventListeners.Json;
case 'rest-json': return AWS.EventListeners.RestJson;
case 'rest-xml': return AWS.EventListeners.RestXml;
}
if (this.api.format) {
throw new Error('Invalid service `format\' ' +
this.api.format + ' in API config');
}
},
/**
* @api private
*/
successfulResponse: function successfulResponse(resp) {
return resp.httpResponse.statusCode < 300;
},
/**
* How many times a failed request should be retried before giving up.
* the defaultRetryCount can be overriden by service classes.
*
* @api private
*/
numRetries: function numRetries() {
if (this.config.maxRetries !== undefined) {
return this.config.maxRetries;
} else {
return this.defaultRetryCount;
}
},
/**
* @api private
*/
retryDelays: function retryDelays() {
var retryCount = this.numRetries();
var delays = [];
for (var i = 0; i < retryCount; ++i) {
delays[i] = Math.pow(2, i) * 30;
}
return delays;
},
/**
* @api private
*/
retryableError: function retryableError(error) {
if (this.networkingError(error)) return true;
if (this.expiredCredentialsError(error)) return true;
if (this.throttledError(error)) return true;
if (error.statusCode >= 500) return true;
return false;
},
/**
* @api private
*/
networkingError: function networkingError(error) {
return error.code === 'NetworkingError';
},
/**
* @api private
*/
expiredCredentialsError: function expiredCredentialsError(error) {
// TODO : this only handles *one* of the expired credential codes
return (error.code === 'ExpiredTokenException');
},
/**
* @api private
*/
throttledError: function throttledError(error) {
// this logic varies between services
return (error.code === 'ProvisionedThroughputExceededException');
},
/**
* @api private
*/
setEndpoint: function setEndpoint(endpoint) {
if (endpoint) {
this.endpoint = new AWS.Endpoint(endpoint, this.config);
} else if (this.hasGlobalEndpoint()) {
this.endpoint = new AWS.Endpoint(this.api.globalEndpoint, this.config);
} else {
var host = this.api.endpointPrefix + '.' + this.config.region +
this.endpointSuffix();
this.endpoint = new AWS.Endpoint(host, this.config);
}
},
/**
* @api private
*/
hasGlobalEndpoint: function hasGlobalEndpoint() {
if (this.isRegionV4()) return false;
return this.api.globalEndpoint;
},
/**
* @api private
*/
endpointSuffix: function endpointSuffix() {
var suffix = '.amazonaws.com';
if (this.isRegionCN()) return suffix + '.cn';
else return suffix;
},
/**
* @api private
*/
isRegionCN: function isRegionCN() {
if (!this.config.region) return false;
return this.config.region.match(/^cn-/) ? true : false;
},
/**
* @api private
*/
isRegionV4: function isRegionV4() {
return this.isRegionCN();
},
/**
* @api private
*/
paginationConfig: function paginationConfig(operation, throwException) {
function fail(name) {
if (throwException) {
var e = new Error();
throw AWS.util.error(e, 'No pagination configuration for ' + name);
}
return null;
}
if (!this.api.pagination) return fail('service');
if (!this.api.pagination[operation]) return fail(operation);
return this.api.pagination[operation];
}
});
AWS.util.update(AWS.Service, {
/**
* Adds one method for each operation described in the api configuration
*
* @api private
*/
defineMethods: function defineMethods(svc) {
AWS.util.each(svc.prototype.api.operations, function iterator(method) {
if (svc.prototype[method]) return;
svc.prototype[method] = function (params, callback) {
return this.makeRequest(method, params, callback);
};
});
},
/**
* Defines a new Service class using a service identifier and list of versions
* including an optional set of features (functions) to apply to the class
* prototype.
*
* @param serviceIdentifier [String] the identifier for the service
* @param versions [Array<String>] a list of versions that work with this
* service
* @param features [Object] an object to attach to the prototype
* @return [Class<Service>] the service class defined by this function.
*/
defineService: function defineService(serviceIdentifier, versions, features) {
if (!Array.isArray(versions)) {
features = versions;
versions = [];
}
var svc = inherit(AWS.Service, features || {});
if (typeof serviceIdentifier === 'string') {
AWS.Service.addVersions(svc, versions);
var identifier = svc.serviceIdentifier || serviceIdentifier;
svc.serviceIdentifier = identifier;
} else { // defineService called with an API
svc.prototype.api = serviceIdentifier;
AWS.Service.defineMethods(svc);
}
return svc;
},
/**
* @api private
*/
addVersions: function addVersions(svc, versions) {
if (!Array.isArray(versions)) versions = [versions];
svc.services = svc.services || {};
for (var i = 0; i < versions.length; i++) {
if (svc.services[versions[i]] === undefined) {
svc.services[versions[i]] = null;
}
}
svc.apiVersions = Object.keys(svc.services).sort();
},
/**
* @api private
*/
defineServiceApi: function defineServiceApi(superclass, version, apiConfig) {
var svc = inherit(superclass, {
serviceIdentifier: superclass.serviceIdentifier
});
function setApi(api) {
if (api.type && api.api_version) {
svc.prototype.api = new Translator(api, {documentation: false});
} else {
svc.prototype.api = api;
}
}
if (typeof version === 'string') {
if (apiConfig) {
setApi(apiConfig);
} else {
var fs = AWS.util.nodeRequire('fs');
var path = AWS.util.nodeRequire('path');
var apis = AWS.util.nodeRequire('aws-sdk-apis');
try {
var name = null;
if (apis) name = apis.serviceName(superclass.serviceIdentifier);
var file = (name || superclass.serviceIdentifier) + '-' + version;
var fullPath = path.dirname(require.resolve('aws-sdk-apis')) +
'/apis/' + file + '.json';
setApi(JSON.parse(fs.readFileSync(fullPath)));
} catch (err) {
throw AWS.util.error(err, {
message: 'Could not find API configuration ' + file
});
}
}
if (!superclass.services.hasOwnProperty(version)) {
superclass.apiVersions = superclass.apiVersions.concat(version).sort();
}
superclass.services[version] = svc;
} else {
setApi(version);
}
AWS.Service.defineMethods(svc);
return svc;
}
});

View File

@ -1,50 +0,0 @@
var AWS = require('../core');
require('../json/builder');
/**
* @api private
*/
AWS.ServiceInterface.Json = {
buildRequest: function buildRequest(req) {
var httpRequest = req.httpRequest;
var api = req.service.api;
var target = api.targetPrefix + '.' + api.operations[req.operation].name;
var version = api.jsonVersion || '1.0';
var rules = api.operations[req.operation].input;
var builder = new AWS.JSON.Builder(rules, api);
httpRequest.body = builder.build(req.params || {});
httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version;
httpRequest.headers['X-Amz-Target'] = target;
},
extractError: function extractError(resp) {
var error = {};
var httpResponse = resp.httpResponse;
if (httpResponse.body.length > 0) {
var e = JSON.parse(httpResponse.body.toString());
if (e.__type || e.code) {
error.code = (e.__type || e.code).split('#').pop();
} else {
error.code = 'UnknownError';
}
if (error.code === 'RequestEntityTooLarge') {
error.message = 'Request body must be less than 1 MB';
} else {
error.message = (e.message || e.Message || null);
}
} else {
error.code = httpResponse.statusCode;
error.message = null;
}
resp.error = AWS.util.error(new Error(), error);
},
extractData: function extractData(resp) {
resp.data = JSON.parse(resp.httpResponse.body.toString() || '{}');
}
};

View File

@ -1,155 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.ServiceInterface.Query = {
buildRequest: function buildRequest(req) {
var operation = req.service.api.operations[req.operation];
var httpRequest = req.httpRequest;
httpRequest.headers['Content-Type'] =
'application/x-www-form-urlencoded; charset=utf-8';
httpRequest.params = {
Version: req.service.api.apiVersion,
Action: operation.name
};
// convert the request parameters into a list of query params,
// e.g. Deeply.NestedParam.0.Name=value
var rules = operation.input;
if (rules) rules = rules.members;
var builder = new AWS.QueryParamSerializer(rules, req.service.api);
builder.serialize(req.params, function(name, value) {
httpRequest.params[name] = value;
});
httpRequest.body = AWS.util.queryParamsToString(httpRequest.params);
},
extractError: function extractError(resp) {
var data, body = resp.httpResponse.body.toString();
if (body.match('<UnknownOperationException')) {
data = {
Code: 'UnknownOperation',
Message: 'Unknown operation ' + resp.request.operation
};
} else {
data = new AWS.XML.Parser({}).parse(body);
}
if (data.Errors) data = data.Errors;
if (data.Error) data = data.Error;
if (data.Code) {
resp.error = AWS.util.error(new Error(), {
code: data.Code,
message: data.Message
});
} else {
resp.error = AWS.util.error(new Error(), {
code: resp.httpResponse.statusCode,
message: null
});
}
},
extractData: function extractData(resp) {
var req = resp.request;
var operation = req.service.api.operations[req.operation];
var wrapperKey = operation.name + 'Result';
var rules = operation.output || {};
if (req.service.api.resultWrapped) {
var tmp = {
type: 'structure',
members: {}
};
tmp.members[wrapperKey] = rules;
rules = tmp;
}
var parser = new AWS.XML.Parser(rules);
var data = parser.parse(resp.httpResponse.body.toString());
if (req.service.api.resultWrapped) {
if (data[wrapperKey]) {
AWS.util.update(data, data[wrapperKey]);
delete data[wrapperKey];
}
}
resp.data = data;
}
};
/**
* @api private
*/
AWS.QueryParamSerializer = inherit({
constructor: function QueryParamSerializer(rules, options) {
this.rules = rules;
this.timestampFormat = options ? options.timestampFormat : 'iso8601';
},
serialize: function serialize(params, fn) {
this.serializeStructure('', params, this.rules, fn);
},
serializeStructure: function serializeStructure(prefix, struct, rules, fn) {
var that = this;
AWS.util.each(struct, function (name, member) {
var n = rules[name].name || name;
var memberName = prefix ? prefix + '.' + n : n;
that.serializeMember(memberName, member, rules[name], fn);
});
},
serializeMap: function serialzeMap(name, map, rules, fn) {
var i = 1;
var that = this;
AWS.util.each(map, function (key, value) {
var prefix = rules.flattened ? '.' : '.entry.';
var position = prefix + (i++) + '.';
var keyName = position + (rules.keys.name || 'key');
var valueName = position + (rules.members.name || 'value');
that.serializeMember(name + keyName, key, rules.keys, fn);
that.serializeMember(name + valueName, value, rules.members, fn);
});
},
serializeList: function serializeList(name, list, rules, fn) {
var that = this;
var memberRules = rules.members || {};
AWS.util.arrayEach(list, function (v, n) {
var suffix = '.' + (n + 1);
if (rules.flattened) {
if (memberRules.name) {
var parts = name.split('.');
parts.pop();
parts.push(memberRules.name);
name = parts.join('.');
}
} else {
suffix = '.member' + suffix;
}
that.serializeMember(name + suffix, v, memberRules, fn);
});
},
serializeMember: function serializeMember(name, value, rules, fn) {
if (value === null || value === undefined) return;
if (rules.type === 'structure') {
this.serializeStructure(name, value, rules.members, fn);
} else if (rules.type === 'list') {
this.serializeList(name, value, rules, fn);
} else if (rules.type === 'map') {
this.serializeMap(name, value, rules, fn);
} else if (rules.type === 'timestamp') {
var timestampFormat = rules.format || this.timestampFormat;
fn.call(this, name, AWS.util.date.format(value, timestampFormat));
} else {
fn.call(this, name, String(value));
}
}
});

View File

@ -1,131 +0,0 @@
var AWS = require('../core');
/**
* @api private
*/
AWS.ServiceInterface.Rest = {
buildRequest: function buildRequest(req) {
AWS.ServiceInterface.Rest.populateMethod(req);
AWS.ServiceInterface.Rest.populateURI(req);
AWS.ServiceInterface.Rest.populateHeaders(req);
},
extractError: function extractError() {
},
extractData: function extractData(resp) {
var req = resp.request;
var data = {};
var r = resp.httpResponse;
var operation = req.service.api.operations[req.operation];
var rules = (operation.output || {}).members || {};
// normalize headers names to lower-cased keys for matching
var headers = {};
AWS.util.each(r.headers, function (k, v) {
headers[k.toLowerCase()] = v;
});
AWS.util.each(rules, function (name, rule) {
if (rule.location === 'header') {
var header = (rule.name || name).toLowerCase();
if (rule.type === 'map') {
data[name] = {};
AWS.util.each(r.headers, function (k, v) {
var result = k.match(new RegExp('^' + rule.name + '(.+)', 'i'));
if (result !== null) {
data[name][result[1]] = v;
}
});
}
if (headers[header] !== undefined) {
data[name] = headers[header];
}
}
if (rule.location === 'status') {
data[name] = parseInt(r.statusCode, 10);
}
});
resp.data = data;
},
populateMethod: function populateMethod(req) {
req.httpRequest.method = req.service.api.operations[req.operation].http.method;
},
populateURI: function populateURI(req) {
var operation = req.service.api.operations[req.operation];
var uri = [req.httpRequest.endpoint.path, operation.http.uri].join('/');
uri = uri.replace(/\/+/g, '/');
var pathPattern = uri.split(/\?/)[0];
var rules = (operation.input || {}).members || {};
var escapePathParam = req.service.escapePathParam ||
AWS.ServiceInterface.Rest.escapePathParam;
var escapeQuerystringParam = req.service.escapeQuerystringParam ||
AWS.ServiceInterface.Rest.escapeQuerystringParam;
AWS.util.each.call(this, rules, function (name, rule) {
if (rule.location === 'uri') {
var paramValue = req.params[name];
if (paramValue === null || paramValue === undefined) return;
// if the value is being inserted into the path portion of the
// URI, then we need to use a different (potentially) escaping
// pattern, this is especially true for S3 path params like Key.
var value = pathPattern.match('{' + name + '}') ?
escapePathParam(paramValue) :
escapeQuerystringParam(paramValue);
uri = uri.replace('{' + name + '}', value);
}
});
var path = uri.split('?')[0];
var querystring = uri.split('?')[1];
if (querystring) {
var parts = [];
AWS.util.arrayEach(querystring.split('&'), function (part) {
if (!part.match('{\\w+}')) parts.push(part);
});
uri = (parts.length > 0 ? path + '?' + parts.join('&') : path);
} else {
uri = path;
}
req.httpRequest.path = uri;
},
escapePathParam: function escapePathParam(value) {
return AWS.util.uriEscape(String(value));
},
escapeQuerystringParam: function escapeQuerystringParam(value) {
return AWS.util.uriEscape(String(value));
},
populateHeaders: function populateHeaders(req) {
var operation = req.service.api.operations[req.operation];
var rules = (operation.input || {}).members || {};
AWS.util.each.call(this, rules, function (name, rule) {
if (rule.location === 'header' && req.params[name]) {
if (rule.type === 'map') {
AWS.util.each(req.params[name], function (key, value) {
req.httpRequest.headers[rule.name + key] = value;
});
} else {
var value = req.params[name];
if (rule.type === 'timestamp') {
var timestampFormat = rule.format || req.service.api.timestampFormat;
value = AWS.util.date.format(value, timestampFormat);
}
req.httpRequest.headers[rule.name || name] = value;
}
}
});
}
};

View File

@ -1,72 +0,0 @@
var AWS = require('../core');
require('./rest');
require('./json');
/**
* @api private
*/
AWS.ServiceInterface.RestJson = {
buildRequest: function buildRequest(req) {
AWS.ServiceInterface.Rest.buildRequest(req);
AWS.ServiceInterface.RestJson.populateBody(req);
},
extractError: function extractError(resp) {
AWS.ServiceInterface.Json.extractError(resp);
},
extractData: function extractData(resp) {
AWS.ServiceInterface.Rest.extractData(resp);
var req = resp.request;
var rules = req.service.api.operations[req.operation].output || {};
if (rules.payload && rules.members[rules.payload]) {
if (rules.members[rules.payload].streaming) {
resp.data[rules.payload] = resp.httpResponse.body;
} else {
resp.data[rules.payload] = resp.httpResponse.body.toString();
}
} else {
var data = resp.data;
AWS.ServiceInterface.Json.extractData(resp);
resp.data = AWS.util.merge(data, resp.data);
}
},
populateBody: function populateBody(req) {
var input = req.service.api.operations[req.operation].input;
var payload = input.payload;
var params = {};
if (typeof payload === 'string') {
var rules = input.members[payload];
params = req.params[payload];
if (params === undefined) return;
if (rules.type === 'structure') {
req.httpRequest.body = this.buildJSON(params, input, req.service.api);
} else {
// non-xml paylaod
req.httpRequest.body = params;
}
} else if (payload) {
AWS.util.arrayEach(payload, function (param) {
if (req.params[param] !== undefined) {
params[param] = req.params[param];
}
});
req.httpRequest.body = this.buildJSON(params, input, req.service.api);
}
},
buildJSON: function buildJSON(params, rules, api) {
var builder = new AWS.JSON.Builder(rules, api);
return builder.build(params);
}
};

View File

@ -1,90 +0,0 @@
var AWS = require('../core');
require('../xml/builder');
require('./rest');
/**
* @api private
*/
AWS.ServiceInterface.RestXml = {
buildRequest: function buildRequest(req) {
AWS.ServiceInterface.Rest.buildRequest(req);
AWS.ServiceInterface.RestXml.populateBody(req);
},
extractError: function extractError(resp) {
AWS.ServiceInterface.Rest.extractError(resp);
var data = new AWS.XML.Parser({}).parse(resp.httpResponse.body.toString());
if (data.Errors) data = data.Errors;
if (data.Error) data = data.Error;
if (data.Code) {
resp.error = AWS.util.error(new Error(), {
code: data.Code,
message: data.Message
});
} else {
resp.error = AWS.util.error(new Error(), {
code: resp.httpResponse.statusCode,
message: null
});
}
},
extractData: function extractData(resp) {
AWS.ServiceInterface.Rest.extractData(resp);
var req = resp.request;
var httpResponse = resp.httpResponse;
var operation = req.service.api.operations[req.operation];
var rules = operation.output.members;
var output = operation.output;
var payload = output.payload;
if (payload) {
if (rules[payload].streaming) {
resp.data[payload] = httpResponse.body;
} else {
resp.data[payload] = httpResponse.body.toString();
}
} else if (httpResponse.body.length > 0) {
var parser = new AWS.XML.Parser(operation.output || {});
AWS.util.update(resp.data, parser.parse(httpResponse.body.toString()));
}
},
populateBody: function populateBody(req) {
var input = req.service.api.operations[req.operation].input;
var payload = input.payload;
var rules = {};
var builder = null;
var params = req.params;
if (typeof payload === 'string') {
rules = input.members[payload];
params = params[payload];
if (params === undefined) return;
if (rules.type === 'structure') {
builder = new AWS.XML.Builder(payload, rules.members, req.service.api);
req.httpRequest.body = builder.toXML(params);
} else {
// non-xml paylaod
req.httpRequest.body = params;
}
} else if (payload) {
AWS.util.arrayEach(payload, function (member) {
rules[member] = input.members[member];
});
builder = new AWS.XML.Builder(input.wrapper, rules, req.service.api);
req.httpRequest.body = builder.toXML(params);
}
}
};

15
node_modules/aws-sdk/lib/services.js generated vendored
View File

@ -1,15 +0,0 @@
var fs = require('fs');
var path = require('path');
var AWS = require('./core');
var apis = require('aws-sdk-apis');
// define services using map
apis.serviceNames.forEach(function(name) {
var identifier = apis.serviceIdentifier(name);
var versions = apis.serviceVersions(identifier);
AWS[name] = AWS.Service.defineService(identifier, versions);
// load any customizations from lib/services/<svcidentifier>.js
var svcFile = path.join(__dirname, 'services', identifier + '.js');
if (fs.existsSync(svcFile)) require(svcFile);
});

View File

@ -1,52 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.DynamoDB.prototype, {
setupRequestListeners: function setupRequestListeners(request) {
if (request.service.config.dynamoDbCrc32) {
request.addListener('extractData', this.checkCrc32);
}
},
/**
* @api private
*/
checkCrc32: function checkCrc32(resp) {
if (!resp.request.service.crc32IsValid(resp)) {
resp.error = AWS.util.error(new Error(), {
code: 'CRC32CheckFailed',
message: 'CRC32 integrity check failed',
retryable: true
});
}
},
/**
* @api private
*/
crc32IsValid: function crc32IsValid(resp) {
var crc = resp.httpResponse.headers['x-amz-crc32'];
if (!crc) return true; // no (valid) CRC32 header
return parseInt(crc, 10) === AWS.util.crypto.crc32(resp.httpResponse.body);
},
/**
* @api private
*/
defaultRetryCount: 10,
/**
* @api private
*/
retryDelays: function retryDelays() {
var retryCount = this.numRetries();
var delays = [];
for (var i = 0; i < retryCount; ++i) {
if (i === 0) {
delays.push(0);
} else {
delays.push(50 * Math.pow(2, i - 1));
}
}
return delays;
}
});

View File

@ -1,30 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.EC2.prototype, {
/**
* @api private
*/
setupRequestListeners: function setupRequestListeners(request) {
request.removeListener('extractError', AWS.EventListeners.Query.EXTRACT_ERROR);
request.addListener('extractError', this.extractError);
},
/**
* @api private
*/
extractError: function extractError(resp) {
// EC2 nests the error code and message deeper than other AWS Query services.
var httpResponse = resp.httpResponse;
var data = new AWS.XML.Parser({}).parse(httpResponse.body.toString() || '');
if (data.Errors)
resp.error = AWS.util.error(new Error(), {
code: data.Errors.Error.Code,
message: data.Errors.Error.Message
});
else
resp.error = AWS.util.error(new Error(), {
code: httpResponse.statusCode,
message: null
});
}
});

View File

@ -1,18 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.ElasticTranscoder.prototype, {
setupRequestListeners: function setupRequestListeners(request) {
request.addListener('extractError', this.extractErrorCode);
},
/**
* @api private
*/
extractErrorCode: function extractErrorCode(resp) {
// ETS stores error type in the header
var errorType = resp.httpResponse.headers['x-amzn-errortype'];
if (errorType) {
resp.error.name = resp.error.code = errorType.split(':')[0];
}
}
});

View File

@ -1,96 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.Glacier.prototype, {
setupRequestListeners: function setupRequestListeners(request) {
request.on('validate', this.validateAccountId);
request.on('build', this.addGlacierApiVersion);
request.on('build', this.addTreeHashHeaders);
},
validateAccountId: function validateAccountId(request) {
if (request.params.accountId !== undefined) return;
request.params = AWS.util.copy(request.params);
request.params.accountId = '-';
},
addGlacierApiVersion: function addGlacierApiVersion(request) {
var version = request.service.api.apiVersion;
request.httpRequest.headers['x-amz-glacier-version'] = version;
},
addTreeHashHeaders: function addTreeHashHeaders(request) {
if (request.params.body === undefined) return;
var hashes = request.service.computeChecksums(request.params.body);
request.httpRequest.headers['x-amz-content-sha256'] = hashes.linearHash;
if (!request.httpRequest.headers['x-amz-sha256-tree-hash']) {
request.httpRequest.headers['x-amz-sha256-tree-hash'] = hashes.treeHash;
}
},
/**
* @!group Computing Checksums
*/
/**
* Computes the SHA-256 linear and tree hash checksums for a given
* block of Buffer data. Pass the tree hash of the computed checksums
* as the checksum input to the {completeMultipartUpload} when performing
* a multi-part upload.
*
* @example Calculate checksum of 5.5MB data chunk
* var glacier = new AWS.Glacier();
* var data = new Buffer(5.5 * 1024 * 1024);
* data.fill('0'); // fill with zeros
* var results = glacier.computeChecksums(data);
* // Result: { linearHash: '68aff0c5a9...', treeHash: '154e26c78f...' }
* @param data [Buffer, String] data to calculate the checksum for
* @return [map<linearHash:String,treeHash:String>] a map containing
* the linearHash and treeHash properties representing hex based digests
* of the respective checksums.
* @see completeMultipartUpload
*/
computeChecksums: function computeChecksums(data) {
if (!AWS.util.Buffer.isBuffer(data)) data = new AWS.util.Buffer(data);
var mb = 1024 * 1024;
var hashes = [];
var hash = AWS.util.crypto.createHash('sha256');
// build leaf nodes in 1mb chunks
for (var i = 0; i < data.length; i += mb) {
var chunk = data.slice(i, Math.min(i + mb, data.length));
hash.update(chunk);
hashes.push(AWS.util.crypto.sha256(chunk));
}
return {
linearHash: hash.digest('hex'),
treeHash: this.buildHashTree(hashes)
};
},
/**
* @api private
*/
buildHashTree: function buildHashTree(hashes) {
// merge leaf nodes
while (hashes.length > 1) {
var tmpHashes = [];
for (var i = 0; i < hashes.length; i += 2) {
if (hashes[i + 1]) {
var tmpHash = new AWS.util.Buffer(64);
tmpHash.write(hashes[i], 0, 32, 'binary');
tmpHash.write(hashes[i + 1], 32, 32, 'binary');
tmpHashes.push(AWS.util.crypto.sha256(tmpHash));
} else {
tmpHashes.push(hashes[i]);
}
}
hashes = tmpHashes;
}
return AWS.util.crypto.toHex(hashes[0]);
}
});

View File

@ -1,30 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.Route53.prototype, {
/**
* @api private
*/
setupRequestListeners: function setupRequestListeners(request) {
request.on('build', this.sanitizeUrl);
},
/**
* @api private
*/
sanitizeUrl: function sanitizeUrl(request) {
var path = request.httpRequest.path;
request.httpRequest.path = path.replace(/\/%2F\w+%2F/, '/');
},
/**
* @api private
*/
setEndpoint: function setEndpoint(endpoint) {
if (endpoint) {
AWS.Service.prototype.setEndpoint(endpoint);
} else {
var opts = {sslEnabled: true}; // SSL is always enabled for Route53
this.endpoint = new AWS.Endpoint(this.api.globalEndpoint, opts);
}
}
});

View File

@ -1,396 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.S3.prototype, {
/**
* @api private
*/
initialize: function initialize(options) {
AWS.Service.prototype.initialize.call(this, options);
this.setEndpoint((options || {}).endpoint, options);
},
/**
* @api private
*/
setupRequestListeners: function setupRequestListeners(request) {
request.addListener('build', this.addContentType);
request.addListener('build', this.populateURI);
request.addListener('build', this.computeContentMd5);
request.addListener('build', this.computeSha256);
request.removeListener('validate',
AWS.EventListeners.Core.VALIDATE_REGION);
request.addListener('extractError', this.extractError);
request.addListener('extractData', this.extractData);
},
/**
* S3 prefers dns-compatible bucket names to be moved from the uri path
* to the hostname as a sub-domain. This is not possible, even for dns-compat
* buckets when using SSL and the bucket name contains a dot ('.'). The
* ssl wildcard certificate is only 1-level deep.
*
* @api private
*/
populateURI: function populateURI(req) {
var httpRequest = req.httpRequest;
var b = req.params.Bucket;
if (b) {
if (!req.service.pathStyleBucketName(b)) {
httpRequest.endpoint.host = httpRequest.endpoint.hostname = b + '.' +
httpRequest.endpoint.hostname;
httpRequest.virtualHostedBucket = b; // needed for signing the request
httpRequest.path = httpRequest.path.replace(new RegExp('^/' + b), '');
if (httpRequest.path[0] !== '/') {
httpRequest.path = '/' + httpRequest.path;
}
}
}
},
/**
* Adds a default content type if none is supplied.
*
* @api private
*/
addContentType: function addContentType(req) {
var httpRequest = req.httpRequest;
if (!httpRequest.headers['Content-Type']) { // always have a Content-Type
httpRequest.headers['Content-Type'] = 'application/octet-stream';
}
if (AWS.util.isBrowser() && navigator.userAgent.match(/Firefox/)) {
if (!httpRequest.headers['Content-Type'].match(/;/)) {
var charset = '; charset=UTF-8';
httpRequest.headers['Content-Type'] += charset;
}
}
},
/**
* @api private
*/
computableChecksumOperations: {
putBucketCors: true,
putBucketLifecycle: true,
putBucketTagging: true,
deleteObjects: true
},
/**
* Checks whether checksums should be computed for the request.
* If the request requires checksums to be computed, this will always
* return true, otherwise it depends on whether {AWS.Config.computeChecksums}
* is set.
*
* @param req [AWS.Request] the request to check against
* @return [Boolean] whether to compute checksums for a request.
* @api private
*/
willComputeChecksums: function willComputeChecksums(req) {
if (this.computableChecksumOperations[req.operation]) return true;
if (!this.config.computeChecksums) return false;
// TODO: compute checksums for Stream objects
if (!AWS.util.Buffer.isBuffer(req.httpRequest.body) &&
typeof req.httpRequest.body !== 'string') {
return false;
}
var rules = req.service.api.operations[req.operation].input.members;
// V4 signer uses SHA256 signatures so only compute MD5 if it is required
if (req.service.getSignerClass(req) === AWS.Signers.V4) {
if (rules.ContentMD5 && !rules.ContentMD5.required) return false;
}
if (rules.ContentMD5 && !req.params.ContentMD5) return true;
},
/**
* A listener that computes the Content-MD5 and sets it in the header.
* @see AWS.S3.willComputeChecksums
* @api private
*/
computeContentMd5: function computeContentMd5(req) {
if (req.service.willComputeChecksums(req)) {
var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64');
req.httpRequest.headers['Content-MD5'] = md5;
}
},
/**
* @api private
*/
computeSha256: function computeSha256(req) {
if (req.service.getSignerClass(req) === AWS.Signers.V4) {
req.httpRequest.headers['X-Amz-Content-Sha256'] =
AWS.util.crypto.sha256(req.httpRequest.body || '', 'hex');
}
},
/**
* Returns true if the bucket name should be left in the URI path for
* a request to S3. This function takes into account the current
* endpoint protocol (e.g. http or https).
*
* @api private
*/
pathStyleBucketName: function pathStyleBucketName(bucketName) {
// user can force path style requests via the configuration
if (this.config.s3ForcePathStyle) return true;
if (this.dnsCompatibleBucketName(bucketName)) {
return (this.config.sslEnabled && bucketName.match(/\./)) ? true : false;
} else {
return true; // not dns compatible names must always use path style
}
},
/**
* Returns true if the bucket name is DNS compatible. Buckets created
* outside of the classic region MUST be DNS compatible.
*
* @api private
*/
dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) {
var b = bucketName;
var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/);
var ipAddress = new RegExp(/(\d+\.){3}\d+/);
var dots = new RegExp(/\.\./);
return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false;
},
/**
* S3 requires that path params not escape forward slashes.
*
* @api private
*/
escapePathParam: function escapePathParam(value) {
return AWS.util.uriEscapePath(String(value));
},
/**
* @return [Boolean] whether response contains an error
* @api private
*/
successfulResponse: function successfulResponse(resp) {
var req = resp.request;
var httpResponse = resp.httpResponse;
if (req.operation === 'completeMultipartUpload' &&
httpResponse.body.toString().match('<Error>'))
return false;
else
return httpResponse.statusCode < 300;
},
/**
* @return [Boolean] whether the error can be retried
* @api private
*/
retryableError: function retryableError(error, request) {
if (request.operation === 'completeMultipartUpload' &&
error.statusCode === 200) {
return true;
} else {
var _super = AWS.Service.prototype.retryableError;
return _super.call(this, error, request);
}
},
/**
* Provides a specialized parser for getBucketLocation -- all other
* operations are parsed by the super class.
*
* @api private
*/
extractData: function extractData(resp) {
var req = resp.request;
if (req.operation === 'getBucketLocation') {
var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/);
if (match) {
delete resp.data['_'];
resp.data.LocationConstraint = match[1];
}
}
},
/**
* Extracts an error object from the http response.
*
* @api private
*/
extractError: function extractError(resp) {
var codes = {
304: 'NotModified',
403: 'Forbidden',
400: 'BadRequest',
404: 'NotFound'
};
var code = resp.httpResponse.statusCode;
var body = resp.httpResponse.body;
if (codes[code] && body.length === 0) {
resp.error = AWS.util.error(new Error(), {
code: codes[resp.httpResponse.statusCode],
message: null
});
} else {
var data = new AWS.XML.Parser({}).parse(body.toString());
resp.error = AWS.util.error(new Error(), {
code: data.Code || code,
message: data.Message || null
});
}
},
/**
* @api private
*/
setEndpoint: function setEndpoint(endpoint) {
if (endpoint) {
this.endpoint = new AWS.Endpoint(endpoint, this.config);
} else if (this.config.region && this.config.region !== 'us-east-1') {
var sep = '-';
if (this.isRegionV4()) sep = '.';
var hostname = 's3' + sep + this.config.region + this.endpointSuffix();
this.endpoint = new AWS.Endpoint(hostname);
} else {
this.endpoint = new AWS.Endpoint(this.api.globalEndpoint, this.config);
}
},
/**
* Get a pre-signed URL for a given operation name.
*
* @note You must ensure that you have static or previously resolved
* credentials if you call this method synchronously (with no callback),
* otherwise it may not properly sign the request. If you cannot guarantee
* this (you are using an asynchronous credential provider, i.e., EC2
* IAM roles), you should always call this method with an asynchronous
* callback.
* @param operation [String] the name of the operation to call
* @param params [map] parameters to pass to the operation. See the given
* operation for the expected operation parameters. In addition, you can
* also pass the "Expires" parameter to inform S3 how long the URL should
* work for.
* @option params Expires [Integer] (900) the number of seconds to expire
* the pre-signed URL operation in. Defaults to 15 minutes.
* @param callback [Function] if a callback is provided, this function will
* pass the URL as the second parameter (after the error parameter) to
* the callback function.
* @return [String] if called synchronously (with no callback), returns the
* signed URL.
* @return [null] nothing is returned if a callback is provided.
* @example Pre-signing a getObject operation (synchronously)
* var params = {Bucket: 'bucket', Key: 'key'};
* var url = s3.getSignedUrl('getObject', params);
* console.log('The URL is', url);
* @example Pre-signing a putObject (asynchronously)
* var params = {Bucket: 'bucket', Key: 'key'};
* s3.getSignedUrl('putObject', params, function (err, url) {
* console.log('The URL is', url);
* });
* @example Pre-signing a putObject operation with a specific payload
* var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};
* var url = s3.getSignedUrl('putObject', params);
* console.log('The URL is', url);
* @example Passing in a 1-minute expiry time for a pre-signed URL
* var params = {Bucket: 'bucket', Key: 'key', Expires: 60};
* var url = s3.getSignedUrl('getObject', params);
* console.log('The URL is', url); // expires in 60 seconds
*/
getSignedUrl: function getSignedUrl(operation, params, callback) {
params = AWS.util.copy(params || {});
var expires = params.Expires || 900;
delete params.Expires; // we can't validate this
var request = this.makeRequest(operation, params);
var expiresHeader = 'presigned-expires';
function signedUrlBuilder() {
delete request.httpRequest.headers['User-Agent'];
delete request.httpRequest.headers['X-Amz-User-Agent'];
if (request.service.getSignerClass() === AWS.Signers.V4) {
if (expires > 604800) { // one week expiry is invalid
var message = 'getSignedUrl() does not support expiry time greater ' +
'than a week with SigV4 signing.';
throw AWS.util.error(new Error(), {
code: 'InvalidExpiryTime', message: message, retryable: false
});
}
request.httpRequest.headers[expiresHeader] = expires;
} else {
request.httpRequest.headers[expiresHeader] = parseInt(
AWS.util.date.unixTimestamp() + expires, 10).toString();
}
}
function signedUrlSigner() {
var queryParams = {};
AWS.util.each(request.httpRequest.headers, function (key, value) {
if (key === expiresHeader) key = 'Expires';
queryParams[key] = value;
});
delete request.httpRequest.headers[expiresHeader];
var auth = queryParams['Authorization'].split(' ');
if (auth[0] === 'AWS') {
auth = auth[1].split(':');
queryParams['AWSAccessKeyId'] = auth[0];
queryParams['Signature'] = auth[1];
} else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing
auth.shift();
var rest = auth.join(' ');
var signature = rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];
queryParams['X-Amz-Signature'] = signature;
delete queryParams['Expires'];
}
delete queryParams['Authorization'];
delete queryParams['Host'];
// build URL
var endpoint = request.httpRequest.endpoint;
var parsedUrl = AWS.util.urlParse(request.httpRequest.path);
var querystring = AWS.util.queryParamsToString(queryParams);
endpoint.pathname = parsedUrl.pathname;
endpoint.search = !parsedUrl.search ? querystring :
parsedUrl.search + '&' + querystring;
}
request.on('build', signedUrlBuilder);
request.on('sign', signedUrlSigner);
request.removeListener('build', this.addContentType);
request.removeAllListeners('afterBuild');
if (!params.Body) { // no Content-MD5/SHA-256 if body is not provided
request.removeListener('build', this.computeContentMd5);
request.removeListener('build', this.computeSha256);
}
if (callback) {
request.build(function() {
if (request.response.error) callback(request.response.error, null);
else callback(null, AWS.util.urlFormat(request.httpRequest.endpoint));
});
} else {
request.build();
return AWS.util.urlFormat(request.httpRequest.endpoint);
}
},
createBucket: function createBucket(params, callback) {
// When creating a bucket *outside* the classic region, the location
// constraint must be set for the bucket and it must match the endpoint.
// This chunk of code will set the location constraint param based
// on the region (when possible), but it will not override a passed-in
// location constraint.
if (!params) params = {};
var hostname = this.endpoint.hostname;
if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) {
params.CreateBucketConfiguration = { LocationConstraint: this.config.region };
}
return this.makeRequest('createBucket', params, callback);
}
});

View File

@ -1,15 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.SimpleDB.prototype, {
/**
* @api private
*/
setEndpoint: function setEndpoint(endpoint) {
if (this.config.region === 'us-east-1') {
var prefix = this.api.endpointPrefix;
this.endpoint = new AWS.Endpoint(prefix + '.amazonaws.com');
} else {
AWS.Service.prototype.setEndpoint.call(this, endpoint);
}
}
});

View File

@ -1,107 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.SQS.prototype, {
setupRequestListeners: function setupRequestListeners(request) {
request.addListener('build', this.buildEndpoint);
if (request.service.config.computeChecksums) {
if (request.operation === 'sendMessage') {
request.addListener('extractData', this.verifySendMessageChecksum);
} else if (request.operation === 'sendMessageBatch') {
request.addListener('extractData', this.verifySendMessageBatchChecksum);
} else if (request.operation === 'receiveMessage') {
request.addListener('extractData', this.verifyReceiveMessageChecksum);
}
}
},
verifySendMessageChecksum: function verifySendMessageChecksum(response) {
if (!response.data) return;
var md5 = response.data.MD5OfMessageBody;
var body = this.params.MessageBody;
var calculatedMd5 = this.service.calculateChecksum(body);
if (calculatedMd5 !== md5) {
var msg = 'Got "' + response.data.MD5OfMessageBody +
'", expecting "' + calculatedMd5 + '".';
this.service.throwInvalidChecksumError(response,
[response.data.MessageId], msg);
}
},
verifySendMessageBatchChecksum: function verifySendMessageBatchChecksum(response) {
if (!response.data) return;
var service = this.service;
var entries = {};
var errors = [];
var messageIds = [];
AWS.util.arrayEach(response.data.Successful, function (entry) {
entries[entry.Id] = entry;
});
AWS.util.arrayEach(this.params.Entries, function (entry) {
if (entries[entry.Id]) {
var md5 = entries[entry.Id].MD5OfMessageBody;
var body = entry.MessageBody;
if (!service.isChecksumValid(md5, body)) {
errors.push(entry.Id);
messageIds.push(entries[entry.Id].MessageId);
}
}
});
if (errors.length > 0) {
service.throwInvalidChecksumError(response, messageIds,
'Invalid messages: ' + errors.join(', '));
}
},
verifyReceiveMessageChecksum: function verifyReceiveMessageChecksum(response) {
if (!response.data) return;
var service = this.service;
var messageIds = [];
AWS.util.arrayEach(response.data.Messages, function(message) {
var md5 = message.MD5OfBody;
var body = message.Body;
if (!service.isChecksumValid(md5, body)) {
messageIds.push(message.MessageId);
}
});
if (messageIds.length > 0) {
service.throwInvalidChecksumError(response, messageIds,
'Invalid messages: ' + messageIds.join(', '));
}
},
throwInvalidChecksumError: function throwInvalidChecksumError(response, ids, message) {
response.error = AWS.util.error(new Error(), {
retryable: true,
code: 'InvalidChecksum',
messageIds: ids,
message: response.request.operation +
' returned an invalid MD5 response. ' + message
});
},
isChecksumValid: function isChecksumValid(checksum, data) {
return this.calculateChecksum(data) === checksum;
},
calculateChecksum: function calculateChecksum(data) {
return AWS.util.crypto.md5(data, 'hex');
},
buildEndpoint: function buildEndpoint(request) {
var url = request.httpRequest.params.QueueUrl;
if (url) {
request.httpRequest.endpoint = new AWS.Endpoint(url);
// signature version 4 requires the region name to be set,
// sqs queue urls contain the region name
var matches = request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./);
if (matches) request.httpRequest.region = matches[1];
}
}
});

View File

@ -1,47 +0,0 @@
var AWS = require('../core');
AWS.util.update(AWS.STS.prototype, {
/**
* @overload credentialsFrom(data, credentials = null)
* Creates a credentials object from STS response data containing
* credentials information. Useful for quickly setting AWS credentials.
*
* @note This is a low-level utility function. If you want to load temporary
* credentials into your process for subsequent requests to AWS resources,
* you should use {AWS.TemporaryCredentials} instead.
* @param data [map] data retrieved from a call to {getFederatedToken},
* {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}.
* @param credentials [AWS.Credentials] an optional credentials object to
* fill instead of creating a new object. Useful when modifying an
* existing credentials object from a refresh call.
* @return [AWS.TemporaryCredentials] the set of temporary credentials
* loaded from a raw STS operation response.
* @example Using credentialsFrom to load global AWS credentials
* var sts = new AWS.STS();
* sts.getSessionToken(function (err, data) {
* if (err) console.log("Error getting credentials");
* else {
* AWS.config.credentials = sts.credentialsFrom(data);
* }
* });
* @see AWS.TemporaryCredentials
*/
credentialsFrom: function credentialsFrom(data, credentials) {
if (!data) return null;
if (!credentials) credentials = new AWS.TemporaryCredentials();
credentials.expired = false;
credentials.accessKeyId = data.Credentials.AccessKeyId;
credentials.secretAccessKey = data.Credentials.SecretAccessKey;
credentials.sessionToken = data.Credentials.SessionToken;
credentials.expireTime = data.Credentials.Expiration;
return credentials;
},
assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) {
return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback);
},
assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) {
return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback);
}
});

View File

@ -1,10 +0,0 @@
var AWS = require('../core');
AWS.util.hideProperties(AWS, ['SimpleWorkflow']);
/**
* @constant
* @readonly
* Backwards compatibility for access to the {AWS.SWF} service class.
*/
AWS.SimpleWorkflow = AWS.SWF;

View File

@ -1,28 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.Signers.RequestSigner = inherit({
constructor: function RequestSigner(request) {
this.request = request;
}
});
AWS.Signers.RequestSigner.getVersion = function getVersion(version) {
switch (version) {
case 'v2': return AWS.Signers.V2;
case 'v3': return AWS.Signers.V3;
case 'v4': return AWS.Signers.V4;
case 's3': return AWS.Signers.S3;
case 'v3https': return AWS.Signers.V3Https;
}
throw new Error('Unknown signing version ' + version);
};
require('./v2');
require('./v3');
require('./v3https');
require('./v4');
require('./s3');

View File

@ -1,166 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, {
/**
* When building the stringToSign, these sub resource params should be
* part of the canonical resource string with their NON-decoded values
*/
subResources: {
'acl': 1,
'cors': 1,
'lifecycle': 1,
'delete': 1,
'location': 1,
'logging': 1,
'notification': 1,
'partNumber': 1,
'policy': 1,
'requestPayment': 1,
'restore': 1,
'tagging': 1,
'torrent': 1,
'uploadId': 1,
'uploads': 1,
'versionId': 1,
'versioning': 1,
'versions': 1,
'website': 1
},
// when building the stringToSign, these querystring params should be
// part of the canonical resource string with their NON-encoded values
responseHeaders: {
'response-content-type': 1,
'response-content-language': 1,
'response-expires': 1,
'response-cache-control': 1,
'response-content-disposition': 1,
'response-content-encoding': 1
},
addAuthorization: function addAuthorization(credentials, date) {
if (!this.request.headers['presigned-expires']) {
this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date);
}
if (credentials.sessionToken) {
// presigned URLs require this header to be lowercased
this.request.headers['x-amz-security-token'] = credentials.sessionToken;
}
var signature = this.sign(credentials.secretAccessKey, this.stringToSign());
var auth = 'AWS ' + credentials.accessKeyId + ':' + signature;
this.request.headers['Authorization'] = auth;
},
stringToSign: function stringToSign() {
var r = this.request;
var parts = [];
parts.push(r.method);
parts.push(r.headers['Content-MD5'] || '');
parts.push(r.headers['Content-Type'] || '');
// This is the "Date" header, but we use X-Amz-Date.
// The S3 signing mechanism requires us to pass an empty
// string for this Date header regardless.
parts.push(r.headers['presigned-expires'] || '');
var headers = this.canonicalizedAmzHeaders();
if (headers) parts.push(headers);
parts.push(this.canonicalizedResource());
return parts.join('\n');
},
canonicalizedAmzHeaders: function canonicalizedAmzHeaders() {
var amzHeaders = [];
AWS.util.each(this.request.headers, function (name) {
if (name.match(/^x-amz-/i))
amzHeaders.push(name);
});
amzHeaders.sort(function (a, b) {
return a.toLowerCase() < b.toLowerCase() ? -1 : 1;
});
var parts = [];
AWS.util.arrayEach.call(this, amzHeaders, function (name) {
parts.push(name.toLowerCase() + ':' + String(this.request.headers[name]));
});
return parts.join('\n');
},
canonicalizedResource: function canonicalizedResource() {
var r = this.request;
var parts = r.path.split('?');
var path = parts[0];
var querystring = parts[1];
var resource = '';
if (r.virtualHostedBucket)
resource += '/' + r.virtualHostedBucket;
resource += path;
if (querystring) {
// collect a list of sub resources and query params that need to be signed
var resources = [];
AWS.util.arrayEach.call(this, querystring.split('&'), function (param) {
var name = param.split('=')[0];
var value = param.split('=')[1];
if (this.subResources[name] || this.responseHeaders[name]) {
var subresource = { name: name };
if (value !== undefined) {
if (this.subResources[name]) {
subresource.value = value;
} else {
subresource.value = decodeURIComponent(value);
}
}
resources.push(subresource);
}
});
resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; });
if (resources.length) {
querystring = [];
AWS.util.arrayEach(resources, function (resource) {
if (resource.value === undefined)
querystring.push(resource.name);
else
querystring.push(resource.name + '=' + resource.value);
});
resource += '?' + querystring.join('&');
}
}
return resource;
},
sign: function sign(secret, string) {
return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1');
}
});
module.exports = AWS.Signers.S3;

View File

@ -1,45 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, {
addAuthorization: function addAuthorization(credentials, date) {
if (!date) date = AWS.util.date.getDate();
var r = this.request;
r.params.Timestamp = AWS.util.date.iso8601(date);
r.params.SignatureVersion = '2';
r.params.SignatureMethod = 'HmacSHA256';
r.params.AWSAccessKeyId = credentials.accessKeyId;
if (credentials.sessionToken) {
r.params.SecurityToken = credentials.sessionToken;
}
delete r.params.Signature; // delete old Signature for re-signing
r.params.Signature = this.signature(credentials);
r.body = AWS.util.queryParamsToString(r.params);
r.headers['Content-Length'] = r.body.length;
},
signature: function signature(credentials) {
return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');
},
stringToSign: function stringToSign() {
var parts = [];
parts.push(this.request.method);
parts.push(this.request.endpoint.host.toLowerCase());
parts.push(this.request.pathname());
parts.push(AWS.util.queryParamsToString(this.request.params));
return parts.join('\n');
}
});
module.exports = AWS.Signers.V2;

View File

@ -1,74 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, {
addAuthorization: function addAuthorization(credentials, date) {
var datetime = AWS.util.date.rfc822(date);
this.request.headers['X-Amz-Date'] = datetime;
if (credentials.sessionToken) {
this.request.headers['x-amz-security-token'] = credentials.sessionToken;
}
this.request.headers['X-Amzn-Authorization'] =
this.authorization(credentials, datetime);
},
authorization: function authorization(credentials) {
return 'AWS3 ' +
'AWSAccessKeyId=' + credentials.accessKeyId + ',' +
'Algorithm=HmacSHA256,' +
'SignedHeaders=' + this.signedHeaders() + ',' +
'Signature=' + this.signature(credentials);
},
signedHeaders: function signedHeaders() {
var headers = [];
AWS.util.arrayEach(this.headersToSign(), function iterator(h) {
headers.push(h.toLowerCase());
});
return headers.sort().join(';');
},
canonicalHeaders: function canonicalHeaders() {
var headers = this.request.headers;
var parts = [];
AWS.util.arrayEach(this.headersToSign(), function iterator(h) {
parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim());
});
return parts.sort().join('\n') + '\n';
},
headersToSign: function headersToSign() {
var headers = [];
AWS.util.each(this.request.headers, function iterator(k) {
if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) {
headers.push(k);
}
});
return headers;
},
signature: function signature(credentials) {
return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');
},
stringToSign: function stringToSign() {
var parts = [];
parts.push(this.request.method);
parts.push('/');
parts.push('');
parts.push(this.canonicalHeaders());
parts.push(this.request.body);
return AWS.util.crypto.sha256(parts.join('\n'));
}
});
module.exports = AWS.Signers.V3;

View File

@ -1,22 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
require('./v3');
/**
* @api private
*/
AWS.Signers.V3Https = inherit(AWS.Signers.V3, {
authorization: function authorization(credentials) {
return 'AWS3-HTTPS ' +
'AWSAccessKeyId=' + credentials.accessKeyId + ',' +
'Algorithm=HmacSHA256,' +
'Signature=' + this.signature(credentials);
},
stringToSign: function stringToSign() {
return this.request.headers['X-Amz-Date'];
}
});
module.exports = AWS.Signers.V3Https;

View File

@ -1,160 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
var cachedSecret = {};
/**
* @api private
*/
AWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, {
constructor: function V4(request, serviceName) {
AWS.Signers.RequestSigner.call(this, request);
this.serviceName = serviceName;
},
addAuthorization: function addAuthorization(credentials, date) {
var datetime = AWS.util.date.iso8601(date).replace(/[:\-]|\.\d{3}/g, '');
this.addHeaders(credentials, datetime);
this.updateBody(credentials);
this.request.headers['Authorization'] =
this.authorization(credentials, datetime);
},
addHeaders: function addHeaders(credentials, datetime) {
this.request.headers['X-Amz-Date'] = datetime;
if (credentials.sessionToken) {
this.request.headers['x-amz-security-token'] = credentials.sessionToken;
}
},
updateBody: function updateBody(credentials) {
if (this.request.params) {
this.request.params.AWSAccessKeyId = credentials.accessKeyId;
if (credentials.sessionToken) {
this.request.params.SecurityToken = credentials.sessionToken;
}
this.request.body = AWS.util.queryParamsToString(this.request.params);
this.request.headers['Content-Length'] = this.request.body.length;
}
},
authorization: function authorization(credentials, datetime) {
var parts = [];
var credString = this.credentialString(datetime);
parts.push('AWS4-HMAC-SHA256 Credential=' +
credentials.accessKeyId + '/' + credString);
parts.push('SignedHeaders=' + this.signedHeaders());
parts.push('Signature=' + this.signature(credentials, datetime));
return parts.join(', ');
},
signature: function signature(credentials, datetime) {
var cache = cachedSecret[this.serviceName];
var date = datetime.substr(0, 8);
if (!cache ||
cache.akid !== credentials.accessKeyId ||
cache.region !== this.request.region ||
cache.date !== date) {
var kSecret = credentials.secretAccessKey;
var kDate = AWS.util.crypto.hmac('AWS4' + kSecret, date, 'buffer');
var kRegion = AWS.util.crypto.hmac(kDate, this.request.region, 'buffer');
var kService = AWS.util.crypto.hmac(kRegion, this.serviceName, 'buffer');
var kCredentials = AWS.util.crypto.hmac(kService, 'aws4_request', 'buffer');
cachedSecret[this.serviceName] = {
region: this.request.region, date: date,
key: kCredentials, akid: credentials.accessKeyId
};
}
var key = cachedSecret[this.serviceName].key;
return AWS.util.crypto.hmac(key, this.stringToSign(datetime), 'hex');
},
stringToSign: function stringToSign(datetime) {
var parts = [];
parts.push('AWS4-HMAC-SHA256');
parts.push(datetime);
parts.push(this.credentialString(datetime));
parts.push(this.hexEncodedHash(this.canonicalString()));
return parts.join('\n');
},
canonicalString: function canonicalString() {
var parts = [];
parts.push(this.request.method);
parts.push(this.request.pathname());
parts.push(this.request.search());
parts.push(this.canonicalHeaders() + '\n');
parts.push(this.signedHeaders());
parts.push(this.hexEncodedBodyHash());
return parts.join('\n');
},
canonicalHeaders: function canonicalHeaders() {
var headers = [];
AWS.util.each.call(this, this.request.headers, function (key, item) {
headers.push([key, item]);
});
headers.sort(function (a, b) {
return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1;
});
var parts = [];
AWS.util.arrayEach.call(this, headers, function (item) {
var key = item[0].toLowerCase();
if (this.isSignableHeader(key)) {
parts.push(key + ':' +
this.canonicalHeaderValues(item[1].toString()));
}
});
return parts.join('\n');
},
canonicalHeaderValues: function canonicalHeaderValues(values) {
return values.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '');
},
signedHeaders: function signedHeaders() {
var keys = [];
AWS.util.each.call(this, this.request.headers, function (key) {
key = key.toLowerCase();
if (this.isSignableHeader(key)) keys.push(key);
});
return keys.sort().join(';');
},
credentialString: function credentialString(datetime) {
var parts = [];
parts.push(datetime.substr(0, 8));
parts.push(this.request.region);
parts.push(this.serviceName);
parts.push('aws4_request');
return parts.join('/');
},
hexEncodedHash: function hash(string) {
return AWS.util.crypto.sha256(string, 'hex');
},
hexEncodedBodyHash: function hexEncodedBodyHash() {
if (this.request.headers['X-Amz-Content-Sha256']) {
return this.request.headers['X-Amz-Content-Sha256'];
} else {
return this.hexEncodedHash(this.request.body || '');
}
},
unsignableHeaders: ['authorization', 'content-type', 'user-agent',
'x-amz-user-agent', 'x-amz-content-sha256'],
isSignableHeader: function isSignableHeader(key) {
return this.unsignableHeaders.indexOf(key) < 0;
}
});
module.exports = AWS.Signers.V4;

View File

@ -1,42 +0,0 @@
function AcceptorStateMachine(states, state) {
this.currentState = state || null;
this.states = states || {};
}
AcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) {
if (typeof finalState === 'function') {
inputError = bindObject; bindObject = done;
done = finalState; finalState = null;
}
var self = this;
var state = self.states[self.currentState];
state.fn.call(bindObject || self, inputError, function(err) {
if (err) {
if (bindObject.logger) bindObject.logger.log(self.currentState, '->', state.fail, err);
if (state.fail) self.currentState = state.fail;
else return done ? done(err) : null;
} else {
if (bindObject.logger) bindObject.logger.log(self.currentState, '->', state.accept);
if (state.accept) self.currentState = state.accept;
else return done ? done() : null;
}
if (self.currentState === finalState) return done ? done(err) : null;
self.runTo(finalState, done, bindObject, err);
});
};
AcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) {
if (typeof acceptState === 'function') {
fn = acceptState; acceptState = null; failState = null;
} else if (typeof failState === 'function') {
fn = failState; failState = null;
}
if (!this.currentState) this.currentState = name;
this.states[name] = { accept: acceptState, fail: failState, fn: fn };
return this;
};
module.exports = AcceptorStateMachine;

561
node_modules/aws-sdk/lib/util.js generated vendored
View File

@ -1,561 +0,0 @@
/* eslint guard-for-in:0 */
var AWS = require('./core');
var cryptoLib = require('crypto');
var Buffer = require('buffer').Buffer;
/**
* A set of utility methods for use with the AWS SDK.
*
* @!attribute abort
* Return this value from an iterator function {each} or {arrayEach}
* to break out of the iteration.
* @example Breaking out of an iterator function
* AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) {
* if (key == 'b') return AWS.util.abort;
* });
* @see each
* @see arrayEach
* @api private
*/
AWS.util = {
engine: function engine() {
if (AWS.util.isBrowser() && typeof navigator !== 'undefined') {
return navigator.userAgent;
} else {
return process.platform + '/' + process.version;
}
},
userAgent: function userAgent() {
var name = AWS.util.isBrowser() ? 'js' : 'nodejs';
var agent = 'aws-sdk-' + name + '/' + AWS.VERSION;
if (name === 'nodejs') agent += ' ' + AWS.util.engine();
return agent;
},
isBrowser: function isBrowser() { return process && process.browser; },
isNode: function isNode() { return !AWS.util.isBrowser(); },
nodeRequire: function nodeRequire(module) {
if (AWS.util.isNode()) return require(module);
},
uriEscape: function uriEscape(string) {
var output = encodeURIComponent(string);
output = output.replace(/[^A-Za-z0-9_.~\-%]+/g, escape);
// AWS percent-encodes some extra non-standard characters in a URI
output = output.replace(/[*]/g, function(ch) {
return '%' + ch.charCodeAt(0).toString(16).toUpperCase();
});
return output;
},
uriEscapePath: function uriEscapePath(string) {
var parts = [];
AWS.util.arrayEach(string.split('/'), function (part) {
parts.push(AWS.util.uriEscape(part));
});
return parts.join('/');
},
urlParse: function urlParse(url) {
return require('url').parse(url);
},
urlFormat: function urlFormat(url) {
return require('url').format(url);
},
queryParamsToString: function queryParamsToString(params) {
var items = [];
var escape = AWS.util.uriEscape;
var sortedKeys = Object.keys(params).sort();
AWS.util.arrayEach(sortedKeys, function(name) {
var value = params[name];
var ename = escape(name);
var result = ename;
if (Array.isArray(value)) {
var vals = [];
AWS.util.arrayEach(value, function(item) { vals.push(escape(item)); });
result = ename + '=' + vals.sort().join('&' + ename + '=');
} else if (value !== undefined && value !== null) {
result = ename + '=' + escape(value);
}
items.push(result);
});
return items.join('&');
},
readFileSync: function readFileSync(path) {
if (typeof window !== 'undefined') return null;
return require('fs').readFileSync(path, 'utf-8');
},
base64: {
encode: function encode64(string) {
return new Buffer(string).toString('base64');
},
decode: function decode64(string) {
return new Buffer(string, 'base64').toString();
}
},
Buffer: Buffer,
buffer: {
/**
* Concatenates a list of Buffer objects.
*/
concat: function(buffers) {
var length = 0,
offset = 0,
buffer = null, i;
for (i = 0; i < buffers.length; i++) {
length += buffers[i].length;
}
buffer = new Buffer(length);
for (i = 0; i < buffers.length; i++) {
buffers[i].copy(buffer, offset);
offset += buffers[i].length;
}
return buffer;
}
},
string: {
byteLength: function byteLength(string) {
if (string === null || string === undefined) return 0;
if (typeof string === 'string') string = new Buffer(string);
if (typeof string.byteLength === 'number') {
return string.byteLength;
} else if (typeof string.length === 'number') {
return string.length;
} else if (typeof string.size === 'number') {
return string.size;
} else if (typeof string.path === 'string') {
return require('fs').lstatSync(string.path).size;
} else {
throw AWS.util.error(new Error('Cannot determine length of ' + string),
{ object: string });
}
},
upperFirst: function upperFirst(string) {
return string[0].toUpperCase() + string.substr(1);
},
lowerFirst: function lowerFirst(string) {
return string[0].toLowerCase() + string.substr(1);
}
},
jamespath: {
query: function query(expression, data) {
if (!data) return [];
var results = [];
var expressions = expression.split(/\s+or\s+/);
AWS.util.arrayEach.call(this, expressions, function (expr) {
var objects = [data];
var tokens = expr.split('.');
AWS.util.arrayEach.call(this, tokens, function (token) {
var match = token.match('^(.+?)(?:\\[(-?\\d+|\\*|)\\])?$');
var newObjects = [];
AWS.util.arrayEach.call(this, objects, function (obj) {
if (match[1] === '*') {
AWS.util.arrayEach.call(this, obj, function (value) {
newObjects.push(value);
});
} else if (obj.hasOwnProperty(match[1])) {
newObjects.push(obj[match[1]]);
}
});
objects = newObjects;
// handle indexing (token[0], token[-1])
if (match[2] !== undefined) {
newObjects = [];
AWS.util.arrayEach.call(this, objects, function (obj) {
if (Array.isArray(obj)) {
if (match[2] === '*' || match[2] === '') {
newObjects = newObjects.concat(obj);
} else {
var idx = parseInt(match[2], 10);
if (idx < 0) idx = obj.length + idx; // negative indexing
newObjects.push(obj[idx]);
}
}
});
objects = newObjects;
}
if (objects.length === 0) return AWS.util.abort;
});
if (objects.length > 0) {
results = objects;
return AWS.util.abort;
}
});
return results;
},
find: function find(expression, data) {
return AWS.util.jamespath.query(expression, data)[0];
}
},
/**
* Date and time utility functions.
*/
date: {
/**
* @return [Date] the current JavaScript date object. Since all
* AWS services rely on this date object, you can override
* this function to provide a special time value to AWS service
* requests.
*/
getDate: function getDate() { return new Date(); },
/**
* @return [String] the date in ISO-8601 format
*/
iso8601: function iso8601(date) {
if (date === undefined) { date = AWS.util.date.getDate(); }
return date.toISOString();
},
/**
* @return [String] the date in RFC 822 format
*/
rfc822: function rfc822(date) {
if (date === undefined) { date = AWS.util.date.getDate(); }
return date.toUTCString();
},
/**
* @return [Integer] the UNIX timestamp value for the current time
*/
unixTimestamp: function unixTimestamp(date) {
if (date === undefined) { date = AWS.util.date.getDate(); }
return date.getTime() / 1000;
},
/**
* @param [String,number,Date] date
* @return [Date]
*/
from: function format(date) {
if (typeof date === 'number') {
return new Date(date * 1000); // unix timestamp
} else {
return new Date(date);
}
},
/**
* Given a Date or date-like value, this function formats the
* date into a string of the requested value.
* @param [String,number,Date] date
* @param [String] formatter Valid formats are:
# * 'iso8601'
# * 'rfc822'
# * 'unixTimestamp'
* @return [String]
*/
format: function format(date, formatter) {
if (!formatter) formatter = 'iso8601';
return AWS.util.date[formatter](AWS.util.date.from(date));
},
parseTimestamp: function parseTimestamp(value) {
if (value.match(/^\d+$/)) { // unix timestamp
return new Date(value * 1000);
} else if (value.match(/^\d{4}/)) { // iso8601
return new Date(value);
} else if (value.match(/^\w{3},/)) { // rfc822
return new Date(value);
} else {
throw AWS.util.error(
new Error('unhandled timestamp format: ' + value),
{code: 'TimestampParserError'});
}
}
},
crypto: {
crc32Table: [
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419,
0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4,
0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07,
0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856,
0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4,
0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3,
0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A,
0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599,
0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190,
0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F,
0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E,
0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED,
0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3,
0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A,
0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5,
0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010,
0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17,
0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6,
0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615,
0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344,
0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A,
0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1,
0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C,
0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF,
0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE,
0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31,
0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C,
0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B,
0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1,
0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278,
0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7,
0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66,
0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605,
0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8,
0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B,
0x2D02EF8D],
crc32: function crc32(data) {
var tbl = AWS.util.crypto.crc32Table;
var crc = 0 ^ -1;
if (typeof data === 'string') {
data = new Buffer(data);
}
for (var i = 0; i < data.length; i++) {
var code = data.readUInt8(i);
crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF];
}
return (crc ^ -1) >>> 0;
},
hmac: function hmac(key, string, digest, fn) {
if (!digest) digest = 'binary';
if (digest === 'buffer') { digest = undefined; }
if (!fn) fn = 'sha256';
if (typeof string === 'string') string = new Buffer(string);
return cryptoLib.createHmac(fn, key).update(string).digest(digest);
},
md5: function md5(data, digest) {
if (!digest) { digest = 'binary'; }
if (digest === 'buffer') { digest = undefined; }
if (typeof data === 'string') data = new Buffer(data);
return AWS.util.crypto.createHash('md5').update(data).digest(digest);
},
sha256: function sha256(string, digest) {
if (!digest) { digest = 'binary'; }
if (digest === 'buffer') { digest = undefined; }
if (typeof string === 'string') string = new Buffer(string);
return AWS.util.crypto.createHash('sha256').update(string).digest(digest);
},
toHex: function toHex(data) {
var out = [];
for (var i = 0; i < data.length; i++) {
out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2));
}
return out.join('');
},
createHash: function createHash(algorithm) {
return cryptoLib.createHash(algorithm);
}
},
/** @!ignore */
/* Abort constant */
abort: {},
each: function each(object, iterFunction) {
for (var key in object) {
if (object.hasOwnProperty(key)) {
var ret = iterFunction.call(this, key, object[key]);
if (ret === AWS.util.abort) break;
}
}
},
arrayEach: function arrayEach(array, iterFunction) {
for (var idx in array) {
if (array.hasOwnProperty(idx)) {
var ret = iterFunction.call(this, array[idx], parseInt(idx, 10));
if (ret === AWS.util.abort) break;
}
}
},
update: function update(obj1, obj2) {
AWS.util.each(obj2, function iterator(key, item) {
obj1[key] = item;
});
return obj1;
},
merge: function merge(obj1, obj2) {
return AWS.util.update(AWS.util.copy(obj1), obj2);
},
copy: function copy(object) {
if (object === null || object === undefined) return object;
var dupe = {};
for (var key in object) {
dupe[key] = object[key];
}
return dupe;
},
isEmpty: function isEmpty(obj) {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
return false;
}
}
return true;
},
isType: function isType(obj, type) {
// handle cross-"frame" objects
if (typeof type === 'function') type = AWS.util.typeName(type);
return Object.prototype.toString.call(obj) === '[object ' + type + ']';
},
typeName: function typeName(type) {
if (type.hasOwnProperty('name')) return type.name;
var str = type.toString();
var match = str.match(/^\s*function (.+)\(/);
return match ? match[1] : str;
},
error: function error(err, options) {
var originalError = null;
if (typeof err.message === 'string' && err.message !== '') {
if (typeof options === 'string' || (options && options.message)) {
originalError = AWS.util.copy(err);
originalError.message = err.message;
}
}
err.message = err.message || null;
if (typeof options === 'string') {
err.message = options;
} else {
AWS.util.update(err, options);
}
if (typeof Object.defineProperty === 'function') {
Object.defineProperty(err, 'name', {writable: true, enumerable: false});
Object.defineProperty(err, 'message', {enumerable: true});
}
err.name = err.name || err.code || 'Error';
err.time = new Date();
if (originalError) err.originalError = originalError;
return err;
},
/**
* @api private
*/
inherit: function inherit(klass, features) {
var newObject = null;
if (features === undefined) {
features = klass;
klass = Object;
newObject = {};
} else {
var ctor = function ConstructorWrapper() {};
ctor.prototype = klass.prototype;
newObject = new ctor();
}
// constructor not supplied, create pass-through ctor
if (features.constructor === Object) {
features.constructor = function() {
if (klass !== Object) {
return klass.apply(this, arguments);
}
};
}
features.constructor.prototype = newObject;
AWS.util.update(features.constructor.prototype, features);
features.constructor.__super__ = klass;
return features.constructor;
},
/**
* @api private
*/
mixin: function mixin() {
var klass = arguments[0];
for (var i = 1; i < arguments.length; i++) {
for (var prop in arguments[i].prototype) {
var fn = arguments[i].prototype[prop];
if (prop !== 'constructor') {
klass.prototype[prop] = fn;
}
}
}
return klass;
},
/**
* @api private
*/
hideProperties: function hideProperties(obj, props) {
if (typeof Object.defineProperty !== 'function') return;
AWS.util.arrayEach(props, function (key) {
Object.defineProperty(obj, key, {
enumerable: false, writable: true, configurable: true });
});
}
};
module.exports = AWS.util;

View File

@ -1,170 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.XML.Parser = inherit({
constructor: function XMLParser(rules) {
this.rules = (rules || {}).members || {};
},
parse: function parse(xml) {
if (xml.replace(/^\s+/, '') === '') return {};
var result, error;
try {
if (window.DOMParser) {
var parser = new DOMParser();
result = parser.parseFromString(xml, 'text/xml');
if (result.documentElement === null) {
throw new Error('Cannot parse empty document.');
}
var isError = result.getElementsByTagName('parsererror')[0];
if (isError && (isError.parentNode === result ||
isError.parentNode.nodeName === 'body')) {
throw new Error(isError.getElementsByTagName('div')[0].textContent);
}
} else if (window.ActiveXObject) {
result = new window.ActiveXObject('Microsoft.XMLDOM');
result.async = false;
if (!result.loadXML(xml)) {
throw new Error('Parse error in document');
}
} else {
throw new Error('Cannot load XML parser');
}
} catch (e) {
error = e;
}
if (result && result.documentElement && !error) {
return this.parseStructure(result.documentElement, this.rules);
} else if (error) {
throw AWS.util.error(error || new Error(), {code: 'XMLParserError'});
} else { // empty xml document
return {};
}
},
parseStructure: function parseStructure(structure, rules) {
var data = {};
// force array members to always be present
AWS.util.each.call(this, rules, function(memberName, memberRules) {
if (memberRules.type === 'list') {
data[memberRules.name || memberName] = [];
}
});
for (var j = 0; j < structure.attributes.length; j++) {
var attr = structure.attributes[j];
var attrRule = rules[attr.name];
if (attrRule) {
var value = this.parseMember({ textContent: attr.value }, attrRule);
data[attrRule.name || attr.name] = value;
}
}
var child = structure.firstElementChild;
while (child) {
var rule = rules[child.nodeName] || {};
var key = rule.name || child.nodeName;
var inData = rule.flattened ? data[key] : null;
data[key] = this.parseMember(child, rule, inData);
child = child.nextElementSibling;
}
return data;
},
parseMap: function parseMap(map, rules, data) {
data = data || {};
var keyRules = rules.keys || {};
var valueRules = rules.members || {};
var keyName = keyRules.name || 'key';
var valueName = valueRules.name || 'value';
function run(item) {
var key = item.getElementsByTagName(keyName)[0].textContent;
var value = item.getElementsByTagName(valueName)[0];
value = this.parseMember(value, valueRules);
data[key] = value;
}
if (rules.flattened) {
run.call(this, map);
} else {
var child = map.firstElementChild;
while (child) {
run.call(this, child);
child = child.nextElementSibling;
}
}
return data;
},
parseList: function parseList(list, rules, data) {
data = data || [];
var memberRules = rules.members || {};
var memberName = memberRules.name || 'member';
if (rules.flattened) {
data.push(this.parseMember(list, memberRules));
} else {
var child = list.firstElementChild;
while (child) {
if (child.nodeName === memberName) {
data.push(this.parseMember(child, memberRules));
}
child = child.nextElementSibling;
}
}
return data;
},
parseMember: function parseMember(member, rules, data) {
if (!rules.type) {
if (member.childElementCount > 0) {
rules.type = 'structure';
} else {
rules.type = 'string';
}
}
if (rules.type === 'structure') {
return this.parseStructure(member, rules.members || {}, data);
} else if (rules.type === 'list') {
return this.parseList(member, rules, data);
} else if (rules.type === 'map') {
return this.parseMap(member, rules, data);
}
if (rules.type === 'string') {
if (member.attributes && member.attributes.encoding &&
member.attributes.encoding.value === 'base64') {
return AWS.util.base64.decode(member.textContent);
} else {
return member.textContent;
}
}
// return null for empty nodes of any other type
if (member.textContent === '') return null;
if (rules.type === 'integer') {
return parseInt(member.textContent, 10);
} else if (rules.type === 'float') {
return parseFloat(member.textContent);
} else if (rules.type === 'timestamp') {
return AWS.util.date.parseTimestamp(member.textContent);
} else if (rules.type === 'boolean') {
return member.textContent === 'true';
} else {
var msg = 'unhandled type: ' + rules.type;
throw AWS.util.error(new Error(msg), {code: 'XMLParserError'});
}
}
});

View File

@ -1,79 +0,0 @@
var AWS = require('../core');
var builder = require('xmlbuilder');
var inherit = AWS.util.inherit;
/**
* @api private
*/
AWS.XML.Builder = inherit({
constructor: function XMLBuilder(root, rules, options) {
this.root = root;
this.rules = rules;
this.xmlns = options.xmlnamespace;
this.timestampFormat = options.timestampFormat;
},
toXML: function toXML(params) {
var xml = builder.create(this.root);
if (this.xmlns) xml.att('xmlns', this.xmlns);
this.serializeStructure(this.rules, params, xml);
return xml.root().toString();
},
serializeStructure: function serializeStructure(rules, params, xml) {
AWS.util.each.call(this, rules || {}, function (memberName, memberRules) {
var value = params[memberName];
if (value !== undefined) {
if (memberRules.attribute) {
xml.att(memberRules.name, value);
} else {
this.serializeMember(memberName, memberRules, value, xml);
}
}
});
},
serializeList: function serializeList(name, rules, list, xml) {
if (rules.flattened) {
AWS.util.arrayEach.call(this, list, function (value) {
this.serializeMember(rules.name || name, rules.members, value, xml);
});
} else {
xml = xml.ele(rules.name || name);
AWS.util.arrayEach.call(this, list, function (value) {
var memberName = rules.members.name || 'member';
this.serializeMember(memberName, rules.members, value, xml);
});
}
},
serializeMember: function serializeMember(memberName, rules, params, xml) {
if (params === null || params === undefined) return;
var name = memberName;
if (rules.type === 'structure') {
xml = xml.ele(name);
this.serializeStructure(rules.members, params, xml);
} else if (rules.type === 'list') {
this.serializeList(name, rules, params, xml);
} else if (rules.type === 'timestamp') {
var timestampFormat = rules.format || this.timestampFormat;
var date = AWS.util.date.format(params, timestampFormat);
xml = xml.ele(name, String(date));
} else {
xml = xml.ele(name, String(params));
}
this.applyNamespaces(xml, rules);
},
applyNamespaces: function applyNamespaces(xml, rules) {
if (rules.xmlns) {
var attr = 'xmlns';
if (rules.xmlns.prefix) attr += ':' + rules.xmlns.prefix;
xml.att(attr, rules.xmlns.uri);
}
}
});

View File

@ -1,153 +0,0 @@
var AWS = require('../core');
var inherit = AWS.util.inherit;
var xml2js = require('xml2js');
/**
* @api private
*/
AWS.XML.Parser = inherit({
constructor: function XMLParser(rules) {
this.rules = (rules || {}).members || {};
},
// options passed to xml2js parser
options: {
explicitCharkey: false, // undocumented
trim: false, // trim the leading/trailing whitespace from text nodes
normalize: false, // trim interior whitespace inside text nodes
explicitRoot: false, // return the root node in the resulting object?
emptyTag: null, // the default value for empty nodes
explicitArray: true, // always put child nodes in an array
ignoreAttrs: false, // ignore attributes, only create text nodes
mergeAttrs: false, // merge attributes and child elements
validator: null // a callable validator
},
parse: function parse(xml) {
var result = null;
var error = null;
var parser = new xml2js.Parser(this.options);
parser.parseString(xml, function (e, r) {
error = e;
result = r;
});
if (result) {
delete result.xmlns;
return this.parseStructure(result, this.rules);
} else if (error) {
throw AWS.util.error(error, {code: 'XMLParserError'});
} else { // empty xml document
return this.parseStructure({}, this.rules);
}
},
parseStructure: function parseStructure(structure, rules) {
var data = {};
// force array members to always be present
AWS.util.each.call(this, rules, function(memberName, memberRules) {
if (memberRules.type === 'list') {
data[memberRules.name || memberName] = [];
}
});
AWS.util.each.call(this, structure, function (xmlName, value) {
var rule;
if (xmlName === '$') {
AWS.util.each.call(this, value, function (attrName, attrValue) {
if (rules[attrName]) {
rule = rules[attrName];
data[rule.name || xmlName] = this.parseMember([attrValue], rule);
}
});
} else {
rule = rules[xmlName] || {};
data[rule.name || xmlName] = this.parseMember(value, rule);
}
});
return data;
},
parseMap: function parseMap(map, rules) {
var data = {};
var keyRules = rules.keys || {};
var valueRules = rules.members || {};
var keyName = keyRules.name || 'key';
var valueName = valueRules.name || 'value';
if (!rules.flattened) {
map = map[0].entry;
}
AWS.util.arrayEach.call(this, map, function (entry) {
var value = this.parseMember(entry[valueName], valueRules);
data[entry[keyName][0]] = value;
});
return data;
},
parseList: function parseList(list, rules) {
var data = [];
var memberRules = rules.members || {};
var memberName = memberRules.name || 'member';
if (rules.flattened) {
AWS.util.arrayEach.call(this, list, function (value) {
data.push(this.parseMember([value], memberRules));
});
} else {
AWS.util.arrayEach.call(this, list, function (member) {
AWS.util.arrayEach.call(this, member[memberName], function (value) {
data.push(this.parseMember([value], memberRules));
});
});
}
return data;
},
parseMember: function parseMember(values, rules) {
if (values[0] === null) {
if (rules.type === 'structure') return {};
if (rules.type === 'list') return [];
if (rules.type === 'map') return {};
if (!rules.type || rules.type === 'string') return '';
return null;
}
if (values[0]['$'] && values[0]['$'].encoding === 'base64') {
return AWS.util.base64.decode(values[0]['_']);
}
if (!rules.type) {
if (typeof values[0] === 'string') {
rules.type = 'string';
} else if (values[0]['_']) {
rules.type = 'string';
values = [values[0]['_']];
} else {
rules.type = 'structure';
}
}
if (rules.type === 'string') {
return values[0] === null ? '' : values[0];
} else if (rules.type === 'structure') {
return this.parseStructure(values[0], rules.members || {});
} else if (rules.type === 'list') {
return this.parseList(values, rules);
} else if (rules.type === 'map') {
return this.parseMap(values, rules);
} else if (rules.type === 'integer') {
return parseInt(values[0], 10);
} else if (rules.type === 'float') {
return parseFloat(values[0]);
} else if (rules.type === 'timestamp') {
return AWS.util.date.parseTimestamp(values[0]);
} else if (rules.type === 'boolean') {
return values[0] === 'true';
} else {
var msg = 'unhandled type: ' + rules.type;
throw AWS.util.error(new Error(msg), {code: 'XMLParserError'});
}
}
});

View File

@ -1,4 +0,0 @@
apis/source
samus.json
scripts
vendor

View File

@ -1,12 +0,0 @@
Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You
may not use this file except in compliance with the License. A copy of
the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.

View File

@ -1,4 +0,0 @@
# AWS SDK for JavaScript APIs Package
This package contains all of the API definitions used by the
[aws-sdk](https://github.com/aws/aws-sdk-js) package.

File diff suppressed because it is too large Load Diff

View File

@ -1,533 +0,0 @@
{
"format": "query",
"apiVersion": "2010-05-15",
"endpointPrefix": "cloudformation",
"resultWrapped": true,
"serviceFullName": "AWS CloudFormation",
"signatureVersion": "v4",
"timestampFormat": "iso8601",
"operations": {
"cancelUpdateStack": {
"name": "CancelUpdateStack",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"createStack": {
"name": "CreateStack",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
},
"TemplateBody": {},
"TemplateURL": {},
"Parameters": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ParameterKey": {},
"ParameterValue": {}
}
}
},
"DisableRollback": {
"type": "boolean"
},
"TimeoutInMinutes": {
"type": "integer"
},
"NotificationARNs": {
"type": "list",
"members": {}
},
"Capabilities": {
"type": "list",
"members": {}
},
"OnFailure": {},
"StackPolicyBody": {},
"StackPolicyURL": {},
"Tags": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Key": {},
"Value": {}
}
}
}
}
},
"output": {
"type": "structure",
"members": {
"StackId": {}
}
}
},
"deleteStack": {
"name": "DeleteStack",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"describeStackEvents": {
"name": "DescribeStackEvents",
"input": {
"type": "structure",
"members": {
"StackName": {},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"StackEvents": {
"type": "list",
"members": {
"type": "structure",
"members": {
"StackId": {},
"EventId": {},
"StackName": {},
"LogicalResourceId": {},
"PhysicalResourceId": {},
"ResourceType": {},
"Timestamp": {
"type": "timestamp"
},
"ResourceStatus": {},
"ResourceStatusReason": {},
"ResourceProperties": {}
}
}
},
"NextToken": {}
}
}
},
"describeStackResource": {
"name": "DescribeStackResource",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
},
"LogicalResourceId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"StackResourceDetail": {
"type": "structure",
"members": {
"StackName": {},
"StackId": {},
"LogicalResourceId": {},
"PhysicalResourceId": {},
"ResourceType": {},
"LastUpdatedTimestamp": {
"type": "timestamp"
},
"ResourceStatus": {},
"ResourceStatusReason": {},
"Description": {},
"Metadata": {}
}
}
}
}
},
"describeStackResources": {
"name": "DescribeStackResources",
"input": {
"type": "structure",
"members": {
"StackName": {},
"LogicalResourceId": {},
"PhysicalResourceId": {}
}
},
"output": {
"type": "structure",
"members": {
"StackResources": {
"type": "list",
"members": {
"type": "structure",
"members": {
"StackName": {},
"StackId": {},
"LogicalResourceId": {},
"PhysicalResourceId": {},
"ResourceType": {},
"Timestamp": {
"type": "timestamp"
},
"ResourceStatus": {},
"ResourceStatusReason": {},
"Description": {}
}
}
}
}
}
},
"describeStacks": {
"name": "DescribeStacks",
"input": {
"type": "structure",
"members": {
"StackName": {},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"Stacks": {
"type": "list",
"members": {
"type": "structure",
"members": {
"StackId": {},
"StackName": {},
"Description": {},
"Parameters": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ParameterKey": {},
"ParameterValue": {}
}
}
},
"CreationTime": {
"type": "timestamp"
},
"LastUpdatedTime": {
"type": "timestamp"
},
"StackStatus": {},
"StackStatusReason": {},
"DisableRollback": {
"type": "boolean"
},
"NotificationARNs": {
"type": "list",
"members": {}
},
"TimeoutInMinutes": {
"type": "integer"
},
"Capabilities": {
"type": "list",
"members": {}
},
"Outputs": {
"type": "list",
"members": {
"type": "structure",
"members": {
"OutputKey": {},
"OutputValue": {},
"Description": {}
}
}
},
"Tags": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Key": {},
"Value": {}
}
}
}
}
}
},
"NextToken": {}
}
}
},
"estimateTemplateCost": {
"name": "EstimateTemplateCost",
"input": {
"type": "structure",
"members": {
"TemplateBody": {},
"TemplateURL": {},
"Parameters": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ParameterKey": {},
"ParameterValue": {}
}
}
}
}
},
"output": {
"type": "structure",
"members": {
"Url": {}
}
}
},
"getStackPolicy": {
"name": "GetStackPolicy",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"StackPolicyBody": {}
}
}
},
"getTemplate": {
"name": "GetTemplate",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"TemplateBody": {}
}
}
},
"listStackResources": {
"name": "ListStackResources",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"StackResourceSummaries": {
"type": "list",
"members": {
"type": "structure",
"members": {
"LogicalResourceId": {},
"PhysicalResourceId": {},
"ResourceType": {},
"LastUpdatedTimestamp": {
"type": "timestamp"
},
"ResourceStatus": {},
"ResourceStatusReason": {}
}
}
},
"NextToken": {}
}
}
},
"listStacks": {
"name": "ListStacks",
"input": {
"type": "structure",
"members": {
"NextToken": {},
"StackStatusFilter": {
"type": "list",
"members": {}
}
}
},
"output": {
"type": "structure",
"members": {
"StackSummaries": {
"type": "list",
"members": {
"type": "structure",
"members": {
"StackId": {},
"StackName": {},
"TemplateDescription": {},
"CreationTime": {
"type": "timestamp"
},
"LastUpdatedTime": {
"type": "timestamp"
},
"DeletionTime": {
"type": "timestamp"
},
"StackStatus": {},
"StackStatusReason": {}
}
}
},
"NextToken": {}
}
}
},
"setStackPolicy": {
"name": "SetStackPolicy",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
},
"StackPolicyBody": {},
"StackPolicyURL": {}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"updateStack": {
"name": "UpdateStack",
"input": {
"type": "structure",
"members": {
"StackName": {
"required": true
},
"TemplateBody": {},
"TemplateURL": {},
"StackPolicyDuringUpdateBody": {},
"StackPolicyDuringUpdateURL": {},
"Parameters": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ParameterKey": {},
"ParameterValue": {}
}
}
},
"Capabilities": {
"type": "list",
"members": {}
},
"StackPolicyBody": {},
"StackPolicyURL": {}
}
},
"output": {
"type": "structure",
"members": {
"StackId": {}
}
}
},
"validateTemplate": {
"name": "ValidateTemplate",
"input": {
"type": "structure",
"members": {
"TemplateBody": {},
"TemplateURL": {}
}
},
"output": {
"type": "structure",
"members": {
"Parameters": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ParameterKey": {},
"DefaultValue": {},
"NoEcho": {
"type": "boolean"
},
"Description": {}
}
}
},
"Description": {},
"Capabilities": {
"type": "list",
"members": {}
},
"CapabilitiesReason": {}
}
}
}
},
"pagination": {
"describeStackEvents": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "StackEvents"
},
"describeStackResources": {
"resultKey": "StackResources"
},
"describeStacks": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "Stacks"
},
"listStackResources": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "StackResourceSummaries"
},
"listStacks": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "StackSummaries"
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,231 +0,0 @@
{
"format": "json",
"apiVersion": "2013-11-01",
"endpointPrefix": "cloudtrail",
"jsonVersion": "1.1",
"serviceAbbreviation": "CloudTrail",
"serviceFullName": "AWS CloudTrail",
"signatureVersion": "v4",
"targetPrefix": "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101",
"timestampFormat": "iso8601",
"operations": {
"createTrail": {
"name": "CreateTrail",
"input": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
},
"trail": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
}
}
}
}
},
"output": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
},
"trail": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
}
}
}
}
}
},
"deleteTrail": {
"name": "DeleteTrail",
"input": {
"type": "structure",
"members": {
"Name": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"describeTrails": {
"name": "DescribeTrails",
"input": {
"type": "structure",
"members": {
"trailNameList": {
"type": "list",
"members": {}
}
}
},
"output": {
"type": "structure",
"members": {
"trailList": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
}
}
}
}
}
}
},
"getTrailStatus": {
"name": "GetTrailStatus",
"input": {
"type": "structure",
"members": {
"Name": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"IsLogging": {
"type": "boolean"
},
"LatestDeliveryError": {},
"LatestNotificationError": {},
"LatestDeliveryTime": {
"type": "timestamp"
},
"LatestNotificationTime": {
"type": "timestamp"
},
"StartLoggingTime": {
"type": "timestamp"
},
"StopLoggingTime": {
"type": "timestamp"
},
"LatestDeliveryAttemptTime": {},
"LatestNotificationAttemptTime": {},
"LatestNotificationAttemptSucceeded": {},
"LatestDeliveryAttemptSucceeded": {},
"TimeLoggingStarted": {},
"TimeLoggingStopped": {}
}
}
},
"startLogging": {
"name": "StartLogging",
"input": {
"type": "structure",
"members": {
"Name": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"stopLogging": {
"name": "StopLogging",
"input": {
"type": "structure",
"members": {
"Name": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"updateTrail": {
"name": "UpdateTrail",
"input": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
},
"trail": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
}
}
}
}
},
"output": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
},
"trail": {
"type": "structure",
"members": {
"Name": {},
"S3BucketName": {},
"S3KeyPrefix": {},
"SnsTopicName": {},
"IncludeGlobalServiceEvents": {
"type": "boolean"
}
}
}
}
}
}
}
}

View File

@ -1,612 +0,0 @@
{
"format": "query",
"apiVersion": "2010-08-01",
"endpointPrefix": "monitoring",
"resultWrapped": true,
"serviceAbbreviation": "CloudWatch",
"serviceFullName": "Amazon CloudWatch",
"signatureVersion": "v4",
"timestampFormat": "iso8601",
"operations": {
"deleteAlarms": {
"name": "DeleteAlarms",
"input": {
"type": "structure",
"members": {
"AlarmNames": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"describeAlarmHistory": {
"name": "DescribeAlarmHistory",
"input": {
"type": "structure",
"members": {
"AlarmName": {},
"HistoryItemType": {},
"StartDate": {
"type": "timestamp"
},
"EndDate": {
"type": "timestamp"
},
"MaxRecords": {
"type": "integer"
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"AlarmHistoryItems": {
"type": "list",
"members": {
"type": "structure",
"members": {
"AlarmName": {},
"Timestamp": {
"type": "timestamp"
},
"HistoryItemType": {},
"HistorySummary": {},
"HistoryData": {}
}
}
},
"NextToken": {}
}
}
},
"describeAlarms": {
"name": "DescribeAlarms",
"input": {
"type": "structure",
"members": {
"AlarmNames": {
"type": "list",
"members": {}
},
"AlarmNamePrefix": {},
"StateValue": {},
"ActionPrefix": {},
"MaxRecords": {
"type": "integer"
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"MetricAlarms": {
"type": "list",
"members": {
"type": "structure",
"members": {
"AlarmName": {},
"AlarmArn": {},
"AlarmDescription": {},
"AlarmConfigurationUpdatedTimestamp": {
"type": "timestamp"
},
"ActionsEnabled": {
"type": "boolean"
},
"OKActions": {
"type": "list",
"members": {}
},
"AlarmActions": {
"type": "list",
"members": {}
},
"InsufficientDataActions": {
"type": "list",
"members": {}
},
"StateValue": {},
"StateReason": {},
"StateReasonData": {},
"StateUpdatedTimestamp": {
"type": "timestamp"
},
"MetricName": {},
"Namespace": {},
"Statistic": {},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"Value": {}
}
}
},
"Period": {
"type": "integer"
},
"Unit": {},
"EvaluationPeriods": {
"type": "integer"
},
"Threshold": {
"type": "float"
},
"ComparisonOperator": {}
}
}
},
"NextToken": {}
}
}
},
"describeAlarmsForMetric": {
"name": "DescribeAlarmsForMetric",
"input": {
"type": "structure",
"members": {
"MetricName": {
"required": true
},
"Namespace": {
"required": true
},
"Statistic": {},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Value": {
"required": true
}
},
"order": [
"Name",
"Value"
]
}
},
"Period": {
"type": "integer"
},
"Unit": {}
}
},
"output": {
"type": "structure",
"members": {
"MetricAlarms": {
"type": "list",
"members": {
"type": "structure",
"members": {
"AlarmName": {},
"AlarmArn": {},
"AlarmDescription": {},
"AlarmConfigurationUpdatedTimestamp": {
"type": "timestamp"
},
"ActionsEnabled": {
"type": "boolean"
},
"OKActions": {
"type": "list",
"members": {}
},
"AlarmActions": {
"type": "list",
"members": {}
},
"InsufficientDataActions": {
"type": "list",
"members": {}
},
"StateValue": {},
"StateReason": {},
"StateReasonData": {},
"StateUpdatedTimestamp": {
"type": "timestamp"
},
"MetricName": {},
"Namespace": {},
"Statistic": {},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"Value": {}
}
}
},
"Period": {
"type": "integer"
},
"Unit": {},
"EvaluationPeriods": {
"type": "integer"
},
"Threshold": {
"type": "float"
},
"ComparisonOperator": {}
}
}
}
}
}
},
"disableAlarmActions": {
"name": "DisableAlarmActions",
"input": {
"type": "structure",
"members": {
"AlarmNames": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"enableAlarmActions": {
"name": "EnableAlarmActions",
"input": {
"type": "structure",
"members": {
"AlarmNames": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"getMetricStatistics": {
"name": "GetMetricStatistics",
"input": {
"type": "structure",
"members": {
"Namespace": {
"required": true
},
"MetricName": {
"required": true
},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Value": {
"required": true
}
},
"order": [
"Name",
"Value"
]
}
},
"StartTime": {
"type": "timestamp",
"required": true
},
"EndTime": {
"type": "timestamp",
"required": true
},
"Period": {
"type": "integer",
"required": true
},
"Statistics": {
"type": "list",
"members": {},
"required": true
},
"Unit": {}
}
},
"output": {
"type": "structure",
"members": {
"Label": {},
"Datapoints": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Timestamp": {
"type": "timestamp"
},
"SampleCount": {
"type": "float"
},
"Average": {
"type": "float"
},
"Sum": {
"type": "float"
},
"Minimum": {
"type": "float"
},
"Maximum": {
"type": "float"
},
"Unit": {}
}
}
}
}
}
},
"listMetrics": {
"name": "ListMetrics",
"input": {
"type": "structure",
"members": {
"Namespace": {},
"MetricName": {},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Value": {}
}
}
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"Metrics": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Namespace": {},
"MetricName": {},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"Value": {}
}
}
}
}
}
},
"NextToken": {}
}
}
},
"putMetricAlarm": {
"name": "PutMetricAlarm",
"input": {
"type": "structure",
"members": {
"AlarmName": {
"required": true
},
"AlarmDescription": {},
"ActionsEnabled": {
"type": "boolean"
},
"OKActions": {
"type": "list",
"members": {}
},
"AlarmActions": {
"type": "list",
"members": {}
},
"InsufficientDataActions": {
"type": "list",
"members": {}
},
"MetricName": {
"required": true
},
"Namespace": {
"required": true
},
"Statistic": {
"required": true
},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Value": {
"required": true
}
},
"order": [
"Name",
"Value"
]
}
},
"Period": {
"type": "integer",
"required": true
},
"Unit": {},
"EvaluationPeriods": {
"type": "integer",
"required": true
},
"Threshold": {
"type": "float",
"required": true
},
"ComparisonOperator": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"putMetricData": {
"name": "PutMetricData",
"input": {
"type": "structure",
"members": {
"Namespace": {
"required": true
},
"MetricData": {
"type": "list",
"members": {
"type": "structure",
"members": {
"MetricName": {
"required": true
},
"Dimensions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Value": {
"required": true
}
},
"order": [
"Name",
"Value"
]
}
},
"Timestamp": {
"type": "timestamp"
},
"Value": {
"type": "float"
},
"StatisticValues": {
"type": "structure",
"members": {
"SampleCount": {
"type": "float",
"required": true
},
"Sum": {
"type": "float",
"required": true
},
"Minimum": {
"type": "float",
"required": true
},
"Maximum": {
"type": "float",
"required": true
}
}
},
"Unit": {}
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setAlarmState": {
"name": "SetAlarmState",
"input": {
"type": "structure",
"members": {
"AlarmName": {
"required": true
},
"StateValue": {
"required": true
},
"StateReason": {
"required": true
},
"StateReasonData": {}
}
},
"output": {
"type": "structure",
"members": {}
}
}
},
"pagination": {
"describeAlarmHistory": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"limitKey": "MaxRecords",
"resultKey": "AlarmHistoryItems"
},
"describeAlarms": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"limitKey": "MaxRecords",
"resultKey": "MetricAlarms"
},
"describeAlarmsForMetric": {
"resultKey": "MetricAlarms"
},
"listMetrics": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "Metrics"
}
}
}

View File

@ -1,606 +0,0 @@
{
"format": "json",
"apiVersion": "2012-10-29",
"endpointPrefix": "datapipeline",
"jsonVersion": "1.1",
"serviceFullName": "AWS Data Pipeline",
"signatureVersion": "v4",
"targetPrefix": "DataPipeline",
"timestampFormat": "iso8601",
"operations": {
"activatePipeline": {
"name": "ActivatePipeline",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"createPipeline": {
"name": "CreatePipeline",
"input": {
"type": "structure",
"members": {
"name": {
"required": true
},
"uniqueId": {
"required": true
},
"description": {}
}
},
"output": {
"type": "structure",
"members": {
"pipelineId": {}
}
}
},
"deletePipeline": {
"name": "DeletePipeline",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"describeObjects": {
"name": "DescribeObjects",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
},
"objectIds": {
"type": "list",
"members": {},
"required": true
},
"evaluateExpressions": {
"type": "boolean"
},
"marker": {}
}
},
"output": {
"type": "structure",
"members": {
"pipelineObjects": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"name": {},
"fields": {
"type": "list",
"members": {
"type": "structure",
"members": {
"key": {},
"stringValue": {},
"refValue": {}
}
}
}
}
}
},
"marker": {},
"hasMoreResults": {
"type": "boolean"
}
}
}
},
"describePipelines": {
"name": "DescribePipelines",
"input": {
"type": "structure",
"members": {
"pipelineIds": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"pipelineDescriptionList": {
"type": "list",
"members": {
"type": "structure",
"members": {
"pipelineId": {},
"name": {},
"fields": {
"type": "list",
"members": {
"type": "structure",
"members": {
"key": {},
"stringValue": {},
"refValue": {}
}
}
},
"description": {}
}
}
}
}
}
},
"evaluateExpression": {
"name": "EvaluateExpression",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
},
"objectId": {
"required": true
},
"expression": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"evaluatedExpression": {}
}
}
},
"getPipelineDefinition": {
"name": "GetPipelineDefinition",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
},
"version": {}
}
},
"output": {
"type": "structure",
"members": {
"pipelineObjects": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"name": {},
"fields": {
"type": "list",
"members": {
"type": "structure",
"members": {
"key": {},
"stringValue": {},
"refValue": {}
}
}
}
}
}
}
}
}
},
"listPipelines": {
"name": "ListPipelines",
"input": {
"type": "structure",
"members": {
"marker": {}
}
},
"output": {
"type": "structure",
"members": {
"pipelineIdList": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"name": {}
}
}
},
"marker": {},
"hasMoreResults": {
"type": "boolean"
}
}
}
},
"pollForTask": {
"name": "PollForTask",
"input": {
"type": "structure",
"members": {
"workerGroup": {
"required": true
},
"hostname": {},
"instanceIdentity": {
"type": "structure",
"members": {
"document": {},
"signature": {}
}
}
}
},
"output": {
"type": "structure",
"members": {
"taskObject": {
"type": "structure",
"members": {
"taskId": {},
"pipelineId": {},
"attemptId": {},
"objects": {
"type": "map",
"keys": {},
"members": {
"type": "structure",
"members": {
"id": {},
"name": {},
"fields": {
"type": "list",
"members": {
"type": "structure",
"members": {
"key": {},
"stringValue": {},
"refValue": {}
}
}
}
}
}
}
}
}
}
}
},
"putPipelineDefinition": {
"name": "PutPipelineDefinition",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
},
"pipelineObjects": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {
"required": true
},
"name": {
"required": true
},
"fields": {
"type": "list",
"members": {
"type": "structure",
"members": {
"key": {
"required": true
},
"stringValue": {},
"refValue": {}
}
},
"required": true
}
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"validationErrors": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"errors": {
"type": "list",
"members": {}
}
}
}
},
"validationWarnings": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"warnings": {
"type": "list",
"members": {}
}
}
}
},
"errored": {
"type": "boolean"
}
}
}
},
"queryObjects": {
"name": "QueryObjects",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
},
"query": {
"type": "structure",
"members": {
"selectors": {
"type": "list",
"members": {
"type": "structure",
"members": {
"fieldName": {},
"operator": {
"type": "structure",
"members": {
"type": {},
"values": {
"type": "list",
"members": {}
}
}
}
}
}
}
}
},
"sphere": {
"required": true
},
"marker": {},
"limit": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"ids": {
"type": "list",
"members": {}
},
"marker": {},
"hasMoreResults": {
"type": "boolean"
}
}
}
},
"reportTaskProgress": {
"name": "ReportTaskProgress",
"input": {
"type": "structure",
"members": {
"taskId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"canceled": {
"type": "boolean"
}
}
}
},
"reportTaskRunnerHeartbeat": {
"name": "ReportTaskRunnerHeartbeat",
"input": {
"type": "structure",
"members": {
"taskrunnerId": {
"required": true
},
"workerGroup": {},
"hostname": {}
}
},
"output": {
"type": "structure",
"members": {
"terminate": {
"type": "boolean"
}
}
}
},
"setStatus": {
"name": "SetStatus",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
},
"objectIds": {
"type": "list",
"members": {},
"required": true
},
"status": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setTaskStatus": {
"name": "SetTaskStatus",
"input": {
"type": "structure",
"members": {
"taskId": {
"required": true
},
"taskStatus": {
"required": true
},
"errorId": {},
"errorMessage": {},
"errorStackTrace": {}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"validatePipelineDefinition": {
"name": "ValidatePipelineDefinition",
"input": {
"type": "structure",
"members": {
"pipelineId": {
"required": true
},
"pipelineObjects": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {
"required": true
},
"name": {
"required": true
},
"fields": {
"type": "list",
"members": {
"type": "structure",
"members": {
"key": {
"required": true
},
"stringValue": {},
"refValue": {}
}
},
"required": true
}
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"validationErrors": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"errors": {
"type": "list",
"members": {}
}
}
}
},
"validationWarnings": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"warnings": {
"type": "list",
"members": {}
}
}
}
},
"errored": {
"type": "boolean"
}
}
}
}
},
"pagination": {
"listPipelines": {
"inputToken": "marker",
"outputToken": "marker",
"moreResults": "hasMoreResults",
"limitKey": "limit",
"resultKey": "pipelineIdList"
},
"describeObjects": {
"inputToken": "marker",
"outputToken": "marker",
"moreResults": "hasMoreResults",
"limitKey": "limit",
"resultKey": "pipelineObjects"
},
"queryObjects": {
"inputToken": "marker",
"outputToken": "marker",
"moreResults": "hasMoreResults",
"limitKey": "limit",
"resultKey": "ids"
}
}
}

View File

@ -1,721 +0,0 @@
{
"format": "json",
"apiVersion": "2012-10-25",
"endpointPrefix": "directconnect",
"jsonVersion": "1.1",
"serviceFullName": "AWS Direct Connect",
"signatureVersion": "v4",
"targetPrefix": "OvertureService",
"timestampFormat": "iso8601",
"operations": {
"allocateConnectionOnInterconnect": {
"name": "AllocateConnectionOnInterconnect",
"input": {
"type": "structure",
"members": {
"bandwidth": {
"required": true
},
"connectionName": {
"required": true
},
"ownerAccount": {
"required": true
},
"interconnectId": {
"required": true
},
"vlan": {
"type": "integer",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ownerAccount": {},
"connectionId": {},
"connectionName": {},
"connectionState": {},
"region": {},
"location": {},
"bandwidth": {},
"vlan": {
"type": "integer"
},
"partnerName": {}
}
}
},
"allocatePrivateVirtualInterface": {
"name": "AllocatePrivateVirtualInterface",
"input": {
"type": "structure",
"members": {
"connectionId": {
"required": true
},
"ownerAccount": {
"required": true
},
"newPrivateVirtualInterfaceAllocation": {
"type": "structure",
"members": {
"virtualInterfaceName": {
"required": true
},
"vlan": {
"type": "integer",
"required": true
},
"asn": {
"type": "integer",
"required": true
},
"authKey": {},
"amazonAddress": {},
"customerAddress": {}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ownerAccount": {},
"virtualInterfaceId": {},
"location": {},
"connectionId": {},
"virtualInterfaceType": {},
"virtualInterfaceName": {},
"vlan": {
"type": "integer"
},
"asn": {
"type": "integer"
},
"authKey": {},
"amazonAddress": {},
"customerAddress": {},
"virtualInterfaceState": {},
"customerRouterConfig": {},
"virtualGatewayId": {},
"routeFilterPrefixes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"cidr": {}
}
}
}
}
}
},
"allocatePublicVirtualInterface": {
"name": "AllocatePublicVirtualInterface",
"input": {
"type": "structure",
"members": {
"connectionId": {
"required": true
},
"ownerAccount": {
"required": true
},
"newPublicVirtualInterfaceAllocation": {
"type": "structure",
"members": {
"virtualInterfaceName": {
"required": true
},
"vlan": {
"type": "integer",
"required": true
},
"asn": {
"type": "integer",
"required": true
},
"authKey": {},
"amazonAddress": {
"required": true
},
"customerAddress": {
"required": true
},
"routeFilterPrefixes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"cidr": {}
}
},
"required": true
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ownerAccount": {},
"virtualInterfaceId": {},
"location": {},
"connectionId": {},
"virtualInterfaceType": {},
"virtualInterfaceName": {},
"vlan": {
"type": "integer"
},
"asn": {
"type": "integer"
},
"authKey": {},
"amazonAddress": {},
"customerAddress": {},
"virtualInterfaceState": {},
"customerRouterConfig": {},
"virtualGatewayId": {},
"routeFilterPrefixes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"cidr": {}
}
}
}
}
}
},
"confirmConnection": {
"name": "ConfirmConnection",
"input": {
"type": "structure",
"members": {
"connectionId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"connectionState": {}
}
}
},
"confirmPrivateVirtualInterface": {
"name": "ConfirmPrivateVirtualInterface",
"input": {
"type": "structure",
"members": {
"virtualInterfaceId": {
"required": true
},
"virtualGatewayId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"virtualInterfaceState": {}
}
}
},
"confirmPublicVirtualInterface": {
"name": "ConfirmPublicVirtualInterface",
"input": {
"type": "structure",
"members": {
"virtualInterfaceId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"virtualInterfaceState": {}
}
}
},
"createConnection": {
"name": "CreateConnection",
"input": {
"type": "structure",
"members": {
"location": {
"required": true
},
"bandwidth": {
"required": true
},
"connectionName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ownerAccount": {},
"connectionId": {},
"connectionName": {},
"connectionState": {},
"region": {},
"location": {},
"bandwidth": {},
"vlan": {
"type": "integer"
},
"partnerName": {}
}
}
},
"createInterconnect": {
"name": "CreateInterconnect",
"input": {
"type": "structure",
"members": {
"interconnectName": {
"required": true
},
"bandwidth": {
"required": true
},
"location": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"interconnectId": {},
"interconnectName": {},
"interconnectState": {},
"region": {},
"location": {},
"bandwidth": {}
}
}
},
"createPrivateVirtualInterface": {
"name": "CreatePrivateVirtualInterface",
"input": {
"type": "structure",
"members": {
"connectionId": {
"required": true
},
"newPrivateVirtualInterface": {
"type": "structure",
"members": {
"virtualInterfaceName": {
"required": true
},
"vlan": {
"type": "integer",
"required": true
},
"asn": {
"type": "integer",
"required": true
},
"authKey": {},
"amazonAddress": {},
"customerAddress": {},
"virtualGatewayId": {
"required": true
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ownerAccount": {},
"virtualInterfaceId": {},
"location": {},
"connectionId": {},
"virtualInterfaceType": {},
"virtualInterfaceName": {},
"vlan": {
"type": "integer"
},
"asn": {
"type": "integer"
},
"authKey": {},
"amazonAddress": {},
"customerAddress": {},
"virtualInterfaceState": {},
"customerRouterConfig": {},
"virtualGatewayId": {},
"routeFilterPrefixes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"cidr": {}
}
}
}
}
}
},
"createPublicVirtualInterface": {
"name": "CreatePublicVirtualInterface",
"input": {
"type": "structure",
"members": {
"connectionId": {
"required": true
},
"newPublicVirtualInterface": {
"type": "structure",
"members": {
"virtualInterfaceName": {
"required": true
},
"vlan": {
"type": "integer",
"required": true
},
"asn": {
"type": "integer",
"required": true
},
"authKey": {},
"amazonAddress": {
"required": true
},
"customerAddress": {
"required": true
},
"routeFilterPrefixes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"cidr": {}
}
},
"required": true
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ownerAccount": {},
"virtualInterfaceId": {},
"location": {},
"connectionId": {},
"virtualInterfaceType": {},
"virtualInterfaceName": {},
"vlan": {
"type": "integer"
},
"asn": {
"type": "integer"
},
"authKey": {},
"amazonAddress": {},
"customerAddress": {},
"virtualInterfaceState": {},
"customerRouterConfig": {},
"virtualGatewayId": {},
"routeFilterPrefixes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"cidr": {}
}
}
}
}
}
},
"deleteConnection": {
"name": "DeleteConnection",
"input": {
"type": "structure",
"members": {
"connectionId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ownerAccount": {},
"connectionId": {},
"connectionName": {},
"connectionState": {},
"region": {},
"location": {},
"bandwidth": {},
"vlan": {
"type": "integer"
},
"partnerName": {}
}
}
},
"deleteInterconnect": {
"name": "DeleteInterconnect",
"input": {
"type": "structure",
"members": {
"interconnectId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"interconnectState": {}
}
}
},
"deleteVirtualInterface": {
"name": "DeleteVirtualInterface",
"input": {
"type": "structure",
"members": {
"virtualInterfaceId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"virtualInterfaceState": {}
}
}
},
"describeConnections": {
"name": "DescribeConnections",
"input": {
"type": "structure",
"members": {
"connectionId": {}
}
},
"output": {
"type": "structure",
"members": {
"connections": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ownerAccount": {},
"connectionId": {},
"connectionName": {},
"connectionState": {},
"region": {},
"location": {},
"bandwidth": {},
"vlan": {
"type": "integer"
},
"partnerName": {}
}
}
}
}
}
},
"describeConnectionsOnInterconnect": {
"name": "DescribeConnectionsOnInterconnect",
"input": {
"type": "structure",
"members": {
"interconnectId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"connections": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ownerAccount": {},
"connectionId": {},
"connectionName": {},
"connectionState": {},
"region": {},
"location": {},
"bandwidth": {},
"vlan": {
"type": "integer"
},
"partnerName": {}
}
}
}
}
}
},
"describeInterconnects": {
"name": "DescribeInterconnects",
"input": {
"type": "structure",
"members": {
"interconnectId": {}
}
},
"output": {
"type": "structure",
"members": {
"interconnects": {
"type": "list",
"members": {
"type": "structure",
"members": {
"interconnectId": {},
"interconnectName": {},
"interconnectState": {},
"region": {},
"location": {},
"bandwidth": {}
}
}
}
}
}
},
"describeLocations": {
"name": "DescribeLocations",
"input": {
"type": "structure",
"members": {}
},
"output": {
"type": "structure",
"members": {
"locations": {
"type": "list",
"members": {
"type": "structure",
"members": {
"locationCode": {},
"locationName": {}
}
}
}
}
}
},
"describeVirtualGateways": {
"name": "DescribeVirtualGateways",
"input": {
"type": "structure",
"members": {}
},
"output": {
"type": "structure",
"members": {
"virtualGateways": {
"type": "list",
"members": {
"type": "structure",
"members": {
"virtualGatewayId": {},
"virtualGatewayState": {}
}
}
}
}
}
},
"describeVirtualInterfaces": {
"name": "DescribeVirtualInterfaces",
"input": {
"type": "structure",
"members": {
"connectionId": {},
"virtualInterfaceId": {}
}
},
"output": {
"type": "structure",
"members": {
"virtualInterfaces": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ownerAccount": {},
"virtualInterfaceId": {},
"location": {},
"connectionId": {},
"virtualInterfaceType": {},
"virtualInterfaceName": {},
"vlan": {
"type": "integer"
},
"asn": {
"type": "integer"
},
"authKey": {},
"amazonAddress": {},
"customerAddress": {},
"virtualInterfaceState": {},
"customerRouterConfig": {},
"virtualGatewayId": {},
"routeFilterPrefixes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"cidr": {}
}
}
}
}
}
}
}
}
}
},
"pagination": {
"describeConnections": {
"resultKey": "connections"
},
"describeOfferings": {
"resultKey": "offerings"
},
"describeVirtualGateways": {
"resultKey": "virtualGateways"
},
"describeVirtualInterfaces": {
"resultKey": "virtualInterfaces"
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,985 +0,0 @@
{
"format": "query",
"apiVersion": "2012-06-01",
"endpointPrefix": "elasticloadbalancing",
"resultWrapped": true,
"serviceFullName": "Elastic Load Balancing",
"signatureVersion": "v4",
"timestampFormat": "iso8601",
"operations": {
"applySecurityGroupsToLoadBalancer": {
"name": "ApplySecurityGroupsToLoadBalancer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"SecurityGroups": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"SecurityGroups": {
"type": "list",
"members": {}
}
}
}
},
"attachLoadBalancerToSubnets": {
"name": "AttachLoadBalancerToSubnets",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"Subnets": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Subnets": {
"type": "list",
"members": {}
}
}
}
},
"configureHealthCheck": {
"name": "ConfigureHealthCheck",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"HealthCheck": {
"type": "structure",
"members": {
"Target": {
"required": true
},
"Interval": {
"type": "integer",
"required": true
},
"Timeout": {
"type": "integer",
"required": true
},
"UnhealthyThreshold": {
"type": "integer",
"required": true
},
"HealthyThreshold": {
"type": "integer",
"required": true
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"HealthCheck": {
"type": "structure",
"members": {
"Target": {},
"Interval": {
"type": "integer"
},
"Timeout": {
"type": "integer"
},
"UnhealthyThreshold": {
"type": "integer"
},
"HealthyThreshold": {
"type": "integer"
}
}
}
}
}
},
"createAppCookieStickinessPolicy": {
"name": "CreateAppCookieStickinessPolicy",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"PolicyName": {
"required": true
},
"CookieName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"createLBCookieStickinessPolicy": {
"name": "CreateLBCookieStickinessPolicy",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"PolicyName": {
"required": true
},
"CookieExpirationPeriod": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"createLoadBalancer": {
"name": "CreateLoadBalancer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"Listeners": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Protocol": {
"required": true
},
"LoadBalancerPort": {
"type": "integer",
"required": true
},
"InstanceProtocol": {},
"InstancePort": {
"type": "integer",
"required": true
},
"SSLCertificateId": {}
}
},
"required": true
},
"AvailabilityZones": {
"type": "list",
"members": {}
},
"Subnets": {
"type": "list",
"members": {}
},
"SecurityGroups": {
"type": "list",
"members": {}
},
"Scheme": {}
}
},
"output": {
"type": "structure",
"members": {
"DNSName": {}
}
}
},
"createLoadBalancerListeners": {
"name": "CreateLoadBalancerListeners",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"Listeners": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Protocol": {
"required": true
},
"LoadBalancerPort": {
"type": "integer",
"required": true
},
"InstanceProtocol": {},
"InstancePort": {
"type": "integer",
"required": true
},
"SSLCertificateId": {}
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"createLoadBalancerPolicy": {
"name": "CreateLoadBalancerPolicy",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"PolicyName": {
"required": true
},
"PolicyTypeName": {
"required": true
},
"PolicyAttributes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"AttributeName": {},
"AttributeValue": {}
}
}
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteLoadBalancer": {
"name": "DeleteLoadBalancer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteLoadBalancerListeners": {
"name": "DeleteLoadBalancerListeners",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"LoadBalancerPorts": {
"type": "list",
"members": {
"type": "integer"
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteLoadBalancerPolicy": {
"name": "DeleteLoadBalancerPolicy",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"PolicyName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deregisterInstancesFromLoadBalancer": {
"name": "DeregisterInstancesFromLoadBalancer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"Instances": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstanceId": {}
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Instances": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstanceId": {}
}
}
}
}
}
},
"describeInstanceHealth": {
"name": "DescribeInstanceHealth",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"Instances": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstanceId": {}
}
}
}
}
},
"output": {
"type": "structure",
"members": {
"InstanceStates": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstanceId": {},
"State": {},
"ReasonCode": {},
"Description": {}
}
}
}
}
}
},
"describeLoadBalancerAttributes": {
"name": "DescribeLoadBalancerAttributes",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"LoadBalancerAttributes": {
"type": "structure",
"members": {
"CrossZoneLoadBalancing": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean"
}
}
},
"AccessLog": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean"
},
"S3BucketName": {},
"EmitInterval": {
"type": "integer"
},
"S3BucketPrefix": {}
}
},
"ConnectionDraining": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean"
},
"Timeout": {
"type": "integer"
}
}
}
}
}
}
}
},
"describeLoadBalancerPolicies": {
"name": "DescribeLoadBalancerPolicies",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {},
"PolicyNames": {
"type": "list",
"members": {}
}
}
},
"output": {
"type": "structure",
"members": {
"PolicyDescriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"PolicyName": {},
"PolicyTypeName": {},
"PolicyAttributeDescriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"AttributeName": {},
"AttributeValue": {}
}
}
}
}
}
}
}
}
},
"describeLoadBalancerPolicyTypes": {
"name": "DescribeLoadBalancerPolicyTypes",
"input": {
"type": "structure",
"members": {
"PolicyTypeNames": {
"type": "list",
"members": {}
}
}
},
"output": {
"type": "structure",
"members": {
"PolicyTypeDescriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"PolicyTypeName": {},
"Description": {},
"PolicyAttributeTypeDescriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"AttributeName": {},
"AttributeType": {},
"Description": {},
"DefaultValue": {},
"Cardinality": {}
}
}
}
}
}
}
}
}
},
"describeLoadBalancers": {
"name": "DescribeLoadBalancers",
"input": {
"type": "structure",
"members": {
"LoadBalancerNames": {
"type": "list",
"members": {}
},
"Marker": {}
}
},
"output": {
"type": "structure",
"members": {
"LoadBalancerDescriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"LoadBalancerName": {},
"DNSName": {},
"CanonicalHostedZoneName": {},
"CanonicalHostedZoneNameID": {},
"ListenerDescriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Listener": {
"type": "structure",
"members": {
"Protocol": {},
"LoadBalancerPort": {
"type": "integer"
},
"InstanceProtocol": {},
"InstancePort": {
"type": "integer"
},
"SSLCertificateId": {}
}
},
"PolicyNames": {
"type": "list",
"members": {}
}
}
}
},
"Policies": {
"type": "structure",
"members": {
"AppCookieStickinessPolicies": {
"type": "list",
"members": {
"type": "structure",
"members": {
"PolicyName": {},
"CookieName": {}
}
}
},
"LBCookieStickinessPolicies": {
"type": "list",
"members": {
"type": "structure",
"members": {
"PolicyName": {},
"CookieExpirationPeriod": {
"type": "integer"
}
}
}
},
"OtherPolicies": {
"type": "list",
"members": {}
}
}
},
"BackendServerDescriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstancePort": {
"type": "integer"
},
"PolicyNames": {
"type": "list",
"members": {}
}
}
}
},
"AvailabilityZones": {
"type": "list",
"members": {}
},
"Subnets": {
"type": "list",
"members": {}
},
"VPCId": {},
"Instances": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstanceId": {}
}
}
},
"HealthCheck": {
"type": "structure",
"members": {
"Target": {},
"Interval": {
"type": "integer"
},
"Timeout": {
"type": "integer"
},
"UnhealthyThreshold": {
"type": "integer"
},
"HealthyThreshold": {
"type": "integer"
}
}
},
"SourceSecurityGroup": {
"type": "structure",
"members": {
"OwnerAlias": {},
"GroupName": {}
}
},
"SecurityGroups": {
"type": "list",
"members": {}
},
"CreatedTime": {
"type": "timestamp"
},
"Scheme": {}
}
}
},
"NextMarker": {}
}
}
},
"detachLoadBalancerFromSubnets": {
"name": "DetachLoadBalancerFromSubnets",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"Subnets": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Subnets": {
"type": "list",
"members": {}
}
}
}
},
"disableAvailabilityZonesForLoadBalancer": {
"name": "DisableAvailabilityZonesForLoadBalancer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"AvailabilityZones": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"AvailabilityZones": {
"type": "list",
"members": {}
}
}
}
},
"enableAvailabilityZonesForLoadBalancer": {
"name": "EnableAvailabilityZonesForLoadBalancer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"AvailabilityZones": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"AvailabilityZones": {
"type": "list",
"members": {}
}
}
}
},
"modifyLoadBalancerAttributes": {
"name": "ModifyLoadBalancerAttributes",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"LoadBalancerAttributes": {
"type": "structure",
"members": {
"CrossZoneLoadBalancing": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean",
"required": true
}
}
},
"AccessLog": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean",
"required": true
},
"S3BucketName": {},
"EmitInterval": {
"type": "integer"
},
"S3BucketPrefix": {}
}
},
"ConnectionDraining": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean",
"required": true
},
"Timeout": {
"type": "integer"
}
}
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"LoadBalancerName": {},
"LoadBalancerAttributes": {
"type": "structure",
"members": {
"CrossZoneLoadBalancing": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean"
}
}
},
"AccessLog": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean"
},
"S3BucketName": {},
"EmitInterval": {
"type": "integer"
},
"S3BucketPrefix": {}
}
},
"ConnectionDraining": {
"type": "structure",
"members": {
"Enabled": {
"type": "boolean"
},
"Timeout": {
"type": "integer"
}
}
}
}
}
}
}
},
"registerInstancesWithLoadBalancer": {
"name": "RegisterInstancesWithLoadBalancer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"Instances": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstanceId": {}
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Instances": {
"type": "list",
"members": {
"type": "structure",
"members": {
"InstanceId": {}
}
}
}
}
}
},
"setLoadBalancerListenerSSLCertificate": {
"name": "SetLoadBalancerListenerSSLCertificate",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"LoadBalancerPort": {
"type": "integer",
"required": true
},
"SSLCertificateId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setLoadBalancerPoliciesForBackendServer": {
"name": "SetLoadBalancerPoliciesForBackendServer",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"InstancePort": {
"type": "integer",
"required": true
},
"PolicyNames": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setLoadBalancerPoliciesOfListener": {
"name": "SetLoadBalancerPoliciesOfListener",
"input": {
"type": "structure",
"members": {
"LoadBalancerName": {
"required": true
},
"LoadBalancerPort": {
"type": "integer",
"required": true
},
"PolicyNames": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
}
},
"pagination": {
"describeInstanceHealth": {
"resultKey": "InstanceStates"
},
"describeLoadBalancerPolicies": {
"resultKey": "PolicyDescriptions"
},
"describeLoadBalancerPolicyTypes": {
"resultKey": "PolicyTypeDescriptions"
},
"describeLoadBalancers": {
"inputToken": "Marker",
"outputToken": "NextMarker",
"resultKey": "LoadBalancerDescriptions"
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,834 +0,0 @@
{
"format": "rest-json",
"apiVersion": "2012-06-01",
"checksumFormat": "sha256",
"endpointPrefix": "glacier",
"serviceFullName": "Amazon Glacier",
"signatureVersion": "v4",
"timestampFormat": "iso8601",
"operations": {
"abortMultipartUpload": {
"name": "AbortMultipartUpload",
"http": {
"method": "DELETE",
"uri": "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"uploadId": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"completeMultipartUpload": {
"name": "CompleteMultipartUpload",
"http": {
"method": "POST",
"uri": "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"uploadId": {
"location": "uri"
},
"archiveSize": {
"location": "header",
"name": "x-amz-archive-size"
},
"checksum": {
"location": "header",
"name": "x-amz-sha256-tree-hash"
}
}
},
"output": {
"type": "structure",
"members": {
"location": {
"location": "header",
"name": "Location"
},
"checksum": {
"location": "header",
"name": "x-amz-sha256-tree-hash"
},
"archiveId": {
"location": "header",
"name": "x-amz-archive-id"
}
}
}
},
"createVault": {
"name": "CreateVault",
"http": {
"method": "PUT",
"uri": "/{accountId}/vaults/{vaultName}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"location": {
"location": "header",
"name": "Location"
}
}
}
},
"deleteArchive": {
"name": "DeleteArchive",
"http": {
"method": "DELETE",
"uri": "/{accountId}/vaults/{vaultName}/archives/{archiveId}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"archiveId": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteVault": {
"name": "DeleteVault",
"http": {
"method": "DELETE",
"uri": "/{accountId}/vaults/{vaultName}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteVaultNotifications": {
"name": "DeleteVaultNotifications",
"http": {
"method": "DELETE",
"uri": "/{accountId}/vaults/{vaultName}/notification-configuration"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"describeJob": {
"name": "DescribeJob",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults/{vaultName}/jobs/{jobId}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"jobId": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"JobId": {},
"JobDescription": {},
"Action": {},
"ArchiveId": {},
"VaultARN": {},
"CreationDate": {},
"Completed": {
"type": "boolean"
},
"StatusCode": {},
"StatusMessage": {},
"ArchiveSizeInBytes": {
"type": "integer"
},
"InventorySizeInBytes": {
"type": "integer"
},
"SNSTopic": {},
"CompletionDate": {},
"SHA256TreeHash": {},
"ArchiveSHA256TreeHash": {},
"RetrievalByteRange": {},
"InventoryRetrievalParameters": {
"type": "structure",
"members": {
"Format": {},
"StartDate": {},
"EndDate": {},
"Limit": {},
"Marker": {}
}
}
}
}
},
"describeVault": {
"name": "DescribeVault",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults/{vaultName}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"VaultARN": {},
"VaultName": {},
"CreationDate": {},
"LastInventoryDate": {},
"NumberOfArchives": {
"type": "integer"
},
"SizeInBytes": {
"type": "integer"
}
}
}
},
"getJobOutput": {
"name": "GetJobOutput",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults/{vaultName}/jobs/{jobId}/output"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"jobId": {
"location": "uri"
},
"range": {
"location": "header",
"name": "Range"
}
}
},
"output": {
"type": "structure",
"members": {
"body": {
"type": "binary",
"streaming": true
},
"checksum": {
"location": "header",
"name": "x-amz-sha256-tree-hash"
},
"status": {
"type": "integer",
"location": "status"
},
"contentRange": {
"location": "header",
"name": "Content-Range"
},
"acceptRanges": {
"location": "header",
"name": "Accept-Ranges"
},
"contentType": {
"location": "header",
"name": "Content-Type"
},
"archiveDescription": {
"location": "header",
"name": "x-amz-archive-description"
}
},
"payload": "body"
}
},
"getVaultNotifications": {
"name": "GetVaultNotifications",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults/{vaultName}/notification-configuration"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"SNSTopic": {},
"Events": {
"type": "list",
"members": {}
}
}
}
},
"initiateJob": {
"name": "InitiateJob",
"http": {
"method": "POST",
"uri": "/{accountId}/vaults/{vaultName}/jobs"
},
"input": {
"payload": "jobParameters",
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"jobParameters": {
"type": "structure",
"members": {
"Format": {},
"Type": {},
"ArchiveId": {},
"Description": {},
"SNSTopic": {},
"RetrievalByteRange": {},
"InventoryRetrievalParameters": {
"type": "structure",
"members": {
"StartDate": {},
"EndDate": {},
"Limit": {},
"Marker": {}
}
}
}
}
}
},
"output": {
"type": "structure",
"members": {
"location": {
"location": "header",
"name": "Location"
},
"jobId": {
"location": "header",
"name": "x-amz-job-id"
}
}
}
},
"initiateMultipartUpload": {
"name": "InitiateMultipartUpload",
"http": {
"method": "POST",
"uri": "/{accountId}/vaults/{vaultName}/multipart-uploads"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"archiveDescription": {
"location": "header",
"name": "x-amz-archive-description"
},
"partSize": {
"location": "header",
"name": "x-amz-part-size"
}
}
},
"output": {
"type": "structure",
"members": {
"location": {
"location": "header",
"name": "Location"
},
"uploadId": {
"location": "header",
"name": "x-amz-multipart-upload-id"
}
}
}
},
"listJobs": {
"name": "ListJobs",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults/{vaultName}/jobs?marker={marker}&limit={limit}&completed={completed}&statuscode={statuscode}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"limit": {
"location": "uri"
},
"marker": {
"location": "uri"
},
"statuscode": {
"location": "uri"
},
"completed": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"JobList": {
"type": "list",
"members": {
"type": "structure",
"members": {
"JobId": {},
"JobDescription": {},
"Action": {},
"ArchiveId": {},
"VaultARN": {},
"CreationDate": {},
"Completed": {
"type": "boolean"
},
"StatusCode": {},
"StatusMessage": {},
"ArchiveSizeInBytes": {
"type": "integer"
},
"InventorySizeInBytes": {
"type": "integer"
},
"SNSTopic": {},
"CompletionDate": {},
"SHA256TreeHash": {},
"ArchiveSHA256TreeHash": {},
"RetrievalByteRange": {},
"InventoryRetrievalParameters": {
"type": "structure",
"members": {
"Format": {},
"StartDate": {},
"EndDate": {},
"Limit": {},
"Marker": {}
}
}
}
}
},
"Marker": {}
}
}
},
"listMultipartUploads": {
"name": "ListMultipartUploads",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults/{vaultName}/multipart-uploads?marker={marker}&limit={limit}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"limit": {
"location": "uri"
},
"marker": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"UploadsList": {
"type": "list",
"members": {
"type": "structure",
"members": {
"MultipartUploadId": {},
"VaultARN": {},
"ArchiveDescription": {},
"PartSizeInBytes": {
"type": "integer"
},
"CreationDate": {}
}
}
},
"Marker": {}
}
}
},
"listParts": {
"name": "ListParts",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}?marker={marker}&limit={limit}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"uploadId": {
"location": "uri"
},
"marker": {
"location": "uri"
},
"limit": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"MultipartUploadId": {},
"VaultARN": {},
"ArchiveDescription": {},
"PartSizeInBytes": {
"type": "integer"
},
"CreationDate": {},
"Parts": {
"type": "list",
"members": {
"type": "structure",
"members": {
"RangeInBytes": {},
"SHA256TreeHash": {}
}
}
},
"Marker": {}
}
}
},
"listVaults": {
"name": "ListVaults",
"http": {
"method": "GET",
"uri": "/{accountId}/vaults?marker={marker}&limit={limit}"
},
"input": {
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"marker": {
"location": "uri"
},
"limit": {
"location": "uri"
}
}
},
"output": {
"type": "structure",
"members": {
"VaultList": {
"type": "list",
"members": {
"type": "structure",
"members": {
"VaultARN": {},
"VaultName": {},
"CreationDate": {},
"LastInventoryDate": {},
"NumberOfArchives": {
"type": "integer"
},
"SizeInBytes": {
"type": "integer"
}
}
}
},
"Marker": {}
}
}
},
"setVaultNotifications": {
"name": "SetVaultNotifications",
"http": {
"method": "PUT",
"uri": "/{accountId}/vaults/{vaultName}/notification-configuration"
},
"input": {
"payload": "vaultNotificationConfig",
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"vaultNotificationConfig": {
"type": "structure",
"members": {
"SNSTopic": {},
"Events": {
"type": "list",
"members": {}
}
}
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"uploadArchive": {
"name": "UploadArchive",
"http": {
"method": "POST",
"uri": "/{accountId}/vaults/{vaultName}/archives"
},
"input": {
"payload": "body",
"type": "structure",
"members": {
"vaultName": {
"location": "uri"
},
"accountId": {
"location": "uri"
},
"archiveDescription": {
"location": "header",
"name": "x-amz-archive-description"
},
"checksum": {
"location": "header",
"name": "x-amz-sha256-tree-hash"
},
"body": {
"type": "binary",
"streaming": true
}
}
},
"output": {
"type": "structure",
"members": {
"location": {
"location": "header",
"name": "Location"
},
"checksum": {
"location": "header",
"name": "x-amz-sha256-tree-hash"
},
"archiveId": {
"location": "header",
"name": "x-amz-archive-id"
}
}
}
},
"uploadMultipartPart": {
"name": "UploadMultipartPart",
"http": {
"method": "PUT",
"uri": "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}"
},
"input": {
"payload": "body",
"type": "structure",
"members": {
"accountId": {
"location": "uri"
},
"vaultName": {
"location": "uri"
},
"uploadId": {
"location": "uri"
},
"checksum": {
"location": "header",
"name": "x-amz-sha256-tree-hash"
},
"range": {
"location": "header",
"name": "Content-Range"
},
"body": {
"type": "binary",
"streaming": true
}
}
},
"output": {
"type": "structure",
"members": {
"checksum": {
"location": "header",
"name": "x-amz-sha256-tree-hash"
}
}
}
}
},
"pagination": {
"listJobs": {
"inputToken": "marker",
"outputToken": "Marker",
"limitKey": "limit",
"resultKey": "JobList"
},
"listMultipartUploads": {
"inputToken": "marker",
"outputToken": "Marker",
"limitKey": "limit",
"resultKey": "UploadsList"
},
"listParts": {
"inputToken": "marker",
"outputToken": "Marker",
"limitKey": "limit",
"resultKey": "Parts"
},
"listVaults": {
"inputToken": "marker",
"outputToken": "Marker",
"limitKey": "limit",
"resultKey": "VaultList"
}
},
"waiters": {
"__default__": {
"interval": 3,
"maxAttempts": 15
},
"__VaultState": {
"operation": "DescribeVault"
},
"vaultExists": {
"extends": "__VaultState",
"ignoreErrors": [
"ResourceNotFoundException"
],
"successType": "output"
},
"vaultNotExists": {
"extends": "__VaultState",
"successType": "error",
"successValue": "ResourceNotFoundException"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,192 +0,0 @@
{
"format": "query",
"apiVersion": "2010-06-01",
"endpointPrefix": "importexport",
"globalEndpoint": "importexport.amazonaws.com",
"resultWrapped": true,
"serviceFullName": "AWS Import/Export",
"signatureVersion": "v2",
"timestampFormat": "iso8601",
"operations": {
"cancelJob": {
"name": "CancelJob",
"http": {
"method": "POST",
"uri": "/?Operation=CancelJob"
},
"input": {
"type": "structure",
"members": {
"JobId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Success": {
"type": "boolean"
}
}
}
},
"createJob": {
"name": "CreateJob",
"http": {
"method": "POST",
"uri": "/?Operation=CreateJob"
},
"input": {
"type": "structure",
"members": {
"JobType": {
"required": true
},
"Manifest": {
"required": true
},
"ManifestAddendum": {},
"ValidateOnly": {
"type": "boolean",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"JobId": {},
"JobType": {},
"AwsShippingAddress": {},
"Signature": {},
"SignatureFileContents": {},
"WarningMessage": {}
}
}
},
"getStatus": {
"name": "GetStatus",
"http": {
"method": "POST",
"uri": "/?Operation=GetStatus"
},
"input": {
"type": "structure",
"members": {
"JobId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"JobId": {},
"JobType": {},
"AwsShippingAddress": {},
"LocationCode": {},
"LocationMessage": {},
"ProgressCode": {},
"ProgressMessage": {},
"Carrier": {},
"TrackingNumber": {},
"LogBucket": {},
"LogKey": {},
"ErrorCount": {
"type": "integer"
},
"Signature": {},
"SignatureFileContents": {},
"CurrentManifest": {},
"CreationDate": {
"type": "timestamp"
}
}
}
},
"listJobs": {
"name": "ListJobs",
"http": {
"method": "POST",
"uri": "/?Operation=ListJobs"
},
"input": {
"type": "structure",
"members": {
"MaxJobs": {
"type": "integer"
},
"Marker": {}
}
},
"output": {
"type": "structure",
"members": {
"Jobs": {
"type": "list",
"members": {
"type": "structure",
"members": {
"JobId": {},
"CreationDate": {
"type": "timestamp"
},
"IsCanceled": {
"type": "boolean"
},
"JobType": {}
}
}
},
"IsTruncated": {
"type": "boolean"
}
}
}
},
"updateJob": {
"name": "UpdateJob",
"http": {
"method": "POST",
"uri": "/?Operation=UpdateJob"
},
"input": {
"type": "structure",
"members": {
"JobId": {
"required": true
},
"Manifest": {
"required": true
},
"JobType": {
"required": true
},
"ValidateOnly": {
"type": "boolean",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Success": {
"type": "boolean"
},
"WarningMessage": {}
}
}
}
},
"pagination": {
"listJobs": {
"inputToken": "Marker",
"outputToken": "Jobs[-1].JobId",
"moreResults": "IsTruncated",
"limitKey": "MaxJobs",
"resultKey": "Jobs"
}
}
}

View File

@ -1,275 +0,0 @@
{
"format": "json",
"apiVersion": "2013-12-02",
"endpointPrefix": "kinesis",
"jsonVersion": "1.1",
"serviceAbbreviation": "Kinesis",
"serviceFullName": "Amazon Kinesis",
"signatureVersion": "v4",
"targetPrefix": "Kinesis_20131202",
"timestampFormat": "iso8601",
"operations": {
"createStream": {
"name": "CreateStream",
"input": {
"type": "structure",
"members": {
"StreamName": {
"required": true
},
"ShardCount": {
"type": "integer",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteStream": {
"name": "DeleteStream",
"input": {
"type": "structure",
"members": {
"StreamName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"describeStream": {
"name": "DescribeStream",
"input": {
"type": "structure",
"members": {
"StreamName": {
"required": true
},
"Limit": {
"type": "integer"
},
"ExclusiveStartShardId": {}
}
},
"output": {
"type": "structure",
"members": {
"StreamDescription": {
"type": "structure",
"members": {
"StreamName": {},
"StreamARN": {},
"StreamStatus": {},
"Shards": {
"type": "list",
"members": {
"type": "structure",
"members": {
"ShardId": {},
"ParentShardId": {},
"AdjacentParentShardId": {},
"HashKeyRange": {
"type": "structure",
"members": {
"StartingHashKey": {},
"EndingHashKey": {}
}
},
"SequenceNumberRange": {
"type": "structure",
"members": {
"StartingSequenceNumber": {},
"EndingSequenceNumber": {}
}
}
}
}
},
"HasMoreShards": {
"type": "boolean"
}
}
}
}
}
},
"getRecords": {
"name": "GetRecords",
"input": {
"type": "structure",
"members": {
"ShardIterator": {
"required": true
},
"Limit": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Records": {
"type": "list",
"members": {
"type": "structure",
"members": {
"SequenceNumber": {},
"Data": {
"type": "base64"
},
"PartitionKey": {}
}
}
},
"NextShardIterator": {}
}
}
},
"getShardIterator": {
"name": "GetShardIterator",
"input": {
"type": "structure",
"members": {
"StreamName": {
"required": true
},
"ShardId": {
"required": true
},
"ShardIteratorType": {
"required": true
},
"StartingSequenceNumber": {}
}
},
"output": {
"type": "structure",
"members": {
"ShardIterator": {}
}
}
},
"listStreams": {
"name": "ListStreams",
"input": {
"type": "structure",
"members": {
"Limit": {
"type": "integer"
},
"ExclusiveStartStreamName": {}
}
},
"output": {
"type": "structure",
"members": {
"StreamNames": {
"type": "list",
"members": {}
},
"HasMoreStreams": {
"type": "boolean"
}
}
}
},
"mergeShards": {
"name": "MergeShards",
"input": {
"type": "structure",
"members": {
"StreamName": {
"required": true
},
"ShardToMerge": {
"required": true
},
"AdjacentShardToMerge": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"putRecord": {
"name": "PutRecord",
"input": {
"type": "structure",
"members": {
"StreamName": {
"required": true
},
"Data": {
"type": "base64",
"required": true
},
"PartitionKey": {
"required": true
},
"ExplicitHashKey": {},
"SequenceNumberForOrdering": {}
}
},
"output": {
"type": "structure",
"members": {
"ShardId": {},
"SequenceNumber": {}
}
}
},
"splitShard": {
"name": "SplitShard",
"input": {
"type": "structure",
"members": {
"StreamName": {
"required": true
},
"ShardToSplit": {
"required": true
},
"NewStartingHashKey": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
}
},
"pagination": {
"describeStream": {
"inputToken": "ExclusiveStartShardId",
"limitKey": "Limit",
"moreResults": "StreamDescription.HasMoreShards",
"outputToken": "StreamDescription.Shards[-1].ShardId",
"resultKey": "StreamDescription.Shards"
},
"getRecords": {
"inputToken": "ShardIterator",
"limitKey": "Limit",
"outputToken": "NextShardIterator",
"resultKey": "Records"
},
"listStreams": {
"inputToken": "ExclusiveStartStreamName",
"limitKey": "Limit",
"moreResults": "HasMoreStreams",
"outputToken": "StreamNames[-1]",
"resultKey": "StreamNames"
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,760 +0,0 @@
{
"format": "rest-xml",
"apiVersion": "2013-04-01",
"endpointPrefix": "route53",
"globalEndpoint": "route53.amazonaws.com",
"serviceAbbreviation": "Route 53",
"serviceFullName": "Amazon Route 53",
"signatureVersion": "v3https",
"timestampFormat": "iso8601",
"xmlnamespace": "https://route53.amazonaws.com/doc/2013-04-01/",
"operations": {
"changeResourceRecordSets": {
"name": "ChangeResourceRecordSets",
"http": {
"method": "POST",
"uri": "/2013-04-01/hostedzone/{HostedZoneId}/rrset/"
},
"input": {
"payload": [
"ChangeBatch"
],
"wrapper": "ChangeResourceRecordSetsRequest",
"type": "structure",
"members": {
"HostedZoneId": {
"required": true,
"location": "uri"
},
"ChangeBatch": {
"type": "structure",
"members": {
"Comment": {},
"Changes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Action": {
"required": true
},
"ResourceRecordSet": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Type": {
"required": true
},
"SetIdentifier": {},
"Weight": {
"type": "integer"
},
"Region": {},
"Failover": {},
"TTL": {
"type": "integer"
},
"ResourceRecords": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Value": {
"required": true
}
},
"order": [
"Value"
],
"name": "ResourceRecord"
}
},
"AliasTarget": {
"type": "structure",
"members": {
"HostedZoneId": {
"required": true
},
"DNSName": {
"required": true
},
"EvaluateTargetHealth": {
"type": "boolean",
"required": true
}
},
"order": [
"HostedZoneId",
"DNSName",
"EvaluateTargetHealth"
]
},
"HealthCheckId": {}
},
"order": [
"Name",
"Type",
"SetIdentifier",
"Weight",
"Region",
"Failover",
"TTL",
"ResourceRecords",
"AliasTarget",
"HealthCheckId"
],
"required": true
}
},
"order": [
"Action",
"ResourceRecordSet"
],
"name": "Change"
},
"required": true
}
},
"order": [
"Comment",
"Changes"
],
"required": true
}
},
"order": [
"HostedZoneId",
"ChangeBatch"
]
},
"output": {
"type": "structure",
"members": {
"ChangeInfo": {
"type": "structure",
"members": {
"Id": {},
"Status": {},
"SubmittedAt": {
"type": "timestamp"
},
"Comment": {}
}
}
}
}
},
"createHealthCheck": {
"name": "CreateHealthCheck",
"http": {
"method": "POST",
"uri": "/2013-04-01/healthcheck"
},
"input": {
"payload": [
"CallerReference",
"HealthCheckConfig"
],
"wrapper": "CreateHealthCheckRequest",
"type": "structure",
"members": {
"CallerReference": {
"required": true
},
"HealthCheckConfig": {
"type": "structure",
"members": {
"IPAddress": {
"required": true
},
"Port": {
"type": "integer"
},
"Type": {
"required": true
},
"ResourcePath": {},
"FullyQualifiedDomainName": {},
"SearchString": {},
"RequestInterval": {
"type": "integer"
},
"FailureThreshold": {
"type": "integer"
}
},
"order": [
"IPAddress",
"Port",
"Type",
"ResourcePath",
"FullyQualifiedDomainName",
"SearchString",
"RequestInterval",
"FailureThreshold"
],
"required": true
}
},
"order": [
"CallerReference",
"HealthCheckConfig"
]
},
"output": {
"type": "structure",
"members": {
"HealthCheck": {
"type": "structure",
"members": {
"Id": {},
"CallerReference": {},
"HealthCheckConfig": {
"type": "structure",
"members": {
"IPAddress": {},
"Port": {
"type": "integer"
},
"Type": {},
"ResourcePath": {},
"FullyQualifiedDomainName": {},
"SearchString": {},
"RequestInterval": {
"type": "integer"
},
"FailureThreshold": {
"type": "integer"
}
}
}
}
},
"Location": {
"location": "header",
"name": "Location"
}
}
}
},
"createHostedZone": {
"name": "CreateHostedZone",
"http": {
"method": "POST",
"uri": "/2013-04-01/hostedzone"
},
"input": {
"payload": [
"Name",
"CallerReference",
"HostedZoneConfig"
],
"wrapper": "CreateHostedZoneRequest",
"type": "structure",
"members": {
"Name": {
"required": true
},
"CallerReference": {
"required": true
},
"HostedZoneConfig": {
"type": "structure",
"members": {
"Comment": {}
},
"order": [
"Comment"
]
}
},
"order": [
"Name",
"CallerReference",
"HostedZoneConfig"
]
},
"output": {
"type": "structure",
"members": {
"HostedZone": {
"type": "structure",
"members": {
"Id": {},
"Name": {},
"CallerReference": {},
"Config": {
"type": "structure",
"members": {
"Comment": {}
}
},
"ResourceRecordSetCount": {
"type": "integer"
}
}
},
"ChangeInfo": {
"type": "structure",
"members": {
"Id": {},
"Status": {},
"SubmittedAt": {
"type": "timestamp"
},
"Comment": {}
}
},
"DelegationSet": {
"type": "structure",
"members": {
"NameServers": {
"type": "list",
"members": {
"name": "NameServer"
}
}
}
},
"Location": {
"location": "header",
"name": "Location"
}
}
}
},
"deleteHealthCheck": {
"name": "DeleteHealthCheck",
"http": {
"method": "DELETE",
"uri": "/2013-04-01/healthcheck/{HealthCheckId}"
},
"input": {
"type": "structure",
"members": {
"HealthCheckId": {
"required": true,
"location": "uri"
}
},
"order": [
"HealthCheckId"
]
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteHostedZone": {
"name": "DeleteHostedZone",
"http": {
"method": "DELETE",
"uri": "/2013-04-01/hostedzone/{Id}"
},
"input": {
"type": "structure",
"members": {
"Id": {
"required": true,
"location": "uri"
}
},
"order": [
"Id"
]
},
"output": {
"type": "structure",
"members": {
"ChangeInfo": {
"type": "structure",
"members": {
"Id": {},
"Status": {},
"SubmittedAt": {
"type": "timestamp"
},
"Comment": {}
}
}
}
}
},
"getChange": {
"name": "GetChange",
"http": {
"method": "GET",
"uri": "/2013-04-01/change/{Id}"
},
"input": {
"type": "structure",
"members": {
"Id": {
"required": true,
"location": "uri"
}
},
"order": [
"Id"
]
},
"output": {
"type": "structure",
"members": {
"ChangeInfo": {
"type": "structure",
"members": {
"Id": {},
"Status": {},
"SubmittedAt": {
"type": "timestamp"
},
"Comment": {}
}
}
}
}
},
"getHealthCheck": {
"name": "GetHealthCheck",
"http": {
"method": "GET",
"uri": "/2013-04-01/healthcheck/{HealthCheckId}"
},
"input": {
"type": "structure",
"members": {
"HealthCheckId": {
"required": true,
"location": "uri"
}
},
"order": [
"HealthCheckId"
]
},
"output": {
"type": "structure",
"members": {
"HealthCheck": {
"type": "structure",
"members": {
"Id": {},
"CallerReference": {},
"HealthCheckConfig": {
"type": "structure",
"members": {
"IPAddress": {},
"Port": {
"type": "integer"
},
"Type": {},
"ResourcePath": {},
"FullyQualifiedDomainName": {},
"SearchString": {},
"RequestInterval": {
"type": "integer"
},
"FailureThreshold": {
"type": "integer"
}
}
}
}
}
}
}
},
"getHostedZone": {
"name": "GetHostedZone",
"http": {
"method": "GET",
"uri": "/2013-04-01/hostedzone/{Id}"
},
"input": {
"type": "structure",
"members": {
"Id": {
"required": true,
"location": "uri"
}
},
"order": [
"Id"
]
},
"output": {
"type": "structure",
"members": {
"HostedZone": {
"type": "structure",
"members": {
"Id": {},
"Name": {},
"CallerReference": {},
"Config": {
"type": "structure",
"members": {
"Comment": {}
}
},
"ResourceRecordSetCount": {
"type": "integer"
}
}
},
"DelegationSet": {
"type": "structure",
"members": {
"NameServers": {
"type": "list",
"members": {
"name": "NameServer"
}
}
}
}
}
}
},
"listHealthChecks": {
"name": "ListHealthChecks",
"http": {
"method": "GET",
"uri": "/2013-04-01/healthcheck?marker={Marker}&maxitems={MaxItems}"
},
"input": {
"type": "structure",
"members": {
"Marker": {
"location": "uri"
},
"MaxItems": {
"location": "uri"
}
},
"order": [
"Marker",
"MaxItems"
]
},
"output": {
"type": "structure",
"members": {
"HealthChecks": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {},
"CallerReference": {},
"HealthCheckConfig": {
"type": "structure",
"members": {
"IPAddress": {},
"Port": {
"type": "integer"
},
"Type": {},
"ResourcePath": {},
"FullyQualifiedDomainName": {},
"SearchString": {},
"RequestInterval": {
"type": "integer"
},
"FailureThreshold": {
"type": "integer"
}
}
}
},
"name": "HealthCheck"
}
},
"Marker": {},
"IsTruncated": {
"type": "boolean"
},
"NextMarker": {},
"MaxItems": {}
}
}
},
"listHostedZones": {
"name": "ListHostedZones",
"http": {
"method": "GET",
"uri": "/2013-04-01/hostedzone?marker={Marker}&maxitems={MaxItems}"
},
"input": {
"type": "structure",
"members": {
"Marker": {
"location": "uri"
},
"MaxItems": {
"location": "uri"
}
},
"order": [
"Marker",
"MaxItems"
]
},
"output": {
"type": "structure",
"members": {
"HostedZones": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {},
"Name": {},
"CallerReference": {},
"Config": {
"type": "structure",
"members": {
"Comment": {}
}
},
"ResourceRecordSetCount": {
"type": "integer"
}
},
"name": "HostedZone"
}
},
"Marker": {},
"IsTruncated": {
"type": "boolean"
},
"NextMarker": {},
"MaxItems": {}
}
}
},
"listResourceRecordSets": {
"name": "ListResourceRecordSets",
"http": {
"method": "GET",
"uri": "/2013-04-01/hostedzone/{HostedZoneId}/rrset?type={StartRecordType}&name={StartRecordName}&identifier={StartRecordIdentifier}&maxitems={MaxItems}"
},
"input": {
"type": "structure",
"members": {
"HostedZoneId": {
"required": true,
"location": "uri"
},
"StartRecordName": {
"location": "uri"
},
"StartRecordType": {
"location": "uri"
},
"StartRecordIdentifier": {
"location": "uri"
},
"MaxItems": {
"location": "uri"
}
},
"order": [
"HostedZoneId",
"StartRecordName",
"StartRecordType",
"StartRecordIdentifier",
"MaxItems"
]
},
"output": {
"type": "structure",
"members": {
"ResourceRecordSets": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"Type": {},
"SetIdentifier": {},
"Weight": {
"type": "integer"
},
"Region": {},
"Failover": {},
"TTL": {
"type": "integer"
},
"ResourceRecords": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Value": {}
},
"name": "ResourceRecord"
}
},
"AliasTarget": {
"type": "structure",
"members": {
"HostedZoneId": {},
"DNSName": {},
"EvaluateTargetHealth": {
"type": "boolean"
}
}
},
"HealthCheckId": {}
},
"name": "ResourceRecordSet"
}
},
"IsTruncated": {
"type": "boolean"
},
"NextRecordName": {},
"NextRecordType": {},
"NextRecordIdentifier": {},
"MaxItems": {}
}
}
}
},
"pagination": {
"listHealthChecks": {
"inputToken": "Marker",
"outputToken": "NextMarker",
"moreResults": "IsTruncated",
"limitKey": "MaxItems",
"resultKey": "HealthChecks"
},
"listHostedZones": {
"inputToken": "Marker",
"outputToken": "NextMarker",
"moreResults": "IsTruncated",
"limitKey": "MaxItems",
"resultKey": "HostedZones"
},
"listResourceRecordSets": {
"moreResults": "IsTruncated",
"limitKey": "MaxItems",
"resultKey": "ResourceRecordSets",
"inputToken": [
"StartRecordName",
"StartRecordType",
"StartRecordIdentifier"
],
"outputToken": [
"NextRecordName",
"NextRecordType",
"NextRecordIdentifier"
]
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,490 +0,0 @@
{
"format": "query",
"apiVersion": "2010-12-01",
"endpointPrefix": "email",
"resultWrapped": true,
"serviceAbbreviation": "Amazon SES",
"serviceFullName": "Amazon Simple Email Service",
"signatureVersion": "v4",
"signingName": "ses",
"timestampFormat": "iso8601",
"operations": {
"deleteIdentity": {
"name": "DeleteIdentity",
"input": {
"type": "structure",
"members": {
"Identity": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteVerifiedEmailAddress": {
"name": "DeleteVerifiedEmailAddress",
"input": {
"type": "structure",
"members": {
"EmailAddress": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"getIdentityDkimAttributes": {
"name": "GetIdentityDkimAttributes",
"input": {
"type": "structure",
"members": {
"Identities": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"DkimAttributes": {
"type": "map",
"keys": {},
"members": {
"type": "structure",
"members": {
"DkimEnabled": {
"type": "boolean"
},
"DkimVerificationStatus": {},
"DkimTokens": {
"type": "list",
"members": {}
}
}
}
}
}
}
},
"getIdentityNotificationAttributes": {
"name": "GetIdentityNotificationAttributes",
"input": {
"type": "structure",
"members": {
"Identities": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"NotificationAttributes": {
"type": "map",
"keys": {},
"members": {
"type": "structure",
"members": {
"BounceTopic": {},
"ComplaintTopic": {},
"ForwardingEnabled": {
"type": "boolean"
}
}
}
}
}
}
},
"getIdentityVerificationAttributes": {
"name": "GetIdentityVerificationAttributes",
"input": {
"type": "structure",
"members": {
"Identities": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"VerificationAttributes": {
"type": "map",
"keys": {},
"members": {
"type": "structure",
"members": {
"VerificationStatus": {},
"VerificationToken": {}
}
}
}
}
}
},
"getSendQuota": {
"name": "GetSendQuota",
"input": {
"type": "structure",
"members": {}
},
"output": {
"type": "structure",
"members": {
"Max24HourSend": {
"type": "float"
},
"MaxSendRate": {
"type": "float"
},
"SentLast24Hours": {
"type": "float"
}
}
}
},
"getSendStatistics": {
"name": "GetSendStatistics",
"input": {
"type": "structure",
"members": {}
},
"output": {
"type": "structure",
"members": {
"SendDataPoints": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Timestamp": {
"type": "timestamp"
},
"DeliveryAttempts": {
"type": "integer"
},
"Bounces": {
"type": "integer"
},
"Complaints": {
"type": "integer"
},
"Rejects": {
"type": "integer"
}
}
}
}
}
}
},
"listIdentities": {
"name": "ListIdentities",
"input": {
"type": "structure",
"members": {
"IdentityType": {},
"NextToken": {},
"MaxItems": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Identities": {
"type": "list",
"members": {}
},
"NextToken": {}
}
}
},
"listVerifiedEmailAddresses": {
"name": "ListVerifiedEmailAddresses",
"input": {
"type": "structure",
"members": {}
},
"output": {
"type": "structure",
"members": {
"VerifiedEmailAddresses": {
"type": "list",
"members": {}
}
}
}
},
"sendEmail": {
"name": "SendEmail",
"input": {
"type": "structure",
"members": {
"Source": {
"required": true
},
"Destination": {
"type": "structure",
"members": {
"ToAddresses": {
"type": "list",
"members": {}
},
"CcAddresses": {
"type": "list",
"members": {}
},
"BccAddresses": {
"type": "list",
"members": {}
}
},
"required": true
},
"Message": {
"type": "structure",
"members": {
"Subject": {
"type": "structure",
"members": {
"Data": {
"required": true
},
"Charset": {}
},
"required": true
},
"Body": {
"type": "structure",
"members": {
"Text": {
"type": "structure",
"members": {
"Data": {
"required": true
},
"Charset": {}
}
},
"Html": {
"type": "structure",
"members": {
"Data": {
"required": true
},
"Charset": {}
}
}
},
"required": true
}
},
"required": true
},
"ReplyToAddresses": {
"type": "list",
"members": {}
},
"ReturnPath": {}
}
},
"output": {
"type": "structure",
"members": {
"MessageId": {}
}
}
},
"sendRawEmail": {
"name": "SendRawEmail",
"input": {
"type": "structure",
"members": {
"Source": {},
"Destinations": {
"type": "list",
"members": {}
},
"RawMessage": {
"type": "structure",
"members": {
"Data": {
"type": "base64",
"required": true
}
},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"MessageId": {}
}
}
},
"setIdentityDkimEnabled": {
"name": "SetIdentityDkimEnabled",
"input": {
"type": "structure",
"members": {
"Identity": {
"required": true
},
"DkimEnabled": {
"type": "boolean",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setIdentityFeedbackForwardingEnabled": {
"name": "SetIdentityFeedbackForwardingEnabled",
"input": {
"type": "structure",
"members": {
"Identity": {
"required": true
},
"ForwardingEnabled": {
"type": "boolean",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setIdentityNotificationTopic": {
"name": "SetIdentityNotificationTopic",
"input": {
"type": "structure",
"members": {
"Identity": {
"required": true
},
"NotificationType": {
"required": true
},
"SnsTopic": {}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"verifyDomainDkim": {
"name": "VerifyDomainDkim",
"input": {
"type": "structure",
"members": {
"Domain": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"DkimTokens": {
"type": "list",
"members": {}
}
}
}
},
"verifyDomainIdentity": {
"name": "VerifyDomainIdentity",
"input": {
"type": "structure",
"members": {
"Domain": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"VerificationToken": {}
}
}
},
"verifyEmailAddress": {
"name": "VerifyEmailAddress",
"input": {
"type": "structure",
"members": {
"EmailAddress": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"verifyEmailIdentity": {
"name": "VerifyEmailIdentity",
"input": {
"type": "structure",
"members": {
"EmailAddress": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
}
},
"pagination": {
"listIdentities": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"limitKey": "MaxItems",
"resultKey": "Identities"
},
"listVerifiedEmailAddresses": {
"resultKey": "VerifiedEmailAddresses"
}
},
"waiters": {
"__default__": {
"interval": 3,
"maxAttempts": 20
},
"identityExists": {
"operation": "GetIdentityVerificationAttributes",
"successType": "output",
"successPath": "VerificationAttributes[].VerificationStatus",
"successValue": true
}
}
}

View File

@ -1,585 +0,0 @@
{
"format": "query",
"apiVersion": "2010-03-31",
"endpointPrefix": "sns",
"resultWrapped": true,
"serviceAbbreviation": "Amazon SNS",
"serviceFullName": "Amazon Simple Notification Service",
"signatureVersion": "v4",
"timestampFormat": "iso8601",
"operations": {
"addPermission": {
"name": "AddPermission",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
},
"Label": {
"required": true
},
"AWSAccountId": {
"type": "list",
"members": {},
"required": true
},
"ActionName": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"confirmSubscription": {
"name": "ConfirmSubscription",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
},
"Token": {
"required": true
},
"AuthenticateOnUnsubscribe": {}
}
},
"output": {
"type": "structure",
"members": {
"SubscriptionArn": {}
}
}
},
"createPlatformApplication": {
"name": "CreatePlatformApplication",
"input": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Platform": {
"required": true
},
"Attributes": {
"type": "map",
"keys": {},
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"PlatformApplicationArn": {}
}
}
},
"createPlatformEndpoint": {
"name": "CreatePlatformEndpoint",
"input": {
"type": "structure",
"members": {
"PlatformApplicationArn": {
"required": true
},
"Token": {
"required": true
},
"CustomUserData": {},
"Attributes": {
"type": "map",
"keys": {},
"members": {}
}
}
},
"output": {
"type": "structure",
"members": {
"EndpointArn": {}
}
}
},
"createTopic": {
"name": "CreateTopic",
"input": {
"type": "structure",
"members": {
"Name": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"TopicArn": {}
}
}
},
"deleteEndpoint": {
"name": "DeleteEndpoint",
"input": {
"type": "structure",
"members": {
"EndpointArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deletePlatformApplication": {
"name": "DeletePlatformApplication",
"input": {
"type": "structure",
"members": {
"PlatformApplicationArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteTopic": {
"name": "DeleteTopic",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"getEndpointAttributes": {
"name": "GetEndpointAttributes",
"input": {
"type": "structure",
"members": {
"EndpointArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Attributes": {
"type": "map",
"keys": {},
"members": {}
}
}
}
},
"getPlatformApplicationAttributes": {
"name": "GetPlatformApplicationAttributes",
"input": {
"type": "structure",
"members": {
"PlatformApplicationArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Attributes": {
"type": "map",
"keys": {},
"members": {}
}
}
}
},
"getSubscriptionAttributes": {
"name": "GetSubscriptionAttributes",
"input": {
"type": "structure",
"members": {
"SubscriptionArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Attributes": {
"type": "map",
"keys": {},
"members": {}
}
}
}
},
"getTopicAttributes": {
"name": "GetTopicAttributes",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"Attributes": {
"type": "map",
"keys": {},
"members": {}
}
}
}
},
"listEndpointsByPlatformApplication": {
"name": "ListEndpointsByPlatformApplication",
"input": {
"type": "structure",
"members": {
"PlatformApplicationArn": {
"required": true
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"Endpoints": {
"type": "list",
"members": {
"type": "structure",
"members": {
"EndpointArn": {},
"Attributes": {
"type": "map",
"keys": {},
"members": {}
}
}
}
},
"NextToken": {}
}
}
},
"listPlatformApplications": {
"name": "ListPlatformApplications",
"input": {
"type": "structure",
"members": {
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"PlatformApplications": {
"type": "list",
"members": {
"type": "structure",
"members": {
"PlatformApplicationArn": {},
"Attributes": {
"type": "map",
"keys": {},
"members": {}
}
}
}
},
"NextToken": {}
}
}
},
"listSubscriptions": {
"name": "ListSubscriptions",
"input": {
"type": "structure",
"members": {
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"Subscriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"SubscriptionArn": {},
"Owner": {},
"Protocol": {},
"Endpoint": {},
"TopicArn": {}
}
}
},
"NextToken": {}
}
}
},
"listSubscriptionsByTopic": {
"name": "ListSubscriptionsByTopic",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"Subscriptions": {
"type": "list",
"members": {
"type": "structure",
"members": {
"SubscriptionArn": {},
"Owner": {},
"Protocol": {},
"Endpoint": {},
"TopicArn": {}
}
}
},
"NextToken": {}
}
}
},
"listTopics": {
"name": "ListTopics",
"input": {
"type": "structure",
"members": {
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"Topics": {
"type": "list",
"members": {
"type": "structure",
"members": {
"TopicArn": {}
}
}
},
"NextToken": {}
}
}
},
"publish": {
"name": "Publish",
"input": {
"type": "structure",
"members": {
"TopicArn": {},
"TargetArn": {},
"Message": {
"required": true
},
"Subject": {},
"MessageStructure": {}
}
},
"output": {
"type": "structure",
"members": {
"MessageId": {}
}
}
},
"removePermission": {
"name": "RemovePermission",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
},
"Label": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setEndpointAttributes": {
"name": "SetEndpointAttributes",
"input": {
"type": "structure",
"members": {
"EndpointArn": {
"required": true
},
"Attributes": {
"type": "map",
"keys": {},
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setPlatformApplicationAttributes": {
"name": "SetPlatformApplicationAttributes",
"input": {
"type": "structure",
"members": {
"PlatformApplicationArn": {
"required": true
},
"Attributes": {
"type": "map",
"keys": {},
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setSubscriptionAttributes": {
"name": "SetSubscriptionAttributes",
"input": {
"type": "structure",
"members": {
"SubscriptionArn": {
"required": true
},
"AttributeName": {
"required": true
},
"AttributeValue": {}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"setTopicAttributes": {
"name": "SetTopicAttributes",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
},
"AttributeName": {
"required": true
},
"AttributeValue": {}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"subscribe": {
"name": "Subscribe",
"input": {
"type": "structure",
"members": {
"TopicArn": {
"required": true
},
"Protocol": {
"required": true
},
"Endpoint": {}
}
},
"output": {
"type": "structure",
"members": {
"SubscriptionArn": {}
}
}
},
"unsubscribe": {
"name": "Unsubscribe",
"input": {
"type": "structure",
"members": {
"SubscriptionArn": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
}
},
"pagination": {
"listEndpointsByPlatformApplication": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "Endpoints"
},
"listPlatformApplications": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "PlatformApplications"
},
"listSubscriptions": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "Subscriptions"
},
"listSubscriptionsByTopic": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "Subscriptions"
},
"listTopics": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "Topics"
}
}
}

View File

@ -1,553 +0,0 @@
{
"format": "query",
"apiVersion": "2012-11-05",
"endpointPrefix": "sqs",
"resultWrapped": true,
"serviceAbbreviation": "Amazon SQS",
"serviceFullName": "Amazon Simple Queue Service",
"signatureVersion": "v4",
"timestampFormat": "iso8601",
"operations": {
"addPermission": {
"name": "AddPermission",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"Label": {
"required": true
},
"AWSAccountIds": {
"type": "list",
"members": {
"name": "AWSAccountId"
},
"flattened": true,
"required": true
},
"Actions": {
"type": "list",
"members": {
"name": "ActionName"
},
"flattened": true,
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"changeMessageVisibility": {
"name": "ChangeMessageVisibility",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"ReceiptHandle": {
"required": true
},
"VisibilityTimeout": {
"type": "integer",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"changeMessageVisibilityBatch": {
"name": "ChangeMessageVisibilityBatch",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"Entries": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {
"required": true
},
"ReceiptHandle": {
"required": true
},
"VisibilityTimeout": {
"type": "integer"
}
},
"name": "ChangeMessageVisibilityBatchRequestEntry"
},
"flattened": true,
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ChangeMessageVisibilityBatchResultEntry": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {}
},
"name": "ChangeMessageVisibilityBatchResultEntry"
},
"flattened": true,
"name": "Successful"
},
"BatchResultErrorEntry": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {},
"SenderFault": {
"type": "boolean"
},
"Code": {},
"Message": {}
},
"name": "BatchResultErrorEntry"
},
"flattened": true,
"name": "Failed"
}
}
}
},
"createQueue": {
"name": "CreateQueue",
"input": {
"type": "structure",
"members": {
"QueueName": {
"required": true
},
"Attributes": {
"type": "map",
"keys": {
"name": "Name"
},
"members": {
"name": "Value"
},
"flattened": true,
"name": "Attribute"
}
}
},
"output": {
"type": "structure",
"members": {
"QueueUrl": {}
}
}
},
"deleteMessage": {
"name": "DeleteMessage",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"ReceiptHandle": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteMessageBatch": {
"name": "DeleteMessageBatch",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"Entries": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {
"required": true
},
"ReceiptHandle": {
"required": true
}
},
"name": "DeleteMessageBatchRequestEntry"
},
"flattened": true,
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"DeleteMessageBatchResultEntry": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {}
},
"name": "DeleteMessageBatchResultEntry"
},
"flattened": true,
"name": "Successful"
},
"BatchResultErrorEntry": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {},
"SenderFault": {
"type": "boolean"
},
"Code": {},
"Message": {}
},
"name": "BatchResultErrorEntry"
},
"flattened": true,
"name": "Failed"
}
}
}
},
"deleteQueue": {
"name": "DeleteQueue",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"getQueueAttributes": {
"name": "GetQueueAttributes",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"AttributeNames": {
"type": "list",
"members": {
"name": "AttributeName"
},
"flattened": true
}
}
},
"output": {
"type": "structure",
"members": {
"Attribute": {
"type": "map",
"keys": {
"name": "Name"
},
"members": {
"name": "Value"
},
"flattened": true,
"name": "Attributes"
}
}
}
},
"getQueueUrl": {
"name": "GetQueueUrl",
"input": {
"type": "structure",
"members": {
"QueueName": {
"required": true
},
"QueueOwnerAWSAccountId": {}
}
},
"output": {
"type": "structure",
"members": {
"QueueUrl": {}
}
}
},
"listDeadLetterSourceQueues": {
"name": "ListDeadLetterSourceQueues",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"QueueUrl": {
"type": "list",
"members": {
"name": "QueueUrl"
},
"flattened": true,
"name": "queueUrls"
}
}
}
},
"listQueues": {
"name": "ListQueues",
"input": {
"type": "structure",
"members": {
"QueueNamePrefix": {}
}
},
"output": {
"type": "structure",
"members": {
"QueueUrl": {
"type": "list",
"members": {
"name": "QueueUrl"
},
"flattened": true,
"name": "QueueUrls"
}
}
}
},
"receiveMessage": {
"name": "ReceiveMessage",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"AttributeNames": {
"type": "list",
"members": {
"name": "AttributeName"
},
"flattened": true
},
"MaxNumberOfMessages": {
"type": "integer"
},
"VisibilityTimeout": {
"type": "integer"
},
"WaitTimeSeconds": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Message": {
"type": "list",
"members": {
"type": "structure",
"members": {
"MessageId": {},
"ReceiptHandle": {},
"MD5OfBody": {},
"Body": {},
"Attribute": {
"type": "map",
"keys": {
"name": "Name"
},
"members": {
"name": "Value"
},
"flattened": true,
"name": "Attributes"
}
},
"name": "Message"
},
"flattened": true,
"name": "Messages"
}
}
}
},
"removePermission": {
"name": "RemovePermission",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"Label": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"sendMessage": {
"name": "SendMessage",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"MessageBody": {
"required": true
},
"DelaySeconds": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"MD5OfMessageBody": {},
"MessageId": {}
}
}
},
"sendMessageBatch": {
"name": "SendMessageBatch",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"Entries": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {
"required": true
},
"MessageBody": {
"required": true
},
"DelaySeconds": {
"type": "integer"
}
},
"name": "SendMessageBatchRequestEntry"
},
"flattened": true,
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"SendMessageBatchResultEntry": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {},
"MessageId": {},
"MD5OfMessageBody": {}
},
"name": "SendMessageBatchResultEntry"
},
"flattened": true,
"name": "Successful"
},
"BatchResultErrorEntry": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Id": {},
"SenderFault": {
"type": "boolean"
},
"Code": {},
"Message": {}
},
"name": "BatchResultErrorEntry"
},
"flattened": true,
"name": "Failed"
}
}
}
},
"setQueueAttributes": {
"name": "SetQueueAttributes",
"input": {
"type": "structure",
"members": {
"QueueUrl": {
"required": true
},
"Attributes": {
"type": "map",
"keys": {
"name": "Name"
},
"members": {
"name": "Value"
},
"flattened": true,
"name": "Attribute",
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
}
},
"pagination": {
"listQueues": {
"resultKey": "QueueUrls"
}
}
}

View File

@ -1,243 +0,0 @@
{
"format": "query",
"apiVersion": "2011-06-15",
"endpointPrefix": "sts",
"globalEndpoint": "sts.amazonaws.com",
"resultWrapped": true,
"serviceAbbreviation": "AWS STS",
"serviceFullName": "AWS Security Token Service",
"signatureVersion": "v4",
"timestampFormat": "iso8601",
"operations": {
"assumeRole": {
"name": "AssumeRole",
"input": {
"type": "structure",
"members": {
"RoleArn": {
"required": true
},
"RoleSessionName": {
"required": true
},
"Policy": {},
"DurationSeconds": {
"type": "integer"
},
"ExternalId": {},
"SerialNumber": {},
"TokenCode": {}
}
},
"output": {
"type": "structure",
"members": {
"Credentials": {
"type": "structure",
"members": {
"AccessKeyId": {},
"SecretAccessKey": {},
"SessionToken": {},
"Expiration": {
"type": "timestamp"
}
}
},
"AssumedRoleUser": {
"type": "structure",
"members": {
"AssumedRoleId": {},
"Arn": {}
}
},
"PackedPolicySize": {
"type": "integer"
}
}
}
},
"assumeRoleWithSAML": {
"name": "AssumeRoleWithSAML",
"input": {
"type": "structure",
"members": {
"RoleArn": {
"required": true
},
"PrincipalArn": {
"required": true
},
"SAMLAssertion": {
"required": true
},
"Policy": {},
"DurationSeconds": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Credentials": {
"type": "structure",
"members": {
"AccessKeyId": {},
"SecretAccessKey": {},
"SessionToken": {},
"Expiration": {
"type": "timestamp"
}
}
},
"AssumedRoleUser": {
"type": "structure",
"members": {
"AssumedRoleId": {},
"Arn": {}
}
},
"PackedPolicySize": {
"type": "integer"
}
}
}
},
"assumeRoleWithWebIdentity": {
"name": "AssumeRoleWithWebIdentity",
"input": {
"type": "structure",
"members": {
"RoleArn": {
"required": true
},
"RoleSessionName": {
"required": true
},
"WebIdentityToken": {
"required": true
},
"ProviderId": {},
"Policy": {},
"DurationSeconds": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Credentials": {
"type": "structure",
"members": {
"AccessKeyId": {},
"SecretAccessKey": {},
"SessionToken": {},
"Expiration": {
"type": "timestamp"
}
}
},
"SubjectFromWebIdentityToken": {},
"AssumedRoleUser": {
"type": "structure",
"members": {
"AssumedRoleId": {},
"Arn": {}
}
},
"PackedPolicySize": {
"type": "integer"
}
}
}
},
"decodeAuthorizationMessage": {
"name": "DecodeAuthorizationMessage",
"input": {
"type": "structure",
"members": {
"EncodedMessage": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"DecodedMessage": {}
}
}
},
"getFederationToken": {
"name": "GetFederationToken",
"input": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Policy": {},
"DurationSeconds": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Credentials": {
"type": "structure",
"members": {
"AccessKeyId": {},
"SecretAccessKey": {},
"SessionToken": {},
"Expiration": {
"type": "timestamp"
}
}
},
"FederatedUser": {
"type": "structure",
"members": {
"FederatedUserId": {},
"Arn": {}
}
},
"PackedPolicySize": {
"type": "integer"
}
}
}
},
"getSessionToken": {
"name": "GetSessionToken",
"input": {
"type": "structure",
"members": {
"DurationSeconds": {
"type": "integer"
},
"SerialNumber": {},
"TokenCode": {}
}
},
"output": {
"type": "structure",
"members": {
"Credentials": {
"type": "structure",
"members": {
"AccessKeyId": {},
"SecretAccessKey": {},
"SessionToken": {},
"Expiration": {
"type": "timestamp"
}
}
}
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,402 +0,0 @@
{
"format": "query",
"apiVersion": "2009-04-15",
"endpointPrefix": "sdb",
"resultWrapped": true,
"serviceFullName": "Amazon SimpleDB",
"signatureVersion": "v2",
"timestampFormat": "iso8601",
"operations": {
"batchDeleteAttributes": {
"name": "BatchDeleteAttributes",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
},
"Items": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true,
"name": "ItemName"
},
"Attributes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"AlternateNameEncoding": {},
"Value": {
"required": true
},
"AlternateValueEncoding": {}
},
"name": "Attribute"
},
"flattened": true
}
},
"name": "Item"
},
"flattened": true,
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"batchPutAttributes": {
"name": "BatchPutAttributes",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
},
"Items": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true,
"name": "ItemName"
},
"Attributes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Value": {
"required": true
},
"Replace": {
"type": "boolean"
}
},
"name": "Attribute"
},
"flattened": true,
"required": true
}
},
"name": "Item"
},
"flattened": true,
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"createDomain": {
"name": "CreateDomain",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteAttributes": {
"name": "DeleteAttributes",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
},
"ItemName": {
"required": true
},
"Attributes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"AlternateNameEncoding": {},
"Value": {
"required": true
},
"AlternateValueEncoding": {}
},
"name": "Attribute"
},
"flattened": true
},
"Expected": {
"type": "structure",
"members": {
"Name": {},
"Value": {},
"Exists": {
"type": "boolean"
}
}
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"deleteDomain": {
"name": "DeleteDomain",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"domainMetadata": {
"name": "DomainMetadata",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"ItemCount": {
"type": "integer"
},
"ItemNamesSizeBytes": {
"type": "integer"
},
"AttributeNameCount": {
"type": "integer"
},
"AttributeNamesSizeBytes": {
"type": "integer"
},
"AttributeValueCount": {
"type": "integer"
},
"AttributeValuesSizeBytes": {
"type": "integer"
},
"Timestamp": {
"type": "integer"
}
}
}
},
"getAttributes": {
"name": "GetAttributes",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
},
"ItemName": {
"required": true
},
"AttributeNames": {
"type": "list",
"members": {
"name": "AttributeName"
},
"flattened": true
},
"ConsistentRead": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {
"Attribute": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"AlternateNameEncoding": {},
"Value": {},
"AlternateValueEncoding": {}
},
"name": "Attribute"
},
"flattened": true,
"name": "Attributes"
}
}
}
},
"listDomains": {
"name": "ListDomains",
"input": {
"type": "structure",
"members": {
"MaxNumberOfDomains": {
"type": "integer"
},
"NextToken": {}
}
},
"output": {
"type": "structure",
"members": {
"DomainName": {
"type": "list",
"members": {
"name": "DomainName"
},
"flattened": true,
"name": "DomainNames"
},
"NextToken": {}
}
}
},
"putAttributes": {
"name": "PutAttributes",
"input": {
"type": "structure",
"members": {
"DomainName": {
"required": true
},
"ItemName": {
"required": true
},
"Attributes": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {
"required": true
},
"Value": {
"required": true
},
"Replace": {
"type": "boolean"
}
},
"name": "Attribute"
},
"flattened": true,
"required": true
},
"Expected": {
"type": "structure",
"members": {
"Name": {},
"Value": {},
"Exists": {
"type": "boolean"
}
}
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"select": {
"name": "Select",
"input": {
"type": "structure",
"members": {
"SelectExpression": {
"required": true
},
"NextToken": {},
"ConsistentRead": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {
"Item": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"AlternateNameEncoding": {},
"Attribute": {
"type": "list",
"members": {
"type": "structure",
"members": {
"Name": {},
"AlternateNameEncoding": {},
"Value": {},
"AlternateValueEncoding": {}
},
"name": "Attribute"
},
"flattened": true,
"name": "Attributes"
}
},
"name": "Item"
},
"flattened": true,
"name": "Items"
},
"NextToken": {}
}
}
}
},
"pagination": {
"listDomains": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"limitKey": "MaxNumberOfDomains",
"resultKey": "DomainNames"
},
"select": {
"inputToken": "NextToken",
"outputToken": "NextToken",
"resultKey": "Items"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,500 +0,0 @@
{
"format": "json",
"apiVersion": "2013-04-15",
"endpointPrefix": "support",
"jsonVersion": "1.1",
"serviceFullName": "AWS Support",
"signatureVersion": "v4",
"targetPrefix": "AWSSupport_20130415",
"timestampFormat": "iso8601",
"operations": {
"addCommunicationToCase": {
"name": "AddCommunicationToCase",
"input": {
"type": "structure",
"members": {
"caseId": {},
"communicationBody": {
"required": true
},
"ccEmailAddresses": {
"type": "list",
"members": {}
}
}
},
"output": {
"type": "structure",
"members": {
"result": {
"type": "boolean"
}
}
}
},
"createCase": {
"name": "CreateCase",
"input": {
"type": "structure",
"members": {
"subject": {
"required": true
},
"serviceCode": {},
"severityCode": {},
"categoryCode": {},
"communicationBody": {
"required": true
},
"ccEmailAddresses": {
"type": "list",
"members": {}
},
"language": {},
"issueType": {}
}
},
"output": {
"type": "structure",
"members": {
"caseId": {}
}
}
},
"describeCases": {
"name": "DescribeCases",
"input": {
"type": "structure",
"members": {
"caseIdList": {
"type": "list",
"members": {}
},
"displayId": {},
"afterTime": {},
"beforeTime": {},
"includeResolvedCases": {
"type": "boolean"
},
"nextToken": {},
"maxResults": {
"type": "integer"
},
"language": {}
}
},
"output": {
"type": "structure",
"members": {
"cases": {
"type": "list",
"members": {
"type": "structure",
"members": {
"caseId": {},
"displayId": {},
"subject": {},
"status": {},
"serviceCode": {},
"categoryCode": {},
"severityCode": {},
"submittedBy": {},
"timeCreated": {},
"recentCommunications": {
"type": "structure",
"members": {
"communications": {
"type": "list",
"members": {
"type": "structure",
"members": {
"caseId": {},
"body": {},
"submittedBy": {},
"timeCreated": {}
}
}
},
"nextToken": {}
}
},
"ccEmailAddresses": {
"type": "list",
"members": {}
},
"language": {}
}
}
},
"nextToken": {}
}
}
},
"describeCommunications": {
"name": "DescribeCommunications",
"input": {
"type": "structure",
"members": {
"caseId": {
"required": true
},
"beforeTime": {},
"afterTime": {},
"nextToken": {},
"maxResults": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"communications": {
"type": "list",
"members": {
"type": "structure",
"members": {
"caseId": {},
"body": {},
"submittedBy": {},
"timeCreated": {}
}
}
},
"nextToken": {}
}
}
},
"describeServices": {
"name": "DescribeServices",
"input": {
"type": "structure",
"members": {
"serviceCodeList": {
"type": "list",
"members": {}
},
"language": {}
}
},
"output": {
"type": "structure",
"members": {
"services": {
"type": "list",
"members": {
"type": "structure",
"members": {
"code": {},
"name": {},
"categories": {
"type": "list",
"members": {
"type": "structure",
"members": {
"code": {},
"name": {}
}
}
}
}
}
}
}
}
},
"describeSeverityLevels": {
"name": "DescribeSeverityLevels",
"input": {
"type": "structure",
"members": {
"language": {}
}
},
"output": {
"type": "structure",
"members": {
"severityLevels": {
"type": "list",
"members": {
"type": "structure",
"members": {
"code": {},
"name": {}
}
}
}
}
}
},
"describeTrustedAdvisorCheckRefreshStatuses": {
"name": "DescribeTrustedAdvisorCheckRefreshStatuses",
"input": {
"type": "structure",
"members": {
"checkIds": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"statuses": {
"type": "list",
"members": {
"type": "structure",
"members": {
"checkId": {},
"status": {},
"millisUntilNextRefreshable": {
"type": "integer"
}
}
}
}
}
}
},
"describeTrustedAdvisorCheckResult": {
"name": "DescribeTrustedAdvisorCheckResult",
"input": {
"type": "structure",
"members": {
"checkId": {
"required": true
},
"language": {}
}
},
"output": {
"type": "structure",
"members": {
"result": {
"type": "structure",
"members": {
"checkId": {},
"timestamp": {},
"status": {},
"resourcesSummary": {
"type": "structure",
"members": {
"resourcesProcessed": {
"type": "integer"
},
"resourcesFlagged": {
"type": "integer"
},
"resourcesIgnored": {
"type": "integer"
},
"resourcesSuppressed": {
"type": "integer"
}
}
},
"categorySpecificSummary": {
"type": "structure",
"members": {
"costOptimizing": {
"type": "structure",
"members": {
"estimatedMonthlySavings": {
"type": "float"
},
"estimatedPercentMonthlySavings": {
"type": "float"
}
}
}
}
},
"flaggedResources": {
"type": "list",
"members": {
"type": "structure",
"members": {
"status": {},
"region": {},
"resourceId": {},
"isSuppressed": {
"type": "boolean"
},
"metadata": {
"type": "list",
"members": {}
}
}
}
}
}
}
}
}
},
"describeTrustedAdvisorCheckSummaries": {
"name": "DescribeTrustedAdvisorCheckSummaries",
"input": {
"type": "structure",
"members": {
"checkIds": {
"type": "list",
"members": {},
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"summaries": {
"type": "list",
"members": {
"type": "structure",
"members": {
"checkId": {},
"timestamp": {},
"status": {},
"hasFlaggedResources": {
"type": "boolean"
},
"resourcesSummary": {
"type": "structure",
"members": {
"resourcesProcessed": {
"type": "integer"
},
"resourcesFlagged": {
"type": "integer"
},
"resourcesIgnored": {
"type": "integer"
},
"resourcesSuppressed": {
"type": "integer"
}
}
},
"categorySpecificSummary": {
"type": "structure",
"members": {
"costOptimizing": {
"type": "structure",
"members": {
"estimatedMonthlySavings": {
"type": "float"
},
"estimatedPercentMonthlySavings": {
"type": "float"
}
}
}
}
}
}
}
}
}
}
},
"describeTrustedAdvisorChecks": {
"name": "DescribeTrustedAdvisorChecks",
"input": {
"type": "structure",
"members": {
"language": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"checks": {
"type": "list",
"members": {
"type": "structure",
"members": {
"id": {},
"name": {},
"description": {},
"category": {},
"metadata": {
"type": "list",
"members": {}
}
}
}
}
}
}
},
"refreshTrustedAdvisorCheck": {
"name": "RefreshTrustedAdvisorCheck",
"input": {
"type": "structure",
"members": {
"checkId": {
"required": true
}
}
},
"output": {
"type": "structure",
"members": {
"status": {
"type": "structure",
"members": {
"checkId": {},
"status": {},
"millisUntilNextRefreshable": {
"type": "integer"
}
}
}
}
}
},
"resolveCase": {
"name": "ResolveCase",
"input": {
"type": "structure",
"members": {
"caseId": {}
}
},
"output": {
"type": "structure",
"members": {
"initialCaseStatus": {},
"finalCaseStatus": {}
}
}
}
},
"pagination": {
"describeCases": {
"inputToken": "nextToken",
"outputToken": "nextToken",
"limitKey": "maxResults",
"resultKey": "cases"
},
"describeCommunications": {
"inputToken": "nextToken",
"outputToken": "nextToken",
"limitKey": "maxResults",
"resultKey": "communications"
},
"describeServices": {
"resultKey": "services"
},
"describeTrustedAdvisorCheckRefreshStatuses": {
"resultKey": "statuses"
},
"describeTrustedAdvisorCheckSummaries": {
"resultKey": "summaries"
}
}
}

View File

@ -1,5 +0,0 @@
{
"CloudFront": ["2013-05-12*"],
"EC2": ["2013-06-15*", "2013-10-15*"],
"ElastiCache": ["2012-11-15*"]
}

View File

@ -1,86 +0,0 @@
var fs = require('fs');
var apiRoot = __dirname + '/apis';
var serviceMap = null;
var serviceIdentifiers = [];
var serviceNames = [];
function buildServiceMap() {
if (serviceMap !== null) return;
// load symlinks file for API versions that have been removed from disk but
// are still referenceable in code.
var symlinksFile = apiRoot + '/symlinks.json';
var symlinks = JSON.parse(fs.readFileSync(symlinksFile).toString());
// create a map of each service name to its list of versions
serviceMap = {};
fs.readdirSync(apiRoot).forEach(function (file) {
var match = file.match(/^([^-]+)-(\d+-\d+-\d+)\.json$/);
if (match) {
var svcName = match[1], version = match[2];
var svcIdentifier = svcName.toLowerCase();
if (!serviceMap[svcIdentifier]) { // build the base service values
// add versions from symlinks, if any
var versions = symlinks[svcName] || [];
serviceMap[svcIdentifier] = { name: svcName, versions: versions };
}
serviceMap[svcIdentifier].versions.push(version);
}
});
Object.keys(serviceMap).forEach(function(identifier) {
serviceMap[identifier].versions = serviceMap[identifier].versions.sort();
serviceIdentifiers.push(identifier);
serviceNames.push(serviceMap[identifier].name);
});
}
function getServices() {
buildServiceMap();
return serviceIdentifiers;
}
function getServiceNames() {
buildServiceMap();
return serviceNames;
}
function serviceVersions(svc) {
buildServiceMap();
svc = serviceIdentifier(svc);
return serviceMap[svc] ? serviceMap[svc].versions : null;
}
function serviceName(svc) {
buildServiceMap();
svc = serviceIdentifier(svc);
return serviceMap[svc] ? serviceMap[svc].name : null;
}
function serviceFile(svc, version) {
buildServiceMap();
svc = serviceIdentifier(svc);
if (!serviceMap[svc]) return null;
return apiRoot + '/' + serviceMap[svc].name + '-' + version + '.json';
}
function serviceIdentifier(svc) {
return svc.toLowerCase();
}
module.exports = {
serviceVersions: serviceVersions,
serviceName: serviceName,
serviceIdentifier: serviceIdentifier,
serviceFile: serviceFile
};
Object.defineProperty(module.exports, 'services', {
enumerable: true, get: getServices
});
Object.defineProperty(module.exports, 'serviceNames', {
enumerable: true, get: getServiceNames
});

View File

@ -1,377 +0,0 @@
/* global Buffer: true */
/* eslint camelcase:0 */
var Buffer = require('buffer').Buffer;
/* A couple of utility methods */
var abort = {};
function each(obj, iter) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
var ret = iter(key, obj[key]);
if (ret === abort) break;
}
}
}
function copy(object) {
if (object === null || object === undefined) return object;
var dupe = {};
for (var key in object) {
dupe[key] = object[key];
}
return dupe;
}
function update(a, b) {
each(b, function iterator(key, value) { a[key] = value; });
return a;
}
function merge(a, b) {
return update(copy(a), b);
}
/* End utility methods */
function Shape(rules, options) {
if (!rules) {
this.rules = { type: 'structure', members: {} };
return;
}
this.options = options;
this.rules = {};
this.set_type(rules.type);
each(rules, function(key, value) {
if (key !== 'type') this['set_' + key](value);
}.bind(this));
if (this.rules.type === 'blob') {
if (this.rules.payload || this.rules.streaming) {
this.rules.type = 'binary';
} else {
this.rules.type = 'base64';
}
}
}
function InputShape(rules, options) {
Shape.call(this, rules, options);
}
function OutputShape(rules, options) {
Shape.call(this, rules, options);
}
/**
* @api private
*/
Shape.prototype = {
shapeClass: function() {
if (this instanceof InputShape) return InputShape;
if (this instanceof OutputShape) return OutputShape;
},
xmlname: function() {
if (this.rules.flattened) {
return this._xmlname || (this.rules.members || {}).name;
} else {
return this._xmlname;
}
},
set_type: function(name) {
var types = {
structure: 'structure',
list: 'list',
map: 'map',
boolean: 'boolean',
timestamp: 'timestamp',
character: 'string',
double: 'float',
float: 'float',
integer: 'integer',
long: 'integer',
short: 'integer',
string: 'string',
blob: 'blob',
biginteger: 'integer',
bigdecimal: 'float'
};
if (name === 'string') { // omit string to reduce size
return;
} else if (types[name]) {
this.rules.type = types[name];
} else {
throw new Error('unhandled shape type ' + name);
}
},
set_members: function(members) {
var type = this.rules.type;
var ShapeClass = this.shapeClass();
if (type === 'structure') {
this.rules.members = {};
each(members, function(memberName, memberRules) {
var shape = new ShapeClass(memberRules, this.options);
if (this.swapNames(shape)) {
shape.rules.name = memberName;
memberName = shape.xmlname();
}
this.rules.members[memberName] = shape.rules;
}.bind(this));
} else if (type === 'list') {
this.rules.members = new ShapeClass(members, this.options).rules;
} else if (type === 'map') {
this.rules.members = new ShapeClass(members, this.options).rules;
} else if (type === 'blob') {
this.rules.members = {};
} else {
throw new Error('unhandled complex shape `' + type + '\'');
}
},
set_keys: function(rules) {
var ShapeClass = this.shapeClass();
this.rules.keys = new ShapeClass(rules, this.options).rules;
},
set_timestamp_format: function(format) {
this.rules.format = format;
},
set_xmlname: function(name) {
this._xmlname = name;
this.rules.name = name;
},
set_location: function (location) {
this.rules.location = (location === 'http_status' ? 'status' : location);
},
set_location_name: function(header_name) {
this.rules.name = header_name;
},
set_payload: function(state) {
if (state) this.rules.payload = true;
},
set_flattened: function(state) {
if (state) this.rules.flattened = true;
},
set_streaming: function(state) {
if (state) this.rules.streaming = true;
},
set_xmlattribute: function(state) {
if (state) this.rules.attribute = true;
},
set_xmlnamespace: function(ns) {
this.rules.xmlns = ns;
},
set_documentation: function(docs) {
if (this.options.documentation) this.rules.documentation = docs;
},
set_enum: function(values) {
if (this.options.documentation) this.rules['enum'] = values;
},
set_wrapper: function() {},
set_shape_name: function() {},
set_box: function() {},
set_sensitive: function() {}
};
InputShape.prototype = merge(Shape.prototype, {
swapNames: function() { return false; },
set_required: function() { this.rules.required = true; },
set_member_order: function(order) { this.rules.order = order; },
set_min_length: function(min) {
if (this.options.documentation) this.rules.min_length = min;
},
set_max_length: function(max) {
if (this.options.documentation) this.rules.max_length = max;
},
set_pattern: function(pattern) {
if (this.options.documentation) this.rules.pattern = pattern;
}
});
OutputShape.prototype = merge(Shape.prototype, {
swapNames: function(shape) {
if (this.options.documentation) return false;
return shape.xmlname() && ['query', 'rest-xml'].indexOf(this.options.type) >= 0;
},
set_required: function() {},
set_member_order: function() {},
set_min_length: function() {},
set_max_length: function() {},
set_pattern: function() {}
});
function Operation(rules, options) {
var origRules = rules;
function normalizeInputs() {
if (options.type.indexOf('rest') < 0) return;
var xml = options.type.indexOf('xml') >= 0;
var payload = false;
var wrapper = false;
var hasPayload = false;
each(rules.input.members, function(name, rule) {
if (rule.payload) {
hasPayload = true;
payload = name;
delete rule.payload;
return abort;
}
});
if (!hasPayload) {
var list = [];
each(rules.input.members, function(name, rule) {
if (!rule.location) { list.push(name); }
});
if (list.length > 0) {
payload = list;
if (xml) wrapper = origRules.input.shape_name;
}
}
if (wrapper) rules.input = merge({wrapper: wrapper}, rules.input);
if (payload) rules.input = merge({payload: payload}, rules.input);
}
function normalizeOutputs() {
var moveUp = null;
each(rules.output.members, function(memberName, rule) {
if (rule.payload && rule.type === 'structure') {
delete rule.payload;
moveUp = memberName;
}
else if (rule.payload || rule.streaming) {
delete rule.payload;
rules.output.payload = memberName;
}
});
if (moveUp) {
var rule = rules.output.members[moveUp];
delete rules.output.members[moveUp];
update(rules.output.members, rule.members);
}
}
rules = copy(rules);
rules.input = new InputShape(rules.input, options).rules;
rules.output = new OutputShape(rules.output, options).rules;
rules.input.members = rules.input.members || {};
rules.output.members = rules.output.members || {};
normalizeInputs();
normalizeOutputs();
if (rules.http) delete rules.http.response_code;
if (options.documentation) {
rules.errors = rules.errors.map(function(e) { return e.shape_name; });
} else {
delete rules.errors;
delete rules.documentation;
delete rules.documentation_url;
delete rules.response_code;
}
return rules;
}
function Translator(api, options) {
var translate = {};
function inflect(key) {
return key.replace(/_(\w)/g, function (_, m) { return m.toUpperCase(); });
}
function setTranslatedKeys() {
var list = Object.keys(api);
list.push('timestamp_format');
list.sort().forEach(function (key) { translate[inflect(key)] = api[key]; });
translate.timestampFormat = translate.timestampFormat || 'iso8601';
if (translate.jsonVersion) translate.jsonVersion = translate.jsonVersion.toString();
if (translate.jsonVersion === '1') translate.jsonVersion = '1.0';
if (!options.documentation) delete translate.documentation;
if (!translate.resultWrapped) delete translate.resultWrapped;
if (!api.type.match(/xml/)) delete translate.xmlnamespace;
delete translate.operations;
delete translate.pagination;
delete translate.waiters;
delete translate.type;
}
function setOperations() {
translate.operations = {};
each(api.operations, function (key, value) {
var methodName = key[0].toLowerCase() + key.substr(1);
methodName = methodName.replace(/\d{4}_\d{2}_\d{2}$/, '');
var operation = new Operation(value, options);
translate.operations[methodName] = operation;
});
}
function setPagination() {
if (api.pagination) {
translate.pagination = {};
each(api.pagination, function (key, value) {
var object = {};
each(value, function (k2, v2) { object[inflect(k2)] = v2; });
translate.pagination[key[0].toLowerCase() + key.substr(1)] = object;
});
}
}
function setWaiters() {
if (api.waiters) {
translate.waiters = {};
each(api.waiters, function (key, value) {
var object = {};
each(value, function (k2, v2) { object[inflect(k2)] = v2; });
translate.waiters[key[0].toLowerCase() + key.substr(1)] = object;
});
}
}
if (typeof api === 'string' || Buffer.isBuffer(api)) {
api = JSON.parse(api);
}
options = options || {};
options.type = api.type;
translate.format = api.type;
setTranslatedKeys();
setOperations();
setPagination();
setWaiters();
return translate;
}
module.exports = Translator;

View File

@ -1,43 +0,0 @@
{
"name": "aws-sdk-apis",
"description": "AWS SDK for JavaScript APIs",
"version": "2.0.5",
"author": {
"name": "Amazon Web Services",
"url": "http://aws.amazon.com/"
},
"homepage": "https://github.com/aws/aws-sdk-js",
"contributors": [
{
"name": "Loren Segal",
"email": "lsegal@amazon.com"
}
],
"repository": {
"type": "git",
"url": "git://github.com/aws/aws-sdk-js-apis"
},
"bugs": {
"url": "http://github.com/aws/aws-sdk-js-apis/issues"
},
"licenses": [
{
"type": "Apache 2.0",
"url": "http://github.com/aws/aws-sdk-js-apis/raw/master/LICENSE.txt"
}
],
"keywords": [
"api",
"amazon",
"aws",
"sdk"
],
"readme": "# AWS SDK for JavaScript APIs Package\n\nThis package contains all of the API definitions used by the\n[aws-sdk](https://github.com/aws/aws-sdk-js) package.\n",
"readmeFilename": "README.md",
"_id": "aws-sdk-apis@2.0.5",
"dist": {
"shasum": "78587e177dc4f6f217948cc0e6d3b8c566c62823"
},
"_from": "aws-sdk-apis@2.x",
"_resolved": "https://registry.npmjs.org/aws-sdk-apis/-/aws-sdk-apis-2.0.5.tgz"
}

Some files were not shown because too many files have changed in this diff Show More