Permalink
Browse files

Remove arnToEndpoint method

Instead, use Endpoint info directly
  • Loading branch information...
1 parent 5b3169e commit bbade56ed43d529331f0a7ae0407469a8db7cc7a @darashi darashi committed Dec 25, 2012
Showing with 1 addition and 17 deletions.
  1. +1 −17 lib/client.js
View
@@ -84,7 +84,7 @@ Client.prototype = {
self.raiseFatalError(error);
try {
- var endpoint = self.arnToEndpoint(domain[definition.elementName].Arn).split(':');
+ var endpoint = domain[definition.elementName].Endpoint.split(':');
var api = self.createService({
domainName: domain.DomainName,
domainId: domain.DomainId.replace(new RegExp('/' + domain.DomainName + '$'), ''),
@@ -351,10 +351,6 @@ Client.prototype = {
});
},
- arnToEndpoint: function(arn) {
- return arnToEndpoint(arn, this.host + ':' + this.port);
- },
-
detectFileFormat: function(path) {
var format = path.match(/\.([^\.]+)$/i);
var supportedFormats = ['xml', 'json'];
@@ -389,16 +385,4 @@ function toValidHostAndPort(hostAndPort) {
}
Client.toValidHostAndPort = toValidHostAndPort;
-function arnToEndpoint(arn, hostAndPort) {
- var match = arn.match(/^arn:aws:cs:[^:]+:([^:]+):([^\/]+)\/(.+)$/);
- if (!match)
- client.raiseFatalError('invalid arn: ' + arn);
-
- var id = match[1];
- var type = match[2];
- var name = match[3];
- return type + '-' + name + '-' + id + '.' + toValidHostAndPort(hostAndPort);
-}
-Client.arnToEndpoint = arnToEndpoint;
-
exports.Client = Client;

0 comments on commit bbade56

Please sign in to comment.