Repository: rubrikinc/rubrik-sdk-for-python

Issue:
Add additional regions to Python Module
**Is your feature request related to a problem? Please describe.**

Please add missing regions to the module

**Describe the solution you'd like**

Add additional regions to `cloud.py`


Comments:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5543e4e..88ca269 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - Added `add_organization_protectable_object_mssql_server_host()` ([Issue 234](https://github.com/rubrikinc/rubrik-sdk-for-python/issues/234))
 - Added `add_organization_protectable_object_sql_server_db()` ([Issue 234](https://github.com/rubrikinc/rubrik-sdk-for-python/issues/234))
 - Added `add_organization_protectable_object_sql_server_availability_group()` ([Issue 234](https://github.com/rubrikinc/rubrik-sdk-for-python/issues/234))
+- Added additional regions to valid_(aws|azure) enums ([Issue 271](https://github.com/rubrikinc/rubrik-sdk-for-python/issues/271))
 
 ### Changed
 
@@ -43,6 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - The `object_id()` function now returns the correct the MSSQL DB and MSSQL Instance. When the object_type is `mssql_instance` the `mssql_host` keyword argument is now required. When the `object_type` is `mssql_db`, both the `mssql_instance` the `mssql_host` keyword arguments are required. 
 - Added all examples to the `object_id()` documentation.
 - Prevent an error from being thrown when passing in an integer value into the `params` keyword argument in the `get()` function ([Issue 239](https://github.com/rubrikinc/rubrik-sdk-for-python/issues/236))
+- Fix Azure CloudOn api failure by adding resource_id
 
 ## v2.0.9
 
diff --git a/rubrik_cdm/cloud.py b/rubrik_cdm/cloud.py
index a46a01e..6475446 100644
--- a/rubrik_cdm/cloud.py
+++ b/rubrik_cdm/cloud.py
@@ -57,24 +57,29 @@ class Cloud(Api):
         self.function_name = inspect.currentframe().f_code.co_name
 
         valid_aws_regions = [
+            'us-gov-east-1',
+            'us-east-1',
+            'us-east-2',
+            'us-west-1',
+            'us-west-2',
+            'eu-west-1',
+            'eu-west-2',
+            'eu-west-3',
+            'eu-central-1',
+            'eu-north-1',
+            'eu-south-1',
+            'ap-east-1',
             'ap-south-1',
-            'ap-northeast-2',
             'ap-southeast-1',
             'ap-southeast-2',
             'ap-northeast-1',
-            'ca-central-1',
+            'ap-northeast-2',
+            'sa-east-1',
             'cn-north-1',
             'cn-northwest-1',
-            'eu-central-1',
-            'eu-west-1',
-            'eu-west-2',
-            'eu-west-3',
-            'sa-east-1',
-            'us-gov-west-1',
-            'us-west-1',
-            'us-east-1',
-            'us-east-2',
-            'us-west-2']
+            'ca-central-1',
+            'af-south-1',
+            'me-south-1']
 
         valid_storage_classes = [
             'standard',
@@ -405,32 +410,48 @@ class Cloud(Api):
         self.function_name = inspect.currentframe().f_code.co_name
 
         valid_regions = [
-            "westus",
-            "westus2",
-            "centralus",
-            "eastus",
-            "eastus2",
-            "northcentralus",
-            "southcentralus",
-            "westcentralus",
-            "canadacentral",
-            "canadaeast",
-            "brazilsouth",
-            "northeurope",
-            "westeurope",
-            "uksouth",
-            "ukwest",
-            "eastasia",
-            "southeastasia",
-            "japaneast",
-            "japanwest",
-            "australiaeast",
-            "australiasoutheast",
-            "centralindia",
-            "southindia",
-            "westindia",
-            "koreacentral",
-            "koreasouth"]
+            'westus',
+            'westus2',
+            'centralus',
+            'eastus',
+            'eastus2',
+            'northcentralus',
+            'southcentralus',
+            'westcentralus',
+            'canadacentral',
+            'canadaeast',
+            'brazilsouth',
+            'northeurope',
+            'westeurope',
+            'uksouth',
+            'ukwest',
+            'francecentral',
+            'francesouth',
+            'eastasia',
+            'southeastasia',
+            'japaneast',
+            'japanwest',
+            'australiaeast',
+            'australiasoutheast',
+            'australiacentral',
+            'australiacentral2',
+            'centralindia',
+            'southindia',
+            'westindia',
+            'koreacentral',
+            'koreasouth',
+            'chinanorth',
+            'chinaeast',
+            'chinanorth2',
+            'chinaeast2',
+            'germanycentral',
+            'germanynortheast',
+            'usgovvirginia',
+            'usgoviowa',
+            'usgovarizona',
+            'usgovtexas',
+            'usdodeast',
+            'usdodcentral']
 
         if region not in valid_regions:
             raise InvalidParameterException('The `region` must be one of the following: {}'.format(valid_regions))
@@ -542,23 +563,29 @@ class Cloud(Api):
         self.function_name = inspect.currentframe().f_code.co_name
 
         valid_aws_regions = [
+            'us-gov-east-1',
+            'us-east-1',
+            'us-east-2',
+            'us-west-1',
+            'us-west-2',
+            'eu-west-1',
+            'eu-west-2',
+            'eu-west-3',
+            'eu-central-1',
+            'eu-north-1',
+            'eu-south-1',
+            'ap-east-1',
             'ap-south-1',
-            'ap-northeast-3',
-            'ap-northeast-2',
             'ap-southeast-1',
             'ap-southeast-2',
             'ap-northeast-1',
-            'ca-central-1',
+            'ap-northeast-2',
+            'sa-east-1',
             'cn-north-1',
             'cn-northwest-1',
-            'eu-central-1',
-            'eu-west-1',
-            'eu-west-2',
-            'eu-west-3',
-            'us-west-1',
-            'us-east-1',
-            'us-east-2',
-            'us-west-2']
+            'ca-central-1',
+            'af-south-1',
+            'me-south-1']
 
         # verify we are on cdm 4.2 or newer, required for cloud native
         # protection


Test patch:
diff --git a/tests/unit/cloud_test.py b/tests/unit/cloud_test.py
index 27344a1..2d5f986 100644
--- a/tests/unit/cloud_test.py
+++ b/tests/unit/cloud_test.py
@@ -16,7 +16,7 @@ def test_aws_s3_cloudout_invalid_aws_region(rubrik):
 
     error_message = error.value.args[0]
 
-    assert error_message == "The `aws_region` must be one of the following: ['ap-south-1', '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', 'sa-east-1', 'us-gov-west-1', 'us-west-1', 'us-east-1', 'us-east-2', 'us-west-2']"
+    assert error_message == "The `aws_region` must be one of the following: ['us-gov-east-1', 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-central-1', 'eu-north-1', 'eu-south-1', 'ap-east-1', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1', 'ap-northeast-2', 'sa-east-1', 'cn-north-1', 'cn-northwest-1', 'ca-central-1', 'af-south-1', 'me-south-1']"
 
 
 def test_aws_s3_cloudout_invalid_storage_class(rubrik):
@@ -647,7 +647,7 @@ def test_azure_cloudon_invalid_region(rubrik):
 
     error_message = error.value.args[0]
 
-    assert error_message == "The `region` must be one of the following: ['westus', 'westus2', 'centralus', 'eastus', 'eastus2', 'northcentralus', 'southcentralus', 'westcentralus', 'canadacentral', 'canadaeast', 'brazilsouth', 'northeurope', 'westeurope', 'uksouth', 'ukwest', 'eastasia', 'southeastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'centralindia', 'southindia', 'westindia', 'koreacentral', 'koreasouth']"
+    assert error_message == "The `region` must be one of the following: ['westus', 'westus2', 'centralus', 'eastus', 'eastus2', 'northcentralus', 'southcentralus', 'westcentralus', 'canadacentral', 'canadaeast', 'brazilsouth', 'northeurope', 'westeurope', 'uksouth', 'ukwest', 'francecentral', 'francesouth', 'eastasia', 'southeastasia', 'japaneast', 'japanwest', 'australiaeast', 'australiasoutheast', 'australiacentral', 'australiacentral2', 'centralindia', 'southindia', 'westindia', 'koreacentral', 'koreasouth', 'chinanorth', 'chinaeast', 'chinanorth2', 'chinaeast2', 'germanycentral', 'germanynortheast', 'usgovvirginia', 'usgoviowa', 'usgovarizona', 'usgovtexas', 'usdodeast', 'usdodcentral']"
 
 
 def test_azure_cloudon_idempotence(rubrik, mocker):
@@ -872,7 +872,7 @@ def test_add_aws_native_account_invalid_aws_regionss(rubrik, mocker):
 
     error_message = error.value.args[0]
 
-    assert error_message == "The list `aws_regions` may only contain the following values: ['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', 'us-west-1', 'us-east-1', 'us-east-2', 'us-west-2']"
+    assert error_message == "The list `aws_regions` may only contain the following values: ['us-gov-east-1', 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-central-1', 'eu-north-1', 'eu-south-1', 'ap-east-1', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1', 'ap-northeast-2', 'sa-east-1', 'cn-north-1', 'cn-northwest-1', 'ca-central-1', 'af-south-1', 'me-south-1']"
 
 
 def test_add_aws_native_account_invalid_regional_bolt_network_configs_list(rubrik, mocker):