From 9832020955dfc0534d2a0aa8d44c04d368ca99d1 Mon Sep 17 00:00:00 2001 From: Jeff Alyanak Date: Tue, 5 Nov 2019 13:36:07 -0500 Subject: [PATCH 1/3] Updated AWS Regions Added regions missing from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html --- glacier/GlacierWrapper.py | 51 ++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/glacier/GlacierWrapper.py b/glacier/GlacierWrapper.py index a2cb57b..c88501e 100755 --- a/glacier/GlacierWrapper.py +++ b/glacier/GlacierWrapper.py @@ -113,20 +113,47 @@ class GlacierWrapper(object): MAX_VAULT_NAME_LENGTH = 255 MAX_VAULT_DESCRIPTION_LENGTH = 1024 MAX_PARTS = 10000 - AVAILABLE_REGIONS = ('us-east-1', 'us-west-2', 'us-west-1', - 'eu-west-1', 'eu-central-1', 'sa-east-1', - 'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2') + AVAILABLE_REGIONS = ( + 'us-east-1', + 'us-east-2', + 'us-west-1', + 'us-west-2', + 'ca-central-1', + 'eu-central-1', + 'eu-west-1', + 'eu-west-2', + 'eu-west-3', + 'eu-north-1', + 'ap-east-1', + 'ap-northeast-1', + 'ap-northeast-2', + 'ap-northeast-3', + 'ap-southeast-1', + 'ap-southeast-2', + 'ap-south-1', + 'me-south-1', + 'sa-east-1') AVAILABLE_REGIONS_MESSAGE = """\ Invalid region. Available regions for Amazon Glacier are: -us-east-1 (US - Virginia) -us-west-1 (US - N. California) -us-west-2 (US - Oregon) -eu-west-1 (EU - Ireland) -eu-central-1 (EU - Frankfurt) -sa-east-1 (South America - Sao Paulo) -ap-northeast-1 (Asia-Pacific - Tokyo) -ap-southeast-1 (Asia Pacific (Singapore) -ap-southeast-2 (Asia-Pacific - Sydney)\ +us-east-1 US East (N. Virginia) +us-east-2 US East (Ohio) +us-west-1 US West (N. California) +us-west-2 US West (Oregon) +ca-central-1 Canada (Central) +eu-central-1 EU (Frankfurt) +eu-west-1 EU (Ireland) +eu-west-2 EU (London) +eu-west-3 EU (Paris) +eu-north-1 EU (Stockholm) +ap-east-1 Asia Pacific (Hong Kong) +ap-northeast-1 Asia Pacific (Tokyo) +ap-northeast-2 Asia Pacific (Seoul) +ap-northeast-3 Asia Pacific (Osaka-Local) +ap-southeast-1 Asia Pacific (Singapore) +ap-southeast-2 Asia Pacific (Sydney) +ap-south-1 Asia Pacific (Mumbai) +me-south-1 Middle East (Bahrain) +sa-east-1 South America (São Paulo)\ """ def setuplogging(self, logfile, loglevel, logtostdout): From a10693f0face733b4738801ddab2bc4c810c3886 Mon Sep 17 00:00:00 2001 From: Jeff Alyanak Date: Tue, 5 Nov 2019 13:45:23 -0500 Subject: [PATCH 2/3] Updated AWS Region Order Updated AWS regions to match order on https://docs.aws.amazon.com/general/latest/gr/rande.html#glacier_region --- glacier/GlacierWrapper.py | 60 ++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/glacier/GlacierWrapper.py b/glacier/GlacierWrapper.py index c88501e..76503a3 100755 --- a/glacier/GlacierWrapper.py +++ b/glacier/GlacierWrapper.py @@ -114,46 +114,54 @@ class GlacierWrapper(object): MAX_VAULT_DESCRIPTION_LENGTH = 1024 MAX_PARTS = 10000 AVAILABLE_REGIONS = ( - 'us-east-1', 'us-east-2', + 'us-east-1', 'us-west-1', 'us-west-2', + 'ap-east-1', + 'ap-south-1', + 'ap-northeast-3', + 'ap-northeast-2', + 'ap-southeast-1', + 'ap-southeast-2', + 'ap-northeast-1', 'ca-central-1', + 'cn-north-1', + 'cn-northwest-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-north-1', - 'ap-east-1', - 'ap-northeast-1', - 'ap-northeast-2', - 'ap-northeast-3', - 'ap-southeast-1', - 'ap-southeast-2', - 'ap-south-1', 'me-south-1', - 'sa-east-1') + 'sa-east-1', + 'us-gov-east-1', + 'us-gov-west-1') AVAILABLE_REGIONS_MESSAGE = """\ Invalid region. Available regions for Amazon Glacier are: -us-east-1 US East (N. Virginia) -us-east-2 US East (Ohio) -us-west-1 US West (N. California) -us-west-2 US West (Oregon) -ca-central-1 Canada (Central) -eu-central-1 EU (Frankfurt) -eu-west-1 EU (Ireland) -eu-west-2 EU (London) -eu-west-3 EU (Paris) -eu-north-1 EU (Stockholm) +us-east-2 US East (Ohio) +us-east-1 US East (N. Virginia) +us-west-1 US West (N. California) +us-west-2 US West (Oregon) ap-east-1 Asia Pacific (Hong Kong) -ap-northeast-1 Asia Pacific (Tokyo) -ap-northeast-2 Asia Pacific (Seoul) -ap-northeast-3 Asia Pacific (Osaka-Local) -ap-southeast-1 Asia Pacific (Singapore) -ap-southeast-2 Asia Pacific (Sydney) -ap-south-1 Asia Pacific (Mumbai) +ap-south-1 Asia Pacific (Mumbai) +ap-northeast-3 Asia Pacific (Osaka-Local) +ap-northeast-2 Asia Pacific (Seoul) +ap-southeast-1 Asia Pacific (Singapore) +ap-southeast-2 Asia Pacific (Sydney) +ap-northeast-1 Asia Pacific (Tokyo) +ca-central-1 Canada (Central) +cn-north-1 China (Beijing) +cn-northwest-1 China (Ningxia) +eu-central-1 EU (Frankfurt) +eu-west-1 EU (Ireland) +eu-west-2 EU (London) +eu-west-3 EU (Paris) +eu-north-1 EU (Stockholm) me-south-1 Middle East (Bahrain) -sa-east-1 South America (São Paulo)\ +sa-east-1 South America (Sao Paulo) +us-gov-east-1 AWS GovCloud (US-East) +us-gov-west-1 AWS GovCloud (US-West)\ """ def setuplogging(self, logfile, loglevel, logtostdout): From ba3b49d66f0b188f221dfa84ea527150fe7879ea Mon Sep 17 00:00:00 2001 From: Jeff Alyanak Date: Tue, 5 Nov 2019 13:50:53 -0500 Subject: [PATCH 3/3] Readibility Fix on Available Region Message Updated AVAILABLE_REGIONS_MESSAGE to make it a bit more readility readable. --- glacier/GlacierWrapper.py | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/glacier/GlacierWrapper.py b/glacier/GlacierWrapper.py index 76503a3..5afd6b7 100755 --- a/glacier/GlacierWrapper.py +++ b/glacier/GlacierWrapper.py @@ -139,29 +139,29 @@ class GlacierWrapper(object): 'us-gov-west-1') AVAILABLE_REGIONS_MESSAGE = """\ Invalid region. Available regions for Amazon Glacier are: -us-east-2 US East (Ohio) -us-east-1 US East (N. Virginia) -us-west-1 US West (N. California) -us-west-2 US West (Oregon) -ap-east-1 Asia Pacific (Hong Kong) -ap-south-1 Asia Pacific (Mumbai) -ap-northeast-3 Asia Pacific (Osaka-Local) -ap-northeast-2 Asia Pacific (Seoul) -ap-southeast-1 Asia Pacific (Singapore) -ap-southeast-2 Asia Pacific (Sydney) -ap-northeast-1 Asia Pacific (Tokyo) -ca-central-1 Canada (Central) -cn-north-1 China (Beijing) -cn-northwest-1 China (Ningxia) -eu-central-1 EU (Frankfurt) -eu-west-1 EU (Ireland) -eu-west-2 EU (London) -eu-west-3 EU (Paris) -eu-north-1 EU (Stockholm) -me-south-1 Middle East (Bahrain) -sa-east-1 South America (Sao Paulo) -us-gov-east-1 AWS GovCloud (US-East) -us-gov-west-1 AWS GovCloud (US-West)\ +us-east-2 US East (Ohio) +us-east-1 US East (N. Virginia) +us-west-1 US West (N. California) +us-west-2 US West (Oregon) +ap-east-1 Asia Pacific (Hong Kong) +ap-south-1 Asia Pacific (Mumbai) +ap-northeast-3 Asia Pacific (Osaka-Local) +ap-northeast-2 Asia Pacific (Seoul) +ap-southeast-1 Asia Pacific (Singapore) +ap-southeast-2 Asia Pacific (Sydney) +ap-northeast-1 Asia Pacific (Tokyo) +ca-central-1 Canada (Central) +cn-north-1 China (Beijing) +cn-northwest-1 China (Ningxia) +eu-central-1 EU (Frankfurt) +eu-west-1 EU (Ireland) +eu-west-2 EU (London) +eu-west-3 EU (Paris) +eu-north-1 EU (Stockholm) +me-south-1 Middle East (Bahrain) +sa-east-1 South America (Sao Paulo) +us-gov-east-1 AWS GovCloud (US-East) +us-gov-west-1 AWS GovCloud (US-West)\ """ def setuplogging(self, logfile, loglevel, logtostdout):